// 创建房间 public void OnCreateRoomRespond(MFRespondHeader header, MFCreateRoomRespond data) { if (header.result == 0) { MFPrepareRoomView.Open(data.roomNumber, data.roomOwner, data.playerCount, data.userList); } }
public void OnStartGameRespond(MFRespondHeader header, MFStartGameRespond data) { if (header.result == 0) { MFLog.LogInfo("房主开始游戏"); } }
// 获取本子详细 public void OnGetBookDetailRespond(MFRespondHeader header, MFGetBookDetailRespond data) { if (header.result == 0) { MFGameObjectUtil.Find <Text>(uiBind.backStoryPanel, "Content").text = data.backStory; } }
// 加入房间 静态的原因是还没有创建实例 public static void OnJoinRoomRespond(MFRespondHeader header, MFJoinRoomRespond data) { if (header.result == 0) { Open(data.roomNumber, data.roomOwner, data.playerCount, data.userList); } }
public void OnReadyToStartRespond(MFRespondHeader header, MFReadyToStartRespond data) { if (header.result == 0) { MFLog.LogInfo("玩家准备完成"); RefreshPlayerList(data.userList); if (isRoomMaster() && AllPlayerReady()) { uiBind.startBtn.enabled = true; } } }
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 { } }
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); } }
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; } } }
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("选择失败"); } } } }
public void OnJoinRoomRespond(MFRespondHeader header, MFJoinRoomRespond data) { MFPrepareRoomView.Open(data.roomNumber, data.roomOwner, data.playerCount, data.userList); }
public void OnGetCharacterListRespond(MFRespondHeader header, MFGetCharacterListRespond data) { InitCharacterInfoList(data.roleList); uiBind.characterListPanel.SetActive(true); InitCharacterInfoObjList(); }