예제 #1
0
    public override void read(ErlKVMessage message)
    {
        ErlType type = message.getValue("msg") as ErlType;

        if (type is ErlArray)
        {
            ErlArray arr          = type as ErlArray;
            int      index        = 0;
            int      checkedPoint = StringKit.toInt(arr.Value[index++].getValueString());
            int      prizeSid     = StringKit.toInt(arr.Value[index++].getValueString());
            int      prizeNum     = StringKit.toInt(arr.Value[index++].getValueString());

            if (callback != null)
            {
                callback(checkedPoint, prizeSid, prizeNum);
            }
        }
        else
        {
            MessageWindow.ShowAlert((message.getValue("msg") as ErlString).getValueString());
            MaskWindow.UnlockUI();
            if (callback != null)
            {
                callback = null;
            }
        }
    }
    public override void read(ErlKVMessage message)
    {
        ErlType msgType = message.getValue("msg") as ErlType;

        if (msgType != null && msgType is ErlArray)
        {
            ErlArray buyArray = msgType as ErlArray;
            if (buyArray.Value[0].getValueString() == "ok")
            {
                StorageManagerment.Instance.parseAddStorageProps(buyArray.Value[1] as ErlArray);
                if (callback != null)
                {
                    callback();
                }
            }
            else
            {
                UiManager.Instance.openDialogWindow <MessageLineWindow>((win) => {
                    win.Initialize(LanguageConfigManager.Instance.getLanguage("OneOnOneBoss_425"));
                });
            }
        }
        else
        {
            UiManager.Instance.openDialogWindow <MessageLineWindow>((win) => {
                win.Initialize(LanguageConfigManager.Instance.getLanguage("OneOnOneBoss_425"));
            });
        }
        callback = null;
    }
예제 #3
0
    //解析ErlKVMessgae
    public bool parseKVMsg(ErlKVMessage message)
    {
        ErlType type = message.getValue("msg") as ErlType;

        if (type is ErlArray)
        {
            ErlArray stateArray = type as ErlArray;
            string   state      = stateArray.Value[0].getValueString();
            if (state == "ok")
            {
                TotalLoginManagerment.Instance.HolidayState = true;
                TotalLoginManagerment.Instance.updateHolidasyAwardData(stateArray.Value[1] as ErlArray);
            }
            else if (state == "close")
            {
                TotalLoginManagerment.Instance.HolidayState = false;
            }
            return(true);
        }
        else
        {
            MonoBase.print(GetType() + "==" + type.getValueString());
        }
        return(false);
    }
예제 #4
0
    public override void read(ErlKVMessage message)
    {
        ErlType type = message.getValue("msg") as ErlType;

        if (type.getValueString() == "condition_err")
        {
        }
        /** 名称非法 */
        else if (type.getValueString() == "name_error")
        {
            UiManager.Instance.createMessageLintWindow(LanguageConfigManager.Instance.getLanguage("roleNameWindow_Validname"));
        }
        /** 长度超标 */
        else if (type.getValueString() == "name_length_err")
        {
            UiManager.Instance.createMessageLintWindow(LanguageConfigManager.Instance.getLanguage("roleName01"));
        }
        /** 名称重复 */
        else if (type.getValueString() == "name_repeat")
        {
            UiManager.Instance.createMessageLintWindow(LanguageConfigManager.Instance.getLanguage("roleName02"));
        }
        /** 改名成功 */
        else if (type.getValueString() == "ok")
        {
            UiManager.Instance.createMessageLintWindow(LanguageConfigManager.Instance.getLanguage("roleName03"));
            if (callBack != null)
            {
                callBack(name);
            }
        }
    }
    public override void read(ErlKVMessage message)
    {
        base.read(message);
        ErlType type = message.getValue("msg") as ErlType;

        if (type is ErlArray)
        {
            ErlArray array = type as ErlArray;
            RankManagerment.Instance.guildAreaHurtList.Clear();
            for (int i = 0; i < array.Value.Length; ++i)
            {
                ErlArray temp              = array.Value[i] as ErlArray;
                int      index             = 0;
                string   uid               = temp.Value[index++].getValueString();
                string   name              = temp.Value[index++].getValueString();
                int      vipLevel          = StringKit.toInt(temp.Value[index++].getValueString());
                string   warNum            = temp.Value[index++].getValueString();
                string   hurtNum           = temp.Value[index++].getValueString();
                GuildAreaHurtRankItem item = new GuildAreaHurtRankItem(uid, name, warNum, hurtNum);
                RankManagerment.Instance.guildAreaHurtList.Add(item);
            }

            if (callBack != null)
            {
                callBack();
            }
        }
    }
예제 #6
0
    /// <summary>
    /// 星魂加锁
    /// </summary>
    /// <param name="lockinfo">锁信息串</param>
    /// <param name="callback">callback</param>
    /// <summary>
    /// 回调读取通讯
    /// </summary>
    /// <param name="message">Message.</param>
    public override void read(ErlKVMessage message)
    {
        ErlType       type    = message.getValue("msg") as ErlType;
        List <string> goodids = null;

        if (type is ErlArray)
        {
            ErlArray arr = type as ErlArray;
            if (arr != null && arr.Value.Length > 0)
            {
                for (int i = 0; i < arr.Value.Length; i++)
                {
                    if (goodids == null)
                    {
                        goodids = new List <string>();
                    }
                    goodids.Add(arr.Value[i].getValueString());
                }
            }
            if (callback != null)
            {
                callback(goodids);
                callback = null;
            }
        }
        else
        {
            UiManager.Instance.openDialogWindow <MessageWindow>((win) => {
                win.initWindow(1, LanguageConfigManager.Instance.getLanguage("s0093"), null, type.getValueString(), null);
            });
        }
    }
예제 #7
0
    public override void read(ErlKVMessage message)
    {
        ErlType type = message.getValue("msg") as ErlType;
        string  msg  = type.getValueString();

        if (msg != null)
        {
            int returnValue = int.Parse(msg);
            if (returnValue > 0)
            {
                if (!isnew)
                {
                    TotalLoginManagerment.Instance.addReceivedAwardId(returnValue);
                }
                else
                {
                    TotalLoginManagerment.Instance.addNewrAwardId(returnValue);
                }
                if (callback != null)
                {
                    callback();
                    callback = null;
                }
            }
        }
    }
예제 #8
0
    public override void read(ErlKVMessage message)
    {
        ErlType type = message.getValue("msg") as ErlType;

        if (type.getValueString() == "non_mem")
        {
            UiManager.Instance.openDialogWindow <MessageWindow>((win) => {
                win.initWindow(1, LanguageConfigManager.Instance.getLanguage("s0093"), null, LanguageConfigManager.Instance.getLanguage("Guild_90"), GuildManagerment.Instance.closeAllGuildWindow);
            });
            return;
        }
        ErlArray array = type as ErlArray;

        if (array.Value.Length > 0)
        {
            for (int i = 0; i < array.Value.Length; i++)
            {
                ErlArray temp    = array.Value[i] as ErlArray;
                string   sid     = temp.Value[0].getValueString();
                ErlArray temps   = temp.Value[1] as ErlArray;
                int      num     = StringKit.toInt(temps.Value[0].getValueString());
                int      buyTime = StringKit.toInt(temps.Value[1].getValueString());
                //GuildGood shop = new GuildGood(sid,num,buyTime);
                //GuildManagerment.Instance.createGuildShop(shop);
            }
        }
        if (callback != null)
        {
            callback();
        }
    }
예제 #9
0
    /// <summary>
    /// 强化星魂通讯读取处理
    /// </summary>
    /// <param name="message">Message.</param>
    private void doStrengStarSoul(ErlKVMessage message)
    {
        ErlType erlType = message.getValue("value") as ErlType;

        if (erlType is ErlArray)
        {
            ErlArray           arr      = erlType as ErlArray;
            int                index    = 0;
            string             uid      = arr.Value [index++].getValueString();
            long               exp      = StringKit.toLong(arr.Value [index++].getValueString());
            StorageManagerment smanager = StorageManagerment.Instance;
            StarSoulManager    manager  = StarSoulManager.Instance;
            StarSoul           starSoul = smanager.getStarSoul(uid);
            if (starSoul != null)
            {
                manager.delStarSoulExp(exp);
                starSoul.updateExp(starSoul.getEXP() + exp);
                starSoul.isNew = false;
            }
            StorageManagerment.Instance.starSoulStorageVersion++;
            if (callback != null)
            {
                callback();
                callback = null;
            }
        }
        else
        {
            UiManager.Instance.openDialogWindow <MessageWindow> ((win) => {
                win.initWindow(1, LanguageConfigManager.Instance.getLanguage("s0093"), null, erlType.getValueString(), null);
            });
        }
    }
예제 #10
0
    public override void read(ErlKVMessage message)
    {
        ErlType type = message.getValue("msg") as ErlType;

        if (type.getValueString() == FPortGlobal.SYSTEM_OK)
        {
            callback(exchangeID, exchangeNum);
        }
        else if (type.getValueString() == FPortGlobal.SYSTEM_FALSE_L)
        {
            MessageWindow.ShowAlert(LanguageConfigManager.Instance.getLanguage("sli001l"));
            if (callback != null)
            {
                callback = null;
            }
        }
        else
        {
            MessageWindow.ShowAlert(LanguageConfigManager.Instance.getLanguage("sli002l"));
            if (callback != null)
            {
                callback = null;
            }
        }
    }
예제 #11
0
    public override void read(ErlKVMessage message)
    {
        ErlType type = message.getValue("msg") as ErlType;

        if (type.getValueString() == "non_mem")
        {
            UiManager.Instance.openDialogWindow <MessageWindow>((win) => {
                win.initWindow(1, LanguageConfigManager.Instance.getLanguage("s0093"), null, LanguageConfigManager.Instance.getLanguage("Guild_90"), GuildManagerment.Instance.closeAllGuildWindow);
            });
            return;
        }
        ErlArray array = type as ErlArray;

        GuildManagerment.Instance.clearGuildRastInfo();
        if (array.Value.Length > 0)
        {
            for (int i = 0; i < array.Value.Length; i++)
            {
                ErlArray      temps      = array.Value[i] as ErlArray;
                int           sid        = StringKit.toInt(temps.Value[0].getValueString());
                string        playerName = temps.Value[1].getValueString();
                int           rask       = StringKit.toInt(temps.Value[2].getValueString());
                GuildRastInfo raskInfo   = new GuildRastInfo(sid, playerName, rask);
                GuildManagerment.Instance.createGuildRastInfo(raskInfo);
            }
        }

        if (callback != null)
        {
            callback();
        }
    }
예제 #12
0
    /// <summary>
    /// 卸星魂通讯读取处理
    /// </summary>
    /// <param name="message">Message.</param>
    private void doPutoffStarSoul(ErlKVMessage message)
    {
        ErlType erlType = message.getValue("value") as ErlType;

        if (erlType is ErlArray)
        {
            ErlArray arr         = erlType as ErlArray;
            int      index       = 0;
            string   cardUid     = arr.Value [index++].getValueString();
            int      hole        = StringKit.toInt(arr.Value [index++].getValueString());
            string   starsoulUid = arr.Value [index++].getValueString();
            StarSoulManager.Instance.delSoulStarState(cardUid, hole);
            StorageManagerment smanager = StorageManagerment.Instance;
            Card card = smanager.getRole(cardUid);
            if (card != null)
            {
                card.delStarSoulBoreByIndex(hole);
            }
            StorageManagerment.Instance.starSoulStorageVersion++;
            if (callback != null)
            {
                callback();
                callback = null;
            }
        }
        else
        {
            UiManager.Instance.openDialogWindow <MessageWindow> ((win) => {
                win.initWindow(1, LanguageConfigManager.Instance.getLanguage("s0093"), null, erlType.getValueString(), null);
            });
        }
    }
예제 #13
0
    public override void read(ErlKVMessage message)
    {
        ErlType type = message.getValue("msg") as ErlType;

        /** 名称非法 */
        if (type.getValueString() == "name_error")
        {
            UiManager.Instance.createMessageLintWindow(LanguageConfigManager.Instance.getLanguage("Guild_1119"));
        }
        /** 长度超标 */
        else if (type.getValueString() == "name_length_err")
        {
            UiManager.Instance.createMessageLintWindow(LanguageConfigManager.Instance.getLanguage("Guild_87"));
        }
        /** 名称重复 */
        else if (type.getValueString() == "name_repeat")
        {
            UiManager.Instance.createMessageLintWindow(LanguageConfigManager.Instance.getLanguage("Guild_1118"));
        }
        /** 改名成功 */
        else if (type.getValueString() == "ok")
        {
            UiManager.Instance.createMessageLintWindow(LanguageConfigManager.Instance.getLanguage("Guild_1117"));
            if (callBack != null)
            {
                callBack(name);
            }
        }
    }
예제 #14
0
    public override void read(ErlKVMessage message)
    {
        ErlType type = message.getValue("msg") as ErlType;

        if (type.getValueString() == "ok")
        {
            GuildManagerment.Instance.updateJobByUid(uid, GuildJobType.JOB_VICE_PRESIDENT);
            if (callback != null)
            {
                callback();
            }
        }
        else if (type.getValueString() == "vice")
        {
            UiManager.Instance.openDialogWindow <MessageWindow>((win) => {
                win.initWindow(1, LanguageConfigManager.Instance.getLanguage("s0093"), null, LanguageConfigManager.Instance.getLanguage("Guild_42"), null);
            });
        }

        else if (type.getValueString() == "non_mem")
        {
            UiManager.Instance.openDialogWindow <MessageWindow>((win) => {
                win.initWindow(1, LanguageConfigManager.Instance.getLanguage("s0093"), null, LanguageConfigManager.Instance.getLanguage("Guild_90"), null);
            });
            return;
        }
    }
예제 #15
0
    //解析ErlKVMessgae
    public bool parseMsg(ErlKVMessage message)
    {
        ErlArray arr1;
        ErlType  type = message.getValue("msg") as ErlType;

        if (type is ErlArray)
        {
            ErlArray stateArray = type as ErlArray;
            string   state      = stateArray.Value[0].getValueString();
            if (state == "ok")
            {
                TotalLoginManagerment.Instance.WeeklyState = true;
                TotalLoginManagerment.Instance.updateWeeklyAwarrdData(stateArray.Value[1] as ErlArray);
                return(true);
            }
            else if (state == "close")
            {
                TotalLoginManagerment.Instance.WeeklyState = false;
                return(true);
            }
            return(false);
        }
        else
        {
            MessageWindow.ShowAlert(type.getValueString());
            if (callback != null)
            {
                callback = null;
            }
        }
        return(false);
    }
예제 #16
0
    public override void read(ErlKVMessage message)
    {
        string str = (message.getValue("msg") as ErlAtom).Value;

        if (str == GOTO)
        {
            ErlType t   = message.getValue("info") as ErlType;
            int     sid = 0;

            if (!(t  is ErlArray) && t.getValueString() == "none")
            {
                //空的休息点,没有pvp
                sid = NONE;
            }
            if (MissionManager.instance != null)
            {
                callback(sid);
            }
        }
        else if (str == NOT_GOTO)
        {
            if (MissionManager.instance != null)
            {
                callback(NOT_GO);
            }
        }
    }
예제 #17
0
    public override void read(ErlKVMessage message)
    {
        base.read(message);
        ErlType type = message.getValue("msg") as ErlType;

        if (type is ErlInt)
        {
            ErlInt erl = type as ErlInt;
            //int index = 0;
            int checkdPoint = StringKit.toInt(erl.getValueString());
            if (callbacks != null)
            {
                callbacks(checkdPoint);
            }
            else
            {
                MaskWindow.UnlockUI();
            }
        }
        else
        {
            MessageWindow.ShowAlert((message.getValue("msg") as ErlType).getValueString());
            MaskWindow.UnlockUI();
            if (callbacks != null)
            {
                callbacks = null;
            }
        }
    }
예제 #18
0
    //解析ErlKVMessgae
    public bool parseKVMsg(ErlKVMessage message)
    {
        ErlType msg = message.getValue("msg") as ErlType;

        readGetInfo(msg);
        return(true);
    }
예제 #19
0
 void FubenGotoNext()
 {
     log("往下走");
     pointIndex++;
     MiniFport.access(cm, FrontPort.FUBEN_GET_CURRENT, (msg11) => {
         int curSid = StringKit.toInt((msg11.getValue("sid") as ErlType).getValueString());
         if (curSid == 0)
         {
             fuben();
         }
         else
         {
             MiniFport.access(cm, FrontPort.FUBEN_GOTO, (msg22) => {
                 ErlType rt = msg22.getValue("msg") as ErlType;
                 string str = rt != null ? rt.getValueString() : "";
                 if (str == "no_fb")
                 {
                     fuben(missionSid);
                 }
                 else if (str == "not_goto" || str == "goto_point")
                 {
                     //FubenGetEventInfo();
                     StartCoroutine(Utils.DelayRun(FubenGetEventInfo, Random.Range(5, 8)));
                 }
                 else
                 {
                     fuben(missionSid - 1 > 41001?missionSid - 1:41001);
                     Debug.LogError("走点返回异常:" + msg22.toJsonString());
                 }
             });
         }
     });
 }
예제 #20
0
    void getCurrentFuben(ErlKVMessage msg)
    {
        ErlType type = msg.getValue("sid") as ErlType;
        int     sid  = StringKit.toInt(type.getValueString());

        if (sid > 0)
        {
            //放弃副本
            MiniFport.access(cm, FrontPort.FUBEN_ABANDON, (msg2) => {
                log("进入副本");
                //进入副本
                MiniFuBenIntoFPort f = new MiniFuBenIntoFPort();
                f.cm = cm;
                f.intoFuben(missionSid = sid, 1, IntoFubenBack);
            });
        }
        else
        {
            log("进入副本");
            //进入副本
            MiniFuBenIntoFPort f = new MiniFuBenIntoFPort();
            f.cm = cm;
            f.intoFuben(missionSid++, 1, IntoFubenBack);
        }
    }
예제 #21
0
    //解析ErlKVMessgae
    public override void read(ErlKVMessage message)
    {
        ErlType type = message.getValue("msg") as ErlType;
        string  msg  = type.getValueString();

        if (msg == "ok")
        {
            TotalLoginManagerment.Instance.addReceivedAwardHoliday(sid);
            if (callback != null)
            {
                callback(1);
                callback = null;
            }
        }
        else if (msg == "aready_award")
        {
            if (callback != null)
            {
                callback(2);
                callback = null;
            }
        }
        else
        {
            if (callback != null)
            {
                callback(3);
                callback = null;
            }
        }
    }
예제 #22
0
    public override void read(ErlKVMessage message)
    {
        ErlType erl = message.getValue("msg") as ErlType;

        if (erl is ErlArray)
        {
            GodsWarFinalUserInfo        user;
            List <GodsWarFinalUserInfo> infos = new List <GodsWarFinalUserInfo>();
            ErlArray erlarry = erl as ErlArray;
            for (int i = 0; i < erlarry.Value.Length; i++)
            {
                user = new GodsWarFinalUserInfo();
                user.bytesRead(erlarry.Value[i] as ErlArray);
                infos.Add(user);
            }
            if (infos != null)
            {
                GodsWarManagerment.Instance.finalInfoList = infos;
            }
            if (callback != null)
            {
                callback();
            }
        }
        else
        {
            MessageWindow.ShowAlert(erl.getValueString());
            if (callback != null)
            {
                callback = null;
            }
        }
    }
예제 #23
0
    //解析ErlKVMessgae
    public bool parseKVMsg(ErlKVMessage message)
    {
        string str    = (message.getValue("msg") as ErlType).getValueString();
        bool   hasPvp = false;

        if (str == "ok")
        {
            hasPvp = true;
            ErlType type = message.getValue("info") as ErlType;
            if (type is ErlArray)
            {
                ErlArray array = type as ErlArray;
                //pvp信息过期时间戳
                int               time    = StringKit.toInt(array.Value [0].getValueString());
                string            rule    = array.Value [1].getValueString();
                int               round   = StringKit.toInt(array.Value [2].getValueString());
                ErlArray          arrays  = array.Value [3] as ErlArray;
                int               max     = arrays.Value.Length;
                List <PvpOppInfo> oppList = new List <PvpOppInfo> ();
                for (int i = 0; i < max; i++)
                {
                    ErlArray list = arrays.Value [i] as ErlArray;
                    oppList.Add(PvpOppInfo.pares(list));
                }
                PvpInfoManagerment.Instance.createPvpInfo(time, rule, round, oppList.ToArray());
            }
        }
        else if (str == "no_pvp")
        {
            PvpInfoManagerment.Instance.clearDate();
        }
        return(hasPvp);
    }
예제 #24
0
    public override void read(ErlKVMessage message)
    {
        ErlType type = message.getValue("msg") as ErlType;

        if (type.getValueString() == "non_mem")
        {
            UiManager.Instance.openDialogWindow <MessageWindow>((win) => {
                win.initWindow(1, LanguageConfigManager.Instance.getLanguage("s0093"), null, LanguageConfigManager.Instance.getLanguage("Guild_90"), GuildManagerment.Instance.closeAllGuildWindow);
            });
        }
        else if (type.getValueString() == "ok")
        {
            GuildManagerment.Instance.removeGuildInviteByUid(uid);
            if (callback != null)
            {
                callback();
            }
        }
        else if (type.getValueString() == "maxmem")
        {
            UiManager.Instance.openDialogWindow <MessageWindow>((win) => {
                win.initWindow(1, LanguageConfigManager.Instance.getLanguage("s0093"), null, LanguageConfigManager.Instance.getLanguage("Guild_18"), null);
            });
        }
        else if (type.getValueString() == "none")
        {
            UiManager.Instance.openDialogWindow <MessageWindow>((win) => {
                win.initWindow(1, LanguageConfigManager.Instance.getLanguage("s0093"), null, LanguageConfigManager.Instance.getLanguage("Guild_84"), null);
            });
        }
    }
예제 #25
0
    public override void read(ErlKVMessage message)
    {
        ErlType msgInfo = message.getValue("msg") as ErlType;

        if (msgInfo is ErlArray)       // 买过//
        {
            ErlArray infoArr = msgInfo as ErlArray;
            WeekCardInfo.Instance.endTime = StringKit.toInt(infoArr.Value[0].getValueString());
            if (ServerTimeKit.getSecondTime() > WeekCardInfo.Instance.endTime)           // 已过期//
            {
                WeekCardInfo.Instance.weekCardState = WeekCardState.over;
            }
            else
            {
                WeekCardInfo.Instance.weekCardState = WeekCardState.open;
            }
            WeekCardInfo.Instance.recevieState = StringKit.toInt(infoArr.Value[1].getValueString());
        }
        else        // 没有买过//
        {
            WeekCardInfo.Instance.weekCardState = WeekCardState.not_open;
        }

        if (callBack != null)
        {
            callBack();
        }
    }
예제 #26
0
    //目前只有修炼副本用到这个
    public void parseFightLose(ErlType e2, ErlType e3)
    {
        bool isExit = false;

        if (e2 != null)
        {
            string key2 = e2.getValueString();
            if (key2 == EXIT)
            {
                isExit = true;
            }
        }
        //更新最高记录
        if (e3 != null)
        {
            int currentPracticePoint      = StringKit.toInt(e3.getValueString());
            int historyPracticeHightPoint = UserManager.Instance.self.practiceHightPoint;
            if (currentPracticePoint > UserManager.Instance.self.practiceHightPoint)
            {
                UserManager.Instance.self.practiceHightPoint = currentPracticePoint;
            }
            MissionInfoManager.Instance.mission.updatePracticeRecode(currentPracticePoint, historyPracticeHightPoint);
        }

        if (MissionInfoManager.Instance != null && MissionInfoManager.Instance.mission != null)
        {
            MissionInfoManager.Instance.mission.fightLoss(isExit);
        }
    }
예제 #27
0
    public override void read(ErlKVMessage message)
    {
        ErlType str = message.getValue("msg") as ErlType;

        if (str.getValueString() == "ok")
        {
            if (callback != null)
            {
                callback();
            }
        }
        else
        {
            if (str.getValueString() == "over_time")
            {
                PvpInfoManagerment.Instance.clearDate();
            }
            else if (str.getValueString() == "pvp_error")
            {
                MessageWindow.ShowAlert(LanguageConfigManager.Instance.getLanguage("pvpuse00"));
            }
            else
            {
                MessageWindow.ShowAlert(str.getValueString());
            }
            if (callback != null)
            {
                callback = null;
            }
        }
    }
예제 #28
0
    public override void read(ErlKVMessage message)
    {
        ErlType str = message.getValue("msg") as ErlType;

        if (str is ErlArray)
        {
            ErlArray arr = str as ErlArray;
            List <GodsWarMySuportInfo> list = new List <GodsWarMySuportInfo>();
            if (arr.Value.Length != 0)
            {
                for (int i = 0; i < arr.Value.Length; i++)
                {
                    ErlArray            tmp  = arr.Value[i] as ErlArray;
                    GodsWarMySuportInfo user = new GodsWarMySuportInfo();
                    user.bytesRead(tmp);
                    list.Add(user);
                }
            }
            if (list.Count > 0)
            {
                GodsWarManagerment.Instance.mySuportInfo = list;
            }
        }
        if (callback != null)
        {
            callback();
            MaskWindow.UnlockUI();
        }
    }
예제 #29
0
    /// <summary>
    /// 回调读取通讯
    /// </summary>
    /// <param name="message">Message.</param>
    public override void read(ErlKVMessage message)
    {
        int     index   = 0;
        ErlType erlType = message.getValue("msg") as ErlType;

        if (erlType is ErlArray)
        {
            ErlArray arr      = erlType as ErlArray;
            int      huntType = StringKit.toInt(arr.Value [index++].getValueString());
            if (huntType == StarSoulConfigManager.HUNT_MONEY_TYPE)             // 普通裂魂
            {
                huntStarSoul(index, arr);
            }
            else if (huntType == StarSoulConfigManager.HUNT_RMB_TYPE)             // 钻石裂魂
            {
                HuntStarSoulByRmb(index, arr);
            }
        }
        else
        {
            UiManager.Instance.openDialogWindow <MessageWindow> ((win) => {
                win.initWindow(1, LanguageConfigManager.Instance.getLanguage("s0093"), null, erlType.getValueString(), null);
            });
        }
    }
예제 #30
0
    public override void read(ErlKVMessage message)
    {
        ErlType msg = message.getValue("msg") as ErlType;

        if (msg != null && msg.getValueString() == "ok")
        {
            GuildManagerment.Instance.getGuild().autoJoin = isOpen;
            if (isOpen == 1)
            {
                UiManager.Instance.createMessageLintWindow(LanguageConfigManager.Instance.getLanguage("guide_autoJoin2"));
                return;
            }
            UiManager.Instance.createMessageLintWindow(LanguageConfigManager.Instance.getLanguage("guide_autoJoin3"));
            return;
        }
        else if (msg != null && msg.getValueString() == "limit")
        {
            UiManager.Instance.createMessageLintWindow(LanguageConfigManager.Instance.getLanguage("guide_autoJoin4"));
            return;
        }
        else
        {
            UiManager.Instance.createMessageLintWindow(LanguageConfigManager.Instance.getLanguage("guide_autoJoin5"));
            return;
        }
    }
예제 #31
0
 public ErlArray(ErlType[] array)
 {
     if (array != null)
     {
         this._value = array;
     }
 }
예제 #32
0
 public override void bytesRead(ByteBuffer data)
 {
     base.bytesRead(data);
     if (this.isTag(base._tag))
     {
         int num = data.readInt();
         this._value = new ByteBuffer();
         this._value.writeBytes(data, 0, (uint) num);
         this._value.position = 0;
         data.position += num;
     }
     ByteBuffer buffer2 = new ByteBuffer(ZIPUtil.Decompress(this._value.toArray()));
     buffer2.readByte();
     this._erlValue = ByteKit.complexAnalyse(buffer2);
 }
예제 #33
0
 public int Int(ErlType data)
 {
     return StringKit.toInt(data.getValueString());
 }
예제 #34
0
 private static ErlType[] getErlArr(List<object> jsonList)
 {
     ErlType[] typeArray = new ErlType[jsonList.Count];
     for (int i = 0; i < jsonList.Count; i++)
     {
         List<object> list = jsonList[i] as List<object>;
         ErlType type = null;
         if ((list[0] as string) == typeof(ErlInt).Name)
         {
             type = new ErlInt(StringKit.toInt(list[1].ToString()));
         }
         else if ((list[0] as string) == typeof(ErlString).Name)
         {
             type = new ErlString(list[1].ToString());
         }
         else if ((list[0] as string) == typeof(ErlByte).Name)
         {
             type = new ErlByte(byte.Parse(list[1].ToString()));
         }
         else if ((list[0] as string) == typeof(ErlAtom).Name)
         {
             type = new ErlAtom(list[1].ToString());
         }
         else if ((list[0] as string) == typeof(ErlNullList).Name)
         {
             type = new ErlNullList();
         }
         else if ((list[0] as string) == typeof(ErlArray).Name)
         {
             type = new ErlArray(getErlArr(list[1] as List<object>));
         }
         typeArray[i] = type;
     }
     return typeArray;
 }
예제 #35
0
 public static ErlType[] toErlTypeArray(string strValue , string strType, char c)
 {
     if (string.IsNullOrEmpty(strValue))
     {
         return null;
     }
     char[] separator = new char[] { c };
     string[] strArray = strValue.Split(separator);
     string[] strTypeArray = strType.Split(separator);
     ErlType[] erlTypeArray = new ErlType[strArray.Length];
     for (int i = 0; i < strArray.Length; i++)
     {
         erlTypeArray[i] = toErlType(strArray[i],strTypeArray[i]);
     }
     return erlTypeArray;
 }
예제 #36
0
 public string checkSample(ErlType[] array)
 {
     string str = null;
     if ((((this._value.Length != 3) || !(this._value[0] is ErlAtom)) || !((this._value[0] as ErlAtom).Value == "sid")) || (!(this._value[1] is ErlByte) && !(this._value[1] is ErlInt)))
     {
         return str;
     }
     if ((!(this._value[2] is ErlNullList) && !(this._value[2] is ErlList)) && !(this._value[2] is ErlString))
     {
         return str;
     }
     int num = 0;
     if (this._value[1] is ErlByte)
     {
         num = (this._value[1] as ErlByte).Value;
     }
     else
     {
         num = (this._value[1] as ErlInt).Value;
     }
     if (this._value[2] is ErlNullList)
     {
         object[] objArray1 = new object[] { "[sid,", num, ",", (this._value[2] as ErlNullList).getValueString(), "]" };
         return string.Concat(objArray1);
     }
     if (this._value[2] is ErlList)
     {
         object[] objArray2 = new object[] { "[sid,", num, ",", (this._value[2] as ErlList).getListString(), "]" };
         return string.Concat(objArray2);
     }
     object[] objArray3 = new object[] { "[sid,", num, ",", (this._value[2] as ErlString).getASCII(true), "]" };
     return string.Concat(objArray3);
 }
예제 #37
0
    public static ErlType[] listToErlTypeArray(List<Object> list )
    {
        ErlType[] et= new ErlType[list.Count ];
        bool isList = false;
        if (list.Count > 0) {
            if (list [0].ToString () == "(erllist)") {
                et = new ErlType[list.Count - 1];
                isList = true;
                list.RemoveAt (0);
            }
        }// = new ErlType[list.Count];

        //string[] strTypeArray = strType.Split(',');
        int k = 0;
        for (int i = 0; i < list.Count; i++) {
            if (list [i].GetType ().Name.Contains ("List")) {
                List<Object> tmpList = list [i] as List<Object>;
                if (tmpList.Count > 0) {
                    if (tmpList [0].ToString () == "(erlist)") {
                        tmpList.RemoveAt (0);
                        et [i] = new ErlList (listToErlTypeArray (tmpList));
                    } else {
                        if (isList) {
                            et [i] = new ErlList (listToErlTypeArray (tmpList));
                        } else {
                            et [i] = new ErlArray (
                                listToErlTypeArray (tmpList));
                        }
                    }
                } else {
                    et [i] = new ErlArray (new ErlType[0]);
                }
            } else {
                string tmpstr = list [i].ToString ();
                string tmpType = "string";
                if (tmpstr == "(erllist)") {
                    isList = true;
                } else {

                    if (list [i].GetType ().Name.ToLower ().Contains ("int")) {
                        int count = StringKit.toInt (list [i].ToString ());

                        if (count < 255) {
                            tmpType = "byte";
                        } else {
                            tmpType = "int";
                        }
                    } else if (tmpstr.ToLower ().Contains ("(erlatom)")) {
                        tmpstr = tmpstr.Substring (0, tmpstr.Length - 9);
                        tmpType = "atom";
                    } else
                    if (tmpstr.ToLower ().Contains ("(clist)")) {
                            tmpstr = tmpstr.Substring (0, tmpstr.Length - 7);
                            tmpType = "clist";
                    }
                        et [i] = toErlType (tmpstr, tmpType);

                }
                k ++;
            }

        }
        return et;
    }
예제 #38
0
 public void simpleBytesRead(ByteBuffer data)
 {
     base.bytesRead(data);
     if (this.isTag(base._tag))
     {
         data.position -= 3;
         int num = data.readUnsignedShort();
         data.readByte();
         this._value = new ByteBuffer();
         this._value.writeBytes(data, 0, (uint) (num - 1));
         this._value.position = 0;
         data.position += num - 1;
     }
     ByteBuffer buffer2 = new ByteBuffer(ZIPUtil.Decompress(this._value.toArray()));
     buffer2.readByte();
     this._erlValue = ByteKit.complexAnalyse(buffer2);
 }