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(); }
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(); }
public ChatroomService(ChatroomSettings settings, params IChatroomServerPlugin[] plugins) { _settings = settings; _plugins = plugins; }