//! Moderation and administration definitions. edition = "2023"; package collabvm.protocol.admin; option csharp_namespace = "CollabVM.Protocol.Admin"; import "vote.proto"; enum ControlCommand { /// Reboot the VM. REBOOT_VM = 0; RESET_VM = 1; /// Pause turns. PAUSE_TURNS = 2; UNPAUSE_TURNS = 3; } message AdminServerMessage { uint32 uid = 1; message StatelessResponse { bool success = 1; } message ExecuteResponse { string output = 1; } message UserInfoResponse { string ip = 1; string subject_id = 2; } oneof Resp { /// Used when we do not need to convey state to the calling user. StatelessResponse stateless_response = 2; ExecuteResponse execute_response = 3; UserInfoResponse user_info_response = 4; } } message AdminClientMessage { /// The uID/serial of this message. This is returned to the user with an AdminResponse. uint32 uid = 1; /// Kick a user. message Kick { /// The user to kick or ban. string user = 1; /// The reason for the kick. Shown to the user. string reason = 2; } /// Mute a user. message Mute { /// The user to mute. string user = 1; /// The duration of the mute in milliseconds. uint32 mute_duration = 2; } /// Unmute a user. message Unmute { /// The user to unmute. string user = 1; } message ExecuteCommand { string command = 1; } message EndTurn {} message EndUserTurn { string user = 1; } message BypassTurn {} message InfiniteTurn {} message ClearTurnQueue {} message ForceEndVote { vote.VoteKind vote_id = 1; /// Choice of vote to force. Optional; a vote can be ended /// without any choice simply by not sending this field. bool choice = 2; } message Control { /// The command to run. Later on more inputs probably ControlCommand command = 1; } /// Request information about a user. Currently, their IP address, and Subject ID if they are logged in. message UserInfo { string user = 1; } oneof Request { // execute cmds ExecuteCommand execute_command = 2; Kick kick = 3; Mute mute = 4; // turn-jacking EndTurn end_turn = 5; EndUserTurn end_user_turn = 6; BypassTurn bypass_turn = 7; InfiniteTurn infinite_turn = 8; // vote ForceEndVote force_end_vote = 9; Control control = 10; UserInfo user_info = 11; ClearTurnQueue clear_turn_queue = 12; Unmute unmute = 13; } }