示例#1
0
 // 创建房间
 public void OnCreateRoomRespond(MFRespondHeader header, MFCreateRoomRespond data)
 {
     if (header.result == 0)
     {
         MFPrepareRoomView.Open(data.roomNumber, data.roomOwner, data.playerCount, data.userList);
     }
 }
示例#2
0
 public void OnStartGameRespond(MFRespondHeader header, MFStartGameRespond data)
 {
     if (header.result == 0)
     {
         MFLog.LogInfo("房主开始游戏");
     }
 }
示例#3
0
 // 获取本子详细
 public void OnGetBookDetailRespond(MFRespondHeader header, MFGetBookDetailRespond data)
 {
     if (header.result == 0)
     {
         MFGameObjectUtil.Find <Text>(uiBind.backStoryPanel, "Content").text = data.backStory;
     }
 }
示例#4
0
 // 加入房间 静态的原因是还没有创建实例
 public static void OnJoinRoomRespond(MFRespondHeader header, MFJoinRoomRespond data)
 {
     if (header.result == 0)
     {
         Open(data.roomNumber, data.roomOwner, data.playerCount, data.userList);
     }
 }
示例#5
0
    public void OnReadyToStartRespond(MFRespondHeader header, MFReadyToStartRespond data)
    {
        if (header.result == 0)
        {
            MFLog.LogInfo("玩家准备完成");
            RefreshPlayerList(data.userList);

            if (isRoomMaster() && AllPlayerReady())
            {
                uiBind.startBtn.enabled = true;
            }
        }
    }
示例#6
0
 public void OnQQLoginRespond(MFRespondHeader header, MFQQLoginRespond data)
 {
     if (header.result == 0)
     {
         MFPlayer player = new MFPlayer(data.playerInfo);
         GameAgent.curPlayer = player;
         List <MFBook> bookList = new List <MFBook>();
         foreach (MFBookInfo bookInfo in data.bookList)
         {
             bookList.Add(new MFBook(bookInfo));
         }
         StartCoroutine(LoadMainScene(player, bookList));
     }
     else
     {
     }
 }
示例#7
0
    private void DispatchRespond(string data)
    {
        // 随便找个int当做具体类型 反正只需要header部分
        try {
            MFLog.LogInfo(data);
            MFRespondHeader rh = MFJsonSerialzator.DeSerialize <MFRespondProtocol <int> >(data).header;
            if (rh.result != 0)
            {
                MFLog.LogError(rh.result, rh.errMsg);
            }

            MFServerAgentBase.Receive(rh.protocolId, data);
        }
        catch (Exception e) {
            MFLog.LogError(e.ToString());
            MFLog.LogError(data);
        }
    }
示例#8
0
    public void OnSendCharacterScriptRespond(MFRespondHeader header, MFSendCharacterScriptRespond data)
    {
        if (header.result == 0)
        {
            MFLog.LogInfo("发放成功");
            MFLog.LogInfo(data.script);

            if (isRoomMaster())
            {
                uiBind.sendScriptBtn.gameObject.SetActive(false);
                uiBind.sendScriptBtn.enabled = false;

                uiBind.startBtn.gameObject.SetActive(true);
                uiBind.startBtn.enabled = false;
            }
            else
            {
                uiBind.readyBtn.gameObject.SetActive(true);
                uiBind.readyBtn.enabled = true;
            }
        }
    }
示例#9
0
 public void OnSelectCharacterRespond(MFRespondHeader header, MFSelectCharacterRespond data)
 {
     if (header.result == 0)
     {
         if (header.broadcast)
         {
             // 更新角色列表状态
             RefreshCharacterInfoList(data.roleList);
         }
         else
         {
             if (data.result)
             {
                 RefreshCharacterInfoList(data.roleList);
             }
             else
             {
                 MFLog.LogError("选择失败");
             }
         }
     }
 }
示例#10
0
 public void OnJoinRoomRespond(MFRespondHeader header, MFJoinRoomRespond data)
 {
     MFPrepareRoomView.Open(data.roomNumber, data.roomOwner, data.playerCount, data.userList);
 }
示例#11
0
 public void OnGetCharacterListRespond(MFRespondHeader header, MFGetCharacterListRespond data)
 {
     InitCharacterInfoList(data.roleList);
     uiBind.characterListPanel.SetActive(true);
     InitCharacterInfoObjList();
 }