Channel/Android/qkbt6game/AndroidManifest.xml
New file @@ -0,0 +1,20 @@ <?xml version="1.0" encoding="utf-8"?> <!-- GENERATED BY UNITY. REMOVE THIS COMMENT TO PREVENT OVERWRITING WHEN EXPORTING AGAIN--> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.unity3d.player" xmlns:tools="http://schemas.android.com/tools"> <application> <activity android:name="com.secondworld.sdk.SplashActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name="com.secondworld.sdk.GameActivity" android:theme="@style/UnityThemeSelector"> <meta-data android:name="unityplayer.UnityActivity" android:value="true" /> </activity> </application> </manifest> Channel/Android/qkbt6game/debug/libs/library-debug-qkbt6game.aarBinary files differ
Channel/Android/qkbt6game/deps.gradle
New file @@ -0,0 +1,4 @@ //æ¤èæ¬ä¸ºæ¸ éçç¬¬ä¸æ¹è¿ç¨ä¾èµåºé ç½®ï¼ä¼å¤å¶å°unityä¸ç¨äºæå»º dependencies { } Channel/Android/qkbt6game/release/libs/library-release-qkbt6game.aarBinary files differ
Channel/IOS/qkbt6game/Plugins/QuickSDK/SMPCQuickSDK.framework/Headers/SMPCQuickSDK.h
New file @@ -0,0 +1,219 @@ // // SMPCQuickSDK.h // // // // #define SMPC_QUICK_SDK_VERSION @"2.5.2" //QuickSDKåºç¡åºçæ¬ #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> #import "SMPCQuickSDKDefines.h" #import "SMPCQuickSDKInitConfigure.h" #import "SMPCQuickSDKPayOrderInfo.h" #import "SMPCQuickSDKGameRoleInfo.h" #import "SMPCQuickSDKShareInfo.h" typedef enum { QuickSDKUserTYPE_UNKnow = 0,//æªç¥çæªå®ä¹ç QuickSDKUserTYPE_Account = 1,//è´¦å· QuickSDKUserTYPE_Phone = 2,//ææºå· QuickSDKUserTYPE_Guest = 3,//游客ç»å½ QuickSDKUserTYPE_WX = 4,//微信 QuickSDKUserTYPE_QQ = 5,//æQ QuickSDKUserTYPE_WeiBo = 6,//å¾®å QuickSDKUserTYPE_GameCenter = 7,//GameCenter QuickSDKUserTYPE_Apple = 16,//è¹æ QuickSDKUserTYPE_OneKey = 18,//é¿éäºä¸é®ç»å½ } QuickSDKUserTYPE; #pragma mark åºæ¬ä¿¡æ¯ @interface SMPCQuickSDK : NSObject #pragma mark åä¾å¯¹è±¡ + (SMPCQuickSDK *)defaultInstance; - (instancetype)init NS_UNAVAILABLE; + (instancetype)new NS_UNAVAILABLE; #pragma mark è·åæ¸ éåºæ¬ä¿¡æ¯ //è·åæ¸ éå¯ä¸æ è¯ï¼ä¸æå¡å¨ç«¯channelIDä¸è´ï¼ä»»ä½æ¶å»é½å¯è°ç¨ - (int)channelType; /** * è·åQuickGameæ¸ écpså çæ¸ éå· */ - (NSString *)cpsChannelId; @end #pragma mark - åå§å æ¥å ¥äº§åä¿¡æ¯ @interface SMPCQuickSDK(Base) #pragma mark åå§å /** @brief åºç¨åå§å 宿åä¼åééç¥kSmpcQuickSDKNotiInitDidFinished @param configure åå§åé 置类ï¼SDKä¼ä¼å ä½¿ç¨æå å·¥å ·ä¸å¨çº¿é ç½®çproductCode @result é误ç @note å¿ æ¥ */ - (int)initWithConfig:(SMPCQuickSDKInitConfigure *)configure application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions; /** @brief è°ç¨ç»ä»¶åè½ï¼åæ°è¯·ç对åºç»ä»¶æ¥å ¥ææ¡£ */ - (int)callPlug:(NSString *)name params:(NSArray *)args; @end #pragma mark - ç¨æ·é¨å ç»å½ 注å ç»åº @interface SMPCQuickSDK(Account) /** @brief ç»å½æ¥å£ ï¼ç»å½åä¼åékSmpcQuickSDKNotiLoginéç¥ @result é误ç @note å¿ æ¥ */ - (int)login; /** @brief ç»åºæ¥å£ 代ç è°ç¨æ³¨é @result é误ç @note æåè°ç¨è¯¥æ¥å£åï¼SDKä¼ååºkSmpcQuickSDKNotiLogoutéç¥ */ - (int)logout; // ç»å½åè·åç¨æ·uid,è¿ä¸ªuid卿¸ éä¸å¯ä¸ï¼å¤ä¸ªæ¸ éçç¨æ·uidå¯è½éå¤ - (NSString *)userId; // ç»å½åè·åuserTokenå¯ç¨äºéªè¯ç¨æ·ä¿¡æ¯ - (NSString *)userToken; // ç»å½åè·åç¨æ·æµç§° - (NSString *)userNick; /** æ¥è¯¢æ¸ éå®å认è¯ä¿¡æ¯ */ - (NSDictionary *)realNameInfo; /** è·å设å¤id */ - (NSString *)getDeviceID; /** æ¸ é¤è®¾å¤idç¼åæ°æ® */ - (void)resetDeviceID; /** @brief è°ç¨æ¸ éå®åè®¤è¯ @result é误ç è¥æ¸ éæ²¡ææä¾æ¤æ¹æ³ä¼è¿åé0 @note ç»æä¼åékSmpcQuickSDKNotiRealAuthéç¥ */ - (int)realAuth; /** è·åæ¸ éç¨æ·ç»å½æ¹å¼ç®åä» QuickGameè¶ç±æ¸ éæç¨ */ - (QuickSDKUserTYPE)getChannelUserLoginType; /** è·åç¨æ·é¢å¤ä¿¡æ¯ï¼è¥æ²¡æé¢å¤ä¿¡æ¯åè¿å空åå ¸ */ - (NSDictionary *)getChannelUserExtInfo; #pragma mark - æ´æ°è§è²ä¿¡æ¯ // è¿å ¥æ¸¸æè§è²ï¼è§è²ä¿¡æ¯åæ´æ¶è°ç¨ï¼æ¯å¦å级ï¼,请使ç¨updateRoleInfoWith:isCreate: - (void)updateRoleInfoWith:(SMPCQuickSDKGameRoleInfo *)info; //// å建è§è²ãè¿å ¥æ¸¸æè§è²ãè§è²ä¿¡æ¯åæ´æ¶è°ç¨ï¼æ¯å¦å级ï¼isCreate表示æ¯å¦ä¸ºå建è§è² - (void)updateRoleInfoWith:(SMPCQuickSDKGameRoleInfo *)info isCreate:(BOOL)isCreate; @end //MARK:- å å¼ @interface SMPCQuickSDK(Pay) /** @brief ååè´ä¹° * @param orderInfo * @param roleInfo @result é误ç */ - (int)payOrderInfo:(SMPCQuickSDKPayOrderInfo *)orderInfo roleInfo:(SMPCQuickSDKGameRoleInfo *)roleInfo; /** @brief ååä¿¡æ¯ * @param productId ååid */ -(void)Getlocalized:(NSString *)productIds; @end #pragma mark - ç颿§å¶ @interface SMPCQuickSDK(UISetting) #pragma mark æµ®å¨æ¡ /** @brief showToolBar: @brief æµ®å¨å·¥å ·æ ï¼å»ºè®®æ¾ç¤ºå¨å·¦ä¸è§ @result é误ç @note */ - (int)showToolBar:(SMPC_QUICK_SDK_TOOLBAR_PLACE)place; //éèæµ®å¨å·¥å ·æ - (int)hideToolBar; @end @interface SMPCQuickSDK(Extend) // è·åQuicSDKåå°ä¸ºæ¸ éæ·»å çèªå®ä¹é®å¼ï¼ä»»ä½æ¶å»é½å¯è°ç¨ // å¦ææ²¡æå°è¿ånil - (NSString *)getConfigValue:(NSString *)key; /** @brief isFunctionSupported: @brief 夿å½åæ¸ éæ¯å¦å®ç°äºQuickSDKæä¾çæä¸ªæ¥å£ @brief 妿å½åæ¸ éæ²¡æå®ç°ç¸åºæ¥å£ï¼å°±æ²¡æç¸åºæ¥å£çåè° @brief ä¾å¦æ¸ éSDK没æå®ç°pausedGameè¿ä¸ªæ¥å£ï¼å³ä½¿è°ç¨äºpausedGameï¼æ²¡ææåæ¢å¤éç¥ï¼å 为pausedGameè°ç¨æ æ @result æ¯å¦ @note */ - (BOOL)isFunctionTypeSupported:(SMPC_QUICK_SDK_FUNC_TYPE)type; /** @brief è¿å ¥ç¨æ·ä¸å¿ å¦ç¨æ·æ³¨éç»å½ä¼åékSmpcQPLogoutNotificationï¼å¯å¤æ¬¡è§¦åï¼ @result é误ç */ - (int)enterUserCenter; /** è¿å ¥YunKefu @param gameRoleInfo @result é误ç */ - (int)enterYunKeFuCenter:(SMPCQuickSDKGameRoleInfo *)gameRoleInfo; #pragma mark å享 /** å享 @param shareInfo shareInfo description @result é误ç */ - (int)callSDKShare:(SMPCQuickSDKShareInfo *)shareInfo; //***********************åºç¨çå½å¨æçåè°*******************// //å¨åºç¨å¯¹åºççå½å¨æåè°ä¸è°ç¨ /** @brief - (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url; @brief - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(nullable NSString *)sourceApplication annotation:(id)annotation @brief - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString*, id> *)options @brief æ¸ éå¤çåºç¨è·³è½¬ @result é误ç @note å¿ æ¥ */ - (int)openURL:(NSURL *)url application:(UIApplication *)application; - (int)openURL:(NSURL *)url sourceApplication:(NSString *)sourceApp application:(UIApplication *)application annotation:(id)annotation; - (int)openURL:(NSURL *)url application:(UIApplication *)app options:(NSDictionary <NSString *, id>*)options; /** @brief application:didRegisterForRemoteNotificationsWithDeviceToken: @brief æ¨éæ¶æ¯ @result é误ç @note å¿ æ¥ */ - (int)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken; /** @brief application:didFailToRegisterForRemoteNotificationsWithError: @brief æ¨éæ¶æ¯ @result é误ç @note å¿ æ¥ */ - (int)application:(UIApplication*)application didFailToRegisterForRemoteNotificationsWithError:(NSError*)error; - (int)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo; - (int)applicationWillResignActive:(UIApplication *)application; - (int)applicationDidEnterBackground:(UIApplication *)application; - (int)applicationWillEnterForeground:(UIApplication *)application; - (int)applicationDidBecomeActive:(UIApplication *)application; - (int)applicationWillTerminate:(UIApplication *)application; - (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window; - (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void(^)(NSArray * restorableObjects))restorationHandler; @end Channel/IOS/qkbt6game/Plugins/QuickSDK/SMPCQuickSDK.framework/Headers/SMPCQuickSDKDefines.h
New file @@ -0,0 +1,91 @@ // // SMPCQuickSDKDefines.h // QuickSDKs // // // #ifndef SMPCQuickSDKDefines_h #define SMPCQuickSDKDefines_h #pragma mark - Notification Name extern NSString* const kSmpcQuickSDKNotiInitDidFinished; //åå§åæå extern NSString* const kSmpcQuickSDKNotiLogin; //ç»å½æå åæ¢è´¦å·æåä¹ä¼åè°è¿ä¸ª extern NSString* const kSmpcQCGetLocalizedNotification; //æ¥è¯¢æ¥ååä¿¡æ¯çéç¥ extern NSString* const kSmpcQuickSDKNotiLogout; //ç¨æ·æ³¨é extern NSString* const kSmpcQuickSDKNotiRecharge; //å å¼ç»æ extern NSString* const kSmpcQuickSDKNotiPauseOver; //æåç»æ è¿ä¸ªåè°å¯ä»¥ä¸ç¨çå¬ extern NSString * const kSmpcQuickSDKNotiPlugin; /*ç»ä»¶éç¥ è§è¯¥æä»¶æ¥å ¥ææ¡£ï¼é»è®¤å¯ä»¥ä¸ç¨çå¬*/ extern NSString* const kSmpcQuickSDKNotiRealAuth; //å®å认è¯ç»æéç¥ #define QUICK_CHANNEL_TO_CP_NOTIFICATON_KEY @"quick_channel_to_cp_notification_key" //QUICK_CHANNEL_TO_CP_NOTIFICATON_KEYè¿ä¸ªé®å®ä¹äºQuickSDKæ 忥å£ä¸è½æä¾æ´å¤çä¿¡æ¯ç»cpé£è¾¹æ¶çä¼ è¾æ¹æ¡ï¼è¿ä¸ªéç¥å¸¦ä¸æ¸ éSDKéè¦ä¼ éå°cpçä¿¡æ¯.é常ä¸éè¦ï¼éå°äºå讨论 #pragma mark - éç¥userInfoä¸çéè¦key é误åä¿¡æ¯ extern NSString* const kSmpcQuickSDKKeyError; /*Notification userinfo error Key */ extern NSString* const kSmpcQuickSDKKeyMsg; /*Notification userinfo msg Key */ // 订åå· #define kSmpcQuickSDKKeyOrderId @"orderId" // 游æå¼ååç»ç订åå· #define kSmpcQuickSDKKeyCpOrderId @"cpOrderId" // 第3æ¹æ¸ ésdkç»ç订åå· #define kSmpcQuickSDKKeySdkOrderId @"sdkOrderId" // éä¼ åæ° #define kSmpcQuickSDKKeyExtraParams @"extraParams" // user_token #define kSmpcQuickSDKKeyUserToken @"user_token" /** å®å认è¯åè°æ¯å¦å·²å®å YES:已认è¯NO:æªè®¤è¯*/ #define kSmpcQuickSDKKeyRealName @"realName" /** å®å认è¯åå¹´é¾ */ #define kSmpcQuickSDKKeyRealAge @"age" /** æ¸ éå®å认è¯å¤±è´¥æ¯å¦å¯ä»¥ç»§ç»æ¸¸æ YES:å¯ä»¥ NO:ä¸å¯ä»¥ */ #define kSmpcQuickSDKKeyRealResumeGame @"resumeGame" /** å®å认è¯é¢çåæ®µ */ #define kSmpcQuickSDKKeyRealOther @"other" #pragma mark - æµ®å¨æ¡ä½ç½® Enum typedef enum { SMPC_QUICK_SDK_TOOLBAR_TOP_LEFT = 1, /* å·¦ä¸ */ SMPC_QUICK_SDK_TOOLBAR_TOP_RIGHT = 2, /* å³ä¸ */ SMPC_QUICK_SDK_TOOLBAR_MID_LEFT = 3, /* å·¦ä¸ */ SMPC_QUICK_SDK_TOOLBAR_MID_RIGHT = 4, /* å³ä¸ */ SMPC_QUICK_SDK_TOOLBAR_BOT_LEFT = 5, /* å·¦ä¸ */ SMPC_QUICK_SDK_TOOLBAR_BOT_RIGHT = 6, /* å³ä¸ */ }SMPC_QUICK_SDK_TOOLBAR_PLACE; #pragma mark - é误ç typedef enum { SMPC_QUICK_SDK_ERROR_NONE = 0, /* 没æé误 */ SMPC_QUICK_SDK_ERROR_UNKNOWN = -1, /* æªç¥é误 */ SMPC_QUICK_SDK_ERROR_NETWORK = -2, /* ç½ç»è¿æ¥é误 */ SMPC_QUICK_SDK_ERROR_CHECKFAILED = -3, /* ç»å½æ ¡éªå¤±è´¥ */ SMPC_QUICK_SDK_ERROR_CHECKLOGINING = -4, /* æ£å¨æ ¡éªç»å½ */ SMPC_QUICK_SDK_ERROR_LOGINDISABLED = -5, /* æ¸ éç¦æ¢ç»å½ */ SMPC_QUICK_SDK_ERROR_PARAM = -10, /* åæ°é误 */ SMPC_QUICK_SDK_ERROR_NOT_INIT = -20, /* è¿æ²¡æåå§å */ SMPC_QUICK_SDK_ERROR_INIT_FAILED = -21, /* åå§å失败*/ SMPC_QUICK_SDK_ERROR_UNSUPPORTED = -100, /* åè½ä¸è¢«æ¯æ */ SMPC_QUICK_SDK_ERROR_NOT_LOGIN = -301, /* 没æç»å½ç¨æ· */ SMPC_QUICK_SDK_ERROR_HAD_LOGIN = -302, /* å·²æç»å½ç¨æ· */ SMPC_QUICK_SDK_ERROR_LOGOUT_FAIL = -303, /* ç¨æ·ç»åºå¤±è´¥ */ SMPC_QUICK_SDK_ERROR_RECHARGE_FAILED = -400, /* å å¼å¤±è´¥ */ SMPC_QUICK_SDK_ERROR_RECHARGE_CANCELLED = -401, /* ç¨æ·å å¼åæ¶ */ }SMPC_QUICK_SDK_ERROR_CODE; typedef enum { SMPC_QUICK_SDK_FUNC_TYPE_CPSCHANNELID = 0, /*宿¹æ¸ écpsæ¸ éid*/ SMPC_QUICK_SDK_FUNC_TYPE_PAUSED_GAME = 1, /*æå游æ*/ SMPC_QUICK_SDK_FUNC_TYPE_ENTER_USER_CENTER = 2, /*è¿å ¥ç¨æ·ä¸å¿*/ SMPC_QUICK_SDK_FUNC_TYPE_ENTER_BBS = 3, /*è¿å ¥è®ºå*/ // SMPC_QUICK_SDK_FUNC_TYPE_OPEN_URL = 4ï¼ SMPC_QUICK_SDK_FUNC_TYPE_SHOW_TOOLBAR = 5, /*æ¾ç¤ºæµ®å¨å·¥å ·æ */ SMPC_QUICK_SDK_FUNC_TYPE_HIDE_TOOLBAR = 6, /*éèæµ®å¨å·¥å ·æ */ SMPC_QUICK_SDK_FUNC_TYPE_ENTER_CUSTOMER_CENTER = 7, /*è¿å ¥å®¢æä¸å¿*/ }SMPC_QUICK_SDK_FUNC_TYPE; #endif Channel/IOS/qkbt6game/Plugins/QuickSDK/SMPCQuickSDK.framework/Headers/SMPCQuickSDKGameRoleInfo.h
New file @@ -0,0 +1,31 @@ // // SMPCQuickSDKGameRoleInfo.h // SMPCQuickSDK // // #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> @interface SMPCQuickSDKGameRoleInfo : NSObject NS_ASSUME_NONNULL_BEGIN @property (nonatomic,copy) NSString *serverId; //æå¡å¨Idï¼å¿ å¡« @property (nonatomic,copy) NSString *serverName; //æå¡å¨åç§°ï¼å¿ å¡« @property (nonatomic,copy) NSString *gameRoleName; //è§è²åï¼å¿ å¡« @property (nonatomic,copy) NSString *gameRoleID; //è§è²IDï¼å¿ å¡« @property (nonatomic, copy) NSString * creatTime; //è§è²å建æ¶é´(10使¶é´æ³)ï¼å¿ å¡«,没æä¼ 0 NS_ASSUME_NONNULL_END @property (nonatomic,copy) NSString * _Nullable gameUserBalance; //ç©å®¶èæè´§å¸ä½é¢ï¼éå¡«ï¼é»è®¤å¼0 @property (nonatomic,copy) NSString * _Nullable vipLevel; //ç©å®¶vipç级ï¼éå¡«ï¼é»è®¤å¼0 @property (nonatomic,copy) NSString * _Nullable gameUserLevel; //ç©å®¶ç级ï¼éå¡«ï¼é»è®¤å¼0 @property (nonatomic,copy) NSString * _Nullable partyName; //å ¬ä¼åç§°ï¼éå¡«ï¼é»è®¤ç©ºå符串 @property (nonatomic,copy) NSString * _Nullable partyId; //å ¬ä¼idï¼éå¡«ï¼é»è®¤ç©ºå符串 @property (nonatomic, copy) NSString * _Nullable fightPower; //æåï¼éå¡«ï¼é»è®¤å¼0 @property (nonatomic, copy) NSString * _Nullable professionId; //è§è²èä¸id, éå¡«ï¼é»è®¤å¼ï¼ç©ºå符串 @property (nonatomic, copy) NSString * _Nullable profession; //è§è²èä¸, éå¡«ï¼é»è®¤å¼ï¼ç©ºå符串 @property (nonatomic,copy) NSString * _Nullable roleGender; //è§è²æ§å«ï¼éå¡«ï¼é»è®¤å¼ç· @property (nonatomic,copy) NSString * _Nullable partyRoleId; //å ¬ä¼è§è²idï¼éå¡«ï¼é»è®¤ç©ºå符串 @property (nonatomic,copy) NSString * _Nullable partyRoleName; //å ¬ä¼è§è²åï¼éå¡«ï¼é»è®¤ç©ºå符串 @end Channel/IOS/qkbt6game/Plugins/QuickSDK/SMPCQuickSDK.framework/Headers/SMPCQuickSDKInitConfigure.h
New file @@ -0,0 +1,17 @@ // // SMPCQuickSDKInitConfigure.h // SMPCQuickSDK // // #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> @interface SMPCQuickSDKInitConfigure : NSObject @property (nonatomic, copy) NSString *productCode; //QuickSDKæä¾ç product_code @property (nonatomic, copy) NSString *productKey; //QuickSDKæä¾ç product_token @end Channel/IOS/qkbt6game/Plugins/QuickSDK/SMPCQuickSDK.framework/Headers/SMPCQuickSDKPayOrderInfo.h
New file @@ -0,0 +1,27 @@ // // SMPCQuickSDKPayOrderInfo.h // SMPCQuickSDK // // #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> @interface SMPCQuickSDKPayOrderInfo : NSObject @property(nonatomic,copy) NSString *goodsID; //ååID IAPæ¶ä¸ºè¹æå¼åè åå°é ç½®çååidï¼å¿ å¡« @property(nonatomic,copy) NSString *productName; //åååç§°ï¼å¿ å¡« @property(nonatomic,copy) NSString *cpOrderID; //游æè®¢åIDï¼å¿ å¡« @property(nonatomic,assign) NSUInteger count; //ååæ°éï¼å¿ å¡« @property(nonatomic,assign) float amount; //å忻价,å¿ å¡«ï¼è¿ä¸ªå¾éè¦ @property(nonatomic,copy) NSString *callbackUrl; //è´ä¹°åè°å°åï¼éå¡«,ä¼å ä½¿ç¨æå¡å¨ç«¯é ç½®ç @property(nonatomic,copy) NSString *extrasParams; //éä¼ åæ®µï¼éå¡«ï¼æå¡å¨åè°åæ ·ä¼ é //deprecated åºå¼çï¼å¯ä»¥ä¸ä¼ å¼ @property(nonatomic,assign) float price; //åååä»·ï¼éå¡«,å¦ææ¸ ééè¦ï¼Quickå°éè¿æ»ä»·åæ°éæ¥è®¡ç® @property(nonatomic,copy) NSString *productDesc; //ååæè¿°ï¼éå¡«ï¼é»è®¤QuickSDK使ç¨âæ°é+åååç§°âæ¼æ¥ï¼å¦ææ°é为1ï¼ä½¿ç¨åååç§° @property(nonatomic,copy) NSString *quantifier; //ååéè¯ï¼éå¡«ï¼å¯ä»¥ä¸º@""空串 + (instancetype)info;//è·åä¸ä¸ªå¯¹è±¡å±æ§å¼ä¸ºnilï¼æ°å¼å±æ§ä¸º0çå®ä¾ @end Channel/IOS/qkbt6game/Plugins/QuickSDK/SMPCQuickSDK.framework/Headers/SMPCQuickSDKShareInfo.h
New file @@ -0,0 +1,28 @@ // // SMPCQuickSDKShareInfo.h // SMPCQuickSDK // // Created by xiaoxiao on 2019/2/19. // #import <Foundation/Foundation.h> @interface SMPCQuickSDKShareInfo : NSObject @property (nonatomic, strong) NSString *type; //å享类å 1.facebookåäº«è¿æ¥ 2.facebookå享å¾ç 3.微信åäº«ææ¬ 4.微信å享å¾ç @property (nonatomic, strong) NSString *title; //å享æ é¢ @property (nonatomic, strong) NSString *content; //å享å 容 @property (nonatomic, strong) NSString *imgPath; //å享å¾çæ¬å°å°å @property (nonatomic, strong) NSString *filePath; //å享æä»¶è·¯å¾ @property (nonatomic, strong) NSString *imgUrl; //å享å¾çç½ç»å°å @property (nonatomic, strong) NSString *sencetype; //åéåºæ¯ 0 è天çé¢ï¼1 æååï¼2 æ¶è @property (nonatomic, strong) NSString *url; //åäº«é¾æ¥ @property (nonatomic, strong) NSString *shareTo; //å享å°åªé @property (nonatomic, strong) NSString *extenal; //é¢å¤å¤æ³¨ @property (nonatomic, assign) float width; //缩ç¥å¾å®½ @property (nonatomic, assign) float height; //缩ç¥å¾é« @end Channel/IOS/qkbt6game/Plugins/QuickSDK/SMPCQuickSDK.framework/SMPCQuickSDKBinary files differ
Channel/IOS/qkbt6game/Plugins/QuickSDK/libSMPCQuickChannel.aBinary files differ
Channel/IOS/qkbt6game/Plugins/The2thWorldSDK/The2thWorldRES.bundle/TY_AN_34.png
Channel/IOS/qkbt6game/Plugins/The2thWorldSDK/The2thWorldRES.bundle/The2thWorldSDKConfig.plist
New file @@ -0,0 +1,12 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>JPush_AppKey</key> <string>111a5f817592ddc68edc802c</string> <key>TTTrack_AppID</key> <string>155761</string> <key>TrackingIO_AppKey</key> <string>12aef4c284c6996703765fe9f7422428</string> </dict> </plist> Channel/IOS/qkbt6game/Plugins/The2thWorldSDK/UniversalSDK.h
New file @@ -0,0 +1,80 @@ // // UniversalSDK.h // Unity-iPhone // // Created by è¡ç on 2018/4/24. // #ifndef __UNIVERSALSDK_H_ #define __UNIVERSALSDK_H_ #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> #import <WebKit/WebKit.h> #define UNITY_OBJ_NAME "SDKUtility" #define UNITY_FUNC_NAME "HandleSdkMessage" #define PRODUCT_CODE @"29867800160198523830628191813245" #define PRODUCT_KEY @"13281292" #define S2U_BatteryLevel 1 #define S2U_BatteryCharging 2 #define S2U_SdkInitComplete 3 #define S2U_DeviceInfo 4 #define S2U_PushClientID 5 #define S2U_FreePlatformInitOk 100 #define S2U_FreePlatformInitFail 101 #define S2U_FreePlatformLoginOk 102 #define S2U_FreePlatformLoginFail 103 #define S2U_FreePlatformLoginCancel 104 #define S2U_FreePlatformLogoutOk 105 #define S2U_FreePlatformLogoutFail 106 #define S2U_FreePlatformSwitchAccountOk 107 #define S2U_FreePlatformPayOk 108 #define S2U_FreePlatformPayFail 109 #define S2U_FreePlatformPayCancel 110 #define S2U_FreePlatformRegisterOk 111 #define U2S_BatteryListenStart 1 #define U2S_BatteryListenStop 2 #define U2S_CopyContent 7 #define U2S_OpenWebView 8 #define U2S_Init 9 #define U2S_FreePlatformInit 100 #define U2S_FreePlatformLogin 101 #define U2S_FreePlatformLogout 102 #define U2S_FreePlatformSwitchAccount 103 #define U2S_FreePlatformPay 104 #define U2S_PayFinished 105 #define U2S_CreateRole 106 #define U2S_RoleLogin 107 #define U2S_RoleLevelUp 108 #define U2S_JPushAddLocalMessage 200 #define U2S_JPushRemoveLocalMessage 201 #define U2S_MakeKeyAndVisible 300 #define U2S_SendRegistEvent 500 #define U2S_SendLoginEvent 600 #define KIsiPhoneX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO) static BOOL JPush_IsProduction = FALSE; @interface UniversalSDK : NSObject<WKUIDelegate, WKNavigationDelegate> { WKWebView* m_UIWebView; WKWebView* m_fakeUIWebView; UIButton* m_CloseBtn; } -(void) HandleUnityMessage:(NSString*) json; -(void) Init; -(id) APNativeJSONObject:(NSData*) data; -(NSData*) APNativeJSONData:(id) obj; -(void) RemoveLocalNotificationWithIdentifierKey:(NSString*) idKey; -(void) QuickSDKInit:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions; @end #endif Channel/IOS/qkbt6game/Plugins/The2thWorldSDK/UniversalSDK.mm
New file @@ -0,0 +1,578 @@ // // UniversalSDK.m // Unity-iPhone // // Created by è¡ç on 2018/4/24. // #import "UniversalSDK.h" #import "AdSupport/AdSupport.h" #import "opus.h" #ifdef NSFoundationVersionNumber_iOS_9_x_Max #import <UserNotifications/UserNotifications.h> #endif #import "SystemConfiguration/CaptiveNetwork.h" #import <SMPCQuickSDK/SMPCQuickSDK.h> @implementation UniversalSDK #define CHANNEL_NUM 1 static int s_frequency = 16000; static int s_bitRate = 20000; static int s_bandMode = OPUS_BANDWIDTH_WIDEBAND; static int s_frameSize = 160; static int sBatteryLevel = -1; static int sBatteryState = -1; static NSString* sAppID; static NSString* sGameID; static NSString* sUserName; static NSThread* _thread; -(id)init { self = [super init]; m_fakeUIWebView = [[WKWebView alloc] initWithFrame:CGRectZero]; NSURL *url = [NSURL URLWithString:@"www.baidu.com"]; NSURLRequest *request = [NSURLRequest requestWithURL:url cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:10.f]; [m_fakeUIWebView loadRequest:request]; return self; } -(void) Init { UIDevice *_device = [UIDevice currentDevice]; _device.batteryMonitoringEnabled = true; NSString* _uniqueID = [[NSUserDefaults standardUserDefaults] objectForKey:@"tsw_unique_id"]; //è·åIDFA NSString* _idfa = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString]; if(_uniqueID == NULL || [_uniqueID length] <= 0) { //夿IDFAæ¯å¦ä¸ºç©º BOOL isEmpty = [[_idfa stringByReplacingOccurrencesOfString:@"-" withString:@""] stringByReplacingOccurrencesOfString:@"0" withString:@""].length; if (isEmpty) { //ä¸ä¸ºç©ºï¼å°IDFAä½ä¸ºå¯ä¸æ è¯ _uniqueID = _idfa; } else { //为空ï¼è·åUUIDä½ä¸ºå¯ä¸æ è¯ _uniqueID = [[[UIDevice currentDevice] identifierForVendor] UUIDString]; } //ä¿åå¯ä¸è®¾å¤æ è¯,å¦å·²åå¨åä¸è¿è¡ä»»ä½å¤ç [[NSUserDefaults standardUserDefaults] setObject:_uniqueID forKey:@"tsw_unique_id"]; [[NSUserDefaults standardUserDefaults] synchronize]; } // åå¾UserAgent [m_fakeUIWebView evaluateJavaScript:@"navigator.userAgent" completionHandler:^(id _Nullable userAgent, NSError * _Nullable error) { NSLog(@"%@", userAgent); NSString* _userAgent = [NSString stringWithFormat:@"%@", userAgent]; // åé设å¤ä¿¡æ¯ NSMutableDictionary *_dict = [NSMutableDictionary dictionaryWithObjectsAndKeys: _uniqueID,@"unique_id", _idfa,@"android_id", [NSNumber numberWithInt:S2U_DeviceInfo],@"code", _userAgent,@"userAgent",nil]; [self SendMessageToUnity:_dict]; }]; } -(void)SendMessageToUnity:(NSDictionary*)dict { BOOL _result = [NSJSONSerialization isValidJSONObject:dict]; if(_result) { NSData* _jsonData = [NSJSONSerialization dataWithJSONObject:dict options:0 error:NULL]; UnitySendMessage(UNITY_OBJ_NAME, UNITY_FUNC_NAME, [[[NSString alloc] initWithData:_jsonData encoding:NSUTF8StringEncoding] UTF8String]); } } -(void) BatteryThread { while (TRUE) { [NSThread sleepForTimeInterval:1]; UIDevice *_device = [UIDevice currentDevice]; int _state = [_device batteryState]; if(_state != sBatteryState){ sBatteryState = _state; NSDictionary *_dict = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt:sBatteryState], @"status", [NSNumber numberWithInt:S2U_BatteryCharging], @"code", nil]; [self SendMessageToUnity:_dict]; } int _level = (int)([_device batteryLevel] * 100); if(_level != sBatteryLevel){ sBatteryLevel = _level; NSDictionary *_dict = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt:sBatteryLevel], @"level", [NSNumber numberWithInt:S2U_BatteryLevel], @"code", nil]; [self SendMessageToUnity:_dict]; } } } -(void) OpenURL:(NSString*) url { if(m_UIWebView != NULL) { [self btnClick:NULL]; return; } CGRect _bounds = UnityGetMainWindow().bounds; float _scale = _bounds.size.width / 1334; float _width = 982 * _scale; float _height = 560 * _scale; float _offsetX = (_bounds.size.width - _width) * .5f; float _offsetY = (_bounds.size.height - _height) * .5f; m_UIWebView = [[WKWebView alloc] initWithFrame:CGRectMake(_offsetX, _offsetY, _width, _height)]; m_UIWebView.UIDelegate = self; m_UIWebView.navigationDelegate = self ; m_UIWebView.scrollView.scrollEnabled = YES; m_UIWebView.scrollView.bounces = NO; NSURLRequest *request =[NSURLRequest requestWithURL:[NSURL URLWithString:url]]; [m_UIWebView loadRequest:request]; } -(void) btnClick:(UIButton*)sender { [m_CloseBtn removeFromSuperview]; [m_CloseBtn removeTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside]; m_CloseBtn = NULL; NSURLCache *_cache = [NSURLCache sharedURLCache]; [_cache removeAllCachedResponses]; [_cache setDiskCapacity:0]; [_cache setMemoryCapacity:0]; [m_UIWebView removeFromSuperview]; m_UIWebView = NULL; } //-(void)webViewDidFinishLoad:(WKWebView *)webView{ - (void)webView:(WKWebView *)webView didFinishNavigation:(null_unspecified WKNavigation *)navigation{ CGRect _bounds = UnityGetMainWindow().bounds; float _scale = _bounds.size.width / 1334; float _width = 982 * _scale; float _height = 560 * _scale; m_CloseBtn = [UIButton buttonWithType:UIButtonTypeRoundedRect]; [m_CloseBtn setFrame:CGRectMake(_width - 600 * _scale, _height - 86 * _scale, 360 * _scale, 72 * _scale)]; [m_CloseBtn setTitle:@"æç¥éäº" forState:UIControlStateNormal]; NSString *_bundlePath = [[NSBundle mainBundle] pathForResource:@"The2thWorldRES.bundle" ofType:nil]; NSBundle *_bundle = [NSBundle bundleWithPath:_bundlePath]; NSString *pic1Path = [_bundle pathForResource:@"TY_AN_34.png" ofType:nil]; [m_CloseBtn setBackgroundImage:[UIImage imageWithContentsOfFile:pic1Path] forState:UIControlStateNormal]; [m_CloseBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; [m_CloseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside]; [m_UIWebView addSubview:m_CloseBtn]; UIView *view = UnityGetGLViewController().view; [view addSubview:m_UIWebView]; } -(void)QuickSDKInit:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // çå¬åå§å [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(smpcQpInitResult:) name:kSmpcQuickSDKNotiInitDidFinished object:nil]; // çå¬ç»å½ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(smpcQpLoginResult:) name:kSmpcQuickSDKNotiLogin object:nil]; // ç嬿³¨é [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(smpcQpLogoutResult:) name:kSmpcQuickSDKNotiLogout object:nil]; // çå¬å å¼ç»æ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(smpcQpRechargeResult:) name:kSmpcQuickSDKNotiRecharge object:nil]; // --------------------- åå§å -------------------------- SMPCQuickSDKInitConfigure *cfg = [[SMPCQuickSDKInitConfigure alloc] init]; cfg.productKey = PRODUCT_KEY; cfg.productCode = PRODUCT_CODE; [[SMPCQuickSDK defaultInstance] initWithConfig:cfg application:application didFinishLaunchingWithOptions:launchOptions]; // ------------------------------------------------------ } - (void)smpcQpInitResult:(NSNotification *)notify { NSLog(@"init result:%@",notify); NSDictionary *userInfo = notify.userInfo; int errorCode = [userInfo[kSmpcQuickSDKKeyError] intValue]; switch (errorCode) { case SMPC_QUICK_SDK_ERROR_NONE: { NSLog(@"åå§åæå"); // NSString *_appid = [[SMPCQuickSDK defaultInstance] getConfigValue:@"zfappid"]; // if (_appid == nil || [_appid isEqualToString:@""]) // { // _appid = sAppID; // } NSString *_appid = sAppID; NSLog(@"init _appid:%@",_appid); NSMutableDictionary *_dict = [NSMutableDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt:S2U_SdkInitComplete], @"code", @"quick", @"channelPlatform", _appid, @"yj_appid", _appid, @"yj_spid", nil]; [self SendMessageToUnity:_dict]; } break; case SMPC_QUICK_SDK_ERROR_INIT_FAILED: default: { //åå§å失败 NSLog(@"æ¸ éåå§å失败"); } break; } } - (void)smpcQpLoginResult:(NSNotification *)notify { NSLog(@"ç»å½æåéç¥%@",notify); int error = [[[notify userInfo] objectForKey:kSmpcQuickSDKKeyError] intValue]; NSDictionary *userInfo = [notify userInfo]; if (error == 0) { NSString *uid = [[SMPCQuickSDK defaultInstance] userId]; NSString *channel =[[SMPCQuickSDK defaultInstance] getConfigValue:@"channel"]; NSString *gameUID; if(channel&&[channel length]!=0) gameUID = [NSString stringWithFormat:@"%@%@%@", uid,@"@",channel]; else gameUID = [NSString stringWithFormat:@"%@@%d", uid, [SMPCQuickSDK defaultInstance].channelType]; NSString *UserName = [[SMPCQuickSDK defaultInstance] userId]; //è·åuser_tokenï¼ç¨äºä»æå¡å¨å»éªè¯ç¨æ·ä¿¡æ¯ NSString *user_token = userInfo[kSmpcQuickSDKKeyUserToken]; NSDictionary *_dict = [NSDictionary dictionaryWithObjectsAndKeys: [NSDictionary dictionaryWithObjectsAndKeys:user_token, @"token", UserName, @"userName", gameUID, @"account", nil],@"info", [NSNumber numberWithInt:S2U_FreePlatformLoginOk], @"code", nil]; [self SendMessageToUnity:_dict]; } } - (void)smpcQpLogoutResult:(NSNotification *)notify { NSLog(@"%s",__func__); NSDictionary *userInfo = notify.userInfo; int errorCode = [userInfo[kSmpcQuickSDKKeyError] intValue]; switch (errorCode) { case SMPC_QUICK_SDK_ERROR_NONE: { NSLog(@"注éæå"); //注éæå NSDictionary *_dict = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInt:S2U_FreePlatformLogoutOk], @"code", nil]; [self SendMessageToUnity:_dict]; } break; case SMPC_QUICK_SDK_ERROR_LOGOUT_FAIL: default: { //注é失败 NSLog(@"注é失败"); } break; } if (errorCode == SMPC_QUICK_SDK_ERROR_NONE) { } } - (void)smpcQpRechargeResult:(NSNotification *)notify{ NSLog(@"å å¼ç»æ%@",notify); NSDictionary *userInfo = notify.userInfo; int error = [[userInfo objectForKey:kSmpcQuickSDKKeyError] intValue]; switch (error) { case SMPC_QUICK_SDK_ERROR_NONE: { //å 弿å //QuickSDK订åå·,cpä¸åæ¶ä¼ å ¥ç订åå·ï¼æ¸ ésdkç订åå·ï¼cpä¸åæ¶ä¼ å ¥çæ©å±åæ° NSString *orderID = userInfo[kSmpcQuickSDKKeyOrderId]; NSString *cpOrderID = userInfo[kSmpcQuickSDKKeyCpOrderId]; NSLog(@"å 弿忰æ®ï¼%@,%@",orderID,cpOrderID); NSDictionary *_dict = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt:S2U_FreePlatformPayOk], @"code", nil]; [self SendMessageToUnity:_dict]; } break; case SMPC_QUICK_SDK_ERROR_RECHARGE_CANCELLED: case SMPC_QUICK_SDK_ERROR_RECHARGE_FAILED: { //å å¼å¤±è´¥ NSString *orderID = userInfo[kSmpcQuickSDKKeyOrderId]; NSString *cpOrderID = userInfo[kSmpcQuickSDKKeyCpOrderId]; NSLog(@"å å¼å¤±è´¥æ°æ®%@,%@",orderID,cpOrderID); NSDictionary *_dict = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt:S2U_FreePlatformPayFail], @"code", nil]; [self SendMessageToUnity:_dict]; } break; default: break; } } -(id) APNativeJSONObject:(NSData *)data{ if (!data) { return nil; } NSError *error = nil; id retId = [NSJSONSerialization JSONObjectWithData:data options:0 error:&error]; if (error) { NSLog(@"%s trans data to obj with error: %@", __func__, error); return nil; } return retId; } -(void)HandleUnityMessage:(NSString *)json { NSLog(@"æ¶å°Unityåæ¥çæ¶æ¯ => %@", json); NSData *_jsonData = [json dataUsingEncoding:NSUTF8StringEncoding]; NSDictionary *_dict = [self APNativeJSONObject:_jsonData]; switch([[_dict objectForKey:@"code"] intValue]){ case U2S_Init: sAppID = _dict[@"appID"]; sGameID = _dict[@"gameID"]; [self Init]; break; case U2S_CopyContent: [UIPasteboard generalPasteboard].string = _dict[@"content"]; break; case U2S_FreePlatformInit: break; case U2S_MakeKeyAndVisible: { UIWindow * _window = [[UIApplication sharedApplication].delegate window]; if (_window != nil && _window.rootViewController != nil) { [_window makeKeyAndVisible]; } } break; case U2S_OpenWebView: [self OpenURL:_dict[@"url"]]; break; case U2S_FreePlatformLogin: { int error = [[SMPCQuickSDK defaultInstance] login]; if (error != 0) { NSLog(@"U2S_FreePlatformLogin => %d",error); } } break; case U2S_FreePlatformLogout: { [[SMPCQuickSDK defaultInstance] logout]; } break; case U2S_CreateRole: { // æ´æ°è§è²ä¿¡æ¯ SMPCQuickSDKGameRoleInfo *gameRoleInfo = [SMPCQuickSDKGameRoleInfo new]; gameRoleInfo.serverName = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"serverName"]]; gameRoleInfo.gameRoleName = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"roleName"]]; gameRoleInfo.serverId = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"sid"]]; //éè¦æ¯æ°åå符串 gameRoleInfo.gameRoleID = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"roleID"]]; gameRoleInfo.gameUserBalance = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"money"]]; gameRoleInfo.vipLevel = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"vipLevel"]]; gameRoleInfo.gameUserLevel = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"level"]]; gameRoleInfo.partyName = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"familyName"]]; gameRoleInfo.creatTime = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"createTime"]]; [[SMPCQuickSDK defaultInstance] updateRoleInfoWith:gameRoleInfo isCreate:YES];//妿è¿ä¸ªè§è²æ¯ååå建çï¼è¿éisCreateå¯ä»¥ä¼ YES break; } case U2S_RoleLogin: { // æ´æ°è§è²ä¿¡æ¯ SMPCQuickSDKGameRoleInfo *gameRoleInfo = [SMPCQuickSDKGameRoleInfo new]; gameRoleInfo.serverName = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"serverName"]]; gameRoleInfo.gameRoleName = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"roleName"]]; gameRoleInfo.serverId = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"sid"]]; //éè¦æ¯æ°åå符串 gameRoleInfo.gameRoleID = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"roleID"]]; gameRoleInfo.gameUserBalance = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"money"]]; gameRoleInfo.vipLevel = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"vipLevel"]]; gameRoleInfo.gameUserLevel = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"level"]]; gameRoleInfo.partyName = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"familyName"]]; gameRoleInfo.creatTime = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"createTime"]]; [[SMPCQuickSDK defaultInstance] updateRoleInfoWith:gameRoleInfo isCreate:NO];//妿è¿ä¸ªè§è²æ¯ååå建çï¼è¿éisCreateå¯ä»¥ä¼ YES break; } case U2S_RoleLevelUp: { // æ´æ°è§è²ä¿¡æ¯ SMPCQuickSDKGameRoleInfo *gameRoleInfo = [SMPCQuickSDKGameRoleInfo new]; gameRoleInfo.serverName = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"serverName"]]; gameRoleInfo.gameRoleName = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"roleName"]]; gameRoleInfo.serverId = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"sid"]]; //éè¦æ¯æ°åå符串 gameRoleInfo.gameRoleID = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"roleID"]]; gameRoleInfo.gameUserBalance = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"money"]]; gameRoleInfo.vipLevel = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"vipLevel"]]; gameRoleInfo.gameUserLevel = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"level"]]; gameRoleInfo.partyName = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"familyName"]]; gameRoleInfo.creatTime = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"createTime"]]; [[SMPCQuickSDK defaultInstance] updateRoleInfoWith:gameRoleInfo isCreate:NO];//妿è¿ä¸ªè§è²æ¯ååå建çï¼è¿éisCreateå¯ä»¥ä¼ YES break; } case U2S_FreePlatformPay: { SMPCQuickSDKGameRoleInfo *role = [[SMPCQuickSDKGameRoleInfo alloc] init]; SMPCQuickSDKPayOrderInfo *order = [[SMPCQuickSDKPayOrderInfo alloc] init]; role.serverName = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"serverName"]]; role.gameRoleName = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"roleName"]]; role.serverId = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"sid"]]; //éè¦æ¯æ°åå符串 role.gameRoleID = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"roleID"]]; role.gameUserBalance = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"money"]]; role.vipLevel = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"vipLevel"]]; role.gameUserLevel = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"level"]]; role.partyName = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"familyName"]]; role.creatTime = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"createTime"]]; order.goodsID = [NSString stringWithFormat:@"%@", [_dict objectForKey:@"cpInfo"]]; //å¿ å¡« iapæ¶æ³¨æåè¹æå¼åè åå°ä¸è´ï¼æè æ¸ éæ å°ç order.productName = [NSString stringWithFormat:@"%@", [_dict objectForKey:@"title"]];//å¿ å¡« order.cpOrderID = [NSString stringWithFormat:@"%@", [_dict objectForKey:@"orderId"]]; //å¿ å¡« 游æè®¢åå· order.count = 1; //å¿ å¡« æ°é order.amount = [[_dict objectForKey:@"mount"] floatValue]; //å¿ å¡« æ»ä»· // NSString *_appid = [[SMPCQuickSDK defaultInstance] getConfigValue:@"zfappid"]; // if (_appid == nil || [_appid isEqualToString:@""]) // { // _appid = sAppID; // } NSString *_appid = sAppID; order.extrasParams = [NSString stringWithFormat:@"{\"appid\":\"%@\",\"cpinfo\":\"%@\",\"cporderid\":\"%@\"}", _appid, [_dict objectForKey:@"cpInfo"], [_dict objectForKey:@"orderId"] ]; // //ä¸ªå«æ¸ éè¦æ±åä»·*æ°é==æ»ä»· // if([SMPCQuickSDK defaultInstance].channelType == 9999){ // //éè¿å¤ææ¸ éå·å¤çç¹å®æ¸ éçåæ° // order.goodsID = @"productlist.name"; // } int error = [[SMPCQuickSDK defaultInstance] payOrderInfo:order roleInfo:role]; if (error!=0) NSLog(@"%d", error); } break; case U2S_BatteryListenStart: if(_thread == NULL) { _thread = [[NSThread alloc] initWithTarget:self selector:@selector(BatteryThread) object:nil]; [_thread setName:@"BatteryCheck"]; } if(![_thread isExecuting]) { [_thread start]; } break; case U2S_BatteryListenStop: break; } } @end extern "C" void native_opus_init(int frequency, int bitRate, int bandMode) { s_frequency = frequency; s_bandMode = bandMode; s_bitRate = bitRate; s_frameSize = frequency / 100; } extern "C" int native_opus_encode(opus_int16 *pcm, int len, unsigned char *opus) { int errorCode = 0; opus_int32 skip = 0; OpusEncoder *enc = opus_encoder_create(s_frequency, CHANNEL_NUM, OPUS_APPLICATION_VOIP, &errorCode); if (OPUS_OK != errorCode) { enc = NULL; return -1; } opus_encoder_ctl(enc, OPUS_SET_BANDWIDTH(s_bandMode)); opus_encoder_ctl(enc, OPUS_SET_BITRATE(s_bitRate)); opus_encoder_ctl(enc, OPUS_SET_VBR(1)); opus_encoder_ctl(enc, OPUS_SET_COMPLEXITY(10)); opus_encoder_ctl(enc, OPUS_SET_INBAND_FEC(0)); opus_encoder_ctl(enc, OPUS_SET_FORCE_CHANNELS(OPUS_SIGNAL_VOICE)); opus_encoder_ctl(enc, OPUS_SET_DTX(0)); opus_encoder_ctl(enc, OPUS_SET_PACKET_LOSS_PERC(0)); opus_encoder_ctl(enc, OPUS_GET_LOOKAHEAD(&skip)); opus_encoder_ctl(enc, OPUS_SET_LSB_DEPTH(16)); unsigned char *rbytes = opus; opus_int16 *frame = pcm; int totalSize = 0; while (len >= s_frameSize) { opus_int32 length = opus_encode(enc, frame, s_frameSize, rbytes + sizeof(char), s_bitRate); rbytes[0] = length; frame += s_frameSize; rbytes += length + sizeof(char); len -= s_frameSize; totalSize += (length+1); } opus_encoder_destroy(enc); return totalSize; } extern "C" int native_opus_decode(unsigned char *opus, int len, short *pcm) { int err = 0; //opus_int32 skip = 0; OpusDecoder *dec = opus_decoder_create(s_frequency, CHANNEL_NUM, &err); if (err != OPUS_OK) { dec = NULL; return -1; } while (len > 0) { int frame_opus_length = opus[0]; int length = opus_decode(dec, opus + sizeof(char), frame_opus_length, pcm, s_frameSize, 0); opus += sizeof(char) + frame_opus_length; pcm += s_frameSize; len = len - frame_opus_length - sizeof(char); } opus_decoder_destroy(dec); return 0; } SdkProject/channel/qkbt6game/AndroidManifest.xml
New file @@ -0,0 +1,45 @@ <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="com.secondworld.sdk"> <uses-permission android:name="android.permission.GET_TASKS" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.READ_PHONE_STATE" /> <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" /> <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" /> <application android:name=".BtGameApp" android:allowBackup="true" android:usesCleartextTraffic="true" tools:replace="android:name"> <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" /> <meta-data android:name="channelID" android:value="quicksdk_channel"/> <activity android:name="com.secondworld.sdk.SplashActivity" android:screenOrientation="sensorLandscape"> </activity> <provider android:name="android.support.v4.content.FileProvider" android:authorities="quicksdk_packName.Provider" android:exported="false" android:grantUriPermissions="true"> <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/filepaths" /> </provider> </application> </manifest> SdkProject/channel/qkbt6game/build.gradle
New file @@ -0,0 +1,4 @@ //å½åèæ¬ä¸ºæ¸ éçå·®å¼åé ç½® dependencies { // implementation project(path: ':quick') } SdkProject/channel/qkbt6game/config.properties
New file @@ -0,0 +1 @@ PLUGINS=quick SdkProject/channel/qkbt6game/deps.gradle
New file @@ -0,0 +1 @@ //æ¤èæ¬ä¸ºæ¸ éçç¬¬ä¸æ¹è¿ç¨ä¾èµåºé ç½®ï¼ä¼å¤å¶å°unityä¸ç¨äºæå»º SdkProject/channel/qkbt6game/java/com/secondworld/sdk/BtGameApp.java
New file @@ -0,0 +1,21 @@ package com.secondworld.sdk; public class BtGameApp extends QuickApp { @Override public void onCreate() { super.onCreate(); //QuickSdkMgr.I.register("40450025922275820036898902533267","31232581"); } @Override protected PlatformDiff getPlatform() { return new BtGamePlatform(); } @Override protected Class<? extends GameActivityProxy> getMainProxy() { return BtGameMain.class; } } SdkProject/channel/qkbt6game/java/com/secondworld/sdk/BtGameMain.java
New file @@ -0,0 +1,90 @@ package com.secondworld.sdk; import android.app.Activity; import android.app.AlertDialog; import android.content.DialogInterface; import android.content.Intent; import android.support.annotation.NonNull; import android.view.KeyEvent; import com.quicksdk.QuickSDK; import com.quicksdk.Sdk; public class BtGameMain extends GameActivityProxy { @Override public void onCreate(Activity activity) { super.onCreate(activity); QuickSdkMgr.I.requestPermissions(activity); //QuickSdkMgr.I.init(activity); com.quicksdk.Sdk.getInstance().onCreate(activity); } @Override public void onStart() { super.onStart(); com.quicksdk.Sdk.getInstance().onStart(activity); } @Override public void onRestart() { super.onRestart(); com.quicksdk.Sdk.getInstance().onRestart(activity); } @Override public void onResume() { super.onResume(); com.quicksdk.Sdk.getInstance().onResume(activity); } @Override public void onStop() { super.onStop(); com.quicksdk.Sdk.getInstance().onStop(activity); } @Override public void onDestroy() { super.onDestroy(); com.quicksdk.Sdk.getInstance().onDestroy(activity); } @Override public void onNewIntent(Intent intent) { super.onNewIntent(intent); com.quicksdk.Sdk.getInstance().onNewIntent(intent); } @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); QuickSdkMgr.I.onActivityResult(activity, requestCode); com.quicksdk.Sdk.getInstance().onActivityResult(activity, requestCode, resultCode, data); } @Override public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { super.onRequestPermissionsResult(requestCode, permissions, grantResults); QuickSdkMgr.I.onRequestPermissionsResult(activity, requestCode, grantResults); } @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK) { if (QuickSDK.getInstance().isShowExitDialog()) { Sdk.getInstance().exit(activity); } else { // 游æè°ç¨èªèº«çéåºå¯¹è¯æ¡ï¼ç¹å»ç¡®å®åï¼è°ç¨quickçexitæ¥å£ new AlertDialog.Builder(activity).setTitle("éåº").setMessage("æ¯å¦éåºæ¸¸æ?").setPositiveButton("ç¡®å®", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface arg0, int arg1) { Sdk.getInstance().exit(activity); } }).setNegativeButton("åæ¶", null).show(); } return true; } return super.onKeyDown(keyCode, event); } } SdkProject/channel/qkbt6game/java/com/secondworld/sdk/BtGamePlatform.java
New file @@ -0,0 +1,19 @@ package com.secondworld.sdk; public class BtGamePlatform extends PlatformDiff { @Override public String platformName() { return "quick"; } @Override public String platformProductCode() { return "41515786846775763118330293702907"; } @Override public String platformProductKey() { return "16873632"; } } SdkProject/gradle.properties
@@ -18,4 +18,4 @@ ## Automatically convert third-party libraries to use AndroidX android.enableJetifier=false #å½åæå»ºçæ¸ éåç§° CHANNEL_NAME=qkbt5game CHANNEL_NAME=qkbt6game SdkProject/plugins/quick/libs/arm64-v8a/libqkcheck.soBinary files differ
SdkProject/plugins/quick/libs/quicksdk_v2.7.1_20200309.jarBinary files differ
SdkProject/plugins/quick/libs/quicksdk_v2.7.3_20220112.jarBinary files differ
ÐÂÔöÇþµÀ.txt
@@ -1,4 +1,28 @@ 1. android ===æ°çæ¬æä½=============================================== 1.android æ°ASæä½ U3DRepository\SdkProjectä¸ æ·è´æ§çæä»¶å¤¹ å¦channel/qkbt6game gradle.propertieséç¼è¯æ¹æ CHANNEL_NAME=qkbt6game ä¿®æ¹BtGamePlatforméçkey 忥gradleï¼ç¼è¯å æ·è´U3DRepository\Channel\Android\qkbt6gameä¸çAndroidManifest.xml 2.ios è·¯å¾ U3DRepository\Channel\IOS a. æ·è´ä¸ä»½åè- æ¹æ¸ éå b. æ¿æ¢ codeåkeyï¼å¦æé»è¾åæ´æ ¹æ®éæ±ä¿®æ¹ c. èµ°æå æµç¨ quicksdkæ´æ° å®å æ·è´è³ U3DRepository\SdkProject\plugins\quick ios æ·è´è³ U3DRepository\Channel\IOS\qkbt6game\Plugins\QuickSDK ==æ§çæ¬================================================= 1. android ----- æ§SDKæä½ a.æ°å»ºæ¨¡å-android lib - åèå ¶ä¸ä¸ä¸ªç´æ¥æ·è´ææä»£ç - æ¹å¯¹åºçæ¸ éå b.æ·è´å¤å±ä¸¤ä¸ªdiffæä»¶å¤¹ å é¤å¤ä½aar c.æ¿æ¢ codeåkeyï¼å¦æé»è¾åæ´æ ¹æ®éæ±ä¿®æ¹ @@ -9,7 +33,3 @@ b. æ¿æ¢ codeåkeyï¼å¦æé»è¾åæ´æ ¹æ®éæ±ä¿®æ¹ c. èµ°æå æµç¨ =================================================== æ°ASæä½ åªè¦æ·è´æ§ç模å å¦channel/qkbt4game gradleç¼è¯æ¹æ CHANNEL_NAME=qkbt4game