#
Android
public interface ISudFSMMG {
/**
* Game log.
* Earliest version: V1.1.30.xx.
*/
void onGameLog(String dataJson);
/**
* Game loading progress (loadMG)
* @param stage stage: start=1,loading=2,end=3
* @param retCode Error code: 0 success
* @param progress progress: [0, 100]
* Minimum version: v1.1.52.xx
*/
void onGameLoadingProgress(int stage, int retCode, int progress);
/**
* Start game.
* Earliest version: V1.1.30.xx.
*/
void onGameStarted();
/**
* Destroy game.
* Earliest version: V1.1.30.xx.
*/
void onGameDestroyed();
/**
* Code expired.
* The app client needs to call handle.success or handle.fail.
* @param dataJson {"code":"value"}
*/
void onExpireCode(ISudFSMStateHandle handle, String dataJson);
/**
* Obtain the game view information.
* The app client needs to call handle.success or handle.fail.
* @param handle
* @param dataJson {}
*/
void onGetGameViewInfo(ISudFSMStateHandle handle, String dataJson);
/**
* Obtain the game Config.
* The app client needs to call handle.success or handle.fail.
* @param handle
* @param dataJson {}
* Earliest version: V1.1.30.xx.
*/
void onGetGameCfg(ISudFSMStateHandle handle, String dataJson);
/**
* Change game state.
* The app client needs to call handle.success or handle.fail.
* @param handle
* @param state
* @param dataJson
*/
void onGameStateChange(ISudFSMStateHandle handle, String state, String dataJson);
/**
* Change game player state.
* The app client needs to call handle.success or handle.fail.
* @param handle
* @param userId
* @param state
* @param dataJson
*/
void onPlayerStateChange(ISudFSMStateHandle handle, String userId, String state, String dataJson);
}
iOS
@protocol ISudFSMMG <NSObject>
/**
* Game log.
* Earliest version: V1.1.30.xx.
*/
-(void) onGameLog:(NSString*)dataJson;
/**
* Game loading progress (loadMG)
* @param stage stage: start=1,loading=2,end=3
* @param retCode Error code: 0 success
* @param progress progress: [0, 100]
* Minimum version: v1.1.52.xx
*/
-(void) onGameLoadingProgress:(int)stage retCode:(int)retCode progress:(int)progress;
/**
* Start game.
* Earliest version: V1.1.30.xx.
*/
-(void) onGameStarted;
/**
* Destroy game.
* Earliest version: V1.1.30.xx.
*/
-(void) onGameDestroyed;
/**
* Code expired.
* The app client needs to call handle.success or handle.fail.
* @param dataJson {"code":"value"}
*/
-(void) onExpireCode:(id<ISudFSMStateHandle>)handle dataJson:(NSString*)dataJson;
/**
* Obtain the game view information.
* The app client needs to call handle.success or handle.fail.
* @param handle
* @param dataJson {}
*/
-(void) onGetGameViewInfo:(id<ISudFSMStateHandle>) handle dataJson:(NSString*)dataJson;
/**
* Obtain the game Config.
* The app client needs to call handle.success or handle.fail.
* @param handle
* @param dataJson {}
* Earliest version: V1.1.30.xx.
*/
-(void) onGetGameCfg:(id<ISudFSMStateHandle>) handle dataJson:(NSString*)dataJson;
/**
* Change game state.
* The app client needs to call handle.success or handle.fail.
* @param handle
* @param state
* @param dataJson
*/
-(void) onGameStateChange:(id<ISudFSMStateHandle>) handle state:(NSString*) state dataJson:(NSString*) dataJson;
/**
* Change game player state.
* The app client needs to call handle.success or handle.fail.
* @param handle
* @param userId
* @param state
* @param dataJson
*/
-(void) onPlayerStateChange:(nullable id<ISudFSMStateHandle>) handle userId:(NSString*) userId state:(NSString*) state dataJson:(NSString*) dataJson;
@end
Web
interface ISudFSMMG {
/**
* Game log
* Minimum version: v1.1.30.xx
*/
onGameLog(dataJson: string): void
/**
* Game loading progress (loadMG)
* @param stage Stage: start=1, loading=2, end=3
* @param retCode Error code: 0 success
* @param progress Progress: [0, 100]
* Minimum version: v1.1.52.xx
*/
onGameLoadingProgress(stage: number, retCode: number, progress: number): void
/**
* Game start (game long connection established)
* Minimum version: v1.1.30.xx
*/
onGameStarted(): void
/**
* Game destroyed
* Minimum version: v1.1.30.xx
*/
onGameDestroyed(): void;
/**
* Code expired
* APP needs to call handle.success or handle.fail
* @param dataJson {"code":"value"}
*/
onExpireCode(handle: ISudFSMStateHandle, dataJson: string): void;
/**
* Get game view information
* APP needs to call handle.success or handle.fail
* @param handle
* @param dataJson {}
*/
onGetGameViewInfo(handle: ISudFSMStateHandle, dataJson: string): void;
/**
* Get game config
* APP needs to call handle.success or handle.fail
* @param handle
* @param dataJson {}
* Minimum version: v1.1.30.xx
*/
onGetGameCfg(handle: ISudFSMStateHandle, dataJson: string): void;
/**
* Game state change
* APP needs to call handle.success or handle.fail
* @param handle
* @param state
* @param dataJson
*/
onGameStateChange(
handle: ISudFSMStateHandle,
state: string,
dataJson: string
): void
/**
* Game player state change
* APP needs to call handle.success or handle.fail
* @param handle
* @param userId
* @param state
* @param dataJson
*/
onPlayerStateChange(
handle: ISudFSMStateHandle,
userId: string,
state: string,
dataJson: string
): void;
}