Bug: Being put to sleep [SOLVED]

Here is the screen shot of the console after being put to sleep

Thanks for the report!

I will try to fix it as soon as I can.

Troubleshooting and solution

Access denied means that the character is already asleep/not controlled when pinged.

I checked the logs, and it seems your browser sent character pings quite irregularly, not with the 3 min intervals set in the client. Your character was put to sleep because your client didn’t send a ping within 5 min from last ping, which triggers the server to put the character to sleep assuming no active client.

Your browser most likely didn’t run the ping script in order to save battery while the browser/tab was not in focus. See this StackOverflow post.

I will try to solve it by using a Web Worker to do the pinging.

Best regards,
Accipiter

Is it possible that internet connectivity could have a role to play in this? Is it possible that the browser couldn’t ping the server because of the loss of connection for that brief moment?

Possible. But in this case, no. The “ping” is sent over an open connection (WebSocket). Any connectivity issues preventing a request to be sent (such as the ping) would result in a lost connection, which in turn would show up in the logs.

But I think I know the issue and the solution (see the hidden section in previous answer).

Best regards,
Accipiter

This issue should be solved :slight_smile:

@Dragonwolf, if you still have issues, please tell me!

Technical solution for those interested

Char pinging is now done in a separate Web Worker thread that shouldn’t be affected by the browser tab’s visibility.

Also, pinging is now done using ordinary HTTP requests rather than WebSocket messages, mainly because Web Workers cannot use WebSockets.

Old behaviour can be activated using this url:
https://wolfery.com/?charPing.method=ws

Best regards,
Accipiter

1 Like