Exemplo n.º 1
0
        public override void OnDataReceived(GNIData data, uint source)
        {
            switch (data.keyString)
            {
            case "message":
                Message("[" + DateTime.Now.ToString() + "] <" + GetClient(source).name + "> " + data.valueString);
                break;

            case "nick":
                string oldname = "";
                for (int i = 0; i < clients.Count; i++)
                {
                    if (clients[i].clientID == source)
                    {
                        GNIClientInformation client = clients[i];
                        oldname     = client.name;
                        client.name = data.valueString;
                        clients[i]  = client;
                    }
                }
                if (oldname != "")
                {
                    SMessage(oldname + " has changed nick to " + data.valueString);
                }
                break;
            }
        }
Exemplo n.º 2
0
 public override void OnClientConnected(GNIClientInformation client)
 {
     Console.WriteLine("Client connected: " + client.clientID);
 }
Exemplo n.º 3
0
 public override void OnClientDisconnected(GNIClientInformation client)
 {
     SMessage(client.name + " has left.");
 }
Exemplo n.º 4
0
 public override void OnClientConnected(GNIClientInformation client)
 {
     SMessage(client.name + " has joined. " + clients.Count + " people online.");
 }