示例#1
0
        public string getProtocol(string json1, int id, IdMapping mapping)
        {
            string json;

            if (mapping == null)
            {
                json = id + "-" + json1;
            }
            else
            {
                json = id + "-" + json1 + mapping.get();
            }

            return(json);
        }
示例#2
0
 public JsonSetting(int id, object responseValue, IdMapping idMapping)
 {
     this.id            = id;
     this.responseValue = responseValue == null?"{}":responseValue;
     this.idMapping     = idMapping;
 }
示例#3
0
 public void send(Type t, IdMapping mapping)
 {
     ProxyHandler.handler.sendEventObject(t, mapping);
 }
示例#4
0
 public void send(Event e, IdMapping mapping)
 {
     ProxyHandler.handler.sendEventObject(e, mapping.appendId(Lib.ID, e));
 }
示例#5
0
 public void sendObject(TcpClient tcp, string json1, int id, IdMapping mapping, bool get)
 {
     //如何定位物品,并设置,通过itemMapping找到id归属对象(player这个字段就是id)
     //然后通过id定位到物品,并设置
     send0(getProtocol(json1, id, mapping), tcp, get);
 }
示例#6
0
 public void sendObject(string json1, int id, IdMapping mapping, bool get)
 {
     sendObject(new TcpClient(), json1, id, mapping, get);
 }
示例#7
0
 public void sendEventObject(Type t, IdMapping mapping)
 {
     sendEventObject(null, RegisterEvents.getId(t), mapping);
 }
示例#8
0
 public void sendEventObject(Event e, IdMapping mapping)
 {
     sendEventObject(e.GetType(), mapping);
 }
示例#9
0
 //触发事件只发id
 //在jsmod2的监听器执行完前不能停止,get为true,在read处阻塞
 public void sendEventObject(Event e, int id, IdMapping mapping)
 {
     sendObject("{}", id, mapping, true);
 }