Example #1
0
    public void sendMsg(GameProtocol pID, msgReqLeaveRoom msg, Action <Message> action)
    {
        JsonObject jsonMsg = new JsonObject();

        jsonMsg.Add("game", (int)msg.game);
        sendMsg(pID, jsonMsg, action);
    }
Example #2
0
    void onEventLeaveRoom(object data)
    {
        bool mustLeave = (bool)data;

        if (mustLeave)
        {
            Room.Room.reset();

            ViewManagerEvent.sShowView s;
            s.fromView = ViewManagerEvent.VIEW_TYPE.GAME_VIEW;
            s.toView   = ViewManagerEvent.VIEW_TYPE.LOBBY_VIEW;
            ViewManagerEvent.EM().InvokeEvent(ViewManagerEvent.EVENT.SHOW_VIEW, (object)s);

            RoomEvent.EM().InvokeEvent(RoomEvent.EVENT.UPDATE_DISSOLVE_ROOM, null);
        }
        else
        {
            msgReqLeaveRoom lr = new msgReqLeaveRoom();
            lr.game = GameType.GAME_LIANQI;
            ProtocolManager.getInstance().sendMsg(GameProtocol.P_GAME_REQ_LEAVEROOM, lr, OnRespLeaveRoom);
        }
    }