Beispiel #1
0
        private static void OnCtcpRequest(object sender, CtcpEventArgs e)
        {
            string from = e.Data.Nick;

            switch (e.CtcpCommand.ToUpper())
            {
            case "CLIENTINFO":
                client.SendMessage(SendType.CtcpReply, from, "CLIENTINFO Supported CTCP commands: CLIENTINFO FACTION PING VERSION");
                break;

            case "FACTION":
                if (!crcNicks.ContainsKey(from))
                {
                    crcNicks[from] = "actor_stalker";
                    client.SendMessage(SendType.CtcpRequest, from, "FACTION");
                }
                client.SendMessage(SendType.CtcpReply, from, "FACTION " + CRCOptions.GetFaction());
                break;

            case "PING":
                client.SendMessage(SendType.CtcpReply, from, "PING " + e.CtcpParameter);
                break;

            case "VERSION":
                client.SendMessage(SendType.CtcpReply, from, "VERSION Chernobyl Relay Chat " + Application.ProductVersion);
                break;
            }
        }
Beispiel #2
0
 private static void OnConnected(object sender, EventArgs e)
 {
     Users.Clear();
     crcNicks.Clear();
     lastName    = CRCOptions.Name;
     lastChannel = CRCOptions.ChannelProxy();
     lastFaction = CRCOptions.GetFaction();
     client.Login(CRCOptions.Name, CRCStrings.Localize("crc_name") + " " + Application.ProductVersion);
     client.RfcJoin(CRCOptions.ChannelProxy());
 }
Beispiel #3
0
 public static void UpdateSettings()
 {
     if (CRCOptions.Name != lastName)
     {
         client.RfcNick(CRCOptions.Name);
         lastName = CRCOptions.Name;
     }
     if (CRCOptions.ChannelProxy() != lastChannel)
     {
         Users.Clear();
         client.RfcPart(lastChannel);
         client.RfcJoin(CRCOptions.ChannelProxy());
         lastChannel = CRCOptions.ChannelProxy();
     }
     if (CRCOptions.GetFaction() != lastFaction)
     {
         foreach (string nick in crcNicks.Keys)
         {
             client.SendMessage(SendType.CtcpReply, nick, CRCOptions.GetFaction());
         }
         lastFaction = CRCOptions.GetFaction();
     }
 }
Beispiel #4
0
 public static void SendQuery(string nick, string message)
 {
     client.SendMessage(SendType.Message, nick, CRCOptions.GetFaction() + META_DELIM + message);
     CRCDisplay.OnQueryMessage(CRCOptions.Name, nick, message);
     CRCGame.OnQueryMessage(CRCOptions.Name, nick, CRCOptions.GetFaction(), message);
 }
Beispiel #5
0
        public static void SendDeath(string message)
        {
            string nick = CRCStrings.RandomName(CRCOptions.GameFaction);

            client.SendMessage(SendType.Message, CRCOptions.ChannelProxy(), nick + FAKE_DELIM + CRCOptions.GetFaction() + META_DELIM + message);
            CRCDisplay.OnChannelMessage(nick, message);
            CRCGame.OnChannelMessage(nick, CRCOptions.GameFaction, message);
        }
Beispiel #6
0
 public static void Send(string message)
 {
     client.SendMessage(SendType.Message, CRCOptions.ChannelProxy(), message);
     CRCDisplay.OnOwnChannelMessage(CRCOptions.Name, message);
     CRCGame.OnChannelMessage(CRCOptions.Name, CRCOptions.GetFaction(), message);
 }