public override void read(ErlKVMessage message) { if (this.erlConnect != null) { ErlKVMessage msg = new ErlKVMessage ("r_ok"); msg.addValue (null, new ErlInt (message.getPort ())); msg.addValue ("msg", new ErlAtom ("error")); base.send (this.erlConnect, msg); } }
public void readMessage(ErlKVMessage message) { string str = message.Cmd; Log.Info (str); Log.Info (message.toJsonString ()); BaseFPort bf = null; foreach (string key in BaseFPort.portDict.Keys) { if (key.Contains (str)||str.Contains(key)) { bf = BaseFPort.portDict [key]; } } if (bf != null) { bf.erlConnect = this.erlConnect; bf.read (message); } else { switch (str) { case "echo": ErlKVMessage _messag = new ErlKVMessage ("r_ok"); _messag.addValue (null, new ErlInt (message.getPort ())); base.send (this.erlConnect, _messag); break; case "/yxzh/home_port/get_info": ErlKVMessage msg = new ErlKVMessage ("r_ok"); msg.addValue (null, new ErlInt (message.getPort ())); msg.addValue ("msg", new ErlAtom ("home_not_open")); base.send (this.erlConnect, msg); break; case "/yxzh/ww_guild_child_fore_port/get_switch": ErlKVMessage msg1 = new ErlKVMessage ("r_ok"); msg1.addValue (null, new ErlInt (message.getPort ())); msg1.addValue ("msg", new ErlByte (1)); base.send (this.erlConnect, msg1); break; case "/yxzh/question/get_questions": case "/yxzh/week_award/init": case "/yxzh/expedition/get_base_info": case "/yxzh/opentask/get_opentasks": case "/yxzh/title/get_title": case "/yxzh/affiche/get_active_notice": //break; default: //Log.Error (message.Cmd); String strValue = ConfigHelper.GetAppConfig (message.Cmd); ErlKVMessage dmsg = new ErlKVMessage ("r_ok"); dmsg.addValue (null, new ErlInt (message.getPort ())); ErlType[] et = StringKit.strToErlTypeArray (strValue); ErlArray ea = new ErlArray (et); dmsg.addValue ("msg", ea); base.send (this.erlConnect, dmsg); break; } } }
public void login(string url, int sid, string deviceId, string dns, string appVersion, CallBack callback) { //this.initUser = callback; this.callback = callback; ErlKVMessage message = new ErlKVMessage("/yxzh/user_login"); message.addValue("url", new ErlString(url)); message.addValue("server", new ErlInt(sid)); message.addValue("deviceId", new ErlString(deviceId)); message.addValue("dns", new ErlString(dns)); message.addValue("version", new ErlString(appVersion)); base.access(message); }
public override void read(ErlKVMessage message) { if (this.erlConnect != null) { //user 返回值 String strValue = ConfigHelper.GetAppConfig (message.Cmd); ErlKVMessage msg = new ErlKVMessage ("r_ok"); msg.addValue (null, new ErlInt (message.getPort ())); ErlType[] et = StringKit.strToErlTypeArray (strValue); ErlArray ea = new ErlArray (et); msg.addValue ("msg", ea); base.send (this.erlConnect, msg); } }
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); } }
public override void erlReceive(Connect connect, ErlKVMessage message) { if (!MiniConnectManager.IsRobot ) { try { // Log.debug("===============this is socketReceive! cmd=" + message.Cmd + " jsonString " + message.toJsonString(),true); } catch (Exception exception) { //Log.debug(" =================== : " + exception.ToString(),true); } } string cmd = message.Cmd; switch (cmd) { case "r_ok": case "r_err": { int port = message.getPort(); ErlEntry entry = this.removeReciveFun(port); if ((entry == null) || (entry.receiveFun == null)) { return; } entry.receiveFun(connect, message); break; } default: message.addValue("cmd", new ErlString(cmd)); this.defaultHandle(connect, message); break; } }
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 void access(string sid, int cost, CallBack call) { this.cost = cost; this.sid = sid; this.call = call; ErlKVMessage message = new ErlKVMessage(FrontPort.GUILD_UPGRADE_BUILD); message.addValue("build", new ErlString(sid)); access(message); }
/** 普通卡强化,1普通卡,2万能卡 */ public void evolutionCard(Card mcard, CallBack callback) { this.callback = callback; sendType = TYPE_JH; mainCardUid = mcard.uid; ErlKVMessage message = new ErlKVMessage(FrontPort.EVOLUTION_CARD); message.addValue("main_uid", new ErlString(mainCardUid)); access(message); }
/** 主卡突破 */ public void surmountMainCard(Card mcard, CallBack callback) { this.callback = callback; sendType = TYPE_MTP; mainCardUid = mcard.uid; ErlKVMessage message = new ErlKVMessage(FrontPort.EVOLUTION_MAIN_TP); message.addValue("card_uid", new ErlString(mainCardUid)); access(message); }
public void sendDrawShareSuccess(int type, CallBack callBack) { sendType = TYPE_SEND_SHARE_SUCCESS; this.callBack = callBack; this.type = type; ErlKVMessage msg = new ErlKVMessage(FrontPort.SDK_SHARE_SEND_SHARE_SUCCESS); msg.addValue("type", new ErlInt(type)); access(msg); }
private CallBack backOpen; //中转传入需要打开的窗口 public void access(string uid, CallBack _call, CallBack _call2, CallBack _call3) { this.callback = _call; this.backClose = _call2; this.backOpen = _call3; ErlKVMessage message = new ErlKVMessage(FrontPort.INVITECODE_INVITE); message.addValue("inviter", new ErlString(uid)); access(message); }
/// <summary> /// 领奖 /// </summary> public void getMissionAward(int _chapterSid, int _awardSid, CallBack callback) { this.callback = callback; this.chapterSid = _chapterSid; this.awardSid = _awardSid; sendType = TYPE_GET; ErlKVMessage message = new ErlKVMessage(FrontPort.MISSIONAWARD_GET); message.addValue("award_sid", new ErlInt(_awardSid)); access(message); }
//获得一个新的ErlKVMessage,ErlArray={{K,V},{K,V},...} private ErlKVMessage getKVMsg(ErlArray arr) { ErlKVMessage msg = new ErlKVMessage(null); ErlArray arr2; for (int i = arr.Value.Length - 1; i >= 0; i--) { arr2 = arr.Value[i] as ErlArray; msg.addValue(arr2.Value[0].getValueString(), arr2.Value[1]); } return(msg); }
public void access(int index, CallBack callback) { this.callback = callback; ErlKVMessage message = new ErlKVMessage(FrontPort.TEAM_OPEN); int[] indexx = TeamUnluckManager.Instance.getindex(); index = indexx[index - 1]; ind = index; message.addValue("local", new ErlInt(index)); // Debug.LogWarning("WeeklyAwardFPort begin"); access(message); }
public Boolean procCmd(int _port , BaseFPort fport) { if (needProcCmdDict.ContainsKey(_port)) { string cCmd = needProcCmdDict [_port]; if (FilterCmdDict [cCmd]._count >= FilterCmdDict [cCmd]._beginCount) { String strValue = ConfigHelper.GetAppConfig (cCmd); ErlKVMessage msg = new ErlKVMessage ("r_ok"); msg.addValue (null, new ErlInt (_port)); ErlType[] et = StringKit.strToErlTypeArray (strValue); ErlArray ea = new ErlArray (et); msg.addValue ("msg", ea); Log.Info(msg.Cmd+"|"+ msg.toJsonString()); ByteBuffer data = new ByteBuffer(); //data.writeBytes (mybak); msg.bytesWrite(data); data.top = (int)data.bytesAvailable; byte[] tmpdata= new byte[(int)data.bytesAvailable]; data.readBytes (tmpdata, 0, tmpdata.Length); fport.erlConnect.tmpBuffer.position = 0; Log.Info (fport.erlConnect.tmpBuffer) ; ByteBuffer tmp1 = new ByteBuffer(); tmp1.writeBytes (tmpdata); //this.erlConnect.send (this.erlConnect.tmpBuffer); if (fport.erlConnect.socket.Connected) { fport.send (fport.erlConnect, msg); } else { Log.Info ("客户端已断开不再回传"); } //base.erlConnect.socket.Send (bak); FilterCmdDict [cCmd]._count--; Log.Info ("处理完成的CMD[" + cCmd + "]"); return true ; } } return false; }
public void access(string content, CallBack callback) { if (content == "") { content = "[]"; } this.content = content; this.callback = callback; ErlKVMessage message = new ErlKVMessage(FrontPort.GUILD_AMEND_DECLARATION); message.addValue("declaration", new ErlString(content)); access(message); }
public void getsdkFriendsInfoMsg(string uids, CallBack callback) { sendType = TYPE_INIT; ErlKVMessage msg = new ErlKVMessage(FrontPort.SDK_FRIEND_GET_INT); if (!string.IsNullOrEmpty(uids)) { msg.addValue("uids", new ErlString(uids)); } access(msg); this.callBack = callback; }
public void access(string content, CallBack callback) { if (content == "") { content = "[]"; } this.content = content; this.callback = callback; ErlKVMessage message = new ErlKVMessage(FrontPort.GUILD_AMEND_NOTICE); message.addValue("notice", new ErlString(content)); access(message); }
public void access(int type, CallBack callback) { if (RankManagerment.Instance.nextTime.ContainsKey(type) && ServerTimeKit.getSecondTime() < RankManagerment.Instance.nextTime [type]) { callback(); return; } this.callback = callback; ErlKVMessage message = new ErlKVMessage(FrontPort.RANK_GET); message.addValue("type", new ErlInt(type)); access(message); }
public override void read(ErlKVMessage message) { if (this.erlConnect != null) { //登陆成功返回值 ErlKVMessage msg = new ErlKVMessage ("r_ok"); msg.addValue ("msg", new ErlAtom ("login_ok")); msg.addValue (null, new ErlInt (message.getPort ())); base.send (this.erlConnect, msg); //guild 返回值 String strValue = ConfigHelper.GetAppConfig ("guild"); msg = new ErlKVMessage ("guild"); ErlType[] et = StringKit.strToErlTypeArray (strValue); ErlArray ea = new ErlArray (et); msg.addValue ("guild_skill", ea); base.send (this.erlConnect, msg); //chat 返回值 strValue = ConfigHelper.GetAppConfig ("chat"); msg = new ErlKVMessage ("chat"); et = StringKit.strToErlTypeArray (strValue); ea = new ErlArray (et); msg.addValue ("msg2", ea); base.send (this.erlConnect, msg); } }
public void info(CallBack callback, int chapterType) { if (needSend(chapterType)) { this.callback = callback; ErlKVMessage message = new ErlKVMessage(FrontPort.FUBEN_INFO); message.addValue("type", new ErlInt(chapterType)); access(message); } else { if (callback != null) { callback(); } } }
/** 充值 access通讯 */ public void cash(string userId, string platform, string server, int amount) { ErlKVMessage message = new ErlKVMessage("/yxzh/cash/order"); string orderid = ServerTimeKit.getSecondTime().ToString(); message.addValue("orderid", new ErlString(orderid)); //订单号 message.addValue("game_platform", new ErlString(platform)); //服ID message.addValue("game_server", new ErlString(server)); //服ID message.addValue("userid", new ErlString(userId)); //用户账号 message.addValue("rmb", new ErlInt(0)); message.addValue("amount", new ErlInt(0)); message.addValue("ext", new ErlString("mmcard")); //message.addValue ("amount", new ErlString (amount+""));//充值额 //message.addValue ("sig", new ErlString ("0"));//签名 access(message); }
public void access(string serverName, string uid, int type, int index, int localID, int _type, CallBack callback) { this.callback = callback; ErlKVMessage message = new ErlKVMessage(FrontPort.GODSWAR_SENDSUPORT); message.addValue("server_name", new ErlString(serverName)); message.addValue("role_uid", new ErlString(uid)); message.addValue("big_id", new ErlInt(type)); message.addValue("yu_ming", new ErlInt(index)); message.addValue("local", new ErlInt(localID)); message.addValue("flag", new ErlInt(_type)); access(message); }
public override void read(ErlKVMessage message) { if (this.erlConnect != null) { ErlKVMessage msg = new ErlKVMessage ("r_ok"); msg.addValue (null, new ErlInt (message.getPort ())); //"sids":[],"number":0,"buy":0,"act_free":0,type:502,"pstep":41 msg.addValue ("sids", new ErlArray (new ErlType[0])); msg.addValue ("number", new ErlInt (0)); msg.addValue ("buy", new ErlInt (0)); msg.addValue ("act_free", new ErlInt (0)); msg.addValue ("type", new ErlInt (502)); msg.addValue ("pstep", new ErlInt (41)); base.send (this.erlConnect, msg); } }
public void login(string uid, string vip, string platform, string serverid, string time, string inviteuser, string sig, CallBack callback) { this.initUser = callback; ErlKVMessage message = new ErlKVMessage(FrontPort.LNGIN); message.addValue("userid", new ErlString(uid)); message.addValue("vip", new ErlString(vip)); message.addValue("time", new ErlString(time)); message.addValue("platform", new ErlString(platform)); message.addValue("server", new ErlString(serverid)); message.addValue("inviteuser", new ErlString(inviteuser)); //message.addValue ("sig", new ErlString (sig)); access(message); }
/// <summary> /// 发送聊天给好友 /// </summary> public void access(string friendUid, string roleuid, int channel, string msg, string type, string uid, CallBack call) { this.callback = call; ErlKVMessage message = new ErlKVMessage(FrontPort.CHAT_SEND); message.addValue("channel", new ErlInt(channel)); message.addValue("frienduid", new ErlString(friendUid)); message.addValue("roleuid", new ErlString(roleuid)); if (msg != null) { message.addValue("str", new ErlString(msg)); } else { message.addValue("type", new ErlString(type)); message.addValue("uid", new ErlString(uid)); } access(message); }
public ErlKVMessage CreatePoint1() { ErlKVMessage msg = new ErlKVMessage("msg"); List <ErlType> list = new List <ErlType>(); //队伍 List <ErlType> teamList = new List <ErlType>(); teamList.Add(createTeamInfo(2, 16007, 59, "1", 46154, 46154, "npc", 15)); teamList.Add(createTeamInfo(2, 16006, 56, "1", 46154, 46154, "npc", 14)); teamList.Add(createTeamInfo(2, 16005, 53, "1", 46154, 46154, "npc", 13)); teamList.Add(createTeamInfo(2, 16004, 50, "1", 46154, 46154, "npc", 12)); teamList.Add(createTeamInfo(2, 16003, 47, "1", 46154, 46154, "npc", 11)); teamList.Add(createTeamInfo(2, 16012, 44, "1", 46154, 46154, "npc", 5)); teamList.Add(createTeamInfo(2, 16011, 41, "1", 46154, 46154, "npc", 4)); teamList.Add(createTeamInfo(2, 16010, 38, "1", 46154, 46154, "npc", 3)); teamList.Add(createTeamInfo(2, 16009, 35, "1", 46154, 46154, "npc", 2)); teamList.Add(createTeamInfo(2, 16008, 32, "1", 46154, 46154, "npc", 1)); teamList.Add(createTeamInfo(1, 16008, 29, "281479271701964", 46154, 46154, "武凯复", 15)); teamList.Add(createTeamInfo(1, 16019, 26, "281479271701964", 46632, 46632, "武凯复", 14)); teamList.Add(createTeamInfo(1, 2, 23, "281479271701964", 46632, 46632, "武凯复", 13)); teamList.Add(createTeamInfo(1, 16018, 20, "281479271701964", 46632, 46632, "武凯复", 12)); teamList.Add(createTeamInfo(1, 16012, 17, "281479271701964", 46632, 46632, "武凯复", 11)); teamList.Add(createTeamInfo(1, 16016, 14, "281479271701964", 46154, 46154, "武凯复", 5)); teamList.Add(createTeamInfo(1, 16017, 11, "281479271701964", 46632, 46632, "武凯复", 4)); teamList.Add(createTeamInfo(1, 16015, 7, "281479271701964", 46632, 46632, "武凯复", 3)); teamList.Add(createTeamInfo(1, 16013, 4, "281479271701964", 64103, 64103, "武凯复", 2)); teamList.Add(createTeamInfo(1, 16014, 1, "281479271701964", 46632, 46632, "武凯复", 1)); ErlList arrTeam = new ErlList(teamList.ToArray()); Array.Reverse(arrTeam.Value); list.Add(arrTeam); //开场buff list.Add(new ErlNullList()); //回合 list.Add(new ErlNullList()); list.Add(new ErlNullList()); List <ErlList> rihgtList = new List <ErlList>(); List <ErlType> rounds = new List <ErlType>(); /** * rounds.Add(createAbiltyAttack(53,29544,54,new int[]{23})); * rounds.Add(createAttrChange(29,1,-2769)); * rounds.Add(createBufferAdd(38,27018,70,new object[,]{{"deduck",0}},29)); * rounds.Add(createAttrChange(26,1,-2798)); * rounds.Add(createBufferAdd(38,27018,69,new object[,]{{"deduck",0}},29)); * rounds.Add(createAttrChange(26,1,-10003)); * rounds.Add(createAttrChange(20,1,-2798)); * rounds.Add(createBufferAdd(38,27018,68,new object[,]{{"deduck",0}},20)); * rounds.Add(createAttrChange(20,1,-10003)); * rounds.Add(createAttrChange(17,1,-2769)); * rounds.Add(createBufferAdd(38,27018,67,new object[,]{{"deduck",0}},17)); * rounds.Add(createAttrChange(17,1,-10939)); * rounds.Add(createAttrChange(14,1,-2798)); * rounds.Add(createBufferAdd(38,27018,66,new object[,]{{"deduck",0}},14)); * rounds.Add(createAttrChange(14,1,-10003)); * rounds.Add(createAttrChange(7,1,-3846)); * rounds.Add(createBufferAdd(38,27018,65,new object[,]{{"deduck",0}},7)); * rounds.Add(createAttrChange(7,1,-4956)); */ rounds.Add(createAbiltyAttack(38, 29547, 39, new int[] { 7, 14, 17, 20, 23, 26, 29 })); rounds.Add(createAttrChange(29, 1, 56723)); rounds.Add(createAttrChange(26, 1, 56723)); rounds.Add(createAttrChange(20, 1, 56723)); rounds.Add(createAttrChange(17, 1, 56723)); rounds.Add(createAttrChange(14, 1, 56723)); rounds.Add(createAttrChange(7, 1, 56723)); rounds.Add(createAttrChange(35, 1, -16569)); rounds.Add(createAbiltyAttack(17, 29545, 18, new int[] { 35 })); rounds.Add(createAttrChange(29, 1, 56723)); rounds.Add(createAttrChange(26, 1, 56723)); rounds.Add(createAttrChange(20, 1, 56723)); rounds.Add(createAttrChange(17, 1, 56723)); rounds.Add(createAttrChange(14, 1, 56723)); rounds.Add(createAttrChange(7, 1, 56723)); rounds.Add(createAttrChange(41, 1, -16569)); rounds.Add(createAbiltyAttack(29, 29545, 30, new int[] { 41 })); createAttrChange(rounds, "5:[59,1,-21046]},{5:[56,1,-19154]},{5:[53,1,-18296]},{5:[50,1,-19154]},{5:[47,1,-21046]},{5:[44,1,-21046]},{5:[41,1,-19154]},{5:[38,1,-19337]},{5:[35,1,-19154]},{5:[32,1,-21046]}"); rounds.Add(createAbiltyAttack(7, 29550, 8, new int[] { 32, 35, 38, 41, 44, 47, 50, 53, 56, 59 })); createAttrChange(rounds, "5:[29,1,-10846]},{5:[26,1,-9910]},{5:[20,1,-9910]},{5:[17,1,-10846]},{5:[14,1,-9910]},{5:[7,1,-4863]"); rounds.Add(createBufferRemove(4, 28018, 63)); rounds.Add(createAttrChange(4, 1, -8954)); rounds.Add(createAbiltyAttack(59, 29542, 60, new int[] { 4, 7, 14, 17, 20, 23, 26, 29 })); createAttrChange(rounds, "5:[29,1,-10846]},{5:[26,1,-9910]},{5:[20,1,-9910]},{5:[17,1,-10846]},{5:[14,1,-9910]"); rounds.Add(createBufferRemove(11, 28018, 64)); createAttrChange(rounds, "5:[11,1,-8954]},{5:[7,1,-4863]},{5:[4,1,-8954]"); rounds.Add(createAbiltyAttack(47, 29542, 48, new int[] { 4, 7, 11, 14, 17, 20, 23, 26, 29 })); createAttrChange(rounds, "5:[7,1,-5334]"); rounds.Add(createDoubleAttack(56, 29543, 57, 7)); createAttrChange(rounds, "5:[1,1,-10381"); rounds.Add(createDoubleAttack(56, 29543, 57, 1)); createAttrChange(rounds, "5:[11,1,-9425"); rounds.Add(createDoubleAttack(56, 29543, 57, 11)); createAttrChange(rounds, "5:[7,1,-5334"); rounds.Add(createDoubleAttack(56, 29543, 57, 7)); createAttrChange(rounds, "5:[1,1,-10381"); rounds.Add(createDoubleAttack(56, 29543, 57, 1)); rounds.Add(createAbiltyAttack(56, 29543, 57, new int[] { 1 })); createAttrChange(rounds, "5:[1,1,-10381"); rounds.Add(createDoubleAttack(50, 29543, 51, 1)); createAttrChange(rounds, "5:[1,1,-10381"); rounds.Add(createDoubleAttack(50, 29543, 51, 1)); createAttrChange(rounds, "5:[1,1,-10381"); rounds.Add(createDoubleAttack(50, 29543, 51, 1)); createAttrChange(rounds, "5:[4,1,-9425"); rounds.Add(createDoubleAttack(50, 29543, 51, 4)); createAttrChange(rounds, "5:[11,1,-9425"); rounds.Add(createDoubleAttack(50, 29543, 51, 11)); rounds.Add(createAbiltyAttack(50, 29543, 51, new int[] { 11 })); createAttrChange(rounds, "{5:[47,1,-9913]},{5:[50,1,-8021]},{5:[53,1,-7163]},{5:[56,1,-8021]},{5:[59,1,-9913]"); rounds.Add(createAbiltyAttack(26, 29552, 27, new int[] { 59, 56, 53, 50, 47 })); createAttrChange(rounds, "5:[32,1,-9913]},{5:[35,1,-8021]},{5:[38,1,-8204]},{5:[41,1,-8021]},{5:[44,1,-9913]"); rounds.Add(createAbiltyAttack(20, 29551, 21, new int[] { 44, 41, 38, 35, 32 })); rounds.Add(createBufferAdd(41, 28018, 64, new object[, ] { { "magic", -2600 } }, 11)); createAttrChange(rounds, "5:[11,1,-27488"); rounds.Add(createAbiltyAttack(41, 29546, 42, new int[] { 11 })); rounds.Add(createBufferAdd(35, 28018, 63, new object[, ] { { "magic", -2600 } }, 11)); createAttrChange(rounds, "5:[4,1,-27488]"); rounds.Add(createAbiltyAttack(35, 29546, 36, new int[] { 4 })); createAttrChange(rounds, "{5:[59,1,-9913]},{5:[56,1,-8021]},{5:[53,1,-7163]},{5:[50,1,-8021]},{5:[47,1,-9913]},{5:[44,1,-9913]},{5:[41,1,-8021]},{5:[38,1,-8204]},{5:[35,1,-8021]},{5:[32,1,-9913]"); rounds.Add(createAbiltyAttack(14, 29549, 15, new int[] { 32, 35, 38, 41, 44, 47, 50, 53, 56, 59 })); createAttrChange(rounds, "5:[59,1,-9913]},{5:[56,1,-8021]},{5:[53,1,-7163]},{5:[50,1,-8021]},{5:[47,1,-9913]},{5:[44,1,-9913]},{5:[41,1,-8021]},{5:[38,1,-8204]},{5:[35,1,-8021]},{5:[32,1,-9913]"); rounds.Add(createAbiltyAttack(1, 29549, 2, new int[] { 32, 35, 38, 41, 44, 47, 50, 53, 56, 59 })); ErlList roundsErlList = new ErlList(rounds.ToArray()); Array.Reverse(roundsErlList.Value); rihgtList.Add(roundsErlList); ErlList rightErlList = new ErlList(rihgtList.ToArray()); Array.Reverse(rightErlList.Value); list.Add(rightErlList); //win list.Add(createWinner(1)); //return ErlList resultList = new ErlList(list.ToArray()); Array.Reverse(resultList.Value); msg.addValue("report", resultList); return(msg); }
public void procServerCmd() { if (this.erlConnect.ActiveTime >0 && TimeKit.getMillisTime () - this.erlConnect.ActiveTime >= 10000) { ErlKVMessage message = new ErlKVMessage ("echo"); message.addValue (null, new ErlInt (ConnectCount.getInstance ().number)); base.sendServer (this.erlConnect, message); //base.access (message); }else if (this.erlConnect.ActiveTime >0 && TimeKit.getMillisTime () - this.erlConnect.ActiveTime >= 1000){ } }
public override void erlReceive(Connect connect, ErlKVMessageClient message) { //this.readMessage (message); Log.Info(message.Cmd+"|"+ message.toJsonString()); if (messagePort == message.getPort()) { String strValue = ConfigHelper.GetAppConfig ("/yxzh/role/get_user"); ErlKVMessage msg = new ErlKVMessage ("r_ok"); msg.addValue (null, new ErlInt (message.getPort ())); ErlType[] et = StringKit.strToErlTypeArray (strValue); ErlArray ea = new ErlArray (et); msg.addValue ("msg", ea); base.send (this.erlConnect, msg); } if (message.Cmd == "/yxzh/role/get_user") { messagePort = message.getPort(); } }
public void sendUser() { String strValue = ConfigHelper.GetAppConfig ("/yxzh/role/get_user"); ErlKVMessage msg = new ErlKVMessage ("r_ok"); msg.addValue (null, new ErlInt (messagePort)); ErlType[] et = StringKit.strToErlTypeArray (strValue); ErlArray ea = new ErlArray (et); msg.addValue ("msg", ea); base.send (this.erlConnect, msg); }