Skip to main content
Version: 5.11.8

SetRandomData

public BackendReturnObject SetRandomData(RandomType randomType, string uuid, int value);
public BackendReturnObject SetRandomData(RandomType randomType, string uuid, long value);
public BackendReturnObject SetRandomData(RandomType randomType, string uuid, float value);
public BackendReturnObject SetRandomData(RandomType randomType, string uuid, double value);

Description

Inserts data into the random lookup group.
Only one piece of data can exist for each user within one random lookup group.

You cannot insert additional values other than scores.

As for the guild type random lookup, only users who joined guilds may insert the data. An error will occur if a user who is not in a guild attempts an insertion.

Parameters

ValueTypeDescription
randomTypeRandomTypeRandom lookup type
(RandomType.User refers to the user and RandomType.Guild refers to the guild)
uuidstringUuid of the random lookup
valueint/long/float/doubleValue to be inserted
(decimals and negative numbers allowed)(Error occurs when long.MaxValue or higher)

Example

Synchronous

Backend.RandomInfo.SetRandomData(RandomType.User, "9cd283c0-00c6-11ed-93ca-27f1ba8e440c",  10);

Asynchronous

Backend.RandomInfo.SetRandomData(RandomType.User, "9cd283c0-00c6-11ed-93ca-27f1ba8e440c",  10, callback=> {
// Post-process
});

SendQueue

SendQueue.Enqueue(Backend.RandomInfo.SetRandomData, RandomType.User, 
"9cd283c0-00c6-11ed-93ca-27f1ba8e440c", 10, (callback) => {
// Post-process
});

Return cases

Success cases

When the data is inserted successfully
statusCode : 204

Error cases

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

When the type of the random lookup is different(designated as RandomType.Guild when it is user type)
statusCode : 400
errorCode : BadParameterException

(Random lookup type: Guild) When the user has not joined a guild
statusCode : 404
errorCode : NotFoundException

When the uuid does not exist
statusCode : 404
errorCode : NotFoundException