Example #1
0
        public void OnSendJoin(EventCmd e)
        {
            int         roomid  = (int)e.Msg["roomid"];
            GameService service = _ctx.QueryService <GameService>(GameService.Name);

            C2sSprotoType.join.request request = new C2sSprotoType.join.request();
            request.roomid = roomid;
            _ctx.SendReq <C2sProtocol.join>(C2sProtocol.join.Tag, request);
        }
Example #2
0
        public void OnRspCreate(SprotoTypeBase responseObj)
        {
            C2sSprotoType.create.response obj = responseObj as C2sSprotoType.create.response;
            if (obj.errorcode == Errorcode.SUCCESS)
            {
                try {
                    _roomid = obj.roomid;
                    _max    = obj.room_max;
                    _host   = true;

                    C2sSprotoType.join.request request = new C2sSprotoType.join.request();
                    request.roomid = _roomid;
                    _ctx.SendReq <C2sProtocol.join>(C2sProtocol.join.Tag, request);
                } catch (Exception ex) {
                    UnityEngine.Debug.LogException(ex);
                }
            }
        }