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); }
public JsonSetting(int id, object responseValue, IdMapping idMapping) { this.id = id; this.responseValue = responseValue == null?"{}":responseValue; this.idMapping = idMapping; }
public void send(Type t, IdMapping mapping) { ProxyHandler.handler.sendEventObject(t, mapping); }
public void send(Event e, IdMapping mapping) { ProxyHandler.handler.sendEventObject(e, mapping.appendId(Lib.ID, e)); }
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); }
public void sendObject(string json1, int id, IdMapping mapping, bool get) { sendObject(new TcpClient(), json1, id, mapping, get); }
public void sendEventObject(Type t, IdMapping mapping) { sendEventObject(null, RegisterEvents.getId(t), mapping); }
public void sendEventObject(Event e, IdMapping mapping) { sendEventObject(e.GetType(), mapping); }
//触发事件只发id //在jsmod2的监听器执行完前不能停止,get为true,在read处阻塞 public void sendEventObject(Event e, int id, IdMapping mapping) { sendObject("{}", id, mapping, true); }