How do I detect player(-client) disconnects correctly?
Posted: Tue Jul 01, 2014 11:53 pm
Hello,
since I am writing some scripts, that depend on the players being online, I'd like to know if there is a way to detect disconnects on the server side. I'd prefer a reliable way, but any way is good.
So far I've been trying to find workarounds - e.g. if a player makes an attempt to login with another char etc. But what I'd really like to do, is be able to reliably determine if a given player is not offline.
The problem is, that so far I determined different behaviors depending on how the user disconnects. If it's a BufferOverflow, caused by e.g. a malformed L2-HTML-file, the client crashes, but it seems it - sometimes - sends a notification to the server about being closed. It seems not to do this if e.g. the connection to the server is closed on the client-side by removing the LAN-cable from the computer.
Does someone know how to - reliably if possible - check, whether a given player is online or not?
Thanks in advance!
since I am writing some scripts, that depend on the players being online, I'd like to know if there is a way to detect disconnects on the server side. I'd prefer a reliable way, but any way is good.
So far I've been trying to find workarounds - e.g. if a player makes an attempt to login with another char etc. But what I'd really like to do, is be able to reliably determine if a given player is not offline.
The problem is, that so far I determined different behaviors depending on how the user disconnects. If it's a BufferOverflow, caused by e.g. a malformed L2-HTML-file, the client crashes, but it seems it - sometimes - sends a notification to the server about being closed. It seems not to do this if e.g. the connection to the server is closed on the client-side by removing the LAN-cable from the computer.
Does someone know how to - reliably if possible - check, whether a given player is online or not?
Thanks in advance!