add color code mapping for CSGO

This commit is contained in:
RaidMax 2021-11-26 20:49:58 -06:00
parent 17c9944eef
commit e739c91b52
3 changed files with 42 additions and 4 deletions

View File

@ -57,6 +57,25 @@ const plugin = {
rconParser.Configuration.OverrideDvarNameMapping.Add('fs_game', 'game_mode'); rconParser.Configuration.OverrideDvarNameMapping.Add('fs_game', 'game_mode');
rconParser.Configuration.OverrideDvarNameMapping.Add('g_password', 'sv_password'); rconParser.Configuration.OverrideDvarNameMapping.Add('g_password', 'sv_password');
rconParser.Configuration.ColorCodeMapping.Clear();
rconParser.Configuration.ColorCodeMapping.Add('White', '\x01');
rconParser.Configuration.ColorCodeMapping.Add('Red', '\x07');
rconParser.Configuration.ColorCodeMapping.Add('LightRed', '\x0F');
rconParser.Configuration.ColorCodeMapping.Add('DarkRed', '\x02');
rconParser.Configuration.ColorCodeMapping.Add('Blue', '\x0B');
rconParser.Configuration.ColorCodeMapping.Add('DarkBlue', '\x0C');
rconParser.Configuration.ColorCodeMapping.Add('Purple', '\x03');
rconParser.Configuration.ColorCodeMapping.Add('Orchid', '\x0E');
rconParser.Configuration.ColorCodeMapping.Add('Yellow', '\x09');
rconParser.Configuration.ColorCodeMapping.Add('Gold', '\x10');
rconParser.Configuration.ColorCodeMapping.Add('LightGreen', '\x05');
rconParser.Configuration.ColorCodeMapping.Add('Green', '\x04');
rconParser.Configuration.ColorCodeMapping.Add('Lime', '\x06');
rconParser.Configuration.ColorCodeMapping.Add('Grey', '\x08');
rconParser.Configuration.ColorCodeMapping.Add('Grey2', '\x0D');
// only adding there here for the default accent color
rconParser.Configuration.ColorCodeMapping.Add('Cyan', '\x0B');
rconParser.Configuration.NoticeLineSeparator = '. '; rconParser.Configuration.NoticeLineSeparator = '. ';
rconParser.Configuration.DefaultRConPort = 27015; rconParser.Configuration.DefaultRConPort = 27015;
rconParser.CanGenerateLogPath = false; rconParser.CanGenerateLogPath = false;

View File

@ -3,7 +3,7 @@ let eventParser;
const plugin = { const plugin = {
author: 'RaidMax', author: 'RaidMax',
version: 0.4, version: 0.5,
name: 'CS:GO (SourceMod) Parser', name: 'CS:GO (SourceMod) Parser',
engine: 'Source', engine: 'Source',
isParser: true, isParser: true,
@ -57,6 +57,25 @@ const plugin = {
rconParser.Configuration.OverrideDvarNameMapping.Add('fs_game', 'game_mode'); rconParser.Configuration.OverrideDvarNameMapping.Add('fs_game', 'game_mode');
rconParser.Configuration.OverrideDvarNameMapping.Add('g_password', 'sv_password'); rconParser.Configuration.OverrideDvarNameMapping.Add('g_password', 'sv_password');
rconParser.Configuration.ColorCodeMapping.Clear();
rconParser.Configuration.ColorCodeMapping.Add('White', '\x01');
rconParser.Configuration.ColorCodeMapping.Add('Red', '\x07');
rconParser.Configuration.ColorCodeMapping.Add('LightRed', '\x0F');
rconParser.Configuration.ColorCodeMapping.Add('DarkRed', '\x02');
rconParser.Configuration.ColorCodeMapping.Add('Blue', '\x0B');
rconParser.Configuration.ColorCodeMapping.Add('DarkBlue', '\x0C');
rconParser.Configuration.ColorCodeMapping.Add('Purple', '\x03');
rconParser.Configuration.ColorCodeMapping.Add('Orchid', '\x0E');
rconParser.Configuration.ColorCodeMapping.Add('Yellow', '\x09');
rconParser.Configuration.ColorCodeMapping.Add('Gold', '\x10');
rconParser.Configuration.ColorCodeMapping.Add('LightGreen', '\x05');
rconParser.Configuration.ColorCodeMapping.Add('Green', '\x04');
rconParser.Configuration.ColorCodeMapping.Add('Lime', '\x06');
rconParser.Configuration.ColorCodeMapping.Add('Grey', '\x08');
rconParser.Configuration.ColorCodeMapping.Add('Grey2', '\x0D');
// only adding there here for the default accent color
rconParser.Configuration.ColorCodeMapping.Add('Cyan', '\x0B');
rconParser.Configuration.NoticeLineSeparator = '. '; rconParser.Configuration.NoticeLineSeparator = '. ';
rconParser.Configuration.DefaultRConPort = 27015; rconParser.Configuration.DefaultRConPort = 27015;
rconParser.CanGenerateLogPath = false; rconParser.CanGenerateLogPath = false;

View File

@ -61,7 +61,7 @@ namespace IW4MAdmin.Plugins.Stats.Commands
var performanceRanking = await Plugin.Manager.GetClientOverallRanking(E.Target.ClientId, serverId); var performanceRanking = await Plugin.Manager.GetClientOverallRanking(E.Target.ClientId, serverId);
var performanceRankingString = performanceRanking == 0 var performanceRankingString = performanceRanking == 0
? _translationLookup["WEBFRONT_STATS_INDEX_UNRANKED"] ? _translationLookup["WEBFRONT_STATS_INDEX_UNRANKED"]
: $"{_translationLookup["WEBFRONT_STATS_INDEX_RANKED"]} #{performanceRanking}/{totalRankedPlayers}"; : $"{_translationLookup["WEBFRONT_STATS_INDEX_RANKED"]} (Color::Accent)#{performanceRanking}/{totalRankedPlayers}";
// target is currently connected so we want their cached stats if they exist // target is currently connected so we want their cached stats if they exist
if (E.Owner.GetClientsAsList().Any(client => client.Equals(E.Target))) if (E.Owner.GetClientsAsList().Any(client => client.Equals(E.Target)))
@ -90,7 +90,7 @@ namespace IW4MAdmin.Plugins.Stats.Commands
var performanceRanking = await Plugin.Manager.GetClientOverallRanking(E.Origin.ClientId, serverId); var performanceRanking = await Plugin.Manager.GetClientOverallRanking(E.Origin.ClientId, serverId);
var performanceRankingString = performanceRanking == 0 var performanceRankingString = performanceRanking == 0
? _translationLookup["WEBFRONT_STATS_INDEX_UNRANKED"] ? _translationLookup["WEBFRONT_STATS_INDEX_UNRANKED"]
: $"{_translationLookup["WEBFRONT_STATS_INDEX_RANKED"]} #{performanceRanking}/{totalRankedPlayers}"; : $"{_translationLookup["WEBFRONT_STATS_INDEX_RANKED"]} (Color::Accent)#{performanceRanking}/{totalRankedPlayers}";
// check if current client is connected to the server // check if current client is connected to the server
if (E.Owner.GetClientsAsList().Any(client => client.Equals(E.Origin))) if (E.Owner.GetClientsAsList().Any(client => client.Equals(E.Origin)))