mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
server shutdown function
This commit is contained in:
parent
5e3db65846
commit
a4c3d48389
33 changed files with 1410 additions and 604 deletions
|
|
@ -142,6 +142,17 @@ ResponseCode Server_ProtocolHandler::processCommandHelper(Command *command, Comm
|
|||
default: return RespInvalidCommand;
|
||||
}
|
||||
}
|
||||
ModeratorCommand *moderatorCommand = qobject_cast<ModeratorCommand *>(command);
|
||||
if (moderatorCommand) {
|
||||
qDebug() << "received ModeratorCommand";
|
||||
if (!(userInfo->getUserLevel() & ServerInfo_User::IsModerator))
|
||||
return RespLoginNeeded;
|
||||
|
||||
switch (command->getItemId()) {
|
||||
case ItemId_Command_BanFromServer: return cmdBanFromServer(static_cast<Command_BanFromServer *>(command), cont);
|
||||
default: return RespInvalidCommand;
|
||||
}
|
||||
}
|
||||
AdminCommand *adminCommand = qobject_cast<AdminCommand *>(command);
|
||||
if (adminCommand) {
|
||||
qDebug() << "received AdminCommand";
|
||||
|
|
@ -149,8 +160,8 @@ ResponseCode Server_ProtocolHandler::processCommandHelper(Command *command, Comm
|
|||
return RespLoginNeeded;
|
||||
|
||||
switch (command->getItemId()) {
|
||||
case ItemId_Command_ShutdownServer: return cmdShutdownServer(static_cast<Command_ShutdownServer *>(command), cont);
|
||||
case ItemId_Command_UpdateServerMessage: return cmdUpdateServerMessage(static_cast<Command_UpdateServerMessage *>(command), cont);
|
||||
case ItemId_Command_BanFromServer: return cmdBanFromServer(static_cast<Command_BanFromServer *>(command), cont);
|
||||
default: return RespInvalidCommand;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue