Server Chat Logging
devicenull
Join Date: 2003-04-30 Member: 15967Members, NS2 Playtester, Squad Five Blue
in Modding
I came up with the following to log all player chat to the server log, so you can actually see wtf players are saying.
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->diff --git a/ConsoleCommands_Server.lua b/ConsoleCommands_Server.lua
index 405bb3d..59ef6fb 100644
--- a/ConsoleCommands_Server.lua
+++ b/ConsoleCommands_Server.lua
@@ -47,7 +47,7 @@ function OnCommandSay(client, chatMessage)
local command = string.format("chat 0 %s %d %s", EncodeStringForNetwork(player:GetName()), player:GetTeamNumber(), chatMessage)
Server.SendCommand(nil, command)
-
+ Print(string.format("%s: %s",player:GetName(),chatMessage))
end
end
@@ -72,6 +72,7 @@ function OnCommandTeamSay(client, chatMessage)
for index, player in ipairs(players) do
Server.SendCommand(player, command)
end
+ Print(string.format("(team) %s: %s",player:GetName(),chatMessage))
end<!--c2--></div><!--ec2-->
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->diff --git a/ConsoleCommands_Server.lua b/ConsoleCommands_Server.lua
index 405bb3d..59ef6fb 100644
--- a/ConsoleCommands_Server.lua
+++ b/ConsoleCommands_Server.lua
@@ -47,7 +47,7 @@ function OnCommandSay(client, chatMessage)
local command = string.format("chat 0 %s %d %s", EncodeStringForNetwork(player:GetName()), player:GetTeamNumber(), chatMessage)
Server.SendCommand(nil, command)
-
+ Print(string.format("%s: %s",player:GetName(),chatMessage))
end
end
@@ -72,6 +72,7 @@ function OnCommandTeamSay(client, chatMessage)
for index, player in ipairs(players) do
Server.SendCommand(player, command)
end
+ Print(string.format("(team) %s: %s",player:GetName(),chatMessage))
end<!--c2--></div><!--ec2-->
Comments