Skip to content

Commit

Permalink
feat(clientuser): added setHandling
Browse files Browse the repository at this point in the history
was taken from old versions of tetr.js (0.4.0). If osk has changed it since then, it's gonna be
broken.
  • Loading branch information
Sup3rFire committed Sep 8, 2021
1 parent 16b95a9 commit 8a549ed
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
15 changes: 15 additions & 0 deletions src/client/ClientUser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,21 @@ export default class ClientUser extends User {
data: discoverable ? "public" : "private",
});
}

/**
* Set the client user's handling settings.
* @param {Handling} handling - The handling options you want to set.
* @returns {void}
*/
public setHandling(handling: Handling): void {
this.handling = handling;

this.client.ws?.send_packet({
id: this.client.ws.clientId,
command: "sethandling",
data: handling
});
}
}

export default interface ClientUser {
Expand Down
6 changes: 3 additions & 3 deletions src/websocket/messages/hello.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ export = async function (packet: any, ws: WebSocketManager): Promise<void> {
if (ws.client.user)
ws.client.user.handling = {
arr: 0,
das: 6,
sdf: 5,
safelock: true,
das: 1,
sdf: 41,
safelock: false,
cancel: false,
dcd: 0,
};
Expand Down

0 comments on commit 8a549ed

Please sign in to comment.