public override void read(ErlKVMessage message) { int multiple = StringKit.toInt((message.getValue("msg") as ErlType).getValueString()); //倍数 int timeId = StringKit.toInt((message.getValue("time") as ErlType).getValueString()); //倍数 FuBenManagerment.Instance.setStarMultiple(timeId, multiple); }
public override void read(ErlKVMessage message) { ErlType uid = message.getValue("main_uid") as ErlType; ErlType msg = message.getValue("msg") as ErlType; if (uid != null) { callback(uid.getValueString()); } else { MessageWindow.ShowAlert(msg.getValueString()); if (callback != null) { callback = null; } } // if (message.getValue ("main_uid") == null) { // MonoBase.print (" addon error!!"); // } // else // { // string uid = (message.getValue ("main_uid") as ErlType).getValueString (); // callback (uid); // } }
public override void read(ErlKVMessage message) { string str = (message.getValue("msg") as ErlAtom).Value; if (str == FPortGlobal.INTENSIFY_SUCCESS) { string uid = (message.getValue("main_uid") as ErlType).getValueString(); //刷新卡片仓库 // SerializeStorageFPort serialize = FPortManager.Instance.getFPort("SerializeStorageFPort") as SerializeStorageFPort; // serialize.access("card_storage",callback,uid); if (callback != null) { callback(uid); callback = null; } } else if (str == FPortGlobal.INTENSIFY_CARD_NONENTITY) //卡片不存在 { } else if (str == FPortGlobal.INTENSIFY_MAINCARD_ERROR) //不能吃主卡 { } else if (str == FPortGlobal.INTENSIFY_OUTCASH) //缺钱 { } }
//解析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); }
public override void read(ErlKVMessage message) { ErlArray arr = message.getValue("msg") as ErlArray; if (arr != null) { ErlArray arr2 = arr.Value[0] as ErlArray; // 增加之后的运势 int num = StringKit.toInt(arr2.Value[0].getValueString()); // 非分享增加的运势 int num1 = StringKit.toInt(arr2.Value[1].getValueString()); // 分享增加的运势 int shareAward = StringKit.toInt(arr2.Value[2].getValueString()); // 基础奖励(不管任何情况都奖励) int awardSid = StringKit.toInt(arr.Value[1].getValueString()); callback(num1, awardSid, shareAward); } else if ((message.getValue("msg") as ErlType).getValueString() == "limit") { UiManager.Instance.getWindow <DivineWindow>().finishWindow(); } else { MessageWindow.ShowAlert((message.getValue("msg") as ErlType).getValueString()); if (callback != null) { callback = null; } } }
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) { 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; } } }
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); } } }
//解析ErlKVMessgae public void parseKVMsg(ErlKVMessage message) { ErlArray exchangeArray = message.getValue("exchange") as ErlArray; ErlArray afficheArray = message.getValue("affiche") as ErlArray; int sid, start, end; ErlArray values; for (int i = 0; i < exchangeArray.Value.Length; i++) { values = exchangeArray.Value [i] as ErlArray; if (values.Value.Length == 3) //未生效,开始结束时间 { sid = StringKit.toInt((values.Value [0] as ErlType).getValueString()); start = StringKit.toInt((values.Value [1] as ErlType).getValueString()); end = StringKit.toInt((values.Value [2] as ErlType).getValueString()); NoticeManagerment.Instance.addExchangeTime(sid, new int[] { start, end }); } } for (int i = 0; i < afficheArray.Value.Length; i++) { values = afficheArray.Value [i] as ErlArray; if (values.Value.Length == 3) //未生效,开始结束时间 { sid = StringKit.toInt((values.Value [0] as ErlType).getValueString()); start = StringKit.toInt((values.Value [1] as ErlType).getValueString()); end = StringKit.toInt((values.Value [2] as ErlType).getValueString()); NoticeManagerment.Instance.addRechargeTime(sid, new int[] { start, end }); } } }
public override void read(ErlKVMessage message) { ErlType msg = message.getValue("msg") as ErlType; if (msg != null && msg.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 = message.getValue("msg") as ErlArray; if (array != null) { StorageManagerment.Instance.parseAddStorageProps(array); if (callback != null) { callback(sid, num); } } else { UiManager.Instance.createMessageLintWindow(LanguageConfigManager.Instance.getLanguage("s0207")); } callback = null; }
public override void read(ErlKVMessage message) { if (message.getValue("add_mail") != null) { ErlType mailType = message.getValue("add_mail") as ErlType; ErlList conList = mailType as ErlList; int index = 0; string uid = "0"; int src = 0; int type = 0; int stime = 0; int etime = 0; string theme; string content; Annex[] annex = null; int state = 0; uid = ((conList.Value [index] as ErlArray).Value [1]).getValueString(); src = StringKit.toInt(((conList.Value [++index] as ErlArray).Value [1]).getValueString()); type = StringKit.toInt(((conList.Value [++index] as ErlArray).Value [1]).getValueString()); stime = StringKit.toInt(((conList.Value [++index] as ErlArray).Value [1]).getValueString()); etime = StringKit.toInt(((conList.Value [++index] as ErlArray).Value [1]).getValueString()); theme = ((conList.Value [++index] as ErlArray).Value [1]).getValueString(); content = ((conList.Value [++index] as ErlArray).Value [1]).getValueString(); ErlList listc = (conList.Value [++index] as ErlArray).Value [1] as ErlList; annex = MailManagerment.Instance.parseAnnex(listc); state = StringKit.toInt(((conList.Value [++index] as ErlArray).Value [1]).getValueString()); MailManagerment.Instance.createMail(uid, src, type, stime, etime, theme, content, annex, state); GameObject mainWin = GameObject.Find("MainWindow"); GameObject win = GameObject.Find("MailWindow"); if (mainWin != null) { // UiManager.Instance.createMessageLintWindow(LanguageConfigManager.Instance.getLanguage("newMail01")); (mainWin.GetComponent <MainWindow> ()).showMailNum(); } else if (win != null) { (win.GetComponent <MailWindow> ()).Initialize(0); (win.GetComponent <MailWindow> ()).mailContent.reLoad(MailManagerment.Instance.getSortAllMail()); (win.GetComponent <MailWindow> ()).changeButton(true); } } if (message.getValue("del_mail") != null) { ErlType erlType = message.getValue("del_mail") as ErlType; ErlList array = erlType as ErlList; for (int i = 0; i < array.Value.Length; i++) { MailManagerment.Instance.addNeedDelUids((array.Value [i] as ErlString).getValueString()); } MailManagerment.Instance.runDeleteUids(); GameObject mainWin = GameObject.Find("MainWindow"); if (mainWin != null) { (mainWin.GetComponent <MainWindow> ()).showMailNum(); } } }
/** 读取数据 */ public override void read(ErlKVMessage message) { ErlType erlType = message.getValue("base") as ErlType; int integral = 0; int rank = -1; if (erlType is ErlArray) { ErlArray arr = erlType as ErlArray; int index = 0; // 活动积分 integral = StringKit.toInt(arr.Value[index++].getValueString()); // 活动排名 rank = StringKit.toInt(arr.Value[index++].getValueString()); } RadioManager.Instance.clearByType(RadioManager.RADIO_LUCKY_CARD_TYPE); ErlType radioErlType = message.getValue("radio") as ErlType; if (radioErlType is ErlArray) { ErlArray arr = radioErlType as ErlArray; if (arr.Value.Length > 0) { for (int m = 0, count = arr.Value.Length; m < count; m++) { ErlArray radioArray = arr.Value[m] as ErlArray; string name = radioArray.Value[0].getValueString(); int vipLevel = StringKit.toInt(radioArray.Value[1].getValueString()); string cardType = radioArray.Value[2].getValueString(); int cardSid = StringKit.toInt(radioArray.Value[3].getValueString()); addMessageRadio(name, vipLevel, cardType, cardSid); } } } RankManagerment.Instance.luckyCardList.Clear(); ErlType rankErlType = message.getValue("rank") as ErlType; if (rankErlType is ErlArray) { ErlArray arr = rankErlType as ErlArray; if (arr.Value.Length > 0) { RankItemLuckyCard rankLuckCard; for (int m = 0, count = arr.Value.Length; m < count; m++) { rankLuckCard = new RankItemLuckyCard(); rankLuckCard.bytesReadLuo(m, 1, arr.Value[m] as ErlArray); addLuckyCardRanking(rankLuckCard); } } } if (callback != null) { callback(integral, rank); } }
public override void read(ErlKVMessage message) { string str = (message.getValue("msg") as ErlAtom).Value; if (str == "ok") { ShopManagerment.Instance.updateShop(message.getValue("info") as ErlArray); callback(); } }
public override void read(ErlKVMessage message) { base.read(message); if ((message.getValue("msg") as ErlType) != null && (message.getValue("msg") as ErlType).getValueString() == "error") { UiManager.Instance.createMessageLintWindow(LanguageConfigManager.Instance.getLanguage("GuildArea_54")); UiManager.Instance.BackToWindow <GuildMainWindow>(); callBack = null; return; } ErlType type = message.getValue("msg") as ErlType; if (type.getValueString() == "cd_limit") { if (callBack != null) { callBack(null); callBack = null; } } else { if (type is ErlArray) { ErlArray array = type as ErlArray; GuildArea area = new GuildArea(); area.pointList = new List <GuildAreaPoint> (); int offset = 0; area.wishNum = StringKit.toInt(array.Value [offset++].getValueString()); area.inspireNum = StringKit.toInt(array.Value [offset++].getValueString()); ErlArray tempArray = array.Value [offset++] as ErlArray; for (int i = 0; i < tempArray.Value.Length; i++) { ErlArray temp = tempArray.Value [i] as ErlArray; int index = 0; string name = temp.Value [index++].getValueString(); int vipLevel = StringKit.toInt(temp.Value [index++].getValueString()); int headIconId = StringKit.toInt(temp.Value [index++].getValueString()); bool isNpc = temp.Value [index++].getValueString().Equals("1"); int bloodNow = StringKit.toInt(temp.Value [index++].getValueString()); int bloodMax = StringKit.toInt(temp.Value [index++].getValueString()); GuildAreaPoint point = new GuildAreaPoint(name, headIconId, bloodMax, bloodNow, vipLevel, isNpc); if (bloodNow == 0) { area.hasKilled++; } area.pointList.Add(point); } if (callBack != null) { callBack(area); } } } }
public override void read(ErlKVMessage message) { string str = (message.getValue("msg") as ErlAtom).Value; if (str == FPortGlobal.INTENSIFY_SUCCESS) { ErlArray ea = message.getValue("uid") as ErlArray; string cuid = ea.Value [0].getValueString(); string euid = ea.Value [1].getValueString(); string lasteuid = ea.Value [2].getValueString(); Card card = StorageManagerment.Instance.getRole(cuid); List <AttrChange> attrs = card.operateEquip(euid, lasteuid); if (euid != "0") { callback(attrs, CardBookWindow.RELOADEQUIP); } else { callback(attrs, CardBookWindow.UNDRESS); } } else { MessageWindow.ShowAlert(str); if (callback != null) { callback = null; } } // else if(str == FPortGlobal.EQUIP_NOHAVE)//脱装备时,装备不存在 // { // // } // else if (str == FPortGlobal.EQUIP_NOEXIST)//装备不存在 // { // // } // else if(str == FPortGlobal.INTENSIFY_CARD_NONENTITY)//卡片不存在 // { // // } // else if(str == FPortGlobal.EQUIP_BEUSED)//装备已使用 // { // // } // else if (str == FPortGlobal.CARD_SID_NOEQUAL)//卡片sid不相等 // { // // } // else if(str == FPortGlobal.PART_NOT_SUIT)//部位不一致 // { // // } }
public override void read(ErlKVMessage message) { ErlType msg = message.getValue("msg") as ErlType; if (msg.getValueString() == "ok") { ErlType value = message.getValue("value") as ErlType; UserManager.Instance.self.updateHonor(StringKit.toInt(value.getValueString())); callback(); } }
public override void read(ErlKVMessage message) { ErlType type = message.getValue("msg") as ErlType; ShenGeManager.Instance.sidList = new List <ShenGeCaoInfo>(); if (type == null) { if (callback != null) { callback(); callback = null; } else { MaskWindow.UnlockUI(); } return; } if (type is ErlArray) { ErlArray erlArray = message.getValue("msg") as ErlArray; if (erlArray.Value.Length == 0) { if (callback != null) { callback(); callback = null; } else { MaskWindow.UnlockUI(); } return; } for (int i = 0; i < erlArray.Value.Length; i++) { ErlArray array = erlArray.Value[i] as ErlArray; ShenGeCaoInfo info = new ShenGeCaoInfo(); info.index = StringKit.toInt(array.Value[0].getValueString()); info.sid = StringKit.toInt(array.Value[1].getValueString()); ShenGeManager.Instance.sidList.Add(info); } } if (callback != null) { callback(); callback = null; } else { MaskWindow.UnlockUI(); } }
public override void read(ErlKVMessage message) { base.read(message); string str = (message.getValue("type") as ErlAtom).Value; // Debug.LogError ("------------------->>>>>>" + str); ErlType msg = message.getValue("value") as ErlType; ErlArray array = msg as ErlArray; GameObject win = GameObject.Find("/NGUI_manager/GameCamera/UIScaleRoot/FriendsShareWindow"); GameObject mainShareWin = GameObject.Find("/NGUI_manager/GameCamera/UIScaleRoot/IncreaseWayWindow"); switch (str) { //我的待分享列表 case "share_list": if (FriendsShareManagerment.Instance == null) { return; } FriendsShareManagerment.Instance.addShareInfoByErlArray(array); if (win != null) { (win.GetComponent <FriendsShareWindow> ()).initWin(true, 0); (win.GetComponent <FriendsShareWindow> ()).changeShareButton(true); } if (mainShareWin != null) { (mainShareWin.GetComponent <IncreaseWayWindow> ()).showShare(); } break; //好友可点赞分享列表 case "shared_list": if (FriendsShareManagerment.Instance == null) { return; } FriendsShareManagerment.Instance.addPraiseInfoByErlArray(array); if (win != null) { (win.GetComponent <FriendsShareWindow> ()).initWin(true, 1); (win.GetComponent <FriendsShareWindow> ()).changePraiseButton(true); } if (mainShareWin != null) { (mainShareWin.GetComponent <IncreaseWayWindow> ()).showShare(); } break; } }
public override void read(ErlKVMessage message) { object msg = message.getValue("msg"); if (msg == null) { callback(-1); return; } string str = (message.getValue("msg") as ErlAtom).Value; if (str == INTO) { callback(intoSid); intoSid = 0; } else if (str == CONTINUE) { // "currentfb":[0,0,[],"none"] //p_sid step 宝箱信息 布阵信息 ErlArray arr = message.getValue(KEY) as ErlArray; int p_index = StringKit.toInt(arr.Value [0].getValueString()); //继续副本 点 索引 0表示起点 int step = StringKit.toInt(arr.Value [1].getValueString()); //点上事件索引 0表示此点上无事件或者事件都完成 /** * MissionInfoManager.Instance.mission.updateMission (p_index, step); * ErlArray treasures = arr.Value [2] as ErlArray; * int embattle = StringKit.toInt (arr.Value [3].getValueString ()); * ArmyManager.Instance.setActive (embattle); * MissionInfoManager.Instance.mission.initTreasures (StringKit.toInt (treasures.Value [0].getValueString ()), * StringKit.toInt (treasures.Value [1].getValueString ())); */ if (callback2 != null) { callback2(p_index, step); } } else if (str == ALREADY) { callback(-2); } else if (str == LIMIT) { callback(-1); } else { MonoBase.print("into fuben error!"); } }
/// <summary> /// 回调读取通讯 /// </summary> /// <param name="message">Message.</param> public override void read(ErlKVMessage message) { string msgInfo = (message.getValue("msg") as ErlType).getValueString(); if (msgInfo == "info") { ErlType erlType = message.getValue("value") as ErlType; if (erlType is ErlArray) { StarSoulManager manager = StarSoulManager.Instance; ErlArray arr = erlType as ErlArray; StarSoulInfo starSoulInfo = manager.createStarSoulInfo(arr); manager.setStarSoulInfo(starSoulInfo); } else { UiManager.Instance.openDialogWindow <MessageWindow> ((win) => { win.initWindow(1, LanguageConfigManager.Instance.getLanguage("s0093"), null, erlType.getValueString(), null); }); } if (callback != null) { callback(); callback = null; } } else if (msgInfo == "lock") { ErlType erlType = message.getValue("value") as ErlType; if (erlType.getValueString() == "ok") { StarSoulManager manager = StarSoulManager.Instance; manager.updateStarSoulLockState(); StarSoulManager.Instance.cleanDic(); StorageManagerment.Instance.starSoulStorageVersion++; } else { UiManager.Instance.openDialogWindow <MessageWindow> ((win) => { win.initWindow(1, LanguageConfigManager.Instance.getLanguage("s0093"), null, erlType.getValueString(), null); }); } if (callback != null) { callback(); callback = null; } } }
public override void read(ErlKVMessage message) { // MonoBase.print (GetType () + "=================read"); ErlArray tools = message.getValue(KEY_TOOL) as ErlArray; if (tools != null) { StorageManagerment.Instance.updateStorageInfo(StorageFPort.GOODS, tools); } ErlArray cards = message.getValue(KEY_CARD) as ErlArray; if (cards != null) { StorageManagerment.Instance.updateStorageInfo(StorageFPort.CARD, cards); } ErlArray equips = message.getValue(KEY_EQUIP) as ErlArray; if (equips != null) { StorageManagerment.Instance.updateStorageInfo(StorageFPort.EQUIPMENT, equips); } ErlArray beasts = message.getValue(KEY_BEAST) as ErlArray; if (beasts != null) { StorageManagerment.Instance.updateStorageInfo(StorageFPort.BEAST, beasts); } ErlArray temp = message.getValue(KEY_TEMP) as ErlArray; if (temp != null) { StorageManagerment.Instance.updateStorageInfo(StorageFPort.TEMP, temp); } ErlArray starSoul = message.getValue(STAR_SOUL) as ErlArray; if (starSoul != null) { StorageManagerment.Instance.updateStorageInfo(StorageFPort.STAR_SOUL_STORAGE, starSoul); } ErlArray hunStarSoul = message.getValue(STAR_SOUL_DRAW) as ErlArray; if (hunStarSoul != null) { StorageManagerment.Instance.updateStorageInfo(StorageFPort.STAR_SOUL_DRAW_STORAGE, hunStarSoul); } ErlArray magicWeapon = message.getValue(MAGIC_WEAPON) as ErlArray; if (magicWeapon != null) { StorageManagerment.Instance.updateStorageInfo(StorageFPort.MAGIC_WEAPON, magicWeapon); } }
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; }
public override void read(ErlKVMessage message) { string msg = (message.getValue("msg") as ErlType).getValueString(); if (msg == "ok") { NoticeManagerment.Instance.getHeroEatInfo() [3] += 1; if (callback != null) { callback(); } } else if (msg == "not_ative_time") { MessageWindow.ShowAlert(LanguageConfigManager.Instance.getLanguage("goddnessShake18")); callback = null; } else { MessageWindow.ShowAlert(msg); if (callback != null) { callback = null; } } }
public override void read(ErlKVMessage message) { string str = (message.getValue("msg") as ErlType).getValueString(); if (StringKit.isNum(str)) { if (starSoulList != null && starSoulList.Count > 0) { StorageManagerment smanager = StorageManagerment.Instance; for (int i = 0; i < starSoulList.Count; i++) { (starSoulList[i] as Card).delStarSoulBoreByAll(); } } callback(StringKit.toInt(str)); } else { if (str == "money_full") { MessageWindow.ShowAlert(LanguageConfigManager.Instance.getLanguage("goldLimit")); } else { MessageWindow.ShowAlert(str); } if (callback != null) { callback = null; } } }
public override void read(ErlKVMessage message) { ErlType practicetime = message.getValue("practicetime") as ErlType; //修炼副本倒计时 if (practicetime != null) { FuBenManagerment.Instance.practiceDueTime = StringKit.toInt(practicetime.getValueString()); } ErlType practicenum = message.getValue("practicecount") as ErlType; //修炼副本使用次数 if (practicenum != null) { int times = StringKit.toInt(practicenum.getValueString()); FuBenManagerment.Instance.updatePracticeNum(times); } }
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); } }
/// <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); }); } }
public override void read(ErlKVMessage message) { Dictionary <int, int> map = new Dictionary <int, int>(); ErlArray array = message.getValue("msg") as ErlArray; if (array != null) { for (int i = 0; i < array.Value.Length; i += 2) { int sid = StringKit.toInt(array.Value[i].getValueString()); int num = StringKit.toInt(array.Value[i + 1].getValueString()); map.Add(sid, num); } } List <ArenaAwardSample> samples = ArenaAwardSampleManager.Instance.getSamplesByType(ArenaAwardWindow.TYPE_GUESS); List <ArenaAwardInfo> infos = new List <ArenaAwardInfo>(); foreach (ArenaAwardSample sample in samples) { ArenaAwardInfo info = new ArenaAwardInfo(); info.sample = sample; info.condition = map[sample.condition]; infos.Add(info); } if (callback != null) { callback(infos); } }
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) { 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; } } }
public override void read(ErlKVMessage message) { string str = message.Cmd; switch (str) { case "/yxzh/active_port/get_active_info": //ErlArray eaa = (message.getValue ("sid") as ErlType).getValueString (); String strValus = (message.getValue ("sid") as ErlType).getValueString (); if (strValus != null && strValus.Split(',').Length > 1) { strValus = ConfigHelper.GetAppConfig (message.Cmd); } else { strValus = (message.getValue ("sid") as ErlType).getValueString (); strValus = ConfigHelper.GetAppConfig(message.Cmd + "_" + strValus); } if (this.erlConnect != null) { // /yxzh/title/get_title 返回值 ErlKVMessage msg = new ErlKVMessage ("r_ok"); msg.addValue (null, new ErlInt (message.getPort ())); //String strValue = ConfigHelper.GetAppConfig (message.Cmd); ErlType[] et = StringKit.strToErlTypeArray (strValus); ErlArray ea = new ErlArray (et); msg.addValue ("msg", ea); base.send (this.erlConnect, msg); } break; case "/yxzh/active_port/get_text_notice": default: if (this.erlConnect != null) { // /yxzh/title/get_title 返回值 ErlKVMessage msg = new ErlKVMessage ("r_ok"); msg.addValue (null, new ErlInt (message.getPort ())); String strValue = ConfigHelper.GetAppConfig (message.Cmd); ErlType[] et = StringKit.strToErlTypeArray (strValue); ErlArray ea = new ErlArray (et); msg.addValue ("msg", ea); base.send (this.erlConnect, msg); Log.Debug (msg.toJsonString ()); } break; } }
public override void read(ErlKVMessage message) { if (this.erlConnect != null) { string stype = (message.getValue ("type") as ErlString).Value; ErlKVMessage msg = new ErlKVMessage ("r_ok"); msg.addValue (null, new ErlInt (message.getPort ())); String strValue = ConfigHelper.GetAppConfig (message.Cmd +"_" + stype); ErlType[] et = StringKit.strToErlTypeArray (strValue); ErlArray ub = new ErlArray (et); msg.addValue ("msg", ub); base.send (this.erlConnect, msg); } }