static void Main(string[] args) { Console.Title = "Flucky Server 1.0"; consoleUI console = new consoleUI(); console.consoleW("Firin' up the server!", "info"); console.consoleW("Connecting to MySql (root@localhost)...", "progress"); IPAddress ipAdresse = IPAddress.Any; Server server = new Server(ipAdresse, 23); Database myDatabase = new Database(server); string dbStatus = myDatabase.connect("localhost", "game", "", "game"); if (dbStatus != "ok") { console.consoleW("MySql Error: " + dbStatus, "error"); while (true) ; } console.consoleW("Successfully connected to MySql!", "success"); Thread tcpHandlerThread = new Thread(server.wait); tcpHandlerThread.Start(); consoleHandler consoleHandler = new Flucky_Server.consoleHandler(server); Thread consoleHandlerThread = new Thread(consoleHandler.start); consoleHandlerThread.Start(); console.consoleW("Finished!", "success"); while (true) ; }
public Client(Server _server, Socket getSocket, int id) { server = _server; socket = getSocket; console = new consoleUI(); ClientID = id; UTF8Encoding encoding = new UTF8Encoding(); socket.Send(encoding.GetBytes("Sie sind nun in guten Hands!")); }
public consoleHandler(Server _server) { console = new consoleUI(); server = _server; }
public Database(Server _server) { server = _server; }