Added the ability or moderation staff to request user ban history

This commit is contained in:
woogerboy21 2015-08-30 18:02:28 -04:00
parent 3bc61eb2e9
commit 90cb890cc2
17 changed files with 140 additions and 4 deletions

View file

@ -16,6 +16,7 @@ void FeatureSet::initalizeFeatureList(QMap<QString, bool> &featureList){
featureList.insert("client_id", false);
featureList.insert("client_ver", false);
featureList.insert("feature_set", false);
featureList.insert("user_ban_history", false);
}
void FeatureSet::enableRequiredFeature(QMap<QString, bool> &featureList, QString featureName){

View file

@ -116,6 +116,7 @@ SET(PROTO_FILES
moderator_commands.proto
move_card_to_zone.proto
response_activate.proto
response_ban_history.proto
response_deck_download.proto
response_deck_list.proto
response_deck_upload.proto
@ -133,6 +134,7 @@ SET(PROTO_FILES
room_commands.proto
room_event.proto
serverinfo_arrow.proto
serverinfo_ban.proto
serverinfo_cardcounter.proto
serverinfo_card.proto
serverinfo_counter.proto

View file

@ -2,6 +2,7 @@ syntax = "proto2";
message ModeratorCommand {
enum ModeratorCommandType {
BAN_FROM_SERVER = 1000;
BAN_HISTORY = 1001;
}
extensions 100 to max;
}
@ -17,3 +18,10 @@ message Command_BanFromServer {
optional string visible_reason = 5;
optional string clientid = 6;
}
message Command_GetBanHistory {
extend ModeratorCommand {
optional Command_GetBanHistory ext = 1001;
}
optional string user_name = 1;
}

View file

@ -52,6 +52,7 @@ message Response {
REGISTER = 1009;
ACTIVATE = 1010;
ADJUST_MOD = 1011;
BAN_HISTORY = 1012;
REPLAY_LIST = 1100;
REPLAY_DOWNLOAD = 1101;
}

View file

@ -0,0 +1,10 @@
syntax = "proto2";
import "response.proto";
import "serverinfo_ban.proto";
message Response_BanHistory{
extend Response {
optional Response_BanHistory ext = 1012;
}
repeated ServerInfo_Ban ban_list = 1;
}

View file

@ -0,0 +1,12 @@
syntax = "proto2";
/*
* Historical ban information stored in the ban table
*/
message ServerInfo_Ban {
required string admin_id = 1; // id of the staff member placing the ban
required string admin_name = 2; // name of the staff member placing the ban
required string ban_time = 3; // start time of the ban
required string ban_length = 4; // amount of time in minutes the ban is for
optional string ban_reason = 5; // reason seen only by moderation staff
optional string visible_reason = 6; // reason shown to the user
}

View file

@ -40,6 +40,7 @@
Server::Server(bool _threaded, QObject *parent)
: QObject(parent), threaded(_threaded), nextLocalGameId(0)
{
qRegisterMetaType<ServerInfo_Ban>("ServerInfo_Ban");
qRegisterMetaType<ServerInfo_Game>("ServerInfo_Game");
qRegisterMetaType<ServerInfo_Room>("ServerInfo_Room");
qRegisterMetaType<ServerInfo_User>("ServerInfo_User");

View file

@ -9,6 +9,7 @@
#include <QReadWriteLock>
#include "pb/commands.pb.h"
#include "pb/serverinfo_user.pb.h"
#include "pb/serverinfo_ban.pb.h"
#include "server_player_reference.h"
class Server_DatabaseInterface;

View file

@ -3,6 +3,7 @@
#include <QMetaType>
#include "pb/serverinfo_ban.pb.h"
#include "pb/serverinfo_user.pb.h"
#include "pb/serverinfo_room.pb.h"
#include "pb/serverinfo_game.pb.h"
@ -12,6 +13,7 @@
#include "pb/isl_message.pb.h"
#include "pb/room_commands.pb.h"
Q_DECLARE_METATYPE(ServerInfo_Ban)
Q_DECLARE_METATYPE(ServerInfo_User)
Q_DECLARE_METATYPE(ServerInfo_Room)
Q_DECLARE_METATYPE(ServerInfo_Game)