Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose event to handle server-issued disconnects #58

Closed
mat1jaczyyy opened this issue Mar 29, 2024 · 3 comments
Closed

Expose event to handle server-issued disconnects #58

mat1jaczyyy opened this issue Mar 29, 2024 · 3 comments

Comments

@mat1jaczyyy
Copy link
Contributor

A client can be disconnected by the server due to various reasons, including regular TETR.IO maintenance, which poses a problem for long-running bots.

Expose an event to notify bots when they've been disconnected and why, allowing them to handle reconnecting and re-setting up any bot state / in-game actions (such as opening rooms) themselves upon successful reconnection.

@mat1jaczyyy
Copy link
Contributor Author

Note: a hotfix was already applied to seemingly random ws closes here:

this.socket.on("close", () => {
this.connect(true); // i guess temporary fix on silent disconnect
});

I'm not sure if these are just random disconnects due to long idle periods, or the ws just closes silently upon maintenance.

@mat1jaczyyy mat1jaczyyy changed the title Expose event to handle disconnects Expose event to handle server-issued disconnects Mar 29, 2024
Sup3rFire added a commit that referenced this issue Mar 29, 2024
@Sup3rFire
Copy link
Member

Fixed

@mat1jaczyyy
Copy link
Contributor Author

if there is no apparent reason for a disconnect (nothing happened on the ribbon, ws just closed itself), can this also be raised as an event rather than just silently reconnecting?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants