Send notification when device disconnnects without closing socket (in

addition to the existing one sent when a socket is closed).
This commit is contained in:
ehouse 2009-09-20 18:47:47 +00:00
parent 1da25307e5
commit b219e8b279
2 changed files with 4 additions and 1 deletions

View file

@ -536,6 +536,8 @@ CookieRef::handleEvents()
case XWA_DISCONNECT:
setAllConnectedTimer();
reducePlayerCounts( evt.u.discon.socket );
notifyOthers( evt.u.discon.socket, XWRELAY_DISCONNECT_OTHER,
XWRELAY_ERROR_OTHER_DISCON );
removeSocket( evt.u.discon.socket );
/* Don't notify. This is a normal part of a game ending. */
break;

View file

@ -119,7 +119,8 @@ enum {
,XWRELAY_ERROR_HEART_YOU /* Haven't heard from somebody in too long */
,XWRELAY_ERROR_HEART_OTHER /* Haven't heard from other in too long */
,XWRELAY_ERROR_LOST_OTHER /* Generic other-left-we-dunno-why error */
,XWRELAY_ERROR_OTHER_DISCON /* The other guy disconnected, maybe to start
a new game? */
,XWRELAY_ERROR_LASTERR
}
#ifndef CANT_DO_TYPEDEF