public static interface SGAgent.SGClient
Modifier and Type | Method and Description |
---|---|
void |
onExitCancelled()
Notify that the exit operation was cancelled.
|
void |
onExtMethodNotification(String cookie,
int code,
String msg)
Notify the result of asynchronous function.
|
void |
onFuncRequest(String func,
String id,
String arg)
Notify client the underlying layer request application to execute a function.
|
void |
onLog(String text)
Display debug message.
|
void |
onLog(String text,
String postfix)
Display debug message.
|
void |
onLogValue(String key,
int value,
String msg)
Inform client value of remote log key.
|
boolean |
onOrderInfoBegin(int num)
Inform client that order information notification will be started.
|
void |
onOrderInfoEnd()
Inform client that order information notification is finished.
|
void |
onOrderInfoFound(UOrder order)
Send order information to client.
|
void |
onOrderStateChange(String productID,
int num,
String orderID,
String state,
String message)
Notify client the state change of product purchase.
|
void |
onPlayerDetails(String details)
Notify player details.
|
boolean |
onProductBegin(int num)
Inform client that product information notification will be started.
|
void |
onProductEnd()
Inform client that product information notification is finished.
|
void |
onProductFound(UProduct product)
Send product information to client.
|
void |
onStateChange(int type,
int orgState,
int newState,
int reason,
int op,
String arg)
Notify client the internal state change in SGAgent.
|
void |
onTreasureChange(String name,
int count)
Inform client updated treasure count.
|
void |
onTreasureListFound(String[] treasures)
Inform client that treasure list is retrieved.
|
void onExitCancelled()
void onExtMethodNotification(String cookie, int code, String msg)
cookie
- string for identification passed when run the functioncode
- result code. One of EXT_RET_OK, EXT_RET_ERROR and EXT_RET_CANCELLED.msg
- content of notification. The format depends on function implementation.void onFuncRequest(String func, String id, String arg)
func
- Function name. Should be on of "screenshot" and "logout".id
- Operation ID. Application may use it to perform multiple operations.arg
- Argument. For "screenshot", it is the file path to which the screen shot should be saved to.
Notify that the exit operation was cancelled. Application should recover current screen and go on.void onLog(String text)
text
- message to displayvoid onLog(String text, String postfix)
text
- message to displaypostfix
- postfix to be appended after textvoid onLogValue(String key, int value, String msg)
key
- key to matchvalue
- value of key or specified default valuemsg
- content text of the logboolean onOrderInfoBegin(int num)
num
- number of ordersvoid onOrderInfoEnd()
void onOrderInfoFound(UOrder order)
order
- order information, null indicating no more information is availablevoid onOrderStateChange(String productID, int num, String orderID, String state, String message)
productID
- product IDorderID
- order IDnum
- number of copiesstate
- state. One of the following text strings:void onPlayerDetails(String details)
details
- player detailsboolean onProductBegin(int num)
num
- number of productsvoid onProductEnd()
void onProductFound(UProduct product)
product
- product information, null indicating no more information is availablevoid onStateChange(int type, int orgState, int newState, int reason, int op, String arg)
type
- state type. One of STATE_TYPE_USR, STATE_TYPE_JOB and STATE_TYPE_PAY.orgState
- original statenewState
- new statereason
- reason of state change. One of STATE_CHANGE_REASON_NONE,
STATE_CHANGE_REASON_OP,
STATE_CHANGE_REASON_OP_SUCCESS,
STATE_CHANGE_REASON_OP_FAILURE and
STATE_CHANGE_REASON_OP_CANCELED.op
- operation leading to the changearg
- extra string information. arg is set to the value of parameter imageFile passed to SGAgent.shareScreen by application.
Application may use this string to delete temporary image file created for sharing.void onTreasureChange(String name, int count)
name
- treasure namecount
- treasure countvoid onTreasureListFound(String[] treasures)
treasures
- Treasure array. Each item of the array has format "name=count",
where 'count' is an integer indicating number of a certain treasure.