When forwarding message, lookup cref by socket if cookieID == 0, as

can be the case when through to a non-all-connected game.
This commit is contained in:
ehouse 2009-11-08 21:32:36 +00:00
parent f6fb019732
commit 2d4ae3e44a

View file

@ -427,8 +427,13 @@ forwardMessage( unsigned char* buf, int buflen, int srcSocket )
&& getNetByte( &bufp, end, &dest ) ) {
logf( XW_LOGINFO, "cookieID = %d", cookieID );
SafeCref scr( cookieID );
success = scr.Forward( src, dest, buf, buflen );
if ( COOKIE_ID_NONE == cookieID ) {
SafeCref scr( srcSocket );
success = scr.Forward( src, dest, buf, buflen );
} else {
SafeCref scr( cookieID ); /* won't work if not allcon; will be 0 */
success = scr.Forward( src, dest, buf, buflen );
}
}
return success;
} /* forwardMessage */