예제 #1
0
        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) ;
        }
예제 #2
0
파일: Client.cs 프로젝트: freddeyyy/mmotest
 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!"));
 }
예제 #3
0
 public consoleHandler(Server _server)
 {
     console = new consoleUI();
     server = _server;
 }
예제 #4
0
 public Database(Server _server)
 {
     server = _server;
 }