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; } }
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()); }
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(); } }
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); }
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); }
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); }