1.4.0
New moderation backends! The moderator backend allows users with rank Moderator
or higher to apply certain moderator actions on users and content. This also adds the request invite feature, where users can request to have an invite sent from the desired user.
Changes
- Added
/api/v1/moderation
(POST
) to API- See below for more details
- Added
requestinvite
message to Socket- See below for more details
- By default, login tokens now expire after
30
days instead of7
days. - Fixed issue where server would crash without Internet
- Fixed issue where
isUserBodyValid
would returntrue
fornull
values - Fixed typo in
SocketServer.GetAllGameServers()
API Changes
Added Moderation
Moderation is here! (kinda) The new moderation endpoint allows moderators to moderate content as they see fit. Here are some example messages:
Adding a Badge
POST /api/v1/moderation
{
"userid": "moderator userid",
"tokenContent": "moderator tokenContent",
"action": "addbadge",
"targetUserId": "the target userid",
"badgeName": "the name of the badge"
}
Removing a Badge
POST /api/v1/moderation
{
"userid": "moderator userid",
"tokenContent": "moderator tokenContent",
"action": "removebadge",
"targetUserId": "the target userid",
"badgeName": "the name of the badge"
}
Setting a Rank
the rank 3 is Verified
POST /api/v1/moderation
{
"userid": "moderator userid",
"tokenContent": "moderator tokenContent",
"action": "setrank",
"targetUserId": "the target userid",
"newRank": 3
}
Warning a User
POST /api/v1/moderation
{
"userid": "moderator userid",
"tokenContent": "moderator tokenContent",
"action": "warnuser",
"targetUserId": "the target userid",
"warnReason": "the reason for the warn",
"warnDescription": "the description for the warn"
}
Banning a User
POST /api/v1/moderation
timeEnd is a UNIX timestamp
{
"userid": "moderator userid",
"tokenContent": "moderator tokenContent",
"action": "addbadge",
"targetUserId": "the target userid",
"banReason": "the reason for the ban",
"banDescription": "the description for the ban",
"timeEnd": 451351341
}
Requesting Invites
Users can now request invites from other users! To get this to work, a new property needed to be added to the User
API Object.
isInWorld
describes if a user is in an instance, and is not on DoNotDisturb status nor Offline status.
To send a request, simply send the following message to the Socket Server
{
"userId": "your userid",
"tokenContent": "your tokenContent (if not verified by socket yet)",
"message": "requestinvite",
"args": {
"targetUserId": "the target userId"
}
}
Then, if the request is allowed, the targetUserId
will recieve the following message:
{
"message": "gotinviterequest",
"result": {
"fromUserId": "the userId that sent the invite request"
}
}
From there, the target user can decide to send an Invite or ignore the message.