/* * @author: jos / George2000 * @copyright: byteEmu, 2012 - 2013 :) © */ using System; using System.Collections.Generic; using System.Linq; using System.Text; using byteEmu.Logging; using byteEmu.Kernel.Database; using byteEmu.Kernel.SocketServer; namespace byteEmu { /// /// Creates a static instance of the emulator, containing bootup and required fields for your emulator. This class cannot be inherited. /// public static class byteEnvironment { public static bool Started = false; internal static MySQL MySql; public static void BootUp() { Out.Title = "Starting up byteEmulator.."; Out.WriteLine("Bootup", "Starting up byteEmulator for " + Environment.UserName, ConsoleColor.Green, ConsoleColor.White); MySql = new MySQL("localhost", "root", "123", "deltadb"); Listener list = new Listener(993, "127.0.0.1", 5); Out.WriteLine("Done", "Done loading byteEmu, ready for connections at game-us.habbo.com on port 993."); Out.Title = "byteEmu ready for connections."; Started = true; } } static class Decoders { public static int DecodeBit24(string v) { if ((v[0] | v[1] | v[2] | v[3]) < 0) return -1; return ((v[0] << 24) + (v[1] << 16) + (v[2] << 8) + (v[3] << 0)); } public static int DecodeBit8(string v) { if ((v[0] | v[1]) < 0) return -1; return ((v[0] << 8) + (v[1] << 0)); } public static bool ConvertEnumToBool(object Enum) { if (Enum.ToString() == "1") return true; else return false; } } }