DEPRECATED since 1.1.0
This feature is now deprecated, and you should use Profiles instead.
More details and API reference: Players
A player is defined as a profile on the mobile application. If your game server allows multiple characters for one player, then you can consider that one iPear player = one character on your server. Also iPear player = one character = one profile for websocket service, it uses a different name but are exactly the same.
| Key | Type | Description |
|---|---|---|
customId | string unique | Unique identifier from your services (1-64 characters) |
rpName | string | RolePlay name of the profile (1-64 characters) |
rpNumber | string unique | Phone number of the profile (1-64 characters) |
.add(customId, rpName, rpNumber)
DEPRECATED since 1.1.0
This feature is now deprecated, and you should use [Profiles] Create instead.
Adds a player to your iPear server data.
More details and API reference: Create player
| Key | Type | Description |
|---|---|---|
customId | string unique required | Unique identifier from your services (1-64 characters) |
rpName | string required | RolePlay name of the profile (1-64 characters) |
rpNumber | string unique required | Phone number of the profile (1-64 characters) |
Promise<{ customId: string, qrcode: string }>
app.players.add("1234", "John Doe", "555-5126").then((player) => {
console.log(player);
}).catch((error) => {
console.log('An error has been occurred!', error);
})
try {
const player = await app.players.add("1234", "John Doe", "555-5126");
console.log(player);
} catch (error) {
console.log('An error has been occurred!', error);
}
{
"customId": "1234",
"qrcode": "https://link_to_qrcode.com/4586632.png"
}
.getQrCode(customId)
DEPRECATED since 1.1.0
This feature is now deprecated, and you should use [Profiles] Retrieve QR Code instead.
Retrieve a new QR Code for a player profile.
Important
You need to add (/create) a player before trying to get a new QR Code.
More details and API reference: Retrieve QR Code
| Key | Type | Description |
|---|---|---|
customId | string unique required | Unique identifier from your services (1-64 characters) |
Promise<{ customId: string, qrcode: string }>
app.players.getQrCode("1234").then((data) => {
console.log(data);
}).catch((error) => {
console.log('An error has been occurred!', error);
})
try {
const data = await app.players.getQrCode("1234");
console.log(data);
} catch (error) {
console.log('An error has been occurred!', error);
}
{
"customId": "1234",
"qrcode": "https://link_to_qrcode.com/544548.png"
}
.getSecretCode(customId)
DEPRECATED since 1.1.0
This feature is now deprecated, and you should use [Profiles] Retrieve Secret Code instead.
Retrieve a new secret code for a player profile. A secret allows the user to avoid scanning the QR Code. (useful in case that their camera doesn't work)
One code is available for 5 minutes.
Important
You need to add (/create) a player before trying to get a new secret code.
More details and API reference: Retrieve secret code
| Key | Type | Description |
|---|---|---|
customId | string unique required | Unique identifier from your services (1-64 characters) |
Promise<{ customId: string, code: string, expiresAt: number, expiresAt_date: Date }>
app.players.getSecretCode("1234").then((data) => {
console.log(data);
}).catch((error) => {
console.log('An error has been occurred!', error);
})
try {
const data = await app.players.getSecretCode("1234");
console.log(data);
} catch (error) {
console.log('An error has been occurred!', error);
}
{
"customId": "1234",
"code": "486327",
"expiresAt": 1682619471476,
"expiresAt_date": Date(1682619471476)
}
.remove(customId)
Remove a player profile from your iPear server data.
More details and API reference: Delete player
| Key | Type | Description |
|---|---|---|
customId | string unique required | Unique identifier from your services (1-64 characters) |
Promise<boolean>
app.players.remove("1234").then((deleted) => {
console.log(deleted);
}).catch((error) => {
console.log('An error has been occurred!', error);
})
try {
const deleted = await app.players.remove("1234");
console.log(deleted);
} catch (error) {
console.log('An error has been occurred!', error);
}
true
Powered by Doctave