mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-04 23:02:02 +01:00
return succes from server_initClientConnection()
This commit is contained in:
parent
4d2f49d33f
commit
7d8b9b4270
1 changed files with 5 additions and 3 deletions
|
@ -551,9 +551,10 @@ server_countTilesInPool( ServerCtxt* server )
|
||||||
#define NAME_LEN_NBITS 6
|
#define NAME_LEN_NBITS 6
|
||||||
#define MAX_NAME_LEN ((1<<(NAME_LEN_NBITS-1))-1)
|
#define MAX_NAME_LEN ((1<<(NAME_LEN_NBITS-1))-1)
|
||||||
#ifndef XWFEATURE_STANDALONE_ONLY
|
#ifndef XWFEATURE_STANDALONE_ONLY
|
||||||
void
|
XP_Bool
|
||||||
server_initClientConnection( ServerCtxt* server, XWStreamCtxt* stream )
|
server_initClientConnection( ServerCtxt* server, XWStreamCtxt* stream )
|
||||||
{
|
{
|
||||||
|
XP_Bool result;
|
||||||
LOG_FUNC();
|
LOG_FUNC();
|
||||||
CurGameInfo* gi = server->vol.gi;
|
CurGameInfo* gi = server->vol.gi;
|
||||||
XP_U16 nPlayers;
|
XP_U16 nPlayers;
|
||||||
|
@ -564,7 +565,8 @@ server_initClientConnection( ServerCtxt* server, XWStreamCtxt* stream )
|
||||||
|
|
||||||
XP_ASSERT( gi->serverRole == SERVER_ISCLIENT );
|
XP_ASSERT( gi->serverRole == SERVER_ISCLIENT );
|
||||||
XP_ASSERT( stream != NULL );
|
XP_ASSERT( stream != NULL );
|
||||||
if ( server->nv.gameState == XWSTATE_NONE ) {
|
result = server->nv.gameState == XWSTATE_NONE;
|
||||||
|
if ( result ) {
|
||||||
stream_open( stream );
|
stream_open( stream );
|
||||||
|
|
||||||
writeProto( server, stream, XWPROTO_DEVICE_REGISTRATION );
|
writeProto( server, stream, XWPROTO_DEVICE_REGISTRATION );
|
||||||
|
@ -598,12 +600,12 @@ server_initClientConnection( ServerCtxt* server, XWStreamCtxt* stream )
|
||||||
#ifdef STREAM_VERS_BIGBOARD
|
#ifdef STREAM_VERS_BIGBOARD
|
||||||
stream_putU8( stream, CUR_STREAM_VERS );
|
stream_putU8( stream, CUR_STREAM_VERS );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
XP_LOGF( "%s: wierd state %s; dropping message", __func__,
|
XP_LOGF( "%s: wierd state %s; dropping message", __func__,
|
||||||
getStateStr(server->nv.gameState) );
|
getStateStr(server->nv.gameState) );
|
||||||
}
|
}
|
||||||
stream_destroy( stream );
|
stream_destroy( stream );
|
||||||
|
return result;
|
||||||
} /* server_initClientConnection */
|
} /* server_initClientConnection */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue