/// <summary>
        ///
        /// </summary>
        /// <param name="iRace"></param>
        /// <param name="iClass"></param>
        /// <param name="playerLevelStats"></param>
        public void AddCreateInfo(uint iRace, uint iClass, WowCharacterCreateInfo playerCreateInfo)
        {
            SafeDictionary <uint, WowCharacterCreateInfo> safeWowPlayerCreateInfo = m_PlayerCreateInfo.GetValue(iRace);

            if (safeWowPlayerCreateInfo == null)
            {
                safeWowPlayerCreateInfo = new SafeDictionary <uint, WowCharacterCreateInfo>();
            }

            safeWowPlayerCreateInfo.Add(iClass, playerCreateInfo);

            m_PlayerCreateInfo.Add(iRace, safeWowPlayerCreateInfo);
        }
Пример #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="iRace"></param>
        /// <param name="iClass"></param>
        /// <returns></returns>
        public GraveyardInfo GetGraveyardInfo(uint iMapId, uint iZoneId, uint iFaction)
        {
            SafeDictionary <uint, SafeDictionary <uint, GraveyardInfo> > mapGraveyardInfo = m_GraveyardInfo.GetValue(iMapId);

            if (mapGraveyardInfo == null)
            {
                return(null);
            }

            SafeDictionary <uint, GraveyardInfo> zoneGraveyardInfo = mapGraveyardInfo.GetValue(iZoneId);

            if (zoneGraveyardInfo == null)
            {
                return(null);
            }

            GraveyardInfo graveyardInfo = zoneGraveyardInfo.GetValue(iFaction);

            if (graveyardInfo == null)
            {
                return(null);
            }

            return(graveyardInfo);
        }
Пример #3
0
 public TDSGlobalUser(Dictionary <string, object> dic)
 {
     this.userId = SafeDictionary.GetValue <long>(dic, "userId");
     this.sub    = SafeDictionary.GetValue <string>(dic, "sub");
     this.name   = SafeDictionary.GetValue <string>(dic, "name");
     this.token  = new TDSGlobalAccessToken(SafeDictionary.GetValue <Dictionary <string, object> >(dic, "token"));
 }
Пример #4
0
 public TDSAccountError(Dictionary <string, object> dic)
 {
     this.code             = SafeDictionary.GetValue <int>(dic, "code");
     this.msg              = SafeDictionary.GetValue <string>(dic, "msg");
     this.error            = SafeDictionary.GetValue <string>(dic, "error");
     this.errorDescription = SafeDictionary.GetValue <string>(dic, "errorDescription");
 }
Пример #5
0
        public TDSGlobalError(string json)
        {
            Dictionary <string, object> dic = Json.Deserialize(json) as Dictionary <string, object>;

            this.error_msg = SafeDictionary.GetValue <string>(dic, "error_msg") as string;
            this.code      = SafeDictionary.GetValue <int>(dic, "code");
        }
Пример #6
0
        public void SetLicencesCallback(TDSLicenseCallback callback)
        {
            Command command = new Command.Builder()
                .Service(TDSLicenseConstants.TDS_LICENSE_SERVICE)
                .Method("setLicenseCallback")
                .Callback(true)
                .CommandBuilder();
                
            EngineBridge.GetInstance().CallHandler(command, (result) =>
             {
                 Debug.Log("result:" + result.toJSON());
                 if (result.code != Result.RESULT_SUCCESS)
                 {
                     return;
                 }

                 if (string.IsNullOrEmpty(result.content))
                 {
                     return;
                 }

                 Dictionary<string, object> dic = Json.Deserialize(result.content) as Dictionary<string, object>;
                 string success = SafeDictionary.GetValue<string>(dic, "login") as string;

                 if (success.Equals("success"))
                 {
                     callback.OnLicenseSuccess();
                 }
             });
        }
Пример #7
0
        public TDSGlobalUserStatusChangeWrapper(string json)
        {
            Dictionary <string, object> dic = Json.Deserialize(json) as Dictionary <string, object>;

            this.code    = SafeDictionary.GetValue <int>(dic, "code");
            this.message = SafeDictionary.GetValue <string>(dic, "message");
        }
Пример #8
0
 public TDSGlobalAccessToken(Dictionary <string, object> dic)
 {
     this.accessToken  = SafeDictionary.GetValue <string>(dic, "accessToken");
     this.kid          = SafeDictionary.GetValue <string>(dic, "kid");
     this.macKey       = SafeDictionary.GetValue <string>(dic, "macKey");
     this.macAlgorithm = SafeDictionary.GetValue <string>(dic, "macAlgorithm");
     this.tokenType    = SafeDictionary.GetValue <string>(dic, "tokenType");
 }
        public MomentCallbackBean(string json)
        {
            Dictionary <string, object> dic = Json.Deserialize(json) as Dictionary <string, object>;

            Debug.Log("callbackCode:" + dic["code"] + "  msg:" + dic["message"]);
            this.code    = SafeDictionary.GetValue <int>(dic, "code");
            this.message = SafeDictionary.GetValue <string>(dic, "message");
        }
Пример #10
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="strGameCommand"></param>
        /// <param name="caseIgnore"></param>
        /// <param name="accessLevel"></param>
        /// <param name="delegateGameCommandCall"></param>
        /// <returns></returns>
        public GameCommandHandler Register(string strGameCommand, bool bIgnoreCase, AccessLevel accessLevel, DelegateGameCommandCall delegateGameCommandCall)
        {
            if (strGameCommand == null || strGameCommand == string.Empty)
            {
                throw new Exception("GameCommandManager.Register(...) - strGameCommand == null || strGameCommand == string.Empty error!");
            }

            GameCommandHandler gameCommand = null;

            if (bIgnoreCase == true)
            {
                string strIgnoreCase = strGameCommand.ToLower();

                gameCommand = m_GameCommandsIgnoreCase.GetValue(strIgnoreCase);
                if (gameCommand == null)
                {
                    gameCommand             = new GameCommandHandler();
                    gameCommand.GameCommand = strGameCommand;
                    gameCommand.IgnoreCase  = bIgnoreCase;
                    gameCommand.AccessLevel = accessLevel;

                    m_GameCommandsIgnoreCase.Add(strIgnoreCase, gameCommand);
                }
            }
            else
            {
                gameCommand = m_GameCommandsInvariant.GetValue(strGameCommand);
                if (gameCommand == null)
                {
                    gameCommand             = new GameCommandHandler();
                    gameCommand.GameCommand = strGameCommand;
                    gameCommand.IgnoreCase  = bIgnoreCase;
                    gameCommand.AccessLevel = accessLevel;

                    m_GameCommandsInvariant.Add(strGameCommand, gameCommand);
                }
            }

            if (delegateGameCommandCall != null)
            {
                gameCommand.ThreadGameCommandCall += new EventHandler <GameCommandEventArgs>(delegateGameCommandCall);
            }

            return(gameCommand);
        }
Пример #11
0
 public TDSGlobalOrderInfo(Dictionary <string, object> dic)
 {
     this.orderId   = SafeDictionary.GetValue <string>(dic, "orderId");
     this.productId = SafeDictionary.GetValue <string>(dic, "productId");
     this.roleId    = SafeDictionary.GetValue <string>(dic, "roleId");
     this.serverId  = SafeDictionary.GetValue <string>(dic, "serverId");
     this.ext       = SafeDictionary.GetValue <string>(dic, "ext");
     Debug.Log("Parse TDSGlobal OrderInfo finish:" + ToJSON());
 }
Пример #12
0
        public TDSLoginProfile(string json)
        {
            Dictionary <string, object> dic = Json.Deserialize(json) as Dictionary <string, object>;

            this.name    = SafeDictionary.GetValue <string>(dic, "name") as string;
            this.avatar  = SafeDictionary.GetValue <string>(dic, "avatar") as string;
            this.openid  = SafeDictionary.GetValue <string>(dic, "openid") as string;
            this.unionid = SafeDictionary.GetValue <string>(dic, "unionid") as string;
        }
Пример #13
0
        public TDSAccountError(string json)
        {
            Dictionary <string, object> dic = Json.Deserialize(json) as Dictionary <string, object>;

            this.code             = SafeDictionary.GetValue <int>(dic, "code");
            this.msg              = SafeDictionary.GetValue <string>(dic, "msg");
            this.error            = SafeDictionary.GetValue <string>(dic, "error");
            this.errorDescription = SafeDictionary.GetValue <string>(dic, "errorDescription");
        }
Пример #14
0
        public TDSAccessToken(string json)
        {
            Dictionary <string, object> dic = Json.Deserialize(json) as Dictionary <string, object>;

            this.kid           = SafeDictionary.GetValue <string>(dic, "kid") as string;
            this.access_token  = SafeDictionary.GetValue <string>(dic, "access_token") as string;
            this.token_type    = SafeDictionary.GetValue <string>(dic, "token_type") as string;
            this.mac_key       = SafeDictionary.GetValue <string>(dic, "mac_key") as string;
            this.mac_algorithm = SafeDictionary.GetValue <string>(dic, "mac_algorithm") as string;
        }
Пример #15
0
        public TDSGlobalSkuDetail(Dictionary <string, object> dic)
        {
            this.localeIdentifier  = SafeDictionary.GetValue <string>(dic, "localeIdentifier");
            this.localizedTitle    = SafeDictionary.GetValue <string>(dic, "localizedTitle");
            this.price             = SafeDictionary.GetValue <double>(dic, "price");
            this.productIdentifier = SafeDictionary.GetValue <string>(dic, "productIdentifier");
            Dictionary <string, object> priceLocaleDic = SafeDictionary.GetValue <Dictionary <string, object> >(dic, "priceLocale") as Dictionary <string, object>;

            this.priceLocale = new PriceLocale(priceLocaleDic);
        }
Пример #16
0
 public PriceLocale(Dictionary <string, object> dic)
 {
     this.localeIdentifier   = SafeDictionary.GetValue <string>(dic, "localeIdentifier");
     this.languageCode       = SafeDictionary.GetValue <string>(dic, "languageCode");
     this.countryCode        = SafeDictionary.GetValue <string>(dic, "countryCode");
     this.scriptCode         = SafeDictionary.GetValue <string>(dic, "scriptCode");
     this.calendarIdentifier = SafeDictionary.GetValue <string>(dic, "calendarIdentifier");
     this.decimalSeparator   = SafeDictionary.GetValue <string>(dic, "decimalSeparator");
     this.currencySymbol     = SafeDictionary.GetValue <string>(dic, "currencySymbol");
 }
        public TDSGlobalInlinePayResult(string jsonStr)
        {
            var dic = Json.Deserialize(jsonStr) as Dictionary <string, object>;

            if (dic != null)
            {
                code    = SafeDictionary.GetValue <int>(dic, "code");
                message = SafeDictionary.GetValue <string>(dic, "message");
            }
        }
Пример #18
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="baseAbility"></param>
        /// <returns></returns>
        public bool CheckAbilityUpdateAllow(BaseAbility baseAbility)
        {
            BaseTreeNode baseTreeNode = m_TreeNodes.GetValue(baseAbility);

            if (baseTreeNode == null)
            {
                return(false);
            }

            return(baseTreeNode.CheckTreeNodeInfo());
        }
Пример #19
0
        /// <summary>
        ///GetValue 的测试
        ///</summary>
        public void GetValueTestHelper <KeyT, ValueT>()
        {
            SafeDictionary <KeyT, ValueT> target = new SafeDictionary <KeyT, ValueT>(); // TODO: 初始化为适当的值
            KeyT   key      = default(KeyT);                                            // TODO: 初始化为适当的值
            ValueT expected = default(ValueT);                                          // TODO: 初始化为适当的值
            ValueT actual;

            actual = target.GetValue(key);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }
Пример #20
0
        public TDSGlobalUser(string json)
        {
            Dictionary <string, object> dic = Json.Deserialize(json) as Dictionary <string, object>;

            this.userId        = SafeDictionary.GetValue <long>(dic, "userId");
            this.sub           = SafeDictionary.GetValue <string>(dic, "sub");
            this.name          = SafeDictionary.GetValue <string>(dic, "name");
            this.loginType     = SafeDictionary.GetValue <int>(dic, "loginType");
            this.boundAccounts = SafeDictionary.GetValue <List <string> >(dic, "boundAccounts");
            this.token         = new TDSGlobalAccessToken(SafeDictionary.GetValue <Dictionary <string, object> >(dic, "token"));
        }
Пример #21
0
        public TDSGlobalShareWrapper(string json)
        {
            Dictionary <string, object> dic = Json.Deserialize(json) as Dictionary <string, object>;

            this.cancel = SafeDictionary.GetValue <bool>(dic, "cancel");
            Dictionary <string, object> errorDic = SafeDictionary.GetValue <Dictionary <string, object> >(dic, "error");

            if (errorDic != null)
            {
                this.error = new TDSGlobalError(errorDic);
            }
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="iRace"></param>
        /// <param name="iClass"></param>
        /// <returns></returns>
        public ExplorationReward GetExplorationReward(uint iLevel)
        {
            ExplorationReward explorationReward = m_ExplorationReward.GetValue(iLevel);

            if (explorationReward == null)
            {
                return(null);
            }
            else
            {
                return(explorationReward);
            }
        }
Пример #23
0
        public TDSGlobalUserWrapper(string json)
        {
            Dictionary <string, object> dic      = Json.Deserialize(json) as Dictionary <string, object>;
            Dictionary <string, object> userDic  = SafeDictionary.GetValue <Dictionary <string, object> >(dic, "user");
            Dictionary <string, object> errorDic = SafeDictionary.GetValue <Dictionary <string, object> >(dic, "error");

            Debug.Log("TDSGlobal User Parse After:" + json);
            if (userDic != null)
            {
                this.user = new TDSGlobalUser(userDic);
            }
            if (errorDic != null)
            {
                this.error = new TDSGlobalError(errorDic);
            }
        }
Пример #24
0
        public TDSGlobalRestoredPurchasesWrapper(string json)
        {
            Dictionary <string, object> dic = Json.Deserialize(json) as Dictionary <string, object>;
            List <object> list = SafeDictionary.GetValue <List <object> >(dic, "transactions");

            if (list == null)
            {
                return;
            }
            this.transactions = new List <TDSGlobalRestoredPurchases>();
            foreach (var obj in list)
            {
                Dictionary <string, object> innerDic         = obj as Dictionary <string, object>;
                TDSGlobalRestoredPurchases  restorePurchases = new TDSGlobalRestoredPurchases(innerDic);
                this.transactions.Add(restorePurchases);
            }
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="iRace"></param>
        /// <param name="iClass"></param>
        /// <returns></returns>
        public WowCharacterCreateInfo GetCreateInfo(uint iRace, uint iClass)
        {
            SafeDictionary <uint, WowCharacterCreateInfo> safeWowPlayerCreateInfo = m_PlayerCreateInfo.GetValue(iRace);

            if (safeWowPlayerCreateInfo == null)
            {
                return(null);
            }

            WowCharacterCreateInfo playerCreateInfo = safeWowPlayerCreateInfo.GetValue(iClass);

            if (playerCreateInfo == null)
            {
                return(null);
            }
            else
            {
                return(playerCreateInfo);
            }
        }
Пример #26
0
        public TDSGlobalOrderInfoWrapper(string json)
        {
            Debug.Log("TDSGlobalOrderInfoWrapper json:" + json);
            Dictionary <string, object> dic          = Json.Deserialize(json) as Dictionary <string, object>;
            Dictionary <string, object> orderInfoDic = SafeDictionary.GetValue <Dictionary <string, object> >(dic, "orderInfo");
            Dictionary <string, object> errorDic     = SafeDictionary.GetValue <Dictionary <string, object> >(dic, "error");

            Debug.Log("TDSGlobalOrderInfoWrapper parse after orderInfoDic json:" + orderInfoDic);
            Debug.Log("TDSGlobalOrderInfoWrapper parse after errorDic json:" + errorDic);

            if (orderInfoDic != null)
            {
                this.orderInfo = new TDSGlobalOrderInfo(orderInfoDic);
            }

            if (errorDic != null)
            {
                this.error = new TDSGlobalError(errorDic);
            }
        }
Пример #27
0
        public TDSGlobalSkuDetailWrapper(string json)
        {
            Dictionary <string, object> dic      = Json.Deserialize(json) as Dictionary <string, object>;
            Dictionary <string, object> errorDic = SafeDictionary.GetValue <Dictionary <string, object> >(dic, "error");
            List <object> list = SafeDictionary.GetValue <List <object> >(dic, "products");

            if (errorDic != null)
            {
                this.error = new TDSGlobalError(errorDic);
            }
            if (list != null)
            {
                this.products = new List <TDSGlobalSkuDetail>();
                foreach (var skuDetail in list)
                {
                    Dictionary <string, object> innerDic = skuDetail as Dictionary <string, object>;
                    TDSGlobalSkuDetail          detail   = new TDSGlobalSkuDetail(innerDic);
                    products.Add(detail);
                }
            }
        }
Пример #28
0
        public void SetDLCCallbackWithParams(TDSDLCCallback callback, bool checkOnce, string publicKey)
        {
            Command command = new Command.Builder()
                .Service(TDSLicenseConstants.TDS_LICENSE_SERVICE)
                .Method("setDLCCallbackWithParams")
                .Callback(true)
                .Args("checkOnce", checkOnce)
                .Args("publicKey", publicKey)
                .CommandBuilder();
            EngineBridge.GetInstance().CallHandler(command, (result) =>
             {
                 Debug.Log("result:" + result.toJSON());
                 if (result.code != Result.RESULT_SUCCESS)
                 {
                     return;
                 }

                 if (string.IsNullOrEmpty(result.content))
                 {
                     return;
                 }

                 Dictionary<string, object> dic = Json.Deserialize(result.content) as Dictionary<string, object>;

                 string dlc = SafeDictionary.GetValue<string>(dic, "orderDLC") as string;
                 if (!string.IsNullOrEmpty(dlc))
                 {
                     int statusCode = SafeDictionary.GetValue<int>(dic, "orderStatus");
                     callback.OnOrderCallBack(dlc, statusCode);
                     return;
                 }

                 int code = SafeDictionary.GetValue<int>(dic, "queryCode");
                 string queryListJson = SafeDictionary.GetValue<string>(dic, "queryResult");

                 Dictionary<string, object> quertListDic = Json.Deserialize(queryListJson) as Dictionary<string, object>;

                 callback.OnQueryCallBack(code, quertListDic);
             });
        }
Пример #29
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="strPrefix"></param>
        /// <param name="bIgnoreCase"></param>
        /// <returns></returns>
        public GameCommandPrefix Register(string strPrefix, bool bIgnoreCase)
        {
            if (strPrefix == null || strPrefix == string.Empty)
            {
                throw new Exception("GameCommandManager.Register(...) - strPrefix == null || strPrefix == string.Empty error!");
            }

            GameCommandPrefix gameCommandPrefix = null;

            if (bIgnoreCase == true)
            {
                string strIgnoreCase = strPrefix.ToLower();

                gameCommandPrefix = m_GameCommandPrefixsIgnoreCase.GetValue(strIgnoreCase);
                if (gameCommandPrefix == null)
                {
                    gameCommandPrefix            = new GameCommandPrefix();
                    gameCommandPrefix.Prefix     = strPrefix;
                    gameCommandPrefix.IgnoreCase = bIgnoreCase;

                    m_GameCommandPrefixsIgnoreCase.Add(strIgnoreCase, gameCommandPrefix);
                }
            }
            else
            {
                gameCommandPrefix = m_GameCommandPrefixsInvariant.GetValue(strPrefix);
                if (gameCommandPrefix == null)
                {
                    gameCommandPrefix            = new GameCommandPrefix();
                    gameCommandPrefix.Prefix     = strPrefix;
                    gameCommandPrefix.IgnoreCase = bIgnoreCase;

                    m_GameCommandPrefixsInvariant.Add(gameCommandPrefix.Prefix, gameCommandPrefix);
                }
            }

            return(gameCommandPrefix);
        }
Пример #30
0
        /// <summary>
        /// 给出某种时间片的处理信息
        /// </summary>
        /// <returns></returns>
        public TimerProfile GetProfile()
        {
            if (OneServer.Profiling == false)
            {
                return(null);
            }

            string strName = ToString();

            if (strName == null || strName == string.Empty)
            {
                strName = "null";
            }

            TimerProfile timerProfile = s_Profiles.GetValue(strName);

            if (timerProfile == null)
            {
                timerProfile = new TimerProfile();
                s_Profiles.Add(strName, timerProfile);
            }

            return(timerProfile);
        }