Skip to main content
Version: 5.15.0

Leaderboard Update With Metadata

public BackendReturnObject UpdateGuildInfoAndRefreshLeaderboard(string leaderboardUuid, string metaKey, int value);
public BackendReturnObject UpdateGuildInfoAndRefreshLeaderboard(string leaderboardUuid, string metaKey, long value);
public BackendReturnObject UpdateGuildInfoAndRefreshLeaderboard(string leaderboardUuid, string metaKey, float value);
public BackendReturnObject UpdateGuildInfoAndRefreshLeaderboard(string leaderboardUuid, string metaKey, double value);

Parameters

ValueTypeDescription
leaderboardUuidstringuuid of the leaderboard to update
metaKeystringMetadata key of the guild to update
valueint/longValue to update

Description

Updates the leaderboard simultaneously with the guild's metadata update.

  • If the metadata to update does not exist, the corresponding metadata will be newly created.
  • This is a method where the leaderboard update method is added to the Backend.Social.Guild.ModifyGuildV3 method.
  • Data updated without using this method is not reflected in the leaderboard.

    The range of metadata values used for leaderboard (values to be used as scores) must be as follows.
    Values out of that range may not be stored properly (e.g., rounded up or down), and cause an error when looking up the leaderboard in the SDK.

    Integer: -9007199254740992 - 9007199254740992 (-2^53 ~ 2^53)
    Real number: -3.40282347E+38F - 3.40282347E+38F (float.MinValue ~ float.MaxValue)

Guild leaderboard does not support additional fields.

Example

Synchronous

Backend.Leaderboard.Guild.UpdateGuildInfoAndRefreshLeaderboard("leaderboardUuid", "meta key to update", 1);

Asynchronous

Backend.Leaderboard.Guild.UpdateGuildInfoAndRefreshLeaderboard("leaderboardUuid", "meta key to update", 1, callback => {
// Post-process
});

ReturnCase

Success cases

When the update is successful
statusCode : 204
message : Success

Error cases

When the uuid is null or string.Empty
statusCode : 400
errorCode : ValidationException
message : leaderboardUuid is null or string.Empty

When the leaderboard to be updated is not a meta leaderboard
statusCode : 400
errorCode : BadParameterException
message : bad table, Invalid table

When there is an attempt to update the leaderboard with other metadata, not the one registered when creating the guild leaderboard
statusCode : 400
errorCode : BadParameterException
message : bad table, Invalid table

When updated to a value other than int, long double, and float
statusCode : 400
errorCode : BadParameterException
message : bad value must number, The value must be a number

When there is an attempt to update the leaderboard with a non-existent uuid
statusCode : 404
errorCode : NotFoundException
message : leaderboard not found, leaderboard cannot be found.

When a user who has not joined a guild attempts to update the leaderboard
statusCode : 412
errorCode : PreconditionFailed
message : notGuildMember prerequisites are not met.

When an attempt is made to update the leaderboard during reset time
statusCode : 428
errorCode : Precondition Required
message : Precondition Required ranking is being counted

When the user tries to renew an expired one-time leaderboard
statusCode : 428
errorCode : Precondition Required
message : Precondition Required ranking is being counted