private bool CheckClientVersion(int majorVersion, int buildVersion, string appVersion, string resourceSha, bool androidClient) { if (majorVersion != LogicVersion.MAJOR_VERSION || buildVersion != LogicVersion.BUILD_VERSION || (appVersion != null && !EnvironmentSettings.IsSupportedAppVersion(appVersion))) { LoginFailedMessage loginFailedMessage = new LoginFailedMessage(); loginFailedMessage.SetErrorCode(LoginFailedMessage.ErrorCode.CLIENT_VERSION); loginFailedMessage.SetUpdateUrl(ResourceSettings.GetAppStoreUrl(androidClient)); this.SendMessage(loginFailedMessage); return(false); } if (resourceSha != ResourceManager.FINGERPRINT_SHA) { LoginFailedMessage loginFailedMessage = new LoginFailedMessage(); loginFailedMessage.SetErrorCode(LoginFailedMessage.ErrorCode.DATA_VERSION); loginFailedMessage.SetContentUrl(ResourceSettings.GetContentUrl()); loginFailedMessage.SetContentUrlList(ResourceSettings.ContentUrlList); loginFailedMessage.SetCompressedFingerprint(ResourceManager.COMPRESSED_FINGERPRINT_DATA); this.SendMessage(loginFailedMessage); return(false); } return(true); }
public override void Process(Level a) { if (Client.CState >= 1) { CheckClient(); // IF THE USER IS TOTALLY NEW, WITH ID 0 AND NO TOKEN if (UserID == 0 || string.IsNullOrEmpty(UserToken)) { NewUser(); return; } level = ResourcesManager.GetPlayer(UserID); // THE USER HAVE AN ID, WE CHECK IF IT'S IN DATABASE if (level != null) { if (level.Banned()) // IF THE USER IS FOUND BUT BANNED { var p = new LoginFailedMessage(Client); p.SetErrorCode(11); PacketManager.ProcessOutgoingPacket(p); return; } if (String.Equals(level.GetPlayerAvatar().GetUserToken(), UserToken, StringComparison.Ordinal)) // IF THE USER TOKEN MATCH THE CLIENT TOKEN { LogUser(); } else // ELSE, HE IS TRYING TO STEAL AN ACCOUNT { var p = new LoginFailedMessage(Client); p.SetErrorCode(11); p.SetReason("We have detected unrecognized token sended from your devices. Please contact server owner for more information"); PacketManager.ProcessOutgoingPacket(p); return; } } else // IF NOTHING IS FOUND IN DATABASE WITH THIS ID, WE CREATE A NEW { NewUser(); } if (ResourcesManager.IsPlayerOnline(level)) { var mail = new AllianceMailStreamEntry(); mail.SetId((int)DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1)).TotalSeconds); mail.SetSenderId(0); mail.SetSenderAvatarId(0); mail.SetSenderName("Server Manager"); mail.SetIsNew(0); mail.SetAllianceId(0); mail.SetSenderLeagueId(22); mail.SetAllianceBadgeData(1728059989); mail.SetAllianceName("Server Admin"); mail.SetMessage(ConfigurationManager.AppSettings["AdminMessage"]); mail.SetSenderLevel(500); var p = new AvatarStreamEntryMessage(level.GetClient()); p.SetAvatarStreamEntry(mail); PacketManager.ProcessOutgoingPacket(p); } } }
public override void Process(Level a) { // IF THE USER IS TOTALLY NEW, WITH ID 0 AND NO TOKEN if (UserID == 0 || string.IsNullOrEmpty(UserToken)) { NewUser(); return; } level = ResourcesManager.GetPlayer(UserID); // THE USER HAVE AN ID, WE CHECK IF IT'S IN DATABASE if (level != null) { if (level.Banned()) // IF THE USER IS FOUND BUT BANNED { var p = new LoginFailedMessage(Client); p.SetErrorCode(11); PacketManager.ProcessOutgoingPacket(p); return; } if (level.GetPlayerAvatar().GetUserToken() == UserToken) // IF THE USER TOKEN MATCH THE CLIENT TOKEN { LogUser(); } else // ELSE, HE IS TRYING TO STEAL AN ACCOUNT { NewUser(); } } else // IF NOTHING IS FOUND IN DATABASE WITH THIS ID, WE CREATE A NEW { NewUser(); } }
private LoginFailedMessage GetLoginFailedMessage(int errCode) { var message = new LoginFailedMessage(Client); message.SetErrorCode(6); message.SetReason($"CoM{errCode}\r\nWe have detected an issue with you ID, clean app data to continue."); return(message); }
private LoginFailedMessage GetCleanUpLoginFailedMessage() { var message = new LoginFailedMessage(Client); message.SetErrorCode(6); message.SetReason("We have detected an issue with your ID. Please clear your app data to continue playing! \n\nSettings -> Application Manager -> Clear App Data\n\nFor more informations, please check our official Website.\n\nhttps://www.clashofmagic.net/"); return(message); }
/// <summary> /// /// </summary> /// <param name="Message"></param> protected override void HandleLoginFailedMessage(LoginFailedMessage Message) { base.HandleLoginFailedMessage(Message); // close connection and exit ServerConnection.Disconnect(); IsRunning = false; Log("ERROR", LOG_CREDENTIALSWRONG); Thread.Sleep(SLEEPAFTERERROR); }
/// <summary> /// Handler for a invalid credentials return /// </summary> /// <param name="Message"></param> protected override void HandleLoginFailedMessage(LoginFailedMessage Message) { // call base handler base.HandleLoginFailedMessage(Message); // tell user about wrong credentials MessageBox.Show(WRONGCREDENTIALS); // reset state of logincontrol MainForm.LoginControl.ConnectedState = false; }
public override void Process(Level level) { MainWindow.RemoteWindow.WriteConsole(Convert.ToString(Unknown1), (int)MainWindow.level.WARNING); MainWindow.RemoteWindow.WriteConsole(Convert.ToString(Unknown2), (int)MainWindow.level.WARNING); MainWindow.RemoteWindow.WriteConsole(Convert.ToString(Unknown3), (int)MainWindow.level.WARNING); MainWindow.RemoteWindow.WriteConsole(Convert.ToString(Unknown4), (int)MainWindow.level.WARNING); MainWindow.RemoteWindow.WriteConsole(Convert.ToString(Unknown5), (int)MainWindow.level.WARNING); MainWindow.RemoteWindow.WriteConsole(Convert.ToString(Unknown6), (int)MainWindow.level.WARNING); MainWindow.RemoteWindow.WriteConsole(Convert.ToString(Unknown7), (int)MainWindow.level.WARNING); var p = new LoginFailedMessage(Client); p.SetErrorCode(10); p.RemainingTime(0); p.SetReason("You are connecting with 8.67 client but UCS not support it yet"); PacketManager.ProcessOutgoingPacket(p); }
private void OnLoginFailedMessageReceived(LoginFailedMessage message) { this.m_serverConnection.SetState(ServerConnectionState.LOGIN_FAILED); switch (message.GetErrorCode()) { case LoginFailedMessage.ErrorCode.DATA_VERSION: ZLibHelper.DecompressInMySQLFormat(message.GetCompressedFingerprint(), out byte[] output); ResourceManager.DownloadDataUpdate(LogicStringUtil.CreateString(output, 0, output.Length), message.GetContentUrl()); break; default: Debugger.Warning("MessageManager.onLoginFailedMessageReceived: error code: " + message.GetErrorCode()); break; } }
async void CheckClient() { try { if (UserID == 0 || string.IsNullOrEmpty(UserToken)) { NewUser(); return; } level = await ResourcesManager.GetPlayer(UserID); if (level != null) { if (level.Banned()) { LoginFailedMessage p = new LoginFailedMessage(Client); p.SetErrorCode(11); PacketProcessor.Send(p); return; } if (string.Equals(level.GetPlayerAvatar().GetUserToken(), UserToken, StringComparison.Ordinal)) { LogUser(); } else { LoginFailedMessage p = new LoginFailedMessage(Client); p.SetErrorCode(11); /*FOR FHX*/ // p.SetReason("Please clean the Data of your CoH app. \n\nSettings -> Application Manager -> Clear Data.(#1)\n\nMore Info, please check our official Website.\nOfficial Site: http://www.clashofheroes.net"); p.SetReason("We have some Problems with your Account. Please clean your App Data. https://ultrapowa.com/forum"); PacketProcessor.Send(p); return; } } else { LoginFailedMessage p = new LoginFailedMessage(Client); p.SetErrorCode(11); /*FOR FHX*/ // p.SetReason("Please clean the Data of your CoH app. \n\nSettings -> Application Manager -> Clear Data.(#1)\n\nMore Info, please check our official Website.\nOfficial Site: http://www.clashofheroes.net"); p.SetReason("We have some Problems with your Account. Please clean your App Data. https://ultrapowa.com/forum"); PacketProcessor.Send(p); return; } } catch (Exception) { } }
public override void Process(Level level) { if (Constants.IsRc4) { if (!string.IsNullOrEmpty(ConfigurationManager.AppSettings["patchingServer"])) { LoginFailedMessage p = new LoginFailedMessage(Client); p.SetErrorCode(7); p.SetResourceFingerprintData(ObjectManager.FingerPrint.SaveToJson()); p.SetContentURL(ConfigurationManager.AppSettings["patchingServer"]); p.SetUpdateURL(ConfigurationManager.AppSettings["UpdateUrl"]); PacketProcessor.Send(p); } } else { PacketProcessor.Send(new HandshakeSuccess(Client, this)); } }
public override void Process(Level a) { if (Client.CState >= 1) { CheckClient(); // IF THE USER IS TOTALLY NEW, WITH ID 0 AND NO TOKEN if (UserID == 0 || string.IsNullOrEmpty(UserToken)) { NewUser(); return; } level = ResourcesManager.GetPlayer(UserID); // THE USER HAVE AN ID, WE CHECK IF IT'S IN DATABASE if (level != null) { if (level.Banned()) // IF THE USER IS FOUND BUT BANNED { var p = new LoginFailedMessage(Client); p.SetErrorCode(11); PacketManager.ProcessOutgoingPacket(p); return; } if (String.Equals(level.GetPlayerAvatar().GetUserToken(), UserToken, StringComparison.Ordinal)) // IF THE USER TOKEN MATCH THE CLIENT TOKEN { LogUser(); } else // ELSE, HE IS TRYING TO STEAL AN ACCOUNT { var p = new LoginFailedMessage(Client); p.SetErrorCode(11); p.SetReason("We have detected unrecognized token sended from your devices. Please contact server owner for more information"); PacketManager.ProcessOutgoingPacket(p); return; } } else // IF NOTHING IS FOUND IN DATABASE WITH THIS ID, WE CREATE A NEW { NewUser(); } } }
void CheckClient() { if (UserID == 0 || string.IsNullOrEmpty(UserToken)) { NewUser(); return; } level = ResourcesManager.GetPlayer(UserID); if (level != null) { if (level.Banned()) { var p = new LoginFailedMessage(Client); p.SetErrorCode(11); PacketManager.ProcessOutgoingPacket(p); return; } if (string.Equals(level.GetPlayerAvatar().GetUserToken(), UserToken, StringComparison.Ordinal)) { LogUser(); } else { var p = new LoginFailedMessage(Client); p.SetErrorCode(11); p.SetReason("We have detected unrecognized token sended from your devices. Please clean your App Data."); PacketManager.ProcessOutgoingPacket(p); return; } } else { var p = new LoginFailedMessage(Client); p.SetErrorCode(11); p.SetReason("We have detected unrecognized token sended from your devices. Please clean your App Data."); PacketManager.ProcessOutgoingPacket(p); return; } }
public override void Process(Level a) { if (Client.CState >= 1) { int time = Convert.ToInt32(ConfigurationManager.AppSettings["maintenanceTimeleft"]); if (time != 0) { var p = new LoginFailedMessage(Client); p.SetErrorCode(10); p.RemainingTime(time); p.SetMessageVersion(8); PacketManager.ProcessOutgoingPacket(p); return; } var cv = ClientVersion.Split('.'); if (cv[0] != "8" || cv[1] != "332") // 8.332 //if (cv[0] != "8" || cv[1] != "551") // for 8.551 { var p = new LoginFailedMessage(Client); p.SetErrorCode(8); p.SetUpdateURL(Convert.ToString(ConfigurationManager.AppSettings["UpdateUrl"])); PacketManager.ProcessOutgoingPacket(p); return; } if (Convert.ToBoolean(ConfigurationManager.AppSettings["useCustomPatch"]) && MasterHash != ObjectManager.FingerPrint.sha) { var p = new LoginFailedMessage(Client); p.SetErrorCode(7); p.SetResourceFingerprintData(ObjectManager.FingerPrint.SaveToJson()); p.SetContentURL(ConfigurationManager.AppSettings["patchingServer"]); p.SetUpdateURL(ConfigurationManager.AppSettings["UpdateUrl"]); PacketManager.ProcessOutgoingPacket(p); return; } CheckClient(); } }
private bool CheckServerCapabilities() { if ((ServerStatus.Status == ServerStatusType.SHUTDOWN_STARTED || ServerStatus.Status == ServerStatusType.MAINTENANCE) && !EnvironmentSettings.IsDeveloperIP(this.m_connection.ClientIP.ToString())) { LoginFailedMessage loginFailedMessage = new LoginFailedMessage(); loginFailedMessage.SetErrorCode(LoginFailedMessage.ErrorCode.SERVER_MAINTENANCE); loginFailedMessage.SetEndMaintenanceTime(LogicMath.Max(ServerStatus.Time + ServerStatus.NextTime - TimeUtil.GetTimestamp(), 0)); this.SendMessage(loginFailedMessage); return(false); } if (ProxySessionManager.Count >= EnvironmentSettings.Settings.Proxy.SessionCapacity) { LoginFailedMessage loginFailedMessage = new LoginFailedMessage(); loginFailedMessage.SetErrorCode((LoginFailedMessage.ErrorCode) 1000); loginFailedMessage.SetReason("The servers are not able to connect you at this time. Try again in a few minutes."); this.SendMessage(loginFailedMessage); return(false); } return(true); }
public override void Process(Level level) { if (Constants.IsRc4) { if (string.IsNullOrWhiteSpace(ConfigurationManager.AppSettings["patchingServer"])) { var p = new LoginFailedMessage(Client); p.SetErrorCode(7); p.SetResourceFingerprintData(ObjectManager.FingerPrint.SaveToJson()); p.SetContentURL(ConfigurationManager.AppSettings["patchingServer"]); p.SetUpdateURL(ConfigurationManager.AppSettings["UpdateUrl"]); p.Send(); } else { throw new NullReferenceException("Patching server cannot be nulled in RC4"); } } else { new HandshakeSuccess(Client, this).Send(); } }
/// <summary> /// Called when a login failed message has been received. /// </summary> internal void LoginFailedMessageReceived(LoginFailedMessage message) { Debugger.Error("LoginFailedMessage, errorCode: " + message.ErrorCode); }
public override void Process(Level a) { try { if (Client.State == ClientState.Login) { if (Constants.IsRc4) { Client.ClientSeed = Seed; PacketProcessor.Send(new RC4SessionKey(Client)); } if (Constants.LicensePlanID == 3) { if (ResourcesManager.GetOnlinePlayers().Count >= Constants.MaxOnlinePlayers) { LoginFailedMessage p = new LoginFailedMessage(Client); p.SetErrorCode(12); p.SetReason("Sorry the Server is currently full! \n\nPlease try again in a few Minutes.\n"); PacketProcessor.Send(p); return; } } if (ParserThread.GetMaintenanceMode()) { LoginFailedMessage p = new LoginFailedMessage(Client); p.SetErrorCode(10); p.RemainingTime(ParserThread.GetMaintenanceTime()); p.SetMessageVersion(8); PacketProcessor.Send(p); return; } if (Constants.LicensePlanID < 1) { if (ResourcesManager.GetOnlinePlayers().Count >= 350) { LoginFailedMessage p = new LoginFailedMessage(Client); p.SetErrorCode(11); p.SetReason("This is a Free Version of UCS. Please Upgrade on https://ultrapowa.com/forum"); PacketProcessor.Send(p); return; } } else if (Constants.LicensePlanID < 2) { if (ResourcesManager.GetOnlinePlayers().Count >= 700) { LoginFailedMessage p = new LoginFailedMessage(Client); p.SetErrorCode(11); p.SetReason("This is a Pro Version of UCS. Please Upgrade to Ultra on https://ultrapowa.com/forum"); PacketProcessor.Send(p); return; } } int time = Convert.ToInt32(ConfigurationManager.AppSettings["maintenanceTimeleft"]); if (time != 0) { LoginFailedMessage p = new LoginFailedMessage(Client); p.SetErrorCode(10); p.RemainingTime(time); p.SetMessageVersion(8); PacketProcessor.Send(p); return; } if (ConfigurationManager.AppSettings["CustomMaintenance"] != string.Empty) { LoginFailedMessage p = new LoginFailedMessage(Client); p.SetErrorCode(10); p.SetReason(ConfigurationManager.AppSettings["CustomMaintenance"]); PacketProcessor.Send(p); return; } string[] cv2 = ConfigurationManager.AppSettings["ClientVersion"].Split('.'); string[] cv = ClientVersion.Split('.'); if (cv[0] != cv2[0] || cv[1] != cv2[1]) { LoginFailedMessage p = new LoginFailedMessage(Client); p.SetErrorCode(8); /*FOR FHX*/ //p.SetReason("Please re-downoad the APK on the Official FHX Site! \n Official Site: \n\n https://fhx-server.com, or \nhttp://fhxservercoc.com \n\n Or click the Update Button below!"); p.SetUpdateURL(Convert.ToString(ConfigurationManager.AppSettings["UpdateUrl"])); PacketProcessor.Send(p); return; } if (Convert.ToBoolean(ConfigurationManager.AppSettings["useCustomPatch"]) && MasterHash != ObjectManager.FingerPrint.sha) { LoginFailedMessage p = new LoginFailedMessage(Client); p.SetErrorCode(7); p.SetResourceFingerprintData(ObjectManager.FingerPrint.SaveToJson()); p.SetContentURL(ConfigurationManager.AppSettings["patchingServer"]); p.SetUpdateURL(ConfigurationManager.AppSettings["UpdateUrl"]); PacketProcessor.Send(p); return; } CheckClient(); } } catch (Exception) { } }
public LoginFailedException(string emailAddress, LoginFailedMessage message) : base($"Login With {emailAddress} not passed!, Response is : {message.AsJson()}") { LoginFailedMessage = message; }
public override PiranhaMessage CreateMessageByType(int type) { PiranhaMessage message = null; if (type < 20000) { switch (type) { case ClientCryptoErrorMessage.MESSAGE_TYPE: { message = new ClientCryptoErrorMessage(); break; } case ClientHelloMessage.MESSAGE_TYPE: { message = new ClientHelloMessage(); break; } case LoginMessage.MESSAGE_TYPE: { message = new LoginMessage(); break; } case KeepAliveMessage.MESSAGE_TYPE: { message = new KeepAliveMessage(); break; } case SetDeviceTokenMessage.MESSAGE_TYPE: { message = new SetDeviceTokenMessage(); break; } case ResetAccountMessage.MESSAGE_TYPE: { message = new ResetAccountMessage(); break; } case ReportUserMessage.MESSAGE_TYPE: { message = new ReportUserMessage(); break; } case AccountSwitchedMessage.MESSAGE_TYPE: { message = new AccountSwitchedMessage(); break; } case UnlockAccountMessage.MESSAGE_TYPE: { message = new UnlockAccountMessage(); break; } case AppleBillingRequestMessage.MESSAGE_TYPE: { message = new AppleBillingRequestMessage(); break; } case ChangeAvatarNameMessage.MESSAGE_TYPE: { message = new ChangeAvatarNameMessage(); break; } case AcceptFriendMessage.MESSAGE_TYPE: { message = new AcceptFriendMessage(); break; } case AddFriendMessage.MESSAGE_TYPE: { message = new AddFriendMessage(); break; } case AskForFriendListMessage.MESSAGE_TYPE: { message = new AskForFriendListMessage(); break; } case RemoveFriendMessage.MESSAGE_TYPE: { message = new RemoveFriendMessage(); break; } case StartFriendLiveSpectateMessage.MESSAGE_TYPE: { message = new StartFriendLiveSpectateMessage(); break; } case InboxOpenedMessage.MESSAGE_TYPE: { message = new InboxOpenedMessage(); break; } case GoHomeMessage.MESSAGE_TYPE: { message = new GoHomeMessage(); break; } case EndClientTurnMessage.MESSAGE_TYPE: { message = new EndClientTurnMessage(); break; } case CancelMatchmakingMessage.MESSAGE_TYPE: { message = new CancelMatchmakingMessage(); break; } case AttackHomeMessage.MESSAGE_TYPE: { message = new AttackHomeMessage(); break; } case StartFriendlyChallengeSpectateMessage.MESSAGE_TYPE: { message = new StartFriendlyChallengeSpectateMessage(); break; } case ScoutFriendlyBattleMessage.MESSAGE_TYPE: { message = new ScoutFriendlyBattleMessage(); break; } case VisitHomeMessage.MESSAGE_TYPE: { message = new VisitHomeMessage(); break; } case HomeBattleReplayMessage.MESSAGE_TYPE: { message = new HomeBattleReplayMessage(); break; } case AttackMatchedHomeMessage.MESSAGE_TYPE: { message = new AttackMatchedHomeMessage(); break; } case AcceptFriendlyBattleMessage.MESSAGE_TYPE: { message = new AcceptFriendlyBattleMessage(); break; } case CancelChallengeMessage.MESSAGE_TYPE: { message = new CancelChallengeMessage(); break; } case AttackNpcMessage.MESSAGE_TYPE: { message = new AttackNpcMessage(); break; } case DuelNpcMessage.MESSAGE_TYPE: { message = new DuelNpcMessage(); break; } case BindGoogleServiceAccountMessage.MESSAGE_TYPE: { message = new BindGoogleServiceAccountMessage(); break; } case BindFacebookAccountMessage.MESSAGE_TYPE: { message = new BindFacebookAccountMessage(); break; } case CreateAllianceMessage.MESSAGE_TYPE: { message = new CreateAllianceMessage(); break; } case AskForAllianceDataMessage.MESSAGE_TYPE: { message = new AskForAllianceDataMessage(); break; } case AskForJoinableAlliancesListMessage.MESSAGE_TYPE: { message = new AskForJoinableAlliancesListMessage(); break; } case JoinAllianceMessage.MESSAGE_TYPE: { message = new JoinAllianceMessage(); break; } case ChangeAllianceMemberRoleMessage.MESSAGE_TYPE: { message = new ChangeAllianceMemberRoleMessage(); break; } case LeaveAllianceMessage.MESSAGE_TYPE: { message = new LeaveAllianceMessage(); break; } case DonateAllianceUnitMessage.MESSAGE_TYPE: { message = new DonateAllianceUnitMessage(); break; } case ChatToAllianceStreamMessage.MESSAGE_TYPE: { message = new ChatToAllianceStreamMessage(); break; } case ChangeAllianceSettingsMessage.MESSAGE_TYPE: { message = new ChangeAllianceSettingsMessage(); break; } case RequestJoinAllianceMessage.MESSAGE_TYPE: { message = new RequestJoinAllianceMessage(); break; } case RespondToAllianceJoinRequestMessage.MESSAGE_TYPE: { message = new RespondToAllianceJoinRequestMessage(); break; } case SendAllianceInvitationMessage.MESSAGE_TYPE: { message = new SendAllianceInvitationMessage(); break; } case JoinAllianceUsingInvitationMessage.MESSAGE_TYPE: { message = new JoinAllianceUsingInvitationMessage(); break; } case SearchAlliancesMessage.MESSAGE_TYPE: { message = new SearchAlliancesMessage(); break; } case AskForAvatarProfileMessage.MESSAGE_TYPE: { message = new AskForAvatarProfileMessage(); break; } case AskForAllianceBookmarksFullDataMessage.MESSAGE_TYPE: { message = new AskForAllianceBookmarksFullDataMessage(); break; } case AddAllianceBookmarkMessage.MESSAGE_TYPE: { message = new AddAllianceBookmarkMessage(); break; } case RemoveAllianceBookmarkMessage.MESSAGE_TYPE: { message = new RemoveAllianceBookmarkMessage(); break; } case AskForAllianceRankingListMessage.MESSAGE_TYPE: { message = new AskForAllianceRankingListMessage(); break; } case AskForAvatarRankingListMessage.MESSAGE_TYPE: { message = new AskForAvatarRankingListMessage(); break; } case AskForAvatarLocalRankingListMessage.MESSAGE_TYPE: { message = new AskForAvatarLocalRankingListMessage(); break; } case AskForAvatarLastSeasonRankingListMessage.MESSAGE_TYPE: { message = new AskForAvatarLastSeasonRankingListMessage(); break; } case AskForAvatarDuelLastSeasonRankingListMessage.MESSAGE_TYPE: { message = new AskForAvatarDuelLastSeasonRankingListMessage(); break; } case RemoveAvatarStreamEntryMessage.MESSAGE_TYPE: { message = new RemoveAvatarStreamEntryMessage(); break; } case AskForLeagueMemberListMessage.MESSAGE_TYPE: { message = new AskForLeagueMemberListMessage(); break; } case BattleEndClientTurnMessage.MESSAGE_TYPE: { message = new BattleEndClientTurnMessage(); break; } case AvatarNameCheckRequestMessage.MESSAGE_TYPE: { message = new AvatarNameCheckRequestMessage(); break; } case SendGlobalChatLineMessage.MESSAGE_TYPE: { message = new SendGlobalChatLineMessage(); break; } case Village2AttackStartSpectateMessage.MESSAGE_TYPE: { message = new Village2AttackStartSpectateMessage(); break; } } } else { switch (type) { case SetEncryptionMessage.MESSAGE_TYPE: { message = new ExtendedSetEncryptionMessage(); break; } case ServerHelloMessage.MESSAGE_TYPE: { message = new ServerHelloMessage(); break; } case LoginFailedMessage.MESSAGE_TYPE: { message = new LoginFailedMessage(); break; } case LoginOkMessage.MESSAGE_TYPE: { message = new LoginOkMessage(); break; } case FriendListMessage.MESSAGE_TYPE: { message = new FriendListMessage(); break; } case FriendListUpdateMessage.MESSAGE_TYPE: { message = new FriendListUpdateMessage(); break; } case KeepAliveServerMessage.MESSAGE_TYPE: { message = new KeepAliveServerMessage(); break; } case AddFriendErrorMessage.MESSAGE_TYPE: { message = new AddFriendErrorMessage(); break; } case ReportUserStatusMessage.MESSAGE_TYPE: { message = new ReportUserStatusMessage(); break; } case UnlockAccountOkMessage.MESSAGE_TYPE: { message = new UnlockAccountOkMessage(); break; } case UnlockAccountFailedMessage.MESSAGE_TYPE: { message = new UnlockAccountFailedMessage(); break; } case AppleBillingProcessedByServerMessage.MESSAGE_TYPE: { message = new AppleBillingProcessedByServerMessage(); break; } case ShutdownStartedMessage.MESSAGE_TYPE: { message = new ShutdownStartedMessage(); break; } case PersonalBreakStartedMessage.MESSAGE_TYPE: { message = new PersonalBreakStartedMessage(); break; } case FacebookAccountBoundMessage.MESSAGE_TYPE: { message = new FacebookAccountBoundMessage(); break; } case AvatarNameChangeFailedMessage.MESSAGE_TYPE: { message = new AvatarNameChangeFailedMessage(); break; } case AvatarOnlineStatusUpdated.MESSAGE_TYPE: { message = new AvatarOnlineStatusUpdated(); break; } case AvatarOnlineStatusListMessage.MESSAGE_TYPE: { message = new AvatarOnlineStatusListMessage(); break; } case AllianceOnlineStatusUpdatedMessage.MESSAGE_TYPE: { message = new AllianceOnlineStatusUpdatedMessage(); break; } case GoogleServiceAccountBoundMessage.MESSAGE_TYPE: { message = new GoogleServiceAccountBoundMessage(); break; } case GoogleServiceAccountAlreadyBoundMessage.MESSAGE_TYPE: { message = new GoogleServiceAccountAlreadyBoundMessage(); break; } case AvatarNameCheckResponseMessage.MESSAGE_TYPE: { message = new AvatarNameCheckResponseMessage(); break; } case AcceptFriendErrorMessage.MESSAGE_TYPE: { message = new AcceptFriendErrorMessage(); break; } case OwnHomeDataMessage.MESSAGE_TYPE: { message = new OwnHomeDataMessage(); break; } case AttackHomeFailedMessage.MESSAGE_TYPE: { message = new AttackHomeFailedMessage(); break; } case OutOfSyncMessage.MESSAGE_TYPE: { message = new OutOfSyncMessage(); break; } case EnemyHomeDataMessage.MESSAGE_TYPE: { message = new EnemyHomeDataMessage(); break; } case AvailableServerCommandMessage.MESSAGE_TYPE: { message = new AvailableServerCommandMessage(); break; } case WaitingToGoHomeMessage.MESSAGE_TYPE: { message = new WaitingToGoHomeMessage(); break; } case VisitedHomeDataMessage.MESSAGE_TYPE: { message = new VisitedHomeDataMessage(); break; } case HomeBattleReplayDataMessage.MESSAGE_TYPE: { message = new HomeBattleReplayDataMessage(); break; } case ServerErrorMessage.MESSAGE_TYPE: { message = new ServerErrorMessage(); break; } case HomeBattleReplayFailedMessage.MESSAGE_TYPE: { message = new HomeBattleReplayFailedMessage(); break; } case LiveReplayHeaderMessage.MESSAGE_TYPE: { message = new LiveReplayHeaderMessage(); break; } case LiveReplayDataMessage.MESSAGE_TYPE: { message = new LiveReplayDataMessage(); break; } case ChallengeFailedMessage.MESSAGE_TYPE: { message = new ChallengeFailedMessage(); break; } case VisitFailedMessage.MESSAGE_TYPE: { message = new VisitFailedMessage(); break; } case AttackSpectatorCountMessage.MESSAGE_TYPE: { message = new AttackSpectatorCountMessage(); break; } case LiveReplayEndMessage.MESSAGE_TYPE: { message = new LiveReplayEndMessage(); break; } case LiveReplayFailedMessage.MESSAGE_TYPE: { message = new LiveReplayFailedMessage(); break; } case NpcDataMessage.MESSAGE_TYPE: { message = new NpcDataMessage(); break; } case AllianceDataMessage.MESSAGE_TYPE: { message = new AllianceDataMessage(); break; } case AllianceJoinFailedMessage.MESSAGE_TYPE: { message = new AllianceJoinFailedMessage(); break; } case JoinableAllianceListMessage.MESSAGE_TYPE: { message = new JoinableAllianceListMessage(); break; } case AllianceListMessage.MESSAGE_TYPE: { message = new AllianceListMessage(); break; } case AllianceStreamMessage.MESSAGE_TYPE: { message = new AllianceStreamMessage(); break; } case AllianceStreamEntryMessage.MESSAGE_TYPE: { message = new AllianceStreamEntryMessage(); break; } case AllianceStreamEntryRemovedMessage.MESSAGE_TYPE: { message = new AllianceStreamEntryRemovedMessage(); break; } case AllianceJoinRequestOkMessage.MESSAGE_TYPE: { message = new AllianceJoinRequestOkMessage(); break; } case AllianceJoinRequestFailedMessage.MESSAGE_TYPE: { message = new AllianceJoinRequestFailedMessage(); break; } case AllianceInvitationSendFailedMessage.MESSAGE_TYPE: { message = new AllianceInvitationSendFailedMessage(); break; } case AllianceInvitationSentOkMessage.MESSAGE_TYPE: { message = new AllianceInvitationSentOkMessage(); break; } case AllianceFullEntryUpdateMessage.MESSAGE_TYPE: { message = new AllianceFullEntryUpdateMessage(); break; } case AllianceWarSearchDataMessage.MESSAGE_TYPE: { message = new AllianceWarSearchDataMessage(); break; } case AllianceWarDataMessage.MESSAGE_TYPE: { message = new AllianceWarDataMessage(); break; } case AllianceCreateFailedMessage.MESSAGE_TYPE: { message = new AllianceCreateFailedMessage(); break; } case AvatarProfileMessage.MESSAGE_TYPE: { message = new AvatarProfileMessage(); break; } case AllianceWarFullEntryMessage.MESSAGE_TYPE: { message = new AllianceWarFullEntryMessage(); break; } case AllianceWarDataFailedMessage.MESSAGE_TYPE: { message = new AllianceWarDataFailedMessage(); break; } case AllianceWarHistoryMessage.MESSAGE_TYPE: { message = new AllianceWarHistoryMessage(); break; } case AvatarProfileFailedMessage.MESSAGE_TYPE: { message = new AvatarProfileFailedMessage(); break; } case BookmarksListMessage.MESSAGE_TYPE: { message = new BookmarksListMessage(); break; } case AllianceBookmarksFullDataMessage.MESSAGE_TYPE: { message = new AllianceBookmarksFullDataMessage(); break; } case Village2AttackEntryListMessage.MESSAGE_TYPE: { message = new Village2AttackEntryListMessage(); break; } case Village2AttackEntryUpdateMessage.MESSAGE_TYPE: { message = new Village2AttackEntryUpdateMessage(); break; } case Village2AttackEntryAddedMessage.MESSAGE_TYPE: { message = new Village2AttackEntryAddedMessage(); break; } case Village2AttackEntryRemovedMessage.MESSAGE_TYPE: { message = new Village2AttackEntryRemovedMessage(); break; } case AllianceRankingListMessage.MESSAGE_TYPE: { message = new AllianceRankingListMessage(); break; } case AllianceLocalRankingListMessage.MESSAGE_TYPE: { message = new AllianceLocalRankingListMessage(); break; } case AvatarRankingListMessage.MESSAGE_TYPE: { message = new AvatarRankingListMessage(); break; } case AvatarLocalRankingListMessage.MESSAGE_TYPE: { message = new AvatarLocalRankingListMessage(); break; } case AvatarLastSeasonRankingListMessage.MESSAGE_TYPE: { message = new AvatarLastSeasonRankingListMessage(); break; } case AvatarDuelLocalRankingListMessage.MESSAGE_TYPE: { message = new AvatarDuelLocalRankingListMessage(); break; } case AvatarDuelLastSeasonRankingListMessage.MESSAGE_TYPE: { message = new AvatarDuelLastSeasonRankingListMessage(); break; } case AvatarDuelRankingListMessage.MESSAGE_TYPE: { message = new AvatarDuelRankingListMessage(); break; } case AvatarStreamMessage.MESSAGE_TYPE: { message = new AvatarStreamMessage(); break; } case AvatarStreamEntryMessage.MESSAGE_TYPE: { message = new AvatarStreamEntryMessage(); break; } case AvatarStreamEntryRemovedMessage.MESSAGE_TYPE: { message = new AvatarStreamEntryRemovedMessage(); break; } case LeagueMemberListMessage.MESSAGE_TYPE: { message = new LeagueMemberListMessage(); break; } case GlobalChatLineMessage.MESSAGE_TYPE: { message = new GlobalChatLineMessage(); break; } case AllianceWarEventMessage.MESSAGE_TYPE: { message = new AllianceWarEventMessage(); break; } case FriendlyScoutHomeDataMessage.MESSAGE_TYPE: { message = new FriendlyScoutHomeDataMessage(); break; } case Village2AttackAvatarDataMessage.MESSAGE_TYPE: { message = new Village2AttackAvatarDataMessage(); break; } case AttackEventMessage.MESSAGE_TYPE: { message = new AttackEventMessage(); break; } case TitanDisconnectedMessage.MESSAGE_TYPE: { message = new DisconnectedMessage(); break; } case CryptoErrorMessage.MESSAGE_TYPE: { message = new CryptoErrorMessage(); break; } } } return(message); }
private async void LoginMessageReceived(LoginMessage message) { if (this.m_connection.State == ClientConnectionState.DEFAULT && this.CheckClientVersion(message.GetClientMajorVersion(), message.GetClientBuildVersion(), message.GetAppVersion(), message.GetResourceSha(), message.IsAndroidClient()) && this.CheckServerCapabilities()) { this.m_connection.Messaging.SetScramblerSeed(message.GetScramblerSeed()); this.m_connection.SetState(ClientConnectionState.LOGIN); AccountDocument accountDocument; if (message.GetAccountId().IsZero() && message.GetPassToken() == null) { IOperationResult <ulong> incrementSeedResult = await ServerProxy.AccountDatabase.IncrementSeed(); if (!incrementSeedResult.Success) { LoginFailedMessage loginFailedMessage = new LoginFailedMessage(); loginFailedMessage.SetErrorCode(LoginFailedMessage.ErrorCode.SERVER_MAINTENANCE); loginFailedMessage.SetReason("Internal server error"); this.SendMessage(loginFailedMessage); return; } accountDocument = new AccountDocument((long)incrementSeedResult.Value); accountDocument.Init(); accountDocument.Country = this.m_connection.Location; IOperationResult <string> createAccountResult = await ServerProxy.AccountDatabase.Insert((long)incrementSeedResult.Value, CouchbaseDocument.Save(accountDocument)); if (!createAccountResult.Success) { LoginFailedMessage loginFailedMessage = new LoginFailedMessage(); loginFailedMessage.SetErrorCode(LoginFailedMessage.ErrorCode.SERVER_MAINTENANCE); loginFailedMessage.SetReason("Internal server error"); this.SendMessage(loginFailedMessage); return; } } else { IOperationResult <string> getResult = await ServerProxy.AccountDatabase.Get(message.GetAccountId()); if (!getResult.Success) { if (getResult.Status == ResponseStatus.KeyNotFound) { LoginFailedMessage loginFailedMessage = new LoginFailedMessage(); loginFailedMessage.SetErrorCode(LoginFailedMessage.ErrorCode.ACCOUNT_NOT_EXISTS); this.SendMessage(loginFailedMessage); } else { LoginFailedMessage loginFailedMessage = new LoginFailedMessage(); loginFailedMessage.SetErrorCode(LoginFailedMessage.ErrorCode.SERVER_MAINTENANCE); loginFailedMessage.SetReason("Internal server error"); this.SendMessage(loginFailedMessage); } return; } accountDocument = CouchbaseDocument.Load <AccountDocument>(getResult.Value); if (accountDocument.PassToken != message.GetPassToken()) { LoginFailedMessage loginFailedMessage = new LoginFailedMessage(); loginFailedMessage.SetErrorCode(LoginFailedMessage.ErrorCode.ACCOUNT_NOT_EXISTS); this.SendMessage(loginFailedMessage); return; } } if (accountDocument.State != AccountState.NORMAL) { switch (accountDocument.State) { case AccountState.BANNED: { LoginFailedMessage loginFailedMessage = new LoginFailedMessage(); loginFailedMessage.SetErrorCode(LoginFailedMessage.ErrorCode.BANNED); loginFailedMessage.SetReason(accountDocument.StateArg); this.SendMessage(loginFailedMessage); return; } case AccountState.LOCKED: { LoginFailedMessage loginFailedMessage = new LoginFailedMessage(); loginFailedMessage.SetErrorCode(LoginFailedMessage.ErrorCode.ACCOUNT_LOCKED); this.SendMessage(loginFailedMessage); return; } } } ProxySession session = ProxySessionManager.Create(this.m_connection, accountDocument); RedisValue prevSession = await ServerProxy.SessionDatabase.GetSet(accountDocument.Id, session.Id.ToString()); if (!prevSession.IsNull) { long prevSessionId = long.Parse(prevSession); ServerMessageManager.SendMessage(new StopSessionMessage { Reason = 1, SessionId = prevSessionId }, ServerManager.GetProxySocket(prevSessionId)); } session.SetSocket(ServerCore.Socket); // Proxy LoginOkMessage loginOkMessage = new LoginOkMessage(); loginOkMessage.SetAccountId(accountDocument.Id); loginOkMessage.SetHomeId(accountDocument.Id); loginOkMessage.SetPassToken(accountDocument.PassToken); loginOkMessage.SetFacebookId(accountDocument.FacebookId); loginOkMessage.SetGamecenterId(accountDocument.GamecenterId); loginOkMessage.SetServerMajorVersion(LogicVersion.MAJOR_VERSION); loginOkMessage.SetServerBuildVersion(LogicVersion.BUILD_VERSION); loginOkMessage.SetContentVersion(ResourceManager.GetContentVersion()); loginOkMessage.SetServerEnvironment(EnvironmentSettings.Environment); loginOkMessage.SetSessionCount(accountDocument.SessionCount); loginOkMessage.SetPlayTimeSeconds(accountDocument.PlayTimeSeconds); loginOkMessage.SetAccountCreatedDate(accountDocument.CreateTime.ToString()); loginOkMessage.SetStartupCooldownSeconds(ServerProxy.GetStartupCooldownSeconds()); loginOkMessage.SetRegion(this.m_connection.Location); loginOkMessage.SetFacebookAppId(ResourceSettings.FacebookAppId); loginOkMessage.SetGoogleServiceId(ResourceSettings.GoogleServiceId); loginOkMessage.SetContentUrlList(ResourceSettings.ContentUrlList); loginOkMessage.SetChronosContentUrlList(ResourceSettings.ChronosContentUrlList); this.SendMessage(loginOkMessage); this.m_connection.SetSession(session); this.m_connection.SetState(ClientConnectionState.LOGGED); if (this.m_connection.State == ClientConnectionState.LOGGED) { accountDocument.SessionCount += 1; accountDocument.LastSessionTime = TimeUtil.GetTimestamp(); ServerRequestManager.Create(new BindServerSocketRequestMessage { ServerType = 9, ServerId = ServerManager.GetDocumentSocket(9, accountDocument.Id).ServerId, SessionId = session.Id }, ServerCore.Socket, 5).OnComplete = this.OnGameServerBound; await ServerProxy.AccountDatabase.Update(accountDocument.Id, CouchbaseDocument.Save(accountDocument)); } else { this.m_connection.DestructSession(); } } }
private async Task HandleLoginRequest(IClient client, Message message, CancellationToken cancellationToken) { var lrMessage = (LoginRequestMessage)message; var level = (Level)null; const string ERROR_ACC_RESOLVE = "Problem resolving account. Clear application data and try again."; const string MARKET_URL = "market://details?id=com.supercell.clashofclans"; const int MAJ_VER = 8; const int MIN_VER = 709; // If the configuration says we're in maintenance we // tell the client the server is maintenance. if (_maintenance) { var lfMessage = new LoginFailedMessage { Reason = LoginFailureReason.Maintenance, }; client.SendMessage(lfMessage); return; } // Make sure the client is running on the version we want it to run. if (lrMessage.MajorVersion != MAJ_VER || lrMessage.MinorVersion != MIN_VER) { var lfMessage = new LoginFailedMessage { Reason = LoginFailureReason.OutdatedVersion, }; client.SendMessage(lfMessage); } // If the client master-hash is not the same as the server master-hash, // we ask the client to download the new assets. else if (lrMessage.MasterHash != Server.Assets.Fingerprint.MasterHash) { var lfMessage = new LoginFailedMessage { Reason = LoginFailureReason.OutdatedContent, FingerprintJson = Server.Assets.Fingerprint.ToJson(), MarketUrl = MARKET_URL, ContentUrl = Server.Configuration.ContentUrl, }; client.SendMessage(lfMessage); } else { try { // Determine if the client is requesting a new Level // to be associated with it. if (lrMessage.UserId == 0) { // If somehow a client had a client ID of 0 but had a non null user token. if (lrMessage.UserToken != null) { var lfMessage = new LoginFailedMessage { Message = ERROR_ACC_RESOLVE }; client.SendMessage(lfMessage); return; } // Otherwise the client had a client ID of 0 and a null user token. // Meaning its a requesting a new account. else { level = await Server.Levels.NewLevelAsync(cancellationToken); } } else { // If somehow a client had a user ID but not a user token. if (lrMessage.UserToken == null) { var lfMessage = new LoginFailedMessage { Message = ERROR_ACC_RESOLVE }; client.SendMessage(lfMessage); return; } else { level = await Server.Levels.GetLevelAsync(lrMessage.UserId, cancellationToken); // If there is no level in the db with the same user id as specified, we create // a level with the same user id and token as specified. if (level == null) { level = await Server.Levels.NewLevelAsync(lrMessage.UserId, lrMessage.UserToken, cancellationToken); } if (level.Token != lrMessage.UserToken) { var lfMessage = new LoginFailedMessage { Message = ERROR_ACC_RESOLVE }; client.SendMessage(lfMessage); return; } } } } catch { var lfMessage = new LoginFailedMessage { Message = ERROR_ACC_RESOLVE // Sorta lie since its not related to account resolving. }; client.SendMessage(lfMessage); throw; } // Client has been successfully logged in! client.Session.Login(level); const string ENV_PROD = "prod"; const string FB_APP_ID = "297484437009394"; var lsMessage = new LoginSuccessMessage { UserToken = level.Token, UserId = level.Avatar.Id, HomeId = level.Avatar.Id, FacebookId = null, GameCenterId = null, MajorVersion = MAJ_VER, MinorVersion = MIN_VER, RevisionVersion = 0, ServerEnvironment = ENV_PROD, LoginCount = level.LoginCount, PlayTime = level.PlayTime, FacebookAppId = FB_APP_ID, DateLastSave = level.DateLastSave, DateCreated = level.DateCreated, GooglePlusId = null, CountryCode = "EN" //TODO: Return Country code of IP. }; var ohdMessage = level.OwnHomeData; client.SendMessage(lsMessage); client.SendMessage(ohdMessage); // If the Level forms part of a clan, we send the AllianceStream message of the alliance, // So that the client knows when stuff was sent. if (level.Avatar.Alliance != null) { var asMessage = level.Avatar.Alliance.AllianceStream; client.SendMessage(asMessage); } } }
/// <summary> /// Called when a <see cref="LoginFailedMessage"/> has been received. /// </summary> internal void LoginFailedMessageReceived(LoginFailedMessage message) { Logging.Print("MessageManager::loginFailedMessageReceived errorCode: " + message.ErrorCode); }
public override void Process(Level a) { if (Client.State == ClientState.Login) { if (Constants.IsRc4) { Client.ClientSeed = Seed; new RC4SessionKey(Client).Send(); } if (ParserThread.GetMaintenanceMode() == true) { var p = new LoginFailedMessage(Client); p.SetErrorCode(10); p.RemainingTime(ParserThread.GetMaintenanceTime()); p.SetMessageVersion(8); p.Send(); return; } if (Constants.IsPremiumServer == false) { if (ResourcesManager.GetOnlinePlayers().Count >= 100) { var p = new LoginFailedMessage(Client); p.SetErrorCode(11); p.SetReason("This is a free Version of UCS. Please Upgrade to Premium on https://ultrapowa.com/forum"); p.Send(); return; } } int time = Convert.ToInt32(ConfigurationManager.AppSettings["maintenanceTimeleft"]); if (time != 0) { var p = new LoginFailedMessage(Client); p.SetErrorCode(10); p.RemainingTime(time); p.SetMessageVersion(8); p.Send(); return; } if (ConfigurationManager.AppSettings["CustomMaintenance"] != string.Empty) { var p = new LoginFailedMessage(Client); p.SetErrorCode(10); p.SetReason(ConfigurationManager.AppSettings["CustomMaintenance"]); p.Send(); return; } var cv2 = ConfigurationManager.AppSettings["ClientVersion"].Split('.'); var cv = ClientVersion.Split('.'); if (cv[0] != cv2[0] || cv[1] != cv2[1]) { var p = new LoginFailedMessage(Client); p.SetErrorCode(8); p.SetUpdateURL(Convert.ToString(ConfigurationManager.AppSettings["UpdateUrl"])); p.Send(); return; } if (Convert.ToBoolean(ConfigurationManager.AppSettings["useCustomPatch"]) && MasterHash != ObjectManager.FingerPrint.sha) { var p = new LoginFailedMessage(Client); p.SetErrorCode(7); p.SetResourceFingerprintData(ObjectManager.FingerPrint.SaveToJson()); p.SetContentURL(ConfigurationManager.AppSettings["patchingServer"]); p.SetUpdateURL(ConfigurationManager.AppSettings["UpdateUrl"]); p.Send(); return; } CheckClient(); } }
/// <summary> /// Executed when login credentials were wrong /// </summary> /// <param name="Message"></param> protected override void HandleLoginFailedMessage(LoginFailedMessage Message) { base.HandleLoginFailedMessage(Message); ui.ShowCredentialsError(); }
/// <summary> /// Creates a message by type. /// </summary> public override PiranhaMessage CreateMessageByType(int type) { PiranhaMessage message = null; if (type < 20000) { switch (type) { case 10100: { message = new ClientHelloMessage(); break; } case 10101: { message = new LoginMessage(); break; } case 10108: { message = new KeepAliveMessage(); break; } case 10113: { message = new SetDeviceTokenMessage(); break; } case 10116: { message = new ResetAccountMessage(); break; } case 10117: { message = new ReportUserMessage(); break; } case 10118: { message = new AccountSwitchedMessage(); break; } case 10150: { message = new AppleBillingRequestMessage(); break; } case 10212: { message = new ChangeAvatarNameMessage(); break; } case 14101: { message = new GoHomeMessage(); break; } case 14102: { message = new EndClientTurnMessage(); break; } case 14134: { message = new AttackNpcMessage(); break; } case 14262: { message = new BindGoogleServiceAccountMessage(); break; } case 14325: { message = new AskForAvatarProfileMessage(); break; } case 14715: { message = new SendGlobalChatLineMessage(); break; } } } else { switch (type) { case 20000: { message = new ExtendedSetEncryptionMessage(); break; } case 20100: { message = new ServerHelloMessage(); break; } case 20103: { message = new LoginFailedMessage(); break; } case 20104: { message = new LoginOkMessage(); break; } case 20108: { message = new KeepAliveServerMessage(); break; } case 20117: { message = new ReportUserStatusMessage(); break; } case 20151: { message = new AppleBillingProcessedByServerMessage(); break; } case 20161: { message = new ShutdownStartedMessage(); break; } case 20171: { message = new PersonalBreakStartedMessage(); break; } case 20261: { message = new GoogleServiceAccountBoundMessage(); break; } case 20262: { message = new GoogleServiceAccountAlreadyBoundMessage(); break; } case 24101: { message = new OwnHomeDataMessage(); break; } case 24104: { message = new OutOfSyncMessage(); break; } case 24111: { message = new AvailableServerCommand(); break; } case 24112: { message = new WaitingToGoHomeMessage(); break; } case 24115: { message = new ServerErrorMessage(); break; } case 24133: { message = new NpcDataMessage(); break; } case 24334: { message = new AvatarProfileMessage(); break; } case 24411: { message = new AvatarStreamMessage(); break; } case 24715: { message = new GlobalChatLineMessage(); break; } } } return(message); }