示例#1
0
        static void Main(string[] args)
        {
            ChatroomSettings settings = new ChatroomSettings();

            //TODO:Add parameters to set settings

            StartChatRoomServer(settings);
        }
        public ChatroomServerProtocolFactory(ChatroomSettings settings, params IChatroomServerPlugin[] plugins)
        {
            _settings = settings;

            LoadDefaultPlugins();

            _plugins.AddRange(plugins);

            _clients = new ClientCache();
        }
示例#3
0
        private static void StartChatRoomServer(ChatroomSettings settings)
        {
            ServiceHost host = new ServiceHost();

            host.AddService(new ChatroomService(settings));

            host.StartServiceHost();
            host.OpenServices();

            Console.WriteLine("Type \"quit\" to shut down server");

            string input = null;

            do
            {
                input = Console.ReadLine();
                Console.WriteLine(input);
                //TODO: Implement Console Commands
            }
            while (input != "quit");

            host.CloseServices();
            host.StopServiceHost();
        }
示例#4
0
 public ChatroomService(ChatroomSettings settings, params IChatroomServerPlugin[] plugins)
 {
     _settings = settings;
     _plugins = plugins;
 }