Skip to main content

SocialService

A static class in Root.Township, the global namespace.

Static wrappers over the Alta web API for friends, server bans and player reports. These call the old Alta API (ApiAccess.ApiClient).

Fields​

2 private and internal fields
MemberWhat it is
private static readonly Logger loggerNLog logger for API results and errors.
private static readonly GroupPermissions[] serverOwnerPermissionsPermission set (ControlServer) that marks a server owner.

Methods​

MemberWhat it is
static async Task<FriendRequestedType> AcceptFriendRequest(int identifier)Accepts a friend request by calling the API's add friend for that player.
static async Task<BanRole?> BanPlayer(int playerToBanId, int serverId)Bans a player from the server's group unless they are a server owner; returns whether the banner was owner or moderator, or null.
static async Task RemoveFriend(int identifier)Removes a friend through the API.
static async Task ReportPlayer(int playerToReportId, ReportType reportType, int serverId)Sends a player report of the given type for a server.
static async Task<FriendRequestedType> RequestFriend(int identifier)Sends a friend request, or with two IDs creates a friendship between two users directly.
static async Task<FriendRequestResult> RequestFriend(int tokenOwnerId, int newFriendId)Sends a friend request, or with two IDs creates a friendship between two users directly.
static async Task UnbanPlayer(int revokedPlayerId, int serverId)Finds the player's ban in the server's group and revokes it.
1 private and internal method
MemberWhat it is
private static async Task<bool> CanBanFromServer(UserInfoWithPermissions user, GameServerInfo server)False if the user has the server_owner policy or control-server permission on that server.