private void ParserCommand(Hashtable has) { _currentId = has["id"].ToString(); #if UNITY_EDITOR //Debug.Log(Time.frameCount + " <Color=#fff000> NET::ParserCommand - " + _currentId.ToString() + " </Color>"); #endif switch (_currentId) { // 로비씬 로딩 ( 팝업로딩화면이 유지된상태에서 로비씬 로딩 ) case PKID.SCENE_LOAD_LOBBY: UI.loginLoadingPage.SceneLoadLobby(); break; case PKID.LobbyConnect: _NetSocket.Connect(CONFIG.GetCurrentConfigServerIP(), CONFIG.GetCurrentConfigServerPORT()); return; case PKID.LobbyDisconnect: _bSelfDisconnect = true; _BCNetSocket.Disconnect(); _NetSocket.Disconnect(); return; // 게스트 유저 아이디 정보가 레지스트리에 없다면 신규 가입 처리 case PKID.GuestUserJoin: USER.I._TempGuestID = PlayerPrefHelper.GetUserID(); if (string.IsNullOrEmpty(USER.I._TempGuestID)) { I.SendReqGuestUserJoin((id, msg) => { if (!string.IsNullOrEmpty(msg)) { PKGuestUserJoin pk = JsonConvert.DeserializeObject <PKGuestUserJoin>(msg); if (pk.data.pid > 0) { USER.I._TempGuestID = pk.data.pid.ToString(); } } remove(PKID.GuestUserJoin); }, I.OnSendReqTimerout); } else { remove(PKID.GuestUserJoin); } return; case PKID.LobbyLogin: I.SendRQLobbyLogin((id, msg) => { Main.I.AppsFlyerEvent(AFInAppEvents.PLAY, AFInAppEvents.ACCOUNT_LOGIN, "true"); USER.I._PKLogin = JsonConvert.DeserializeObject <PK.Login.RECEIVE>(msg); remove(PKID.LobbyLogin); }, OnSendReqTimerout); return; case PKID.GuestUserUpdate: I.SendGuestUserUpdate(); break; case PKID.UserInfo: I.SendReqLobbyUserInfo((id, msg) => { Main.I.AppsFlyerEvent(AFInAppEvents.PLAY, AFInAppEvents.USER_DATA_LOADING, "true"); USER.I.SetPKUserInfo(msg); Main.I.AppsFlyerEvent(AFInAppEvents.USER, AFInAppEvents.USER_LEVEL, USER.I._PKUserInfo.data.user_level.ToString(), AFInAppEvents.LEVEL_UP, "false", AFInAppEvents.COINS_BALANCE, USER.I._PKUserInfo.data.balance.ToString()); remove(PKID.UserInfo); }, OnSendReqTimerout); return; case PKID.ServerInfo: I.SendReqServerInfo((id, msg) => { PK.ServerInfo.RECEIVE info = JsonConvert.DeserializeObject <PK.ServerInfo.RECEIVE>(msg); if (info != null) { for (int i = 0; i < info.data.Length; i++) { if (info.data[i].server_name == "broadcast") { _BCNetSocket.Connect(info.data[i].server_address); I.AddMessage(PKID.BroadCastConnect); break; } } } remove(PKID.ServerInfo); }, OnSendReqTimerout); return; case PKID.News: I.SendReqNews((id, msg) => { if (!string.IsNullOrEmpty(msg)) { USER.I._PKNews = JsonConvert.DeserializeObject <PK.News.RECEIVE>(msg); } remove(PKID.News); }, I.OnSendReqTimerout); return; case PKID.CheckDeal: I.SendReqCheckDeal((id, msg) => { USER.I.SetPKCheckDeal(msg); remove(PKID.CheckDeal); }, OnSendReqTimerout, "init", 0); return; case PKID.GetPurchaseItems: I.SendReqGetPurchaseItems((id, msg) => { USER.I._PKGetPurchaseItems = JsonConvert.DeserializeObject <PK.GetPurchaseItems.RECEIVE>(msg); remove(PKID.GetPurchaseItems); }, OnSendReqTimerout, USER.I.GetDealKind().ToString(), ""); return; //case PKID.GetVaultShop: // I.SendReqGetVaultShop((id, msg) => // { // USER.I._PKGetVaultShop = JsonConvert.DeserializeObject<PK.GetVaultShop.RECEIVE>(msg); // remove(PKID.GetVaultShop); // }, OnSendReqTimerout); // return; case PKID.GamesInfo: I.SendReqGamesInfo((id, msg) => { USER.I._PKGamesInfo = JsonConvert.DeserializeObject <PK.GamesInfo.RECEIVE>(msg); remove(PKID.GamesInfo); }, OnSendReqTimerout, USER.I._PKUserInfo.GetId()); return; case PKID.GiftsCount: I.SendReqGiftsCount((id, msg) => { USER.I._PKGiftsCount = JsonConvert.DeserializeObject <PK.GiftsCount.RECEIVE>(msg); remove(PKID.GiftsCount); }, OnSendReqTimerout); return; case PKID.ListGifts: I.SendReqListGifts((id, msg) => { USER.I.SetPKListGifts(msg); remove(PKID.ListGifts); }, OnSendReqTimerout); return; case PKID.AppFriends: I.SendReqAppFriends((id, msg) => { if (!string.IsNullOrEmpty(msg)) { USER.I.PKReciveSetAppFriends(msg); } remove(PKID.AppFriends); }, OnSendReqTimerout); return; case PKID.SendGiftChallengeItems: I.SendReqSendGiftChallengeItems((id, msg) => { USER.I._PKSendGiftChallengeItems = JsonConvert.DeserializeObject <PK.SendGiftChallengeItems.RECEIVE>(msg); remove(PKID.SendGiftChallengeItems); }, OnSendReqTimerout); return; case PKID.InvitationChallengeCheck: I.SendReqInvitationChallengeCheck((id, msg) => { USER.I._PKInvitChallengeCheck = JsonConvert.DeserializeObject <PK.InviteChallengeCheck.RECEIVE>(msg); remove(PKID.InvitationChallengeCheck); }, OnSendReqTimerout); return; case PKID.BroadCastConnect: SendBroadCastConnect(); break; // 토너먼트 패킷 case PKID.TournamentNowConfig: I.SendReqTmtNowConfig((id, msg) => { if (!string.IsNullOrEmpty(msg)) { UI.Tournaments.PKNowConfig(JsonConvert.DeserializeObject <PK.TmtNowConfig.RECEIVE>(msg)); } remove(PKID.TournamentNowConfig); }, OnSendReqTimerout, HasToInt("tmtid"), HasToInt("gameid")); return; case PKID.TournamentNowRank: I.SendReqTmtNowRank((id, msg) => { if (!string.IsNullOrEmpty(msg)) { UI.Tournaments.PKNowRank(JsonConvert.DeserializeObject <PK.TmtNowRank.RECEIVE>(msg)); } remove(PKID.TournamentNowRank); }, OnSendReqTimerout, HasToInt("tmtid"), HasToInt("gameid")); return; case PKID.TournamentUserRank: I.SendReqTmtUserRank((id, msg) => { if (!string.IsNullOrEmpty(msg)) { UI.Tournaments.PKUserRank(JsonConvert.DeserializeObject <PK.TmtUserRank.RECEIVE>(msg)); } remove(PKID.TournamentUserRank); }, OnSendReqTimerout, HasToInt("tmtid"), HasToInt("gameid")); return; // collect bonus case PKID.BonusInfo: I.SendReqBonusInfo((id, msg) => { if (!string.IsNullOrEmpty(msg)) { USER.I._PKBonusInfo = JsonConvert.DeserializeObject <PK.BonusInfo.RECEIVE>(msg); } remove(PKID.BonusInfo); }, OnSendReqTimerout); return; } remove(_currentId); }
/// <summary> /// 서버 연결로 네트워크 정상인지 채크 ( 재접속 채크용 ) /// </summary> public void CheckNetConnect() { _IsReConnect = true; // Callback_EventSocket :: NetSocket.eEventIDs.SocketConnect 에서 구별플러그 _NetSocket.Connect(CONFIG.GetCurrentConfigServerIP(), CONFIG.GetCurrentConfigServerPORT()); }