uuid -> id
This commit is contained in:
@ -76,8 +76,8 @@ class FairHopper {
|
||||
return await r.json();
|
||||
}
|
||||
|
||||
async getPlayerInfo(playerUuid) {
|
||||
const r = await fetch(this.formatUrl(`/player/${playerUuid}`), {
|
||||
async getPlayerInfo(playerId) {
|
||||
const r = await fetch(this.formatUrl(`/player/${playerId}`), {
|
||||
headers: this.defaultHeaders,
|
||||
});
|
||||
switch (r.status) {
|
||||
@ -89,24 +89,24 @@ class FairHopper {
|
||||
return await r.json();
|
||||
}
|
||||
|
||||
async moveLeft(playerUuid) {
|
||||
return await this.move(playerUuid, "left");
|
||||
async moveLeft(playerId) {
|
||||
return await this.move(playerId, "left");
|
||||
}
|
||||
|
||||
async moveRight(playerUuid) {
|
||||
return await this.move(playerUuid, "right");
|
||||
async moveRight(playerId) {
|
||||
return await this.move(playerId, "right");
|
||||
}
|
||||
|
||||
async moveUp(playerUuid) {
|
||||
return await this.move(playerUuid, "up");
|
||||
async moveUp(playerId) {
|
||||
return await this.move(playerId, "up");
|
||||
}
|
||||
|
||||
async moveDown(playerUuid) {
|
||||
return await this.move(playerUuid, "down");
|
||||
async moveDown(playerId) {
|
||||
return await this.move(playerId, "down");
|
||||
}
|
||||
|
||||
async move(playerUuid, direction) {
|
||||
const url = this.formatUrl(`/player/${playerUuid}/move/${direction}`);
|
||||
async move(playerId, direction) {
|
||||
const url = this.formatUrl(`/player/${playerId}/move/${direction}`);
|
||||
const r = await fetch(url, {
|
||||
method: "post",
|
||||
headers: this.defaultHeaders,
|
||||
|
||||
Reference in New Issue
Block a user