mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-30 08:34:16 +01:00
Refactor to not return from middle of function. No behavior change.
This commit is contained in:
parent
e2f3a55611
commit
130c0f5a92
1 changed files with 16 additions and 15 deletions
|
@ -472,6 +472,7 @@ callTurnChangeListener( ServerCtxt* server )
|
|||
static XP_Bool
|
||||
handleRegistrationMsg( ServerCtxt* server, XWStreamCtxt* stream )
|
||||
{
|
||||
XP_Bool success = XP_TRUE;
|
||||
XP_U16 playersInMsg, i;
|
||||
XP_STATUSF( "handleRegistrationMsg" );
|
||||
|
||||
|
@ -481,24 +482,24 @@ handleRegistrationMsg( ServerCtxt* server, XWStreamCtxt* stream )
|
|||
|
||||
if ( server->nv.pendingRegistrations < playersInMsg ) {
|
||||
util_userError( server->vol.util, ERR_REG_UNEXPECTED_USER );
|
||||
return XP_FALSE;
|
||||
}
|
||||
success = XP_FALSE;
|
||||
} else {
|
||||
for ( i = 0; i < playersInMsg; ++i ) {
|
||||
registerRemotePlayer( server, stream );
|
||||
|
||||
for ( i = 0; i < playersInMsg; ++i ) {
|
||||
registerRemotePlayer( server, stream );
|
||||
/* This is abusing the semantics of turn change -- at least in the
|
||||
case where there is another device yet to register -- but we
|
||||
need to let the board know to redraw the scoreboard with more
|
||||
players there. */
|
||||
callTurnChangeListener( server );
|
||||
}
|
||||
|
||||
/* This is abusing the semantics of turn change -- at least in the
|
||||
case where there is another device yet to register -- but we
|
||||
need to let the board know to redraw the scoreboard with more
|
||||
players there. */
|
||||
callTurnChangeListener( server );
|
||||
if ( server->nv.pendingRegistrations == 0 ) {
|
||||
assignTilesToAll( server );
|
||||
SETSTATE( server, XWSTATE_RECEIVED_ALL_REG );
|
||||
}
|
||||
}
|
||||
|
||||
if ( server->nv.pendingRegistrations == 0 ) {
|
||||
assignTilesToAll( server );
|
||||
SETSTATE( server, XWSTATE_RECEIVED_ALL_REG );
|
||||
}
|
||||
return XP_TRUE;
|
||||
return success;
|
||||
} /* handleRegistrationMsg */
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue