From 49676995e765e1843dac91e877f9ecc1bfcdacea Mon Sep 17 00:00:00 2001 From: ehouse Date: Sat, 3 Sep 2005 15:37:49 +0000 Subject: [PATCH] handle other-disconnected error message --- common/comms.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/common/comms.c b/common/comms.c index 12ffe4f31..dd5deb881 100644 --- a/common/comms.c +++ b/common/comms.c @@ -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 */