What it is is a command to report a player and it will store who used the command, who was reported and the reason in a handy little database for gm's to use later.
Personally I plan to use it (or a cleaned up version) to allow moderators to report problems or hackers for when a gm is not online. It's not perfect as it is but it works.
Note: this version is CoEmu but really... it's not hard at all to convert.
Handlers>Chat.cs
Notice you will have some undefined strings. Go up to the top of the file and see string[] Command = Message.Substring(1).Split(' ');
Place these two under that
string Command1 = Message.Substring(1);
string Result = "";
That's just what I used for clearing out the initial part of the msg so that you could write more than 1 word reasons for reporting a player. Simple but somewhat messy fix.
Now Database>Database.cs
PHP Code:
public static void ReportPlayer(ClientSocket CSocket, ClientSocket RSocket, string Report1)
{
lock (DatabaseConnection.NewConnection())
{
MySqlCommand Cmd = new MySqlCommand("insert into `Report`(`WhoReport`, `WhoReported`, `Report`) values ('" + CSocket.Client.Name + "', '" + RSocket.Client.Name + "', '" + Report1 + "')", DatabaseConnection.NewConnection());
Cmd.ExecuteNonQuery();
}
}
And for the database itself. Open up navicat and create a new database.
Mine is called "Report" with the following fields
ReportUID, int, 11, 0 notnull, key, auto incrimented
WhoReport, varchar, 20, 0, notnull
WhoReported, varchar, 20, 0, notnull
Report, varchar, 200, 0, notnull
That should be all you need, you will wanna add a bool under Characters.cs for "isHH", that's the new moderator position I am adding for players with improved server rights (such as reporting, don't want noobs spamming up the log)
You can also use this type of a thing to log server events such as errors for later reference.... but that's a different thing and I'm super tired so yah.
Enjoy,
Pro4never