public static void InitializeNetwork() { Console.WriteLine("Initing Packets..."); ServerHandleData.InitializePackets(); serverSocket.Start(); serverSocket.BeginAcceptTcpClient(new AsyncCallback(OnClientConnect), null); }
public static void InitializeServer() { var startTime = GetTickCount(); Cnsl.Info("Initializing Server", true); //Intializing all game data arrays Cnsl.Debug("Initializing Game Arrays", true); for (var i = 0; i < Constants.MAX_PLAYERS; i++) { ServerTcp.Client[i] = new Clients(); } Cnsl.Finalize("Initializing Game Arrays"); //Start the Networking Cnsl.Debug("Initializing Network", true); Cnsl.Debug("Initializing Status Listener", true); ServerHandleData.InitializePackets(); ServerTcp.InitializeNetwork(); ServerTcp.InitializeStatusListener(); //Load database items LoadData(); var endTime = GetTickCount(); Cnsl.Info(@"Initialization complete. Server loaded in " + (endTime - startTime) + " ms."); Cnsl.Banner(" Server has started successfully \n @ " + DateTime.UtcNow + " UTC"); Globals.Initialized = true; Cnsl.Finalize("Initializing Server"); }