SimTX API/Packets/IpModerationRequest: Difference between revisions
Appearance
Clanker moved page SimTX API/Packets/IpModerationRequest to SimTX API v24/Packets/IpModerationRequest: Archive the v24 protocol reference Tag: New redirect |
Remove development history and server internals |
||
| (One intermediate revision by the same user not shown) | |||
| Line 1: | Line 1: | ||
# | {{SimTX API navigation}} | ||
{{SimTX packet | |||
| name = IpModerationRequest | |||
| frame = ClientFrame | |||
| field = 61 | |||
| member = ip_moderation | |||
| direction = c2s | |||
| session = [[SimTX API/Moderation session|Moderation]] | |||
| roles = <code>ROLE_MODERATION</code>. | |||
| permission = <code>moderation.manage</code> | |||
| reply = [[SimTX API/Packets/IpModerationResult|IpModerationResult]] or [[SimTX API/Packets/Error|Error]] | |||
| group = moderation | |||
| file = control.proto | |||
}} | |||
'''IpModerationRequest''' bans or unbans a client address. | |||
== Definition == | |||
<syntaxhighlight lang="protobuf"> | |||
message IpModerationRequest { | |||
int64 request_id = 1; | |||
IpModerationAction action = 2; | |||
string target = 3; | |||
string reason = 4; | |||
int64 duration_seconds = 5; | |||
} | |||
</syntaxhighlight> | |||
== Fields == | |||
{| class="wikitable" | |||
! # !! Field !! Type !! Description | |||
|- | |||
| 1 || <code>request_id</code> || <code>int64</code> || Nonzero; echoed in the [[SimTX API/Packets/IpModerationResult|IpModerationResult]] or [[SimTX API/Packets/Error|Error]]. | |||
|- | |||
| 2 || <code>action</code> || [[SimTX API/Data types#IpModerationAction|IpModerationAction]] || <code>IP_MODERATION_ACTION_BAN</code> or <code>IP_MODERATION_ACTION_UNBAN</code>. Required. | |||
|- | |||
| 3 || <code>target</code> || <code>string</code> || An IP address, or the callsign of a connected session whose address should be used. | |||
|- | |||
| 4 || <code>reason</code> || <code>string</code> || Reason, shown to the banned user. | |||
|- | |||
| 5 || <code>duration_seconds</code> || <code>int64</code> || Ban duration. 0 = permanent. At most 3,650 days; not negative. | |||
|} | |||
== Effects == | |||
A ban disconnects the address's receiver and transmitter sessions, sends a <code>BANNER_LEVEL_BAN_NOTICE</code> [[SimTX API/Packets/Banner|Banner]] to its control sessions, and refuses new game connections from it with <code>HELLO_STATUS_IP_BANNED</code>. Unbanning an address that is not banned is answered with [[SimTX API/Packets/Error|Error]] <code>NOT_FOUND</code>; an invalid target or duration with <code>INVALID_REQUEST</code>. | |||
== Example == | |||
Complete frames, including the varint length prefix. | |||
'''<code>ip_moderation_ban</code>''' (client to server, 30 bytes): | |||
<syntaxhighlight lang="text"> | |||
1D frame length 29 | |||
EA 03 1A ip_moderation (IpModerationRequest), 26 bytes | |||
08 2E request_id = 46 | |||
10 02 action = 2 (IP_MODERATION_ACTION_BAN) | |||
1A 0B 32 30 33 2E 30 2E 31 31 33 2E 39 target = "203.0.113.9" | |||
22 04 73 70 61 6D reason = "spam" | |||
28 90 1C duration_seconds = 3600 | |||
</syntaxhighlight> | |||
== See also == | |||
* [[SimTX API/Moderation session]] | |||
{{SimTX API navbox}} | |||
[[Category:SimTX API]] | |||
Latest revision as of 17:16, 24 October 2026
| Frame | ClientFrame, field 61
|
|---|---|
| Member | ip_moderation
|
| Direction | Client → server |
| Session | Moderation |
| Roles | ROLE_MODERATION.
|
| Permission | moderation.manage
|
| Answered by | IpModerationResult or Error |
| Defined in | control.proto
|
IpModerationRequest bans or unbans a client address.
Definition[edit | edit source]
message IpModerationRequest {
int64 request_id = 1;
IpModerationAction action = 2;
string target = 3;
string reason = 4;
int64 duration_seconds = 5;
}
Fields[edit | edit source]
| # | Field | Type | Description |
|---|---|---|---|
| 1 | request_id |
int64 |
Nonzero; echoed in the IpModerationResult or Error. |
| 2 | action |
IpModerationAction | IP_MODERATION_ACTION_BAN or IP_MODERATION_ACTION_UNBAN. Required.
|
| 3 | target |
string |
An IP address, or the callsign of a connected session whose address should be used. |
| 4 | reason |
string |
Reason, shown to the banned user. |
| 5 | duration_seconds |
int64 |
Ban duration. 0 = permanent. At most 3,650 days; not negative. |
Effects[edit | edit source]
A ban disconnects the address's receiver and transmitter sessions, sends a BANNER_LEVEL_BAN_NOTICE Banner to its control sessions, and refuses new game connections from it with HELLO_STATUS_IP_BANNED. Unbanning an address that is not banned is answered with Error NOT_FOUND; an invalid target or duration with INVALID_REQUEST.
Example[edit | edit source]
Complete frames, including the varint length prefix.
ip_moderation_ban (client to server, 30 bytes):
1D frame length 29
EA 03 1A ip_moderation (IpModerationRequest), 26 bytes
08 2E request_id = 46
10 02 action = 2 (IP_MODERATION_ACTION_BAN)
1A 0B 32 30 33 2E 30 2E 31 31 33 2E 39 target = "203.0.113.9"
22 04 73 70 61 6D reason = "spam"
28 90 1C duration_seconds = 3600