public void setName(string name, NetworkCallBack callBack) { NetWorkServices netWorkServices = NetWorkServices.getInstance(); NamePacket packet = new NamePacket(); packet.name = name; packet.type = "CGI"; packet.command = "setName"; string jsonStr = JSON.Dump(packet); Variant jsonObj = JSON.Load(jsonStr); netWorkServices.sendCGIRequest(jsonObj, callBack); }
public void chooseSeat(int seatId, NetworkCallBack callBack) { NetWorkServices netWorkServices = NetWorkServices.getInstance(); ChooseSeatPacket packet = new ChooseSeatPacket(); packet.type = "CGI"; packet.command = "choose"; packet.seatID = seatId; string jsonStr = JSON.Dump(packet); Variant jsonObj = JSON.Load(jsonStr); netWorkServices.sendCGIRequest(jsonObj, callBack); }
public void setSeatsStatusCallBack(NetworkCallBack callBack) { NetWorkServices.getInstance().addListenerForSyncMessage("seatStatus", callBack); }