maxdamage99
13th January 2019, 09:46
example:
codecallback_remoteCommand(from, command, pointerMsg)
{
parseCMD = strtok(command, " ");
command = parseCMD[2];
value = parseCMD[3];
sfrom = strtok(from, ":");
ip = sfrom[0];
port = sfrom[1];
if (command == "rcon_password" || command == "killserver" || command == "quit")
return;
if ((command == "clientkick" || command == "banclient") && isDefined(value))
{
value = int(value);
if (value < 0 || value > 63)
return;
/* some */
player = getPlayerByEntityID(value);
if (isDefined(player))
player iprintlnbold("bye bye :(");
}
doRcon(from, pointerMsg);
}
https://github.com/damage99/libcod/commit/a15523897c07892138cbceb22f93138508d1ead9
thank you very much to Voron00 (https://github.com/voron00/libcod) for help!
codecallback_remoteCommand(from, command, pointerMsg)
{
parseCMD = strtok(command, " ");
command = parseCMD[2];
value = parseCMD[3];
sfrom = strtok(from, ":");
ip = sfrom[0];
port = sfrom[1];
if (command == "rcon_password" || command == "killserver" || command == "quit")
return;
if ((command == "clientkick" || command == "banclient") && isDefined(value))
{
value = int(value);
if (value < 0 || value > 63)
return;
/* some */
player = getPlayerByEntityID(value);
if (isDefined(player))
player iprintlnbold("bye bye :(");
}
doRcon(from, pointerMsg);
}
https://github.com/damage99/libcod/commit/a15523897c07892138cbceb22f93138508d1ead9
thank you very much to Voron00 (https://github.com/voron00/libcod) for help!