Allows moderators to promote users to mod and demote mod to user

This commit is contained in:
woogerboy21 2015-08-16 15:09:02 -04:00
parent b2ab2c6eba
commit 39fcabe921
15 changed files with 169 additions and 4 deletions

View file

@ -106,6 +106,7 @@ SET(PROTO_FILES
event_user_joined.proto
event_user_left.proto
event_user_message.proto
event_notify_user.proto
game_commands.proto
game_event_container.proto
game_event_context.proto
@ -127,6 +128,7 @@ SET(PROTO_FILES
response_register.proto
response_replay_download.proto
response_replay_list.proto
response_adjust_mod.proto
response.proto
room_commands.proto
room_event.proto

View file

@ -3,6 +3,7 @@ message AdminCommand {
UPDATE_SERVER_MESSAGE = 1000;
SHUTDOWN_SERVER = 1001;
RELOAD_CONFIG = 1002;
ADJUST_MOD = 1003;
}
extensions 100 to max;
}
@ -26,3 +27,12 @@ message Command_ReloadConfig {
optional Command_ReloadConfig ext = 1002;
}
}
message Command_AdjustMod {
extend AdminCommand {
optional Command_AdjustMod ext = 1003;
}
required string user_name = 1;
required bool should_be_mod = 2;
}

View file

@ -11,6 +11,7 @@ message Event_ConnectionClosed {
BANNED = 4;
USERNAMEINVALID = 5;
USER_LIMIT_REACHED = 6;
DEMOTED = 7;
}
optional CloseReason reason = 1;
optional string reason_str = 2;

View file

@ -0,0 +1,14 @@
import "session_event.proto";
message Event_NotifyUser {
enum NotificationType {
PROMOTED = 1;
}
extend SessionEvent {
optional Event_NotifyUser ext = 1010;
}
optional NotificationType type = 1;
}

View file

@ -49,6 +49,7 @@ message Response {
DECK_UPLOAD = 1008;
REGISTER = 1009;
ACTIVATE = 1010;
ADJUST_MOD = 1011;
REPLAY_LIST = 1100;
REPLAY_DOWNLOAD = 1101;
}

View file

@ -0,0 +1,7 @@
import "response.proto";
message Response_AdjustMod{
extend Response {
optional Response_AdjustMod ext = 1011;
}
}

View file

@ -12,6 +12,7 @@ message SessionEvent {
USER_JOINED = 1007;
USER_LEFT = 1008;
GAME_JOINED = 1009;
NOTIFY_USER = 1010;
REPLAY_ADDED = 1100;
}
extensions 100 to max;