static void Main(string[] args) { Log.Init("proxy"); waiting = new List <Connection>(); Log.Trace("Main", "Connecting to Database"); if (Database.Database.Init() == false) { while (true) { Thread.Sleep(1); } } Log.Debug("Main", "Connected to database sucesfull"); Log.Trace("Main", "Reseting Solar Systems' status"); Log.Trace("Main", "Starting listener on port 26000"); listener = new TCPSocket(26000, false); if (listener.Listen(int.MaxValue) == false) { Log.Error("Main", "Cannot listen on port 26000"); while (true) { ; } } Log.Debug("Main", "Listening on port 26000"); LoginQueue.Start(); // Add two nodes to the NodeManager NodeManager.AddNode(null); NodeManager.AddNode(null); while (true) { Thread.Sleep(1); TCPSocket con = listener.Accept(); if (con != null) { Connection tmp = new Connection(con); tmp.Start(); waiting.Add(tmp); } } }
static void Main(string[] args) { Log.Init("cluster", Log.LogLevel.All); Log.Info("Cluster", "Starting GameCluster"); Log.Info("Cluster", "Loading database.conf file"); string[] lines = File.ReadAllLines("database.conf"); Database.Database.Username = lines[0]; Database.Database.Password = lines[1]; Database.Database.Host = lines[2]; Database.Database.DB = lines[3]; if (Database.Database.Init() == false) { Log.Error("Cluster", "Cannot connect to database"); while (true) { Thread.Sleep(1); } } Log.Debug("Cluster", "Connected to database"); if (socket.Listen(1) == false) { Log.Error("Cluster", "Cannot listen on port 26000"); while (true) { Thread.Sleep(1); } } // set max_allowed_packet value to 1GB Database.Database.Query("SET global max_allowed_packet=1073741824"); Log.Debug("Cluster", "Listening on port 26000"); // Begin accept socket.Socket.BeginAccept(acceptAsync, socket); // Start the login queue LoginQueue.Start(); while (true) { // Timers or whatever here? Or maybe async calls with timers? Pretty much that will help Thread.Sleep(1); } }
static void Main(string[] args) { Log.Init("packet-editor"); Log.Info("Main", "Starting listening socket"); socket = new TCPSocket(26000, false); if (socket.Listen(5) == false) { Log.Error("Main", "Cannot start listening socket on port 26000."); Log.Info("Main", "You should have your EVEmu server working on port 25999"); Log.Info("Main", "and port 26000 free of any server."); while (true) { Thread.Sleep(1); } } Log.Info("Main", "Listening socket started succesful"); while (true) { Thread.Sleep(1); while (clientList.Count > 0) { Thread.Sleep(10); } TCPSocket client = socket.Accept(); if (client != null) { clientList.Add(new Client.Client(client)); Log.Debug("Main", "Incoming connection, waiting until it finishes"); } } }
static void Main(string[] args) { Log.Init("cluster", Log.LogLevel.All); Log.Info("Cluster", "Starting GameCluster"); if (socket.Listen(1)) { Log.Error("Cluster", "Cannot listen on port 5000"); while (true) { Thread.Sleep(1); } } // Begin accept socket.Socket.BeginAccept(acceptAsync, socket); while (true) { Thread.Sleep(1); } }