mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-05 20:45:49 +01:00
remove dead (relay) code
This commit is contained in:
parent
434096046b
commit
57b78141e9
5 changed files with 28 additions and 14 deletions
|
@ -460,11 +460,11 @@ init_relay( CommsCtxt* comms, XWEnv xwe, XP_U16 nPlayersHere, XP_U16 nPlayersTot
|
|||
CommsCtxt*
|
||||
comms_make( MPFORMAL XWEnv xwe, XW_UtilCtxt* util, XP_Bool isServer,
|
||||
const CommsAddrRec* selfAddr, const CommsAddrRec* hostAddr,
|
||||
const TransportProcs* procs,
|
||||
#ifdef XWFEATURE_RELAY
|
||||
XP_U16 nPlayersHere, XP_U16 nPlayersTotal,
|
||||
#endif
|
||||
const TransportProcs* procs,
|
||||
RoleChangeProc rcp, void* rcClosure,
|
||||
#endif
|
||||
XP_U16 forceChannel
|
||||
#ifdef SET_GAMESEED
|
||||
, XP_U16 gameSeed
|
||||
|
@ -489,14 +489,14 @@ comms_make( MPFORMAL XWEnv xwe, XW_UtilCtxt* util, XP_Bool isServer,
|
|||
comms->xportFlags = comms->procs.flags;
|
||||
#endif
|
||||
}
|
||||
XP_ASSERT( rcp );
|
||||
comms->rcProc = rcp;
|
||||
comms->rcClosure = rcClosure;
|
||||
|
||||
comms->util = util;
|
||||
comms->dutil = util_getDevUtilCtxt( util, xwe );
|
||||
|
||||
#ifdef XWFEATURE_RELAY
|
||||
XP_ASSERT( rcp );
|
||||
comms->rcProc = rcp;
|
||||
comms->rcClosure = rcClosure;
|
||||
|
||||
init_relay( comms, xwe, nPlayersHere, nPlayersTotal );
|
||||
# ifdef SET_GAMESEED
|
||||
comms->channelSeed = gameSeed;
|
||||
|
@ -790,7 +790,9 @@ CommsCtxt*
|
|||
comms_makeFromStream( MPFORMAL XWEnv xwe, XWStreamCtxt* stream,
|
||||
XW_UtilCtxt* util, XP_Bool isServer,
|
||||
const TransportProcs* procs,
|
||||
#ifdef XWFEATURE_RELAY
|
||||
RoleChangeProc rcp, void* rcClosure,
|
||||
#endif
|
||||
XP_U16 forceChannel )
|
||||
{
|
||||
LOG_FUNC();
|
||||
|
@ -819,11 +821,12 @@ comms_makeFromStream( MPFORMAL XWEnv xwe, XWStreamCtxt* stream,
|
|||
nPlayersHere = 0;
|
||||
nPlayersTotal = 0;
|
||||
}
|
||||
CommsCtxt* comms = comms_make( MPPARM(mpool) xwe, util, isServer, NULL, NULL,
|
||||
CommsCtxt* comms = comms_make( MPPARM(mpool) xwe, util, isServer,
|
||||
NULL, NULL, procs,
|
||||
#ifdef XWFEATURE_RELAY
|
||||
nPlayersHere, nPlayersTotal,
|
||||
nPlayersHere, nPlayersTotal, rcp, rcClosure,
|
||||
#endif
|
||||
procs, rcp, rcClosure, forceChannel
|
||||
forceChannel
|
||||
#ifdef SET_GAMESEED
|
||||
, 0
|
||||
#endif
|
||||
|
|
|
@ -150,11 +150,11 @@ CommsCtxt* comms_make( MPFORMAL XWEnv xwe, XW_UtilCtxt* util,
|
|||
XP_Bool isServer,
|
||||
const CommsAddrRec* selfAddr,
|
||||
const CommsAddrRec* hostAddr,
|
||||
const TransportProcs* procs,
|
||||
#ifdef XWFEATURE_RELAY
|
||||
XP_U16 nPlayersHere, XP_U16 nPlayersTotal,
|
||||
#endif
|
||||
const TransportProcs* procs,
|
||||
RoleChangeProc rcp, void* rcClosure,
|
||||
#endif
|
||||
XP_U16 forceChannel
|
||||
#ifdef SET_GAMESEED
|
||||
,XP_U16 gameSeed
|
||||
|
@ -191,7 +191,9 @@ XP_Bool comms_getIsServer( const CommsCtxt* comms );
|
|||
CommsCtxt* comms_makeFromStream( MPFORMAL XWEnv xwe, XWStreamCtxt* stream,
|
||||
XW_UtilCtxt* util, XP_Bool isServer,
|
||||
const TransportProcs* procs,
|
||||
#ifdef XWFEATURE_RELAY
|
||||
RoleChangeProc rcp, void* rcClosure,
|
||||
#endif
|
||||
XP_U16 forceChannel );
|
||||
void comms_start( CommsCtxt* comms, XWEnv xwe );
|
||||
void comms_stop( CommsCtxt* comms
|
||||
|
|
|
@ -105,6 +105,7 @@ timerChangeListener( XWEnv xwe, void* data, const XP_U32 gameID,
|
|||
gameID, oldVal, newVal );
|
||||
}
|
||||
|
||||
#ifdef XWFEATURE_RELAY
|
||||
static void
|
||||
onRoleChanged( XWEnv xwe, void* closure, XP_Bool amNowGuest )
|
||||
{
|
||||
|
@ -112,6 +113,7 @@ onRoleChanged( XWEnv xwe, void* closure, XP_Bool amNowGuest )
|
|||
XWGame* game = (XWGame*)closure;
|
||||
server_onRoleChanged( game->server, xwe, amNowGuest );
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
setListeners( XWGame* game, const CommonPrefs* cp )
|
||||
|
@ -196,11 +198,11 @@ game_makeNewGame( MPFORMAL XWEnv xwe, XWGame* game, CurGameInfo* gi,
|
|||
if ( gi->serverRole != SERVER_STANDALONE ) {
|
||||
game->comms = comms_make( MPPARM(mpool) xwe, util,
|
||||
gi->serverRole != SERVER_ISCLIENT,
|
||||
selfAddr, hostAddr,
|
||||
selfAddr, hostAddr, procs,
|
||||
#ifdef XWFEATURE_RELAY
|
||||
nPlayersHere, nPlayersTotal,
|
||||
onRoleChanged, game,
|
||||
#endif
|
||||
procs, onRoleChanged, game,
|
||||
gi->forceChannel
|
||||
#ifdef SET_GAMESEED
|
||||
, gameSeed
|
||||
|
@ -345,7 +347,10 @@ game_makeFromStream( MPFORMAL XWEnv xwe, XWStreamCtxt* stream,
|
|||
if ( hasComms ) {
|
||||
game->comms = comms_makeFromStream( MPPARM(mpool) xwe, stream, util,
|
||||
gi->serverRole != SERVER_ISCLIENT,
|
||||
procs, onRoleChanged, game,
|
||||
procs,
|
||||
#ifdef XWFEATURE_RELAY
|
||||
onRoleChanged, game,
|
||||
#endif
|
||||
gi->forceChannel );
|
||||
} else {
|
||||
XP_ASSERT( NULL == game->comms );
|
||||
|
|
|
@ -640,6 +640,7 @@ server_writeToStream( const ServerCtxt* server, XWStreamCtxt* stream )
|
|||
}
|
||||
} /* server_writeToStream */
|
||||
|
||||
#ifdef XWFEATURE_RELAY
|
||||
void
|
||||
server_onRoleChanged( ServerCtxt* server, XWEnv xwe, XP_Bool amNowGuest )
|
||||
{
|
||||
|
@ -654,6 +655,7 @@ server_onRoleChanged( ServerCtxt* server, XWEnv xwe, XP_Bool amNowGuest )
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
cleanupServer( ServerCtxt* server )
|
||||
|
|
|
@ -44,7 +44,9 @@ void server_reset( ServerCtxt* server, XWEnv xwe, CommsCtxt* comms );
|
|||
void server_destroy( ServerCtxt* server );
|
||||
|
||||
void server_prefsChanged( ServerCtxt* server, const CommonPrefs* cp );
|
||||
#ifdef XWFEATURE_RELAY
|
||||
void server_onRoleChanged( ServerCtxt* server, XWEnv xwe, XP_Bool amNowGuest );
|
||||
#endif
|
||||
|
||||
typedef void (*TurnChangeListener)( XWEnv xwe, void* data );
|
||||
void server_setTurnChangeListener( ServerCtxt* server, TurnChangeListener tl,
|
||||
|
|
Loading…
Add table
Reference in a new issue