void Listener_OnPublic(UserInfo user, string channel, string message) { //string allowedchars = "1234567890-=qwertyuiop[]\\asdfghjkl;'zxcvbnm,./!@#$%^*()_+QWERTYUIOPASDFGHJKL:\"ZXCVBNM<>? "; // Allowed chars are any ASCII char between 20h/32 and 7Ah/122 inclusive, except for 26h/38 (&) and 60h/96 (`) for (byte i = 10; i < 16; i++) { message = message.Replace(ColorSignal + i, c.IRCtoMC(i).Replace('&', '%')); } for (byte i = 0; i < 10; i++) { message = message.Replace(ColorSignal + i, c.IRCtoMC(i).Replace('&', '%')); } message = message.MCCharFilter(); if (message.Contains("%/"))//This causes all players to crash! { return; } if (Regex.IsMatch(message, "%[^a-fA-F0-9]"))//This causes all players to crash! { return; } if (Player.MessageHasBadColorCodes(null, message)) { return; } if (Player.CapsDetection(message)) { message = message.ToLower(); } if (channel == opchannel) { Server.s.Log(String.Format("(OPs): [IRC] {0}: {1}", user.Nick, message)); Player.GlobalMessageOps(String.Format("To Ops &f-{0}[IRC] {1}&f- {2}", Server.IRCColour, user.Nick, Server.profanityFilter ? ProfanityFilter.Parse(message) : message)); } else { Server.s.Log(String.Format("[IRC] {0}: {1}", user.Nick, message)); Player.GlobalMessage(String.Format("{0}[IRC] {1}: &f{2}", Server.IRCColour, user.Nick, Server.profanityFilter ? ProfanityFilter.Parse(message) : message)); } }