private void OnGetTownPlayers(FaustComm.NetResponse msg) { if (msg.Succeeded) { loadedPlayerInfoList = (msg as GetTownPlayersResponse).playerInfoList; } else { Debug.LogError("Get town players error."); } }
private void OnSaveTutorialProgress(FaustComm.NetResponse msg) { if (msg.Succeeded) { _hasTutorialDataChange = false; Debug.Log("Succeess saving tutorial states."); } else { Debug.LogError("Error saving tutorial states: " + msg.errorCode); } }
void OnGetCharacters(FaustComm.NetResponse msg) { if (msg.Succeeded) { ConnectionManager.Instance.SendACK(GetCharacters, true); Camera camera = this.GetComponentInChildren <Camera>(); camera.cullingMask = 1 << LayerMask.NameToLayer("2DUILOADING") | 1 << LayerMask.NameToLayer("2DUI"); Debug.Log("Characters retrieved successfully."); GetCharactersResponse myMsg = (GetCharactersResponse)msg; for (int i = 0; i < FCConst.k_role_count; i++) { EnumRole role = (EnumRole)i; if (myMsg.playerInfos.ContainsKey(role)) { _playerInfos[role] = myMsg.playerInfos[role]; } else { _playerInfos[role] = null; } } _selectedRoleID = (EnumRole)PlayerPrefs.GetInt("LastUsedRole", 0); InitRoleModelsWithEquipments(); if (IsForceToSelectServer) { _loadingStep = EnumLoadingStep.step3; IsForceToSelectServer = false; } else { if (!IsFreshFish || IsManualSelectServerComplete) { _loadingStep = EnumLoadingStep.step4; } else { _loadingStep = EnumLoadingStep.step3; } } } else { UIMessageBoxManager.Instance.ShowMessageBox(Utils.GetErrorIDS(msg.errorCode), "", MB_TYPE.MB_OK, null); } }
public void OnEnterGameRequest(FaustComm.NetResponse msg) { ConnectionManager.Instance.SendACK(RequestToEnterGame, msg.Succeeded); if (msg.Succeeded) { //fill PlayerInfoManager EnterGameResponse myMsg = (EnterGameResponse)msg; PlayerInfo.Instance.PlayerInventory = myMsg.playerInventory; StepAt(EnumLoadingStep.step8); } else { //show msg box StepAt(EnumLoadingStep.step5); Debug.LogError(string.Format("Cannot enter game. Error = {0} {1}", msg.errorCode, msg.errorMsg)); } }