mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-19 13:23:55 -07:00
Added official warning messages moderators can use to inform users
This commit is contained in:
parent
1409b97490
commit
6ad2a59367
23 changed files with 429 additions and 7 deletions
|
|
@ -12,12 +12,13 @@ QMap<QString, bool> FeatureSet::getDefaultFeatureList() {
|
|||
return featureList;
|
||||
}
|
||||
|
||||
void FeatureSet::initalizeFeatureList(QMap<QString, bool> &featureList){
|
||||
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);
|
||||
featureList.insert("room_chat_history", false);
|
||||
featureList.insert("client_warnings", false);
|
||||
}
|
||||
|
||||
void FeatureSet::enableRequiredFeature(QMap<QString, bool> &featureList, QString featureName){
|
||||
|
|
|
|||
|
|
@ -130,6 +130,8 @@ SET(PROTO_FILES
|
|||
response_replay_download.proto
|
||||
response_replay_list.proto
|
||||
response_adjust_mod.proto
|
||||
response_warn_history.proto
|
||||
response_warn_list.proto
|
||||
response.proto
|
||||
room_commands.proto
|
||||
room_event.proto
|
||||
|
|
@ -149,6 +151,7 @@ SET(PROTO_FILES
|
|||
serverinfo_replay_match.proto
|
||||
serverinfo_room.proto
|
||||
serverinfo_user.proto
|
||||
serverinfo_warning.proto
|
||||
serverinfo_zone.proto
|
||||
server_message.proto
|
||||
session_commands.proto
|
||||
|
|
|
|||
|
|
@ -5,11 +5,13 @@ message Event_NotifyUser {
|
|||
|
||||
enum NotificationType {
|
||||
PROMOTED = 1;
|
||||
WARNING = 2;
|
||||
}
|
||||
|
||||
extend SessionEvent {
|
||||
optional Event_NotifyUser ext = 1010;
|
||||
}
|
||||
optional NotificationType type = 1;
|
||||
optional string warning_reason = 2;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,9 @@ message ModeratorCommand {
|
|||
enum ModeratorCommandType {
|
||||
BAN_FROM_SERVER = 1000;
|
||||
BAN_HISTORY = 1001;
|
||||
WARN_USER = 1002;
|
||||
WARN_HISTORY = 1003;
|
||||
WARN_LIST = 1004;
|
||||
}
|
||||
extensions 100 to max;
|
||||
}
|
||||
|
|
@ -24,4 +27,30 @@ message Command_GetBanHistory {
|
|||
optional Command_GetBanHistory ext = 1001;
|
||||
}
|
||||
optional string user_name = 1;
|
||||
}
|
||||
|
||||
message Command_WarnUser {
|
||||
extend ModeratorCommand {
|
||||
optional Command_WarnUser ext = 1002;
|
||||
}
|
||||
|
||||
optional string user_name = 1;
|
||||
optional string reason = 2;
|
||||
optional string clientid = 3;
|
||||
}
|
||||
|
||||
message Command_GetWarnHistory {
|
||||
extend ModeratorCommand {
|
||||
optional Command_GetWarnHistory ext = 1003;
|
||||
}
|
||||
optional string user_name = 1;
|
||||
}
|
||||
|
||||
message Command_GetWarnList {
|
||||
extend ModeratorCommand {
|
||||
optional Command_GetWarnList ext = 1004;
|
||||
}
|
||||
optional string mod_name = 1;
|
||||
optional string user_name = 2;
|
||||
optional string user_clientid = 3;
|
||||
}
|
||||
|
|
@ -53,6 +53,8 @@ message Response {
|
|||
ACTIVATE = 1010;
|
||||
ADJUST_MOD = 1011;
|
||||
BAN_HISTORY = 1012;
|
||||
WARN_HISTORY = 1013;
|
||||
WARN_LIST = 1014;
|
||||
REPLAY_LIST = 1100;
|
||||
REPLAY_DOWNLOAD = 1101;
|
||||
}
|
||||
|
|
|
|||
10
common/pb/response_warn_history.proto
Normal file
10
common/pb/response_warn_history.proto
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
syntax = "proto2";
|
||||
import "response.proto";
|
||||
import "serverinfo_warning.proto";
|
||||
|
||||
message Response_WarnHistory{
|
||||
extend Response {
|
||||
optional Response_WarnHistory ext = 1013;
|
||||
}
|
||||
repeated ServerInfo_Warning warn_list = 1;
|
||||
}
|
||||
11
common/pb/response_warn_list.proto
Normal file
11
common/pb/response_warn_list.proto
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
syntax = "proto2";
|
||||
import "response.proto";
|
||||
|
||||
message Response_WarnList{
|
||||
extend Response {
|
||||
optional Response_WarnList ext = 1014;
|
||||
}
|
||||
repeated string warning = 1;
|
||||
optional string user_name = 2;
|
||||
optional string user_clientid = 3;
|
||||
}
|
||||
10
common/pb/serverinfo_warning.proto
Normal file
10
common/pb/serverinfo_warning.proto
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
syntax = "proto2";
|
||||
/*
|
||||
* Historical warning information stored in the warnings table
|
||||
*/
|
||||
message ServerInfo_Warning {
|
||||
optional string user_name = 1; // name of user being warned
|
||||
optional string admin_name = 2; // name of the moderator making the warning
|
||||
optional string reason = 3; // type of warning being placed
|
||||
optional string time_of = 4; // time of warning
|
||||
}
|
||||
|
|
@ -629,4 +629,4 @@ void Server::sendIsl_RoomCommand(const CommandContainer &item, int serverId, qin
|
|||
cont->set_room_id(roomId);
|
||||
|
||||
emit sigSendIslMessage(msg, serverId);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
#include "pb/commands.pb.h"
|
||||
#include "pb/serverinfo_user.pb.h"
|
||||
#include "pb/serverinfo_ban.pb.h"
|
||||
#include "pb/serverinfo_warning.pb.h"
|
||||
#include "server_player_reference.h"
|
||||
|
||||
class Server_DatabaseInterface;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue