string CleanupColors(string value) { // Although ClassiCube in classic mode supports invalid colours, // the original vanilla client crashes with invalid colour codes // Since it's impossible to identify which client is being used, // just remove the ampersands to be on the safe side // when text colours extension is not supported return(LineWrapper.CleanupColors(value, hasTextColors, hasTextColors)); }
static string ToIRCColors(string input) { input = Colors.Escape(input); input = LineWrapper.CleanupColors(input, true, false); StringBuilder sb = new StringBuilder(input); for (int i = 0; i < ircColors.Length; i++) { sb.Replace(ircReplacements[i], ircColors[i]); } return(sb.ToString()); }