mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-30 10:26:58 +01:00
handle other-disconnected error message
This commit is contained in:
parent
9e53da6545
commit
49676995e7
1 changed files with 14 additions and 3 deletions
|
@ -672,6 +672,7 @@ relayPreProcess( CommsCtxt* comms, XWStreamCtxt* stream, XWHostID* senderID )
|
|||
XP_Bool consumed;
|
||||
XWHostID destID, srcID;
|
||||
XP_U32 cookieID;
|
||||
XP_U8 relayErr;
|
||||
|
||||
if ( comms->addr.conType != COMMS_CONN_RELAY ) {
|
||||
consumed = XP_FALSE; /* nothing for us to do here! */
|
||||
|
@ -708,9 +709,19 @@ relayPreProcess( CommsCtxt* comms, XWStreamCtxt* stream, XWHostID* senderID )
|
|||
}
|
||||
break;
|
||||
|
||||
case XWRELAY_DISCONNECT:
|
||||
case XWRELAY_CONNECTDENIED:
|
||||
util_userError( comms->util, ERR_RELAY_BASE + stream_getU8( stream ) );
|
||||
case XWRELAY_DISCONNECT_OTHER:
|
||||
relayErr = stream_getU8( stream );
|
||||
srcID = stream_getU16( stream );
|
||||
XP_LOGF( "host id %d disconnected", srcID );
|
||||
/* we will eventually want to tell the user which player's gone */
|
||||
util_userError( comms->util, ERR_RELAY_BASE + relayErr );
|
||||
consumed = XP_TRUE;
|
||||
break;
|
||||
|
||||
case XWRELAY_DISCONNECT_YOU: /* Close socket for this? */
|
||||
case XWRELAY_CONNECTDENIED: /* Close socket for this? */
|
||||
relayErr = stream_getU8( stream );
|
||||
util_userError( comms->util, ERR_RELAY_BASE + relayErr );
|
||||
/* fallthru */
|
||||
default:
|
||||
consumed = XP_TRUE; /* drop it */
|
||||
|
|
Loading…
Reference in a new issue