コード例 #1
0
    public void PrepareEnterGame(pb.GS2CEnterGameRet msg)
    {
        Debug.Log("PrepareEnterGame=> _gameMode=" + msg.mode.ToString() + ", _roomId=" + msg.roomId);
        _gameMode = msg.mode;
        _roomId   = msg.roomId;
        switch (msg.mode)
        {
        case pb.GameMode.CreateRoom:
            BattleManager.Instance.IsWaitingEnterRoomRet = false;
            break;

        default:
            break;
        }
    }
コード例 #2
0
    public void RevMsgGS2CEnterGameRet(int pid, byte[] msgBuf, int msgSize)
    {
        Debug.Log("==>> RevMsgGS2CEnterGameRet");
        Stream stream = new MemoryStream(msgBuf);

        pb.GS2CEnterGameRet msg = ProtoBuf.Serializer.Deserialize <pb.GS2CEnterGameRet>(stream);
        switch (msg.errorCode)
        {
        case pb.GS2CEnterGameRet.ErrorCode.SUCCESS:
            BattleManager.Instance.PrepareEnterGame(msg);
            break;

        case pb.GS2CEnterGameRet.ErrorCode.FAIL:
            break;

        case pb.GS2CEnterGameRet.ErrorCode.PLAYER_COUNT_LIMITE:
            UIManager.Instance.ShowTips(TipsType.text, "房间已满");
            break;
        }
    }