public GameContext() { HabboEncryptionV2.Initialize(new RSAKeys()); _moderationManager = new ModerationManager(); _itemDataManager = new ItemDataManager(); _catalogManager = new CatalogManager(_itemDataManager); _navigatorManager = new NavigatorManager(); _roomManager = new RoomManager(); _chatManager = new ChatManager(); _groupManager = new GroupManager(); _questManager = new QuestManager(); _achievementManager = new AchievementManager(); _talentTrackManager = new TalentTrackManager(); _hotelViewManager = new HotelViewManager(); _gameDataManager = new GameDataManager(); _botManager = new BotManager(); _cacheManager = new CacheManager(); _rewardManager = new RewardManager(); _badgeManager = new BadgeManager(); _permissionManager = new PermissionManager(); _subscriptionManager = new SubscriptionManager(); _gameCycle = new Task(GameCycle); _gameCycle.Start(); _cycleActive = true; }
public void Parse(GameClient Session, ClientPacket Packet) { string CipherPublickey = Packet.PopString(); //BigInteger SharedKey = HabboEncryptionV2.CalculateDiffieHellmanSharedKey(CipherPublickey); //if (SharedKey != 0) //Session.RC4Client = new ARC4(SharedKey.getBytes()); Session.SendPacket(new SecretKeyComposer(HabboEncryptionV2.GetRsaDiffieHellmanPublicKey())); }
public void Parse(Player player, IncomingPacket IncomingPacket) { var cipherPublickey = IncomingPacket.GetString(); var sharedKey = HabboEncryptionV2.CalculateDiffieHellmanSharedKey(cipherPublickey); if (sharedKey == 0) { return; } player.Arc4 = new ARC4(sharedKey.getBytes()); player.SendMessage(new SecretKeyMessageComposer(HabboEncryptionV2.GetRsaDiffieHellmanPublicKey())); }
public void Load() { _logManager = new LogManager(); _serverInformation = new ServerInformation(); foreach (var consoleOutputString in _serverInformation.ConsoleLogo) { Console.WriteLine(consoleOutputString); } _logManager.Log("Loading " + _serverInformation.ServerName + "...", LogType.Information); var stopwatch = Stopwatch.StartNew(); _configManager = new ConfigManager("Extra/Other/config.ini"); var databaseStopwatch = Stopwatch.StartNew(); _mysqlManager = new DatabaseManager(new DatabaseSettings( _configManager.GetConfigElement("database.host"), _configManager.GetConfigElement("database.username"), _configManager.GetConfigElement("database.password"), _configManager.GetConfigElement("database.name"), int.Parse(_configManager.GetConfigElement("database.port")), int.Parse(_configManager.GetConfigElement("database.max_connections")))); if (!_mysqlManager.WorkingConnection()) { _logManager.Log("Unable to connect to the MySQL server.", LogType.Error); return; } databaseStopwatch.Stop(); _logManager.Log("Loaded MySQL [" + databaseStopwatch.ElapsedMilliseconds + "ms]", LogType.Information); _socketManager = new SocketManager(); _gameManager = new GameManager(); _packetManager = new PacketManager(); _utility = new Utility(); StartedTime = DateTime.Now; _serverStatusUpdater = new ServerStatusUpdater(); HabboEncryptionV2.Initialize(new RSAKeys()); stopwatch.Stop(); _logManager.Log("Finished Loading! [" + stopwatch.ElapsedMilliseconds + "ms]", LogType.Warning); Console.ForegroundColor = ConsoleColor.Black; }
public void Parse(GameClient session, ClientPacket packet) { string cipherPublickey = packet.PopString(); BigInteger sharedKey = HabboEncryptionV2.CalculateDiffieHellmanSharedKey(cipherPublickey); if (sharedKey != 0) { session.Rc4Client = new ARC4(sharedKey.getBytes()); session.SendPacket(new SecretKeyComposer(HabboEncryptionV2.GetRsaDiffieHellmanPublicKey())); } else { session.SendNotification("There was an error logging you in, please try again!"); } }
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet) { string CipherPublickey = Packet.PopString(); BigInteger SharedKey = HabboEncryptionV2.CalculateDiffieHellmanSharedKey(CipherPublickey); if (SharedKey != 0) { Session.RC4Client = new ARC4(SharedKey.getBytes()); Session.SendPacket(new SecretKeyComposer(HabboEncryptionV2.GetRsaDiffieHellmanPublicKey())); } else { Session.SendNotification("There was an error logging you in, please try again!"); return; } }
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet) { string CipherPublickey = Packet.PopString(); BigInteger SharedKey = HabboEncryptionV2.CalculateDiffieHellmanSharedKey(CipherPublickey); if (SharedKey != 0) { Session.RC4Client = new ARC4(SharedKey.getBytes()); Session.SendMessage(new SecretKeyComposer(HabboEncryptionV2.GetRsaDiffieHellmanPublicKey())); } else { Session.SendNotification("Houve um log de erro.Por favor tente novamente.!"); return; } }
public void Initialize() { ServerStarted = DateTime.Now; CultureInfo = CultureInfo.CreateSpecificCulture("en-GB"); DefaultEncoding = Encoding.Default; Header("Loading " + PrettyVersion); try { LoadConfig(); LoadDatabase(); LoadSettings(); LoadTexts(); Game = new Game(); HabboEncryptionV2.Initialize(new RSAKeys()); LoadConnections(); LoadMus(); LoadServerStatusUpdater(); GameCycle = new GameCycle(); GameCycle.StartLoop(); TimeSpan TimeUsed = DateTime.Now - ServerStarted; Logging.WriteLine(EmuName + " loaded (" + TimeUsed.Seconds + " s, " + TimeUsed.Milliseconds + " ms)"); Console.Beep(); } catch (InvalidOperationException Error) { Logging.LogError(Error.ToString()); Logging.WriteLine("Failed to initialize ProjectHub: " + Error.Message, ConsoleColor.Red); Logging.WriteLine("Press any key to shut down ...", ConsoleColor.Red); Console.ReadKey(true); Environment.Exit(1); return; } catch (Exception Error) { Logging.LogError(Error.ToString()); Logging.WriteLine("Fatal error during startup: " + Error, ConsoleColor.Red); Logging.WriteLine("Press a key to exit", ConsoleColor.Red); Console.ReadKey(); Environment.Exit(1); } }
public void Parse(GameClient session, ClientPacket packet) { session.SendPacket(new InitCryptoComposer(HabboEncryptionV2.GetRsaDiffieHellmanPrimeKey(), HabboEncryptionV2.GetRsaDiffieHellmanGeneratorKey())); }
public static void Initialize() { string CurrentTime = DateTime.Now.ToString("HH:mm:ss" + " | "); ServerStarted = DateTime.Now; Console.BackgroundColor = ConsoleColor.White; Console.ForegroundColor = ConsoleColor.Black; Console.Clear(); Console.WriteLine(@" :::: ::: :::::::::: :::::::: :::: ::: "); Console.WriteLine(@" :+:+: :+: :+: :+: :+: :+:+: :+: "); Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine(@" :+:+:+ +:+ +:+ +:+ +: +:+:+:+ +:+ "); Console.ForegroundColor = ConsoleColor.DarkYellow; Console.WriteLine(@" +#+ +:+ +#+ +#++:++# +#+ +:+ +#+ +:+ +#+ "); Console.ForegroundColor = ConsoleColor.Blue; Console.WriteLine(@" +#+ +#+#+# +#+ +#+ +#+ +#+ +#+#+# "); Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine(@" #+# #+#+# #+# #+# #+# #+# #+#+# "); Console.ForegroundColor = ConsoleColor.DarkMagenta; Console.WriteLine(@" ### #### ########## ######## ### #### "); Console.WriteLine(""); Console.ForegroundColor = ConsoleColor.DarkCyan; Console.WriteLine(""); Console.WriteLine(@" © 2020 - Neon Corporation ©"); Console.WriteLine(@" Agradecimientos a » @Sledmore @Nillus - Un proyecto hecho por Javas para Keko Hotel"); Console.ForegroundColor = ConsoleColor.Black; Console.WriteLine(""); Console.WriteLine(""); Console.WriteLine(@"-------------------------------------------------------------------------------------------------------------"); Console.WriteLine(""); Console.Title = "Loading Neon..."; _defaultEncoding = Encoding.Default; Console.WriteLine(""); Console.WriteLine(""); CultureInfo = CultureInfo.CreateSpecificCulture("en-GB"); try { _configuration = new ConfigurationData(Path.Combine(Application.StartupPath, @"config.ini")); MySqlConnectionStringBuilder connectionString = new MySqlConnectionStringBuilder { ConnectionTimeout = 10, Database = GetConfig().data["db.name"], DefaultCommandTimeout = 30, Logging = false, MaximumPoolSize = uint.Parse(GetConfig().data["db.pool.maxsize"]), MinimumPoolSize = uint.Parse(GetConfig().data["db.pool.minsize"]), Password = GetConfig().data["db.password"], Pooling = true, Port = uint.Parse(GetConfig().data["db.port"]), Server = GetConfig().data["db.hostname"], UserID = GetConfig().data["db.username"], AllowZeroDateTime = true, ConvertZeroDateTime = true, }; _manager = new DatabaseManager(connectionString.ToString()); if (!_manager.IsConnected()) { Console.WriteLine(CurrentTime + "» Ya existe una conexión a la base de datos."); Console.ReadKey(true); Environment.Exit(1); return; } Console.ForegroundColor = ConsoleColor.DarkGray; Console.WriteLine(CurrentTime + "» Conexión a la base de datos."); //Reset our statistics first. using (IQueryAdapter dbClient = GetDatabaseManager().GetQueryReactor()) { dbClient.RunQuery("TRUNCATE `catalog_marketplace_data`"); dbClient.RunQuery("UPDATE `rooms` SET `users_now` = '0' WHERE `users_now` > '0';"); dbClient.RunQuery("UPDATE `users` SET `online` = '0' WHERE `online` = '1'"); dbClient.RunQuery("UPDATE `server_status` SET `users_online` = '0', `loaded_rooms` = '0'"); } //Get the configuration & Game set. ConfigData = new ConfigData(); _game = new Game(); //Have our encryption ready. HabboEncryptionV2.Initialize(new RSAKeys()); //Make sure MUS is working. MusSystem = new MusSocket(GetConfig().data["mus.tcp.bindip"], int.Parse(GetConfig().data["mus.tcp.port"]), GetConfig().data["mus.tcp.allowedaddr"].Split(Convert.ToChar(";")), 0); //Accept connections. _connectionManager = new ConnectionHandling(int.Parse(GetConfig().data["game.tcp.port"]), int.Parse(GetConfig().data["game.tcp.conlimit"]), int.Parse(GetConfig().data["game.tcp.conperip"]), GetConfig().data["game.tcp.enablenagles"].ToLower() == "true"); _connectionManager.init(); _game.StartGameLoop(); TimeSpan TimeUsed = DateTime.Now - ServerStarted; Console.WriteLine(); log.Info(">> NEON SERVER -> READY! (" + TimeUsed.Seconds + " s, " + TimeUsed.Milliseconds + " ms)"); } catch (KeyNotFoundException e) { Logging.WriteLine("Please check your configuration file - some values appear to be missing.", ConsoleColor.Red); Logging.WriteLine("Press any key to shut down ..."); Logging.WriteLine(e.ToString()); Console.ReadKey(true); Environment.Exit(1); return; } catch (InvalidOperationException e) { Logging.WriteLine("Failed to initialize KeyEmulator: " + e.Message, ConsoleColor.Red); Logging.WriteLine("Press any key to shut down ..."); Console.ReadKey(true); Environment.Exit(1); return; } catch (Exception e) { Logging.WriteLine("Fatal error during startup: " + e, ConsoleColor.Red); Logging.WriteLine("Press a key to exit"); Console.ReadKey(); Environment.Exit(1); } }
public static void Initialize() { Console.Clear(); ServerStarted = DateTime.Now; Console.ForegroundColor = ConsoleColor.Gray; PatchDir = System.IO.Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) + "/"; Console.Title = "Butterfly Emulator"; try { _configuration = new ConfigurationData(PatchDir + "Settings/configuration.ini", false); _datebasemanager = new DatabaseManager(uint.Parse(GetConfig().data["db.pool.maxsize"]), uint.Parse(GetConfig().data["db.pool.minsize"]), GetConfig().data["db.hostname"], uint.Parse(GetConfig().data["db.port"]), GetConfig().data["db.username"], GetConfig().data["db.password"], GetConfig().data["db.name"]); int TryCount = 0; while (!_datebasemanager.IsConnected()) { TryCount++; Thread.Sleep(5000); //sleep 5sec if (TryCount > 10) { Logging.WriteLine("Failed to connect to the specified MySQL server."); Console.ReadKey(true); Environment.Exit(1); return; } } HabboEncryptionV2.Initialize(new RSAKeys()); _languageManager = new LanguageManager(); _languageManager.Init(); _game = new Game(); _game.StartGameLoop(); _figureManager = new FigureDataManager(); _figureManager.Init(); if (_configuration.data["Websocketenable"] == "true") { _webSocketManager = new WebSocketManager(527, int.Parse(GetConfig().data["game.tcp.conlimit"]), int.Parse(GetConfig().data["game.tcp.conlimit"])); } _connectionManager = new ConnectionHandeling(int.Parse(GetConfig().data["game.tcp.port"]), int.Parse(GetConfig().data["game.tcp.conlimit"]), int.Parse(GetConfig().data["game.tcp.conperip"])); if (_configuration.data["Musenable"] == "true") { _rcon = new RCONSocket(int.Parse(GetConfig().data["mus.tcp.port"]), GetConfig().data["mus.tcp.allowedaddr"].Split(new char[1] { ';' })); } StaticEvents = _configuration.data["static.events"] == "true"; Logging.WriteLine("ENVIRONMENT -> READY!"); if (Debugger.IsAttached) { Console.ForegroundColor = ConsoleColor.Yellow; Logging.WriteLine("Server is debugging: Console writing enabled"); Console.ForegroundColor = ConsoleColor.White; } else { Logging.WriteLine("Server is not debugging: Console writing disabled"); Logging.DisablePrimaryWriting(false); } } catch (KeyNotFoundException ex) { Logging.WriteLine("Please check your configuration file - some values appear to be missing."); Logging.WriteLine("Press any key to shut down ..."); Logging.WriteLine((ex).ToString()); Console.ReadKey(true); } catch (InvalidOperationException ex) { Logging.WriteLine("Failed to initialize ButterflyEmulator: " + ex.Message); Logging.WriteLine("Press any key to shut down ..."); Console.ReadKey(true); } catch (Exception ex) { Console.WriteLine("Fatal error during startup: " + (ex).ToString()); Console.WriteLine("Press a key to exit"); Console.ReadKey(); Environment.Exit(1); } }
public static void Initialize() { ServerStarted = DateTime.Now; Console.ForegroundColor = ConsoleColor.DarkGreen; Console.WriteLine(); Console.WriteLine(" ____ __ ________ _____ __"); Console.WriteLine(@" / __ \/ /_ _______/ ____/ |/ / / / /"); Console.WriteLine(" / /_/ / / / / / ___/ __/ / /|_/ / / / / "); Console.WriteLine(" / ____/ / /_/ (__ ) /___/ / / / /_/ / "); Console.WriteLine(@" /_/ /_/\__,_/____/_____/_/ /_/\____/ "); Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine(" " + PrettyVersion + " <Feito por " + PrettyBuild + ">"); Console.WriteLine(" suamae"); Console.WriteLine(""); Console.Title = "Plus Emulador [Carregando...]"; _defaultEncoding = Encoding.Default; Console.WriteLine(""); Console.WriteLine(""); CultureInfo = CultureInfo.CreateSpecificCulture("pt-BR"); try { _configuration = new ConfigurationData(Path.Combine(Application.StartupPath, @"config.ini")); var connectionString = new MySqlConnectionStringBuilder { ConnectionTimeout = 60, Database = GetConfig().data["db.name"], DefaultCommandTimeout = 120, Logging = false, MaximumPoolSize = uint.Parse(GetConfig().data["db.pool.maxsize"]), MinimumPoolSize = uint.Parse(GetConfig().data["db.pool.minsize"]), Password = GetConfig().data["db.password"], Pooling = true, Port = uint.Parse(GetConfig().data["db.port"]), Server = GetConfig().data["db.hostname"], UserID = GetConfig().data["db.username"], AllowZeroDateTime = true, ConvertZeroDateTime = true, }; _manager = new DatabaseManager(connectionString.ToString()); if (!_manager.IsConnected()) { log.Error("Falha ao conectar ao específico servidor MySQL."); Console.ReadKey(true); Environment.Exit(1); return; } log.Info("Conectado a database!"); //Reset our statistics first. int randomInt = ((System.Diagnostics.Debugger.IsAttached) ? 0 : 1); using (IQueryAdapter dbClient = GetDatabaseManager().GetQueryReactor()) { dbClient.RunQuery("TRUNCATE `catalog_marketplace_data`"); dbClient.RunQuery("UPDATE `rooms` SET `users_now` = '0' WHERE `users_now` > '0';"); dbClient.RunQuery("UPDATE `users` SET `online` = '0' WHERE `online` = '1'"); dbClient.RunQuery("UPDATE `server_status` SET `users_online` = '0', `loaded_rooms` = '0', `environment_status` = '" + randomInt + "'"); } //Get the configuration & Game set. ConfigData = new ConfigData(); _game = new Game(); //Have our encryption ready. HabboEncryptionV2.Initialize(new RSAKeys()); //Make sure MUS is working. MusSystem = new MusSocket(GetConfig().data["mus.tcp.bindip"], int.Parse(GetConfig().data["mus.tcp.port"]), GetConfig().data["mus.tcp.allowedaddr"].Split(Convert.ToChar(";")), 0); //Accept connections. _connectionManager = new ConnectionHandling(int.Parse(GetConfig().data["game.tcp.port"]), int.Parse(GetConfig().data["game.tcp.conlimit"]), int.Parse(GetConfig().data["game.tcp.conperip"]), GetConfig().data["game.tcp.enablenagles"].ToLower() == "true"); _connectionManager.init(); _game.StartGameLoop(); TimeSpan TimeUsed = DateTime.Now - ServerStarted; Console.WriteLine(); log.Info("EMULATOR -> READY! (" + TimeUsed.Seconds + " s, " + TimeUsed.Milliseconds + " ms)"); } catch (KeyNotFoundException e) { Logging.WriteLine("Verifique o seu arquivo de configuração - alguns valores parecem estar faltando.", ConsoleColor.Red); Logging.WriteLine("Pressione qualquer tecla para desligar..."); Logging.WriteLine(e.ToString()); Console.ReadKey(true); Environment.Exit(1); return; } catch (InvalidOperationException e) { Logging.WriteLine("Falha ao inicializar Plus Emulador: " + e.Message, ConsoleColor.Red); Logging.WriteLine("Pressione qualquer tecla para desligar..."); Console.ReadKey(true); Environment.Exit(1); return; } catch (Exception e) { Logging.WriteLine("Erro fatal para iniciar: " + e, ConsoleColor.Red); Logging.WriteLine("Pressione qualquer tecla para fechar."); Console.ReadKey(); Environment.Exit(1); } RoleplayBotManager.Initialize(false); }
public static void Initialize() { string CurrentTime = DateTime.Now.ToString("HH:mm:ss" + " | "); ServerStarted = DateTime.Now; Console.WindowWidth = 120; Console.WindowHeight = 42; Console.ForegroundColor = ConsoleColor.Cyan; Console.WriteLine(@" _ _ _ _ _ "); Console.WriteLine(@"| | | | __ _| |__ | |__ (_)___ "); Console.WriteLine(@"| |_| |/ _` | '_ \| '_ \| / __|"); Console.WriteLine(@"| _ | (_| | |_) | |_) | \__ \"); Console.WriteLine(@"|_| |_|\__,_|_.__/|_.__/|_|___/"); Console.WriteLine(@" "); Console.ResetColor(); Console.ForegroundColor = ConsoleColor.Cyan; Console.WriteLine("Emulator »"); Console.Title = "Loading Quasar Emulator"; _defaultEncoding = Encoding.Default; Console.WriteLine(""); Console.WriteLine(""); CultureInfo = CultureInfo.CreateSpecificCulture("en-GB"); try { _configuration = new ConfigurationData(Path.Combine(Application.StartupPath, @"config.ini")); var connectionString = new MySqlConnectionStringBuilder { ConnectionTimeout = 10, Database = GetConfig().data["db.name"], DefaultCommandTimeout = 30, Logging = false, MaximumPoolSize = uint.Parse(GetConfig().data["db.pool.maxsize"]), MinimumPoolSize = uint.Parse(GetConfig().data["db.pool.minsize"]), Password = GetConfig().data["db.password"], Pooling = true, Port = uint.Parse(GetConfig().data["db.port"]), Server = GetConfig().data["db.hostname"], UserID = GetConfig().data["db.username"], AllowZeroDateTime = true, ConvertZeroDateTime = true, }; _manager = new DatabaseManager(connectionString.ToString()); if (!_manager.IsConnected()) { Console.WriteLine(CurrentTime + "» Kan geen verbinding maken met de database."); Console.ReadKey(true); Environment.Exit(1); return; } Console.ForegroundColor = ConsoleColor.DarkGray; Console.WriteLine(CurrentTime + "» Heeft verbinding met de database."); Console.ResetColor(); //Reset our statistics first. using (IQueryAdapter dbClient = GetDatabaseManager().GetQueryReactor()) { dbClient.RunQuery("TRUNCATE `catalog_marketplace_data`"); dbClient.RunQuery("UPDATE `rooms` SET `users_now` = '0' WHERE `users_now` > '0';"); dbClient.RunQuery("UPDATE `users` SET `online` = '0' WHERE `online` = '1'"); dbClient.RunQuery("UPDATE `server_status` SET `users_online` = '0', `loaded_rooms` = '0'"); } //Get the configuration & Game set. ConfigData = new ConfigData(); _game = new Game(); //Have our encryption ready. HabboEncryptionV2.Initialize(new RSAKeys()); //Make sure MUS is working. MusSystem = new MusSocket(GetConfig().data["mus.tcp.bindip"], int.Parse(GetConfig().data["mus.tcp.port"]), GetConfig().data["mus.tcp.allowedaddr"].Split(Convert.ToChar(";")), 0); //Accept connections. _connectionManager = new ConnectionHandling(int.Parse(GetConfig().data["game.tcp.port"]), int.Parse(GetConfig().data["game.tcp.conlimit"]), int.Parse(GetConfig().data["game.tcp.conperip"]), GetConfig().data["game.tcp.enablenagles"].ToLower() == "true"); _connectionManager.init(); _game.StartGameLoop(); TimeSpan TimeUsed = DateTime.Now - ServerStarted; Console.ForegroundColor = ConsoleColor.Cyan; Console.WriteLine(CurrentTime + "» Emulator is opgestart! [" + TimeUsed.Seconds + " s, " + TimeUsed.Milliseconds + " ms]"); Console.ResetColor(); } catch (KeyNotFoundException e) { Logging.WriteLine(CurrentTime + "Je configuratie is verkeerd ingesteld.", ConsoleColor.Red); Logging.WriteLine(CurrentTime + "Druk een toets in om af te sluiten.."); Logging.WriteLine(e.ToString()); Console.ReadKey(true); Environment.Exit(1); return; } catch (InvalidOperationException e) { Logging.WriteLine(CurrentTime + "Fout bij het vinden van de Emulator Key." + e.Message, ConsoleColor.Red); Logging.WriteLine(CurrentTime + "Druk een toets in om af te sluiten.."); Console.ReadKey(true); Environment.Exit(1); return; } catch (Exception e) { Logging.WriteLine(CurrentTime + "Relevante error tijdens het opstarten: " + e, ConsoleColor.Red); Logging.WriteLine(CurrentTime + "Druk een toets in om af te sluiten.."); Console.ReadKey(); Environment.Exit(1); } }
public static void Initialize() { ServerStarted = DateTime.Now; Console.WindowWidth = 110; Console.WindowHeight = 45; Console.ForegroundColor = ConsoleColor.Gray; Console.WriteLine(); Console.WriteLine(@" Dual Server" + PrettyBuild + " " + VersionCloud + " / Créditos: Xjoao,Paulo!"); Console.WriteLine(); Console.ForegroundColor = ConsoleColor.Gray; Console.WriteLine( Console.LargestWindowWidth > 30 ? @"-------------------------------------------------------------------------------------------------------------" : @""); Console.WriteLine(""); _defaultEncoding = Encoding.Default; Console.Title = "Dual Server | Carregando..."; CultureInfo = CultureInfo.CreateSpecificCulture("en-GB"); try { _configuration = new ConfigurationData(Path.Combine(Application.StartupPath, @"Settings/config.ini")); var connectionString = new MySqlConnectionStringBuilder { ConnectionTimeout = 10, Database = GetConfig().data["db.name"], DefaultCommandTimeout = 30, Logging = false, MaximumPoolSize = uint.Parse(GetConfig().data["db.pool.maxsize"]), MinimumPoolSize = uint.Parse(GetConfig().data["db.pool.minsize"]), Password = GetConfig().data["db.password"], Pooling = true, Port = uint.Parse(GetConfig().data["db.port"]), Server = GetConfig().data["db.hostname"], UserID = GetConfig().data["db.username"], AllowZeroDateTime = true, ConvertZeroDateTime = true, }; _manager = new DatabaseManager(connectionString.ToString()); if (!_manager.IsConnected()) { log.Warn("» Ya existe una conexión a la base de datos o hay un problema al conectarse con ella."); Console.ReadKey(true); Environment.Exit(1); return; } log.Info("» Conectado a la Base de datos!"); #region Add 2016 HotelName = Convert.ToString(GetConfig().data["hotel.name"]); Licenseto = Convert.ToString(GetConfig().data["license"]); #endregion Add 2016 //Reset our statistics first. using (IQueryAdapter dbClient = GetDatabaseManager().GetQueryReactor()) { dbClient.runFastQuery("TRUNCATE `catalog_marketplace_data`"); dbClient.runFastQuery("UPDATE `rooms` SET `users_now` = '0' WHERE `users_now` > '0'"); dbClient.runFastQuery("UPDATE `users` SET `online` = '0' WHERE `online` = '1'"); dbClient.runFastQuery("UPDATE `server_status` SET `users_online` = '0', `loaded_rooms` = '0', `status` = '1'"); } _game = new Game(); _game.ContinueLoading(); //Have our encryption ready. HabboEncryptionV2.Initialize(new RSAKeys()); //Make sure MUS is working. _rcon = new RCONSocket(GetConfig().data["mus.tcp.bindip"], int.Parse(GetConfig().data["mus.tcp.port"]), GetConfig().data["mus.tcp.allowedaddr"].Split(Convert.ToChar(";"))); //Accept connections. _connectionManager = new ConnectionHandling(int.Parse(GetConfig().data["game.tcp.port"]), int.Parse(GetConfig().data["game.tcp.conlimit"]), int.Parse(GetConfig().data["game.tcp.conperip"]), GetConfig().data["game.tcp.enablenagles"].ToLower() == "true"); _connectionManager.Init(); //_game.StartGameLoop(); TimeSpan TimeUsed = DateTime.Now - ServerStarted; Console.WriteLine(); Console.ForegroundColor = ConsoleColor.Green; log.Info("» CLOUD SERVER -> LISTO!! (" + TimeUsed.Seconds + " s, " + TimeUsed.Milliseconds + " ms)"); Console.ResetColor(); IsLive = true; } catch (KeyNotFoundException e) { log.ErrorFormat("Please check your configuration file - some values appear to be missing.", ConsoleColor.Red); log.Error("Press any key to shut down ..."); ExceptionLogger.LogException(e); Console.ReadKey(true); Environment.Exit(1); return; } catch (InvalidOperationException e) { log.Error("Failed to initialize CloudServer: " + e.Message); log.Error("Press any key to shut down ..."); Console.ReadKey(true); Environment.Exit(1); return; } catch (Exception e) { log.Error("Fatal error during startup: " + e); log.Error("Press a key to exit"); Console.ReadKey(); Environment.Exit(1); } }
public static void Initialize() { ServerStarted = DateTime.Now; Console.ForegroundColor = ConsoleColor.Gray; Console.WriteLine(""); Console.ForegroundColor = ConsoleColor.Blue; Console.WriteLine(""); Console.WriteLine(@"© 2016 - 2017 SaoDev Corporation Ltd. Todos os direitos reservados ao Thiago Araujo."); Console.WriteLine(""); Console.WriteLine(""); Console.ForegroundColor = ConsoleColor.Blue; Console.WriteLine( Console.LargestWindowWidth > 30 ? @"-------------------------------------------------------------------------------------------------------------" : @""); Console.ForegroundColor = ConsoleColor.Gray; Console.WriteLine(""); _defaultEncoding = Encoding.Default; Console.Write("VERIFICANDO LICENSIA: "); string passthiago = "servidoresdabiosdevCreditosThiagoAraujoSAODevLTDHappy"; if (ExtraSettings.LICENSE != passthiago) { Console.Clear(); } else { Console.ForegroundColor = ConsoleColor.Blue; Console.WriteLine(@" ( ( ) * ) ) ( "); Console.WriteLine(@" )\ ( ( )\ ) ( ( /( ` ) /(( /(( ) ( ( )\ ( ) ( ( "); Console.WriteLine(@" (((_) )( ))\(()/( )\ )\())( ( ( )(_))\())\ ( /( )\))( ( ((((_)( )( ( /( ))\ )\ ( "); Console.WriteLine(@" )\___(()\ /((_)((_))(_)_))/ )\ )\ _ (_(_())(_)((_))(_))(_))\ )\ )\ _ )(()\ )(_))/((_)(_) )\ "); Console.WriteLine(@" ((/ __|((_)_)) _| | (_) |_ ((_)(_)_) |_ _| |(_)_)(_)_ (()(_)(_) (_)_\(_)(_)(_)_(_))( ! ((_) "); Console.WriteLine(@" | (__| '_/ -_) _` | | | _/ _ (_-<_ | | | ' \| / _` / _` / _ \ / _ \| '_/ _` | || || / _ \ "); Console.WriteLine(@" \___|_| \___\__,_| |_|\__\___/__(_) |_| |_||_|_\__,_\__, \___/ /_/ \_\_| \__,_|\_,_|/ \___/ "); Console.WriteLine(); Console.ForegroundColor = ConsoleColor.Red; Console.Title = ("BIOSEMU - OPS ALGO ESTA ERRADO COM SUA LICENSIA!"); Console.Clear(); Console.ForegroundColor = ConsoleColor.Blue; Console.WriteLine(@" ( ( ) * ) ) ( "); Console.WriteLine(@" )\ ( ( )\ ) ( ( /( ` ) /(( /(( ) ( ( )\ ( ) ( ( "); Console.WriteLine(@" (((_) )( ))\(()/( )\ )\())( ( ( )(_))\())\ ( /( )\))( ( ((((_)( )( ( /( ))\ )\ ( "); Console.WriteLine(@" )\___(()\ /((_)((_))(_)_))/ )\ )\ _ (_(_())(_)((_))(_))(_))\ )\ )\ _ )(()\ )(_))/((_)(_) )\ "); Console.WriteLine(@" ((/ __|((_)_)) _| | (_) |_ ((_)(_)_) |_ _| |(_)_)(_)_ (()(_)(_) (_)_\(_)(_)(_)_(_))( ! ((_) "); Console.WriteLine(@" | (__| '_/ -_) _` | | | _/ _ (_-<_ | | | ' \| / _` / _` / _ \ / _ \| '_/ _` | || || / _ \ "); Console.WriteLine(@" \___|_| \___\__,_| |_|\__\___/__(_) |_| |_||_|_\__,_\__, \___/ /_/ \_\_| \__,_|\_,_|/ \___/ "); Console.WriteLine(); Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine(" Licensia do emulador não é valida para o BiosEmulador, Fale com o dono do pack (Thiago Araujo)!"); Console.WriteLine(" "); Console.WriteLine(" Clique em qualquer tecla para desligar o BIOSEMU"); Console.ReadKey(); Environment.Exit(1); } Console.ForegroundColor = ConsoleColor.Gray; Console.WriteLine(""); Console.ForegroundColor = ConsoleColor.Blue; Console.WriteLine(@" ( ) ( * ( ( ) ( "); Console.WriteLine(@" ( )\ ) ( /( )\ ) ( ` )\ ) ( )\ ) ( /( )\ ) "); Console.WriteLine(@" ( )\(()/( )\())(()/( ( )\))( ( (()/( )\ (()/( )\())(()/( "); Console.WriteLine(@" )((_)/(_))(_)\ /(_)) )\ ((_)()\ )\ /(_))(((_)( /(_))((_)\ /(_)) "); Console.WriteLine(@" ((_)_(_)) ((_)(_)) ((_)(_()((_)_ ((_)_)) )\ _ )(_))_ ((_)(_)) "); Console.WriteLine(@" | _ )_ _| / _ \/ __| | __| \/ | | | | | (_)_\(_) \ / _ \| _ \ "); Console.WriteLine(@" | _ \| | | (_) \__ \ | _|| |\/| | |_| | |__ / _ \ | |) | (_) | / "); Console.WriteLine(@" |___/___| \___/|___/ |___|_| |_|\___/|____|/_/ \_\|___/ \___/|_|_\ "); Console.WriteLine(""); Console.WriteLine(@"© 2016 - 2017 SaoDev Corporation Ltd. Todos os direitos reservados ao Thiago Araujo."); Console.WriteLine(""); Console.WriteLine(""); Console.ForegroundColor = ConsoleColor.Blue; Console.WriteLine( Console.LargestWindowWidth > 30 ? @"-------------------------------------------------------------------------------------------------------------" : @""); Console.WriteLine(""); Console.ForegroundColor = ConsoleColor.Gray; Console.Title = "BIOS EMULADOR | Carregando..."; CultureInfo = CultureInfo.CreateSpecificCulture("en-GB"); try { _configuration = new ConfigurationData(Path.Combine(Application.StartupPath, @"BiosConfingThiago/ConfigBiosEmuThiago.ini")); var connectionString = new MySqlConnectionStringBuilder { ConnectionTimeout = 10, Database = GetConfig().data["db.name"], DefaultCommandTimeout = 30, Logging = false, MaximumPoolSize = uint.Parse(GetConfig().data["db.pool.maxsize"]), MinimumPoolSize = uint.Parse(GetConfig().data["db.pool.minsize"]), Password = GetConfig().data["db.password"], Pooling = true, Port = uint.Parse(GetConfig().data["db.port"]), Server = GetConfig().data["db.hostname"], UserID = GetConfig().data["db.username"], AllowZeroDateTime = true, ConvertZeroDateTime = true, }; _manager = new DatabaseManager(connectionString.ToString()); if (!_manager.IsConnected()) { log.Warn("» Existe uma conexão com o banco de dados já existente ou há um problema para se conectar a ele."); Console.ReadKey(true); Environment.Exit(1); return; } log.Info("» Conectado ao banco de dados!"); #region Add 2016 HotelName = Convert.ToString(GetConfig().data["hotel.name"]); Licenseto = Convert.ToString(GetConfig().data["license"]); #endregion Add 2016 //Reset our statistics first. using (IQueryAdapter dbClient = GetDatabaseManager().GetQueryReactor()) { dbClient.runFastQuery("TRUNCATE `catalog_marketplace_data`"); dbClient.runFastQuery("UPDATE `rooms` SET `users_now` = '0' WHERE `users_now` > '0'"); dbClient.runFastQuery("UPDATE `users` SET `online` = '0' WHERE `online` = '1'"); dbClient.runFastQuery("UPDATE `server_status` SET `users_online` = '0', `loaded_rooms` = '0', `status` = '1'"); } _game = new Game(); _game.ContinueLoading(); //Have our encryption ready. HabboEncryptionV2.Initialize(new RSAKeys()); //Make sure MUS is working. _rcon = new RCONSocket(GetConfig().data["mus.tcp.bindip"], int.Parse(GetConfig().data["mus.tcp.port"]), GetConfig().data["mus.tcp.allowedaddr"].Split(Convert.ToChar(";"))); //Accept connections. _connectionManager = new ConnectionHandling(int.Parse(GetConfig().data["game.tcp.port"]), int.Parse(GetConfig().data["game.tcp.conlimit"]), int.Parse(GetConfig().data["game.tcp.conperip"]), GetConfig().data["game.tcp.enablenagles"].ToLower() == "true"); _connectionManager.Init(); //_game.StartGameLoop(); TimeSpan TimeUsed = DateTime.Now - ServerStarted; Quartovip = int.Parse(GetConfig().data["Quartovip"]); Prisao = int.Parse(GetConfig().data["Prisao"]); Console.WriteLine(); Console.ForegroundColor = ConsoleColor.Green; log.Info("» BIOSEMULADOR -> LISTO!! (" + TimeUsed.Seconds + " s, " + TimeUsed.Milliseconds + " ms)"); Console.ResetColor(); IsLive = true; Console.ForegroundColor = ConsoleColor.Blue; Console.WriteLine(""); Console.WriteLine( Console.LargestWindowWidth > 30 ? @"-------------------------------------------------------------------------------------------------------------" : @""); Console.ForegroundColor = ConsoleColor.Gray; } catch (KeyNotFoundException e) { log.ErrorFormat("Verifique o seu arquivo de configuração - alguns valores parecem estar faltando.", ConsoleColor.Red); log.Error("Pressione qualquer tecla para desligar ..."); ExceptionLogger.LogException(e); Console.ReadKey(true); Environment.Exit(1); return; } catch (InvalidOperationException e) { log.Error("Falha ao inicializar BIOS EMULADOR:" + e.Message); log.Error("Pressione qualquer tecla para desligar ..."); Console.ReadKey(true); Environment.Exit(1); return; } catch (Exception e) { log.Error("Erro fatal durante a inicialização:" + e); log.Error("Pressione uma tecla para sair"); Console.ReadKey(); Environment.Exit(1); } }
public static void Initialize() { ServerStarted = DateTime.Now; Console.ForegroundColor = ConsoleColor.DarkGreen; Console.WriteLine(); Console.WriteLine(" ____ __ ________ _____ __"); Console.WriteLine(@" / __ \/ /_ _______/ ____/ |/ / / / /"); Console.WriteLine(" / /_/ / / / / / ___/ __/ / /|_/ / / / / "); Console.WriteLine(" / ____/ / /_/ (__ ) /___/ / / / /_/ / "); Console.WriteLine(@" /_/ /_/\__,_/____/_____/_/ /_/\____/ "); Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine(" " + PrettyVersion + " <Build " + PrettyBuild + ">"); Console.WriteLine(" http://PlusIndustry.com"); Console.WriteLine(""); Console.Title = "Loading Plus Emulator"; _defaultEncoding = Encoding.Default; Console.WriteLine(""); Console.WriteLine(""); CultureInfo = CultureInfo.CreateSpecificCulture("en-GB"); try { _configuration = new ConfigurationData(Path.Combine(Application.StartupPath, @"config.ini")); var connectionString = new MySqlConnectionStringBuilder { ConnectionTimeout = 10, Database = GetConfig().data["db.name"], DefaultCommandTimeout = 30, Logging = false, MaximumPoolSize = uint.Parse(GetConfig().data["db.pool.maxsize"]), MinimumPoolSize = uint.Parse(GetConfig().data["db.pool.minsize"]), Password = GetConfig().data["db.password"], Pooling = true, Port = uint.Parse(GetConfig().data["db.port"]), Server = GetConfig().data["db.hostname"], UserID = GetConfig().data["db.username"], AllowZeroDateTime = true, ConvertZeroDateTime = true, }; _manager = new DatabaseManager(connectionString.ToString()); if (!_manager.IsConnected()) { log.Error("Failed to connect to the specified MySQL server."); Console.ReadKey(true); Environment.Exit(1); return; } log.Info("Connected to Database!"); //Reset our statistics first. using (IQueryAdapter dbClient = GetDatabaseManager().GetQueryReactor()) { dbClient.RunQuery("TRUNCATE `catalog_marketplace_data`"); dbClient.RunQuery("UPDATE `rooms` SET `users_now` = '0' WHERE `users_now` > '0';"); dbClient.RunQuery("UPDATE `users` SET `online` = '0' WHERE `online` = '1'"); dbClient.RunQuery("UPDATE `server_status` SET `users_online` = '0', `loaded_rooms` = '0'"); } //Get the configuration & Game set. _languageManager = new LanguageManager(); _languageManager.Init(); _settingsManager = new SettingsManager(); _settingsManager.Init(); _figureManager = new FigureDataManager(); _figureManager.Init(); //Have our encryption ready. HabboEncryptionV2.Initialize(new RSAKeys()); //Make sure RCON is connected before we allow clients to connect. _rcon = new RCONSocket(GetConfig().data["rcon.tcp.bindip"], int.Parse(GetConfig().data["rcon.tcp.port"]), GetConfig().data["rcon.tcp.allowedaddr"].Split(Convert.ToChar(";"))); //Accept connections. _connectionManager = new ConnectionHandling(int.Parse(GetConfig().data["game.tcp.port"]), int.Parse(GetConfig().data["game.tcp.conlimit"]), int.Parse(GetConfig().data["game.tcp.conperip"]), GetConfig().data["game.tcp.enablenagles"].ToLower() == "true"); _connectionManager.init(); _game = new Game(); _game.StartGameLoop(); TimeSpan TimeUsed = DateTime.Now - ServerStarted; Console.WriteLine(); log.Info("EMULATOR -> READY! (" + TimeUsed.Seconds + " s, " + TimeUsed.Milliseconds + " ms)"); } catch (KeyNotFoundException e) { log.Error("Please check your configuration file - some values appear to be missing."); log.Error("Press any key to shut down ..."); Console.ReadKey(true); Environment.Exit(1); return; } catch (InvalidOperationException e) { log.Error("Failed to initialize PlusEmulator: " + e.Message); log.Error("Press any key to shut down ..."); Console.ReadKey(true); Environment.Exit(1); return; } catch (Exception e) { log.Error("Fatal error during startup: " + e); log.Error("Press a key to exit"); Console.ReadKey(); Environment.Exit(1); } }
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet) { Session.SendMessage(new InitCryptoComposer(HabboEncryptionV2.GetRsaDiffieHellmanPrimeKey(), HabboEncryptionV2.GetRsaDiffieHellmanGeneratorKey())); }
public void Parse(Player player, IncomingPacket IncomingPacket) { player.SendMessage(new InitCryptoMessageComposer(HabboEncryptionV2.GetRsaDiffieHellmanPrimeKey(), HabboEncryptionV2.GetRsaDiffieHellmanGeneratorKey())); }