예제 #1
0
        public override void Connect()
        {
            Networking = new ClientNetworking(); // we need this so as to create Outgoing messages :\
            server     = ServerBase.CreateReflection();

            Config config = Config.ReadFile(settingsFilename);

            if (config == null)
            {
                config = server.CreateDefaultConfig();
                config.SaveToFile(settingsFilename);
            }

            server.Start(false, config);
            SendClientInfo();
        }
예제 #2
0
        static void Main(string[] args)
        {
            ServerBase server = ServerBase.CreateReflection();

            Config config = Config.ReadFile(settingsFilename);

            if (config == null)
            {
                config = server.CreateDefaultConfig();
                config.SaveToFile(settingsFilename);
            }

            server.Start(true, config);
            while (server.IsRunning)
            {
                server.HandleCommand(Console.ReadLine());
            }
        }
예제 #3
0
        public ServerGUI()
        {
            InitializeComponent();

            TextWriter tw = new TextBoxStreamWriter(txtOutput);

            Console.SetOut(tw);
            Console.SetError(tw);

            server = ServerBase.CreateReflection();

            Config config = Config.ReadFile(settingsFilename);

            if (config == null)
            {
                config = server.CreateDefaultConfig();
                config.SaveToFile(settingsFilename);
            }

            server.Start(true, config);

            this.Text = server.Name;
        }