Skip to main content
Social features let players find each other, build relationships, and exchange messages or rewards. Operators can inspect users, mail, messages, and guilds in Console.

User Search and Random Lookup

var users = await HyperX.Core.Social.Search.Users(query: "hero", limit: 20);

await player.RegisterRandom(
    "arena",
    new { power = 1200 }
);

var candidates = await player.LookupRandom(
    bucket: "arena",
    limit: 5
);
Search returns public users by nickname or user ID. Random lookup returns candidates that registered into the same bucket.

Friends

var request = await player.SendFriendRequest(targetUserId);

await otherPlayer.AcceptFriendRequest(request.Id);
var friends = await player.Friends();
Friends support request, accept, reject, remove, and block. Blocked relationships cannot send friend requests or messages.

Mail

var mail = await player.SendMail(
    recipientUserId,
    "gift",
    "welcome",
    new { gold = 100 }
);

var inbox = await player.Mail();
var claimed = await player.ClaimMail(mail.Id);
Mail attachments are returned as JSON payloads. Apply rewards according to your game policy and rely on server claim state to prevent duplicate claims.

Messages

var sent = await player.SendMessage(recipientUserId, "hello");

var thread = await player.Messages(peerUserId: recipientUserId);
Messages are user-to-user text messages. Operators can hide inappropriate messages in Console.

Guilds

var guild = await player.CreateGuild(
    "knights",
    "Knights",
    joinPolicy: HyperX.GuildJoinPolicy.Approval
);

var requested = await otherPlayer.JoinGuild(guild.Id);
await player.ApproveGuildMember(guild.Id, requested.UserId);
var members = await player.GuildMembers(guild.Id);
For joinPolicy, use HyperX.GuildJoinPolicy.Open, HyperX.GuildJoinPolicy.Approval, or HyperX.GuildJoinPolicy.InviteOnly. You can still pass a string for custom values. Joining an approval or invite-only guild creates a member with requested status, and the guild owner or an officer can approve or reject the request. Guild owners and officers can create and revoke invite codes. Joining by invite either adds the player immediately or creates a pending request depending on the guild policy.
var invite = await player.CreateGuildInvite(
    guild.Id,
    maxUses: 10
);

await otherPlayer.JoinGuildByInvite(invite.Code);
await player.RevokeGuildInvite(guild.Id, invite.Id);
Guild goods are server-managed guild balances with ledger history. Contributions, grants, and spends take a positive amount and can include an idempotency key.
await player.ContributeGuildGoods(
    guild.Id,
    "guild_gold",
    amount: 100,
    reason: "raid"
);

var balances = await player.GuildGoods(guild.Id);
var ledger = await player.GuildGoodsLedger(guild.Id, goodsKey: "guild_gold");
Operators can inspect invite links, goods balances, and ledger entries from Console Social, then apply reasoned adjustments when needed.

Notifications

var notifications = await player.Notifications(unreadOnly: true);

await player.MarkNotificationRead(notifications[0].Id);
Use the subscription wrapper to receive new notifications periodically from Unity.
using var subscription = player.SubscribeNotifications(
    notification => Debug.Log(notification.EventType),
    error => Debug.LogWarning(error.Message),
    pollIntervalMilliseconds: 2000
);