예제 #1
0
    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);
    }
예제 #2
0
    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);
    }
예제 #3
0
 public void setSeatsStatusCallBack(NetworkCallBack callBack)
 {
     NetWorkServices.getInstance().addListenerForSyncMessage("seatStatus", callBack);
 }