Exemple #1
0
        static void Main(string[] args)
        {
            ChatServer chatServer = new ChatServer();
            ChatClient client1    = new ChatClient("Alex");
            ChatClient client2    = new ChatClient("Jack", 1);
            ChatClient client3    = new ChatClient("Rose", 1);

            client1.Connect(chatServer);
            client1.SendMessage(ChatType.Global, "Hello");
            client2.Connect(chatServer);
            client2.SendMessage(ChatType.Global, "Hi~");
            client3.Connect(chatServer);
            client3.SendMessage(ChatType.Alliance, "This is Our Alliance.");
            client1.SendMessage(ChatType.Private, "Hi Rose. Nice to meet you.", client3.IpAddress);
            client2.SendMessage(ChatType.Global, "GoodBye Everyone.");
            client2.Disconnect();
            client1.SendMessage(ChatType.Global, "GoodBye Jack.");

            client1.ShowMessages();
            client2.ShowMessages();
            client3.ShowMessages();
        }
Exemple #2
0
 public AllianceChatFilter(ChatServer server)
     : base(server)
 {
     ChatType = ChatType.Alliance;
 }
Exemple #3
0
 public GlobalChatFilter(ChatServer server) : base(server)
 {
     ChatType = ChatType.Global;
 }
Exemple #4
0
 protected ChatFilter(ChatServer server)
 {
     Server     = server;
     NextFilter = null;
 }
Exemple #5
0
 public PrivateChatFilter(ChatServer server)
     : base(server)
 {
     ChatType = ChatType.Private;
 }