#
Android
public class SudMGP {
/**
* Obtain the SDK version.
* @return
*/
public static String getVersion();
/**
* Get SDK version alias
* @return Example: "v1.1.52.xx-et"
* Minimum version: v1.1.52.xx
*/
public static String getVersionAlias();
/**
* Obtain the configuration.
* @return ISudCfg
* Minimum version: V1.1.46.xx
*/
public static ISudCfg getCfg();
/**
* Initialize SDK.
* @param context
* @param appId
* @param appKey
* @param isTestEnv
* @param listener
*/
public static void initSDK(Context context, String appId, String appKey, boolean isTestEnv, ISudListenerInitSDK listener);
/**
* Deinitialize SDK.
* @param listener
*/
public static void uninitSDK(ISudListenerUninitSDK listener);
/**
* Obtain the game list.
* @param listener
*/
public static void getMGList(ISudListenerGetMGList listener);
/**
* Load game.
* @param activity
* @param userId
* @param roomId
* @param code
* @param mgId
* @param language
* @param fsmMG
* @return
*/
public static ISudFSTAPP loadMG(Activity activity, String userId, String roomId, String code, long mgId, String language, ISudFSMMG fsmMG);
/**
* List of pre-loaded game packs
* @param context context
* @param mgIdList List of Game ids
* @param listener listener
*/
public static void preloadMGPkgList(Context context, List<Long> mgIdList, ISudListenerPreloadMGPkg listener);
/**
* Cancel preloading the game package
* @param mgIdList List of Game ids
*/
public static void cancelPreloadMGPkgList(List<Long> mgIdList);
/**
* Destroy game.
* @param fstApp
* @return
*/
public static boolean destroyMG(ISudFSTAPP fstApp);
/**
* Set statistics reporting userId
* @param userId
*/
public static void setUserId(String userId);
/**
* Set statistics reporting callback on UI or Main Thread
* @param listener
* @return
*/
public static boolean setReportStatsEventListener(ISudListenerReportStatsEvent listener);
/**
* Set log level.
* @param logLevel
*/
public static void setLogLevel(int logLevel);
/**
* Set takeover log.
* @param logger
*/
public static void setLogger(ISudLogger logger);
/**
* Gets the directory for saving log files. Available starting from version v1.4.7.1218.
* @param context The context
* @return Note: Null check required
*/
public static String getLogDirPath(Context context);
}
iOS
@interface SudMGP : NSObject
/**
* Obtain the SDK version.
* @return Example: "1.1.35.286"
*/
+ (NSString*_Nonnull)getVersion;
/**
* 获取SDK版本别名
* @return 示例:"v1.1.35.286-et"
*/
+ (NSString*_Nonnull)getVersionAlias;
/**
* Obtain the configuration. Earliest version: V1.1.46.449
* @return ISudCfg
*/
+ (id<ISudCfg>_Nonnull)getCfg;
/**
* Initialize SDK.
* @param context Context
* @param appId Generated by the game platform.
* @param appKey Generated by the game platform.
* @param isTestEnv Valid values: true: test environment; false: production environment.
* @param listener ISudListenerInitSDK
*/
+ (void)initSDK:(NSString*_Nonnull)appId
appKey:(NSString*_Nonnull)appKey
isTestEnv:(BOOL)isTestEnv
listener:(ISudListenerInitSDK _Nullable )listener;
/**
* Deinitialize SDK.
* @param listener ISudListenerUninitSDK
*/
+ (void)uninitSDK:(ISudListenerUninitSDK _Nullable )listener;
/**
* Obtain the game list.
* @param listener ISudListenerGetMGList
*/
+ (void)getMGList:(ISudListenerGetMGList _Nullable )listener;
/**
* Load game.
* @param userId User ID. The unique ID of each user generated by the system.
* @param roomId Room ID. The unique ID of each room generated by the system.
* @param code Short-term token code.
* @param mgId Game ID. The game IDs of the test environment and the production environment are the same.
* @param language Languages currently supported by the game. Valid values: zh-CN: Simplified Chinese; zh-TW: Traditional Chinese; en-US: English; ms-MY: Malay.
* @param fsmMG ISudFSMMG
* @param rootView The root view of the game.
* @return ISudFSTAPP
*/
+ (id<ISudFSTAPP>_Nonnull)loadMG:(NSString*_Nonnull)userId
roomId:(NSString*_Nonnull)roomId
code:(NSString*_Nonnull)code
mgId:(int64_t)mgId
language:(NSString*_Nonnull)language
fsmMG:(id<ISudFSMMG>_Nonnull)fsmMG
rootView:(UIView*_Nonnull)rootView;
/**
* List of pre-loaded game packs
* @param mgIdList List of Game ids
* @param listener listener
*/
+ (void) prepareGameList:(NSArray<NSNumber *> *) mgIdList listener:(id<ISudListenerPrepareGame>) listener;
/**
* Cancel preloading the game package
* @param mgIdList List of Game ids
*/
+ (void) cancelPrepareGameList:(NSArray<NSNumber *> *) mgIdList;
/**
* Destroy game.
* @param fstApp The object ISudFSTAPP returned when loading the game.
* @return boolean
*/
+ (bool)destroyMG:(id<ISudFSTAPP>_Nonnull) fstAPP;
/**
* Set statistics reporting userId
* @param userId
*/
+ (void)setUserId:(NSString*)userId;
/**
* Set statistics reporting callback on UI or Main Thread
* @param listener callback
* @return
*/
+ (bool)setReportStatsEventListener:(ISudListenerReportStatsEvent)listener;
/**
* Set log level.
* @param logLevel The level of the log. For more information about LogVERBOSE, LogDEBUG, and LogINFO, see ISudLogger.h.
*/
+ (void)setLogLevel:(int)logLevel;
/**
* Whether AudioSession is set in the game.
* 1. When autoSet is set to true, AudioSession is set in the game.
* 2. When autoSet is set to false, AudioSession is not set in the game.
* 3. The autoSet parameter is set to false by default, indicating that AudioSession is not set in the game.
* @param autoSet
*/
+ (void) autoSetAudioSession:(BOOL)autoSet;
/**
* Get the SDK local log storage path
*/
+ (NSString *_Nonnull)getLogDirPath;
@end
Web
class SudMGP {
/**
* Get SDK version
* @return
*/
public static getVersion(): string
/**
* Get SDK version alias
* @return Example: "v1.1.35.286-et"
*/
public static getVersionAlias(): string {
return Version.kVersionAlias
}
/**
* Get configuration. Minimum supported version is v1.1.46.449
* @return ISudCfg
*/
public static getSudCfg(): ISudCfg
/**
* Initialize SDK
* @param appId
* @param appKey
* @param bundleId // Domain origin
* @param isTestEnv
* @param listener
*/
public static initSDK(appId: string, appKey: string, bundleId: string, isTestEnv: boolean,listener: ISudListenerInitSDK): void
/**
* Uninitialize SDK
* @param listener
*/
public static void uninitSDK(listener: ISudListenerUninitSDK): void
/**
* Get game list
* @param listener
*/
public static void getMGList(listener: ISudListenerGetMGList): void
/**
* Load game
* @param userId
* @param roomId
* @param code
* @param mgId
* @param language
* @param fsmMG
* @param rootElm Element to be mounted
* @return
*/
public static ISudFSTAPP loadMG(
userId: string,
roomId: string,
code: string,
mgId: string,
language: string,
fsmMg: ISudFSMMG,
rootElm: HTMLElement
): ISudFSTAPP | null
/**
* Destroy game
* @param fstApp
* @return
*/
public static destroyMG(fstApp: ISudFSTAPP): boolean
/**
* Set user ID for statistics reporting
* @param userId
*/
public static setUserId(userId: string): void
/**
* Set log level
* @param logLevel
*/
public static setLogLevel(logLevel: number): void
/**
* Set logger takeover
* @param logger
*/
public static setLogger(logger: ISudLogger): void
}