/// <summary>
        /// extension of readline
        /// </summary>
        /// <returns>
        /// </returns>
        public static async Task <string> ReadLine(this Form f)
        {
            FConsole console = CheckFConsole(f);
            var      line    = await console.ReadLine();

            return(line);
        }
Пример #2
0
        public static void Main()
        {
            FConsole.Title = "SERVER APP";
            GlobalExceptionHandler.Setup();
            Jit.PreJit();

            Core.Db = new JsonDb();
            Core.Db.EnsureDbReady();

            ReceiveQueue.OnPacket += PacketRouter.Route;

            ServerSocket.Start(Core.Settings.Port);

            FConsole.WriteLine("Online");

            while (true)
            {
                var cmd = FConsole.ReadLine();
                switch (cmd)
                {
                case "exit":
                    Core.Db.Save();
                    Environment.Exit(0);
                    break;

                default:
                    break;
                }
            }
        }
Пример #3
0
        public static void Main()
        {
            FConsole.Title = "CLIENT APP";
            GlobalExceptionHandler.Setup();
            Jit.PreJit();

            StartupScreen.Draw();

            while (true)
            {
                DrawUI();
                //HomeScreen.Draw();
                var input = FConsole.ReadLine();

                if (input.StartsWith('/'))
                {
                    var command = input.Split(' ')[0];
                    switch (command)
                    {
                    case "/s":
                        ServerCommandHandler.Process(input);
                        break;

                    case "/c":
                        ChannelCommandHandler.Process(input);
                        break;

                    case "/dm":
                        ServerCommandHandler.Process("/s 0");
                        break;
                    }
                }
                else
                {
                    Core.MyUser.SendMessage(input);
                }
            }
        }