mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-20 22:26:54 +01:00
rename Cookie to Invite, a change that may change. Rename everywhere
in clients but not in relay where cookie is too pervasive. (There are no code changes in this checkin.)
This commit is contained in:
parent
6603949b0e
commit
18e9301e87
22 changed files with 69 additions and 69 deletions
|
@ -401,8 +401,8 @@ addrFromStream( CommsAddrRec* addrP, XWStreamCtxt* stream )
|
||||||
addr.u.ip.port_ip = stream_getU16( stream );
|
addr.u.ip.port_ip = stream_getU16( stream );
|
||||||
break;
|
break;
|
||||||
case COMMS_CONN_RELAY:
|
case COMMS_CONN_RELAY:
|
||||||
stringFromStreamHere( stream, addr.u.ip_relay.cookie,
|
stringFromStreamHere( stream, addr.u.ip_relay.invite,
|
||||||
sizeof(addr.u.ip_relay.cookie) );
|
sizeof(addr.u.ip_relay.invite) );
|
||||||
stringFromStreamHere( stream, addr.u.ip_relay.hostName,
|
stringFromStreamHere( stream, addr.u.ip_relay.hostName,
|
||||||
sizeof(addr.u.ip_relay.hostName) );
|
sizeof(addr.u.ip_relay.hostName) );
|
||||||
addr.u.ip_relay.ipAddr = stream_getU32( stream );
|
addr.u.ip_relay.ipAddr = stream_getU32( stream );
|
||||||
|
@ -598,7 +598,7 @@ addrToStream( XWStreamCtxt* stream, const CommsAddrRec* addrP )
|
||||||
stream_putU16( stream, addr.u.ip.port_ip );
|
stream_putU16( stream, addr.u.ip.port_ip );
|
||||||
break;
|
break;
|
||||||
case COMMS_CONN_RELAY:
|
case COMMS_CONN_RELAY:
|
||||||
stringToStream( stream, addr.u.ip_relay.cookie );
|
stringToStream( stream, addr.u.ip_relay.invite );
|
||||||
stringToStream( stream, addr.u.ip_relay.hostName );
|
stringToStream( stream, addr.u.ip_relay.hostName );
|
||||||
stream_putU32( stream, addr.u.ip_relay.ipAddr );
|
stream_putU32( stream, addr.u.ip_relay.ipAddr );
|
||||||
stream_putU16( stream, addr.u.ip_relay.port );
|
stream_putU16( stream, addr.u.ip_relay.port );
|
||||||
|
@ -706,7 +706,7 @@ comms_getInitialAddr( CommsAddrRec* addr )
|
||||||
char* name = RELAY_NAME_DEFAULT;
|
char* name = RELAY_NAME_DEFAULT;
|
||||||
XP_MEMCPY( addr->u.ip_relay.hostName, name, XP_STRLEN(name)+1 );
|
XP_MEMCPY( addr->u.ip_relay.hostName, name, XP_STRLEN(name)+1 );
|
||||||
}
|
}
|
||||||
addr->u.ip_relay.cookie[0] = '\0';
|
addr->u.ip_relay.invite[0] = '\0';
|
||||||
#elif defined PLATFORM_PALM
|
#elif defined PLATFORM_PALM
|
||||||
/* default values; default is still IR where there's a choice, at least on
|
/* default values; default is still IR where there's a choice, at least on
|
||||||
Palm... */
|
Palm... */
|
||||||
|
@ -1424,7 +1424,7 @@ comms_checkComplete( const CommsAddrRec* addr )
|
||||||
|
|
||||||
switch ( addr->conType ) {
|
switch ( addr->conType ) {
|
||||||
case COMMS_CONN_RELAY:
|
case COMMS_CONN_RELAY:
|
||||||
result = !!addr->u.ip_relay.cookie[0]
|
result = !!addr->u.ip_relay.invite[0]
|
||||||
&& !!addr->u.ip_relay.hostName[0]
|
&& !!addr->u.ip_relay.hostName[0]
|
||||||
&& !!addr->u.ip_relay.port > 0;
|
&& !!addr->u.ip_relay.port > 0;
|
||||||
break;
|
break;
|
||||||
|
@ -1715,7 +1715,7 @@ send_via_relay( CommsCtxt* comms, XWRELAY_Cmd cmd, XWHostID destID,
|
||||||
break;
|
break;
|
||||||
case XWRELAY_GAME_CONNECT:
|
case XWRELAY_GAME_CONNECT:
|
||||||
stream_putU8( tmpStream, XWRELAY_PROTO_VERSION );
|
stream_putU8( tmpStream, XWRELAY_PROTO_VERSION );
|
||||||
stringToStream( tmpStream, addr.u.ip_relay.cookie );
|
stringToStream( tmpStream, addr.u.ip_relay.invite );
|
||||||
stream_putU8( tmpStream, comms->r.myHostID );
|
stream_putU8( tmpStream, comms->r.myHostID );
|
||||||
stream_putU8( tmpStream, comms->r.nPlayersHere );
|
stream_putU8( tmpStream, comms->r.nPlayersHere );
|
||||||
stream_putU8( tmpStream, comms->r.nPlayersTotal );
|
stream_putU8( tmpStream, comms->r.nPlayersTotal );
|
||||||
|
@ -1725,7 +1725,7 @@ send_via_relay( CommsCtxt* comms, XWRELAY_Cmd cmd, XWHostID destID,
|
||||||
|
|
||||||
case XWRELAY_GAME_RECONNECT:
|
case XWRELAY_GAME_RECONNECT:
|
||||||
stream_putU8( tmpStream, XWRELAY_PROTO_VERSION );
|
stream_putU8( tmpStream, XWRELAY_PROTO_VERSION );
|
||||||
stringToStream( tmpStream, addr.u.ip_relay.cookie );
|
stringToStream( tmpStream, addr.u.ip_relay.invite );
|
||||||
stream_putU8( tmpStream, comms->r.myHostID );
|
stream_putU8( tmpStream, comms->r.myHostID );
|
||||||
stream_putU8( tmpStream, comms->r.nPlayersHere );
|
stream_putU8( tmpStream, comms->r.nPlayersHere );
|
||||||
stream_putU8( tmpStream, comms->r.nPlayersTotal );
|
stream_putU8( tmpStream, comms->r.nPlayersTotal );
|
||||||
|
|
|
@ -84,7 +84,7 @@ typedef struct CommsAddrRec {
|
||||||
XP_U16 port_ip;
|
XP_U16 port_ip;
|
||||||
} ip;
|
} ip;
|
||||||
struct {
|
struct {
|
||||||
XP_UCHAR cookie[MAX_COOKIE_LEN + 1];
|
XP_UCHAR invite[MAX_INVITE_LEN + 1];
|
||||||
XP_UCHAR hostName[MAX_HOSTNAME_LEN + 1];
|
XP_UCHAR hostName[MAX_HOSTNAME_LEN + 1];
|
||||||
XP_U32 ipAddr; /* looked up from above */
|
XP_U32 ipAddr; /* looked up from above */
|
||||||
XP_U16 port;
|
XP_U16 port;
|
||||||
|
|
|
@ -1488,8 +1488,8 @@ cursesmain( XP_Bool isServer, LaunchParams* params )
|
||||||
addr.u.ip_relay.port = params->connInfo.relay.defaultSendPort;
|
addr.u.ip_relay.port = params->connInfo.relay.defaultSendPort;
|
||||||
XP_STRNCPY( addr.u.ip_relay.hostName, params->connInfo.relay.relayName,
|
XP_STRNCPY( addr.u.ip_relay.hostName, params->connInfo.relay.relayName,
|
||||||
sizeof(addr.u.ip_relay.hostName) - 1 );
|
sizeof(addr.u.ip_relay.hostName) - 1 );
|
||||||
XP_STRNCPY( addr.u.ip_relay.cookie, params->connInfo.relay.cookie,
|
XP_STRNCPY( addr.u.ip_relay.invite, params->connInfo.relay.invite,
|
||||||
sizeof(addr.u.ip_relay.cookie) - 1 );
|
sizeof(addr.u.ip_relay.invite) - 1 );
|
||||||
# endif
|
# endif
|
||||||
# ifdef XWFEATURE_SMS
|
# ifdef XWFEATURE_SMS
|
||||||
} else if ( params->conType == COMMS_CONN_SMS ) {
|
} else if ( params->conType == COMMS_CONN_SMS ) {
|
||||||
|
|
|
@ -27,7 +27,7 @@ typedef struct _GtkConnsState {
|
||||||
GtkAppGlobals* globals;
|
GtkAppGlobals* globals;
|
||||||
CommsAddrRec* addr;
|
CommsAddrRec* addr;
|
||||||
|
|
||||||
GtkWidget* cookie;
|
GtkWidget* invite;
|
||||||
GtkWidget* hostName;
|
GtkWidget* hostName;
|
||||||
GtkWidget* port;
|
GtkWidget* port;
|
||||||
GtkWidget* bthost;
|
GtkWidget* bthost;
|
||||||
|
@ -77,9 +77,9 @@ handle_ok( GtkWidget* XP_UNUSED(widget), gpointer closure )
|
||||||
case COMMS_CONN_IP_DIRECT:
|
case COMMS_CONN_IP_DIRECT:
|
||||||
#ifdef XWFEATURE_RELAY
|
#ifdef XWFEATURE_RELAY
|
||||||
case COMMS_CONN_RELAY:
|
case COMMS_CONN_RELAY:
|
||||||
txt = gtk_entry_get_text( GTK_ENTRY(state->cookie) );
|
txt = gtk_entry_get_text( GTK_ENTRY(state->invite) );
|
||||||
XP_STRNCPY( state->addr->u.ip_relay.cookie, txt,
|
XP_STRNCPY( state->addr->u.ip_relay.invite, txt,
|
||||||
sizeof(state->addr->u.ip_relay.cookie) );
|
sizeof(state->addr->u.ip_relay.invite) );
|
||||||
txt = gtk_entry_get_text( GTK_ENTRY(state->hostName) );
|
txt = gtk_entry_get_text( GTK_ENTRY(state->hostName) );
|
||||||
XP_STRNCPY( state->addr->u.ip_relay.hostName, txt,
|
XP_STRNCPY( state->addr->u.ip_relay.hostName, txt,
|
||||||
sizeof(state->addr->u.ip_relay.hostName) );
|
sizeof(state->addr->u.ip_relay.hostName) );
|
||||||
|
@ -115,7 +115,7 @@ handle_cancel( GtkWidget* XP_UNUSED(widget), void* closure )
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Cookie: _____
|
* Invite: _____
|
||||||
* Relay: _____
|
* Relay: _____
|
||||||
* Port: _____
|
* Port: _____
|
||||||
* Cancel OK
|
* Cancel OK
|
||||||
|
@ -126,11 +126,11 @@ makeRelayPage( GtkConnsState* state )
|
||||||
{
|
{
|
||||||
GtkWidget* vbox = gtk_vbox_new( FALSE, 0 );
|
GtkWidget* vbox = gtk_vbox_new( FALSE, 0 );
|
||||||
|
|
||||||
GtkWidget* hbox = makeLabeledField( "Cookie", &state->cookie );
|
GtkWidget* hbox = makeLabeledField( "Invite", &state->invite );
|
||||||
gtk_entry_set_text( GTK_ENTRY(state->cookie),
|
gtk_entry_set_text( GTK_ENTRY(state->invite),
|
||||||
state->addr->u.ip_relay.cookie );
|
state->addr->u.ip_relay.invite );
|
||||||
gtk_box_pack_start( GTK_BOX(vbox), hbox, FALSE, TRUE, 0 );
|
gtk_box_pack_start( GTK_BOX(vbox), hbox, FALSE, TRUE, 0 );
|
||||||
gtk_widget_set_sensitive( state->cookie, !state->readOnly );
|
gtk_widget_set_sensitive( state->invite, !state->readOnly );
|
||||||
|
|
||||||
hbox = makeLabeledField( "Relay address", &state->hostName );
|
hbox = makeLabeledField( "Relay address", &state->hostName );
|
||||||
gtk_entry_set_text( GTK_ENTRY(state->hostName),
|
gtk_entry_set_text( GTK_ENTRY(state->hostName),
|
||||||
|
|
|
@ -365,8 +365,8 @@ createOrLoadObjects( GtkAppGlobals* globals )
|
||||||
addr.u.ip_relay.port = params->connInfo.relay.defaultSendPort;
|
addr.u.ip_relay.port = params->connInfo.relay.defaultSendPort;
|
||||||
XP_STRNCPY( addr.u.ip_relay.hostName, params->connInfo.relay.relayName,
|
XP_STRNCPY( addr.u.ip_relay.hostName, params->connInfo.relay.relayName,
|
||||||
sizeof(addr.u.ip_relay.hostName) - 1 );
|
sizeof(addr.u.ip_relay.hostName) - 1 );
|
||||||
XP_STRNCPY( addr.u.ip_relay.cookie, params->connInfo.relay.cookie,
|
XP_STRNCPY( addr.u.ip_relay.invite, params->connInfo.relay.invite,
|
||||||
sizeof(addr.u.ip_relay.cookie) - 1 );
|
sizeof(addr.u.ip_relay.invite) - 1 );
|
||||||
#endif
|
#endif
|
||||||
#ifdef XWFEATURE_BLUETOOTH
|
#ifdef XWFEATURE_BLUETOOTH
|
||||||
} else if ( addr.conType == COMMS_CONN_BT ) {
|
} else if ( addr.conType == COMMS_CONN_BT ) {
|
||||||
|
|
|
@ -213,7 +213,7 @@ usage( char* appName, char* msg )
|
||||||
"\t [-l] # disallow hints\n"
|
"\t [-l] # disallow hints\n"
|
||||||
"\t [-P] # pick tiles face up\n"
|
"\t [-P] # pick tiles face up\n"
|
||||||
"\t [-c] # explain robot scores after each move\n"
|
"\t [-c] # explain robot scores after each move\n"
|
||||||
"\t [-C COOKIE] # cookie used to groups games on relay\n"
|
"\t [-C INVITE] # invite used to groups games on relay\n"
|
||||||
"\t\t # (max of four players total, local and remote)\n"
|
"\t\t # (max of four players total, local and remote)\n"
|
||||||
"\t [-b boardSize] # number of columns and rows\n"
|
"\t [-b boardSize] # number of columns and rows\n"
|
||||||
"\t [-e random_seed] \n"
|
"\t [-e random_seed] \n"
|
||||||
|
@ -245,8 +245,8 @@ usage( char* appName, char* msg )
|
||||||
/* "\t [-p client_port] # must != server's port if on same device" */
|
/* "\t [-p client_port] # must != server's port if on same device" */
|
||||||
#ifdef XWFEATURE_RELAY
|
#ifdef XWFEATURE_RELAY
|
||||||
"\nrelay example: \n"
|
"\nrelay example: \n"
|
||||||
"\t host: ./xwords -d dict.xwd -r Eric -s -N -a localhost -p 10999 -C COOKIE\n"
|
"\t host: ./xwords -d dict.xwd -r Eric -s -N -a localhost -p 10999 -C INVITE\n"
|
||||||
"\tguest: ./xwords -d dict.xwd -r Kati -a localhost -p 10999 -C COOKIE"
|
"\tguest: ./xwords -d dict.xwd -r Kati -a localhost -p 10999 -C INVITE"
|
||||||
#endif
|
#endif
|
||||||
#ifdef XWFEATURE_SMS
|
#ifdef XWFEATURE_SMS
|
||||||
"\nsms example: \n"
|
"\nsms example: \n"
|
||||||
|
@ -743,7 +743,7 @@ main( int argc, char** argv )
|
||||||
/* defaults */
|
/* defaults */
|
||||||
#ifdef XWFEATURE_RELAY
|
#ifdef XWFEATURE_RELAY
|
||||||
mainParams.connInfo.relay.defaultSendPort = DEFAULT_PORT;
|
mainParams.connInfo.relay.defaultSendPort = DEFAULT_PORT;
|
||||||
mainParams.connInfo.relay.cookie = "COOKIE";
|
mainParams.connInfo.relay.invite = "INVITE";
|
||||||
#endif
|
#endif
|
||||||
#ifdef XWFEATURE_IP_DIRECT
|
#ifdef XWFEATURE_IP_DIRECT
|
||||||
mainParams.connInfo.ip.port = DEFAULT_PORT;
|
mainParams.connInfo.ip.port = DEFAULT_PORT;
|
||||||
|
@ -811,7 +811,7 @@ main( int argc, char** argv )
|
||||||
case 'C':
|
case 'C':
|
||||||
XP_ASSERT( conType == COMMS_CONN_NONE ||
|
XP_ASSERT( conType == COMMS_CONN_NONE ||
|
||||||
conType == COMMS_CONN_RELAY );
|
conType == COMMS_CONN_RELAY );
|
||||||
mainParams.connInfo.relay.cookie = optarg;
|
mainParams.connInfo.relay.invite = optarg;
|
||||||
conType = COMMS_CONN_RELAY;
|
conType = COMMS_CONN_RELAY;
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -78,7 +78,7 @@ typedef struct LaunchParams {
|
||||||
#ifdef XWFEATURE_RELAY
|
#ifdef XWFEATURE_RELAY
|
||||||
struct {
|
struct {
|
||||||
char* relayName;
|
char* relayName;
|
||||||
char* cookie;
|
char* invite;
|
||||||
short defaultSendPort;
|
short defaultSendPort;
|
||||||
} relay;
|
} relay;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -79,8 +79,8 @@ ctlsFromState( PalmAppGlobals* globals )
|
||||||
setFieldStr( XW_CONNS_PORT_FIELD_ID, buf );
|
setFieldStr( XW_CONNS_PORT_FIELD_ID, buf );
|
||||||
setFieldEditable( XW_CONNS_PORT_FIELD_ID, isNewGame );
|
setFieldEditable( XW_CONNS_PORT_FIELD_ID, isNewGame );
|
||||||
|
|
||||||
setFieldStr( XW_CONNS_COOKIE_FIELD_ID, addr->u.ip_relay.cookie );
|
setFieldStr( XW_CONNS_INVITE_FIELD_ID, addr->u.ip_relay.invite );
|
||||||
setFieldEditable( XW_CONNS_COOKIE_FIELD_ID, isNewGame );
|
setFieldEditable( XW_CONNS_INVITE_FIELD_ID, isNewGame );
|
||||||
#endif
|
#endif
|
||||||
#ifdef XWFEATURE_BLUETOOTH
|
#ifdef XWFEATURE_BLUETOOTH
|
||||||
} else if ( addr->conType == COMMS_CONN_BT
|
} else if ( addr->conType == COMMS_CONN_BT
|
||||||
|
@ -136,8 +136,8 @@ stateFromCtls( PalmAppGlobals* globals, XP_Bool* prefsChanged )
|
||||||
getFieldStr( XW_CONNS_PORT_FIELD_ID, buf, sizeof(buf) );
|
getFieldStr( XW_CONNS_PORT_FIELD_ID, buf, sizeof(buf) );
|
||||||
addr.u.ip_relay.port = StrAToI( buf );
|
addr.u.ip_relay.port = StrAToI( buf );
|
||||||
|
|
||||||
getFieldStr( XW_CONNS_COOKIE_FIELD_ID, addr.u.ip_relay.cookie,
|
getFieldStr( XW_CONNS_INVITE_FIELD_ID, addr.u.ip_relay.invite,
|
||||||
sizeof(addr.u.ip_relay.cookie) );
|
sizeof(addr.u.ip_relay.invite) );
|
||||||
#endif
|
#endif
|
||||||
#ifdef XWFEATURE_BLUETOOTH
|
#ifdef XWFEATURE_BLUETOOTH
|
||||||
} else if ( addr.conType == COMMS_CONN_BT
|
} else if ( addr.conType == COMMS_CONN_BT
|
||||||
|
@ -178,8 +178,8 @@ updateFormCtls( FormPtr form, ConnsDlgState* state )
|
||||||
XW_CONNS_RELAY_FIELD_ID,
|
XW_CONNS_RELAY_FIELD_ID,
|
||||||
XW_CONNS_PORT_LABEL_ID,
|
XW_CONNS_PORT_LABEL_ID,
|
||||||
XW_CONNS_PORT_FIELD_ID,
|
XW_CONNS_PORT_FIELD_ID,
|
||||||
XW_CONNS_COOKIE_LABEL_ID,
|
XW_CONNS_INVITE_LABEL_ID,
|
||||||
XW_CONNS_COOKIE_FIELD_ID,
|
XW_CONNS_INVITE_FIELD_ID,
|
||||||
#endif
|
#endif
|
||||||
0
|
0
|
||||||
};
|
};
|
||||||
|
|
|
@ -322,9 +322,9 @@ BEGIN
|
||||||
FIELD XW_CONNS_PORT_FIELD_ID CONNS_FIELD_LEFT PREVTOP 30 AUTO \
|
FIELD XW_CONNS_PORT_FIELD_ID CONNS_FIELD_LEFT PREVTOP 30 AUTO \
|
||||||
EDITABLE SINGLELINE UNDERLINED NUMERIC MAXCHARS 5
|
EDITABLE SINGLELINE UNDERLINED NUMERIC MAXCHARS 5
|
||||||
|
|
||||||
LABEL "Cookie:" XW_CONNS_COOKIE_LABEL_ID
|
LABEL "Invite:" XW_CONNS_INVITE_LABEL_ID
|
||||||
AT ( LEFTCOL+10 PREVBOTTOM + 2 )
|
AT ( LEFTCOL+10 PREVBOTTOM + 2 )
|
||||||
FIELD XW_CONNS_COOKIE_FIELD_ID CONNS_FIELD_LEFT PREVTOP 70 AUTO \
|
FIELD XW_CONNS_INVITE_FIELD_ID CONNS_FIELD_LEFT PREVTOP 70 AUTO \
|
||||||
SINGLELINE EDITABLE UNDERLINED MAXCHARS 32
|
SINGLELINE EDITABLE UNDERLINED MAXCHARS 32
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -325,9 +325,9 @@ BEGIN
|
||||||
FIELD XW_CONNS_PORT_FIELD_ID CONNS_FIELD_LEFT PREVTOP 30 AUTO \
|
FIELD XW_CONNS_PORT_FIELD_ID CONNS_FIELD_LEFT PREVTOP 30 AUTO \
|
||||||
EDITABLE SINGLELINE UNDERLINED NUMERIC MAXCHARS 5
|
EDITABLE SINGLELINE UNDERLINED NUMERIC MAXCHARS 5
|
||||||
|
|
||||||
LABEL "Cookie:" XW_CONNS_COOKIE_LABEL_ID
|
LABEL "Invite:" XW_CONNS_INVITE_LABEL_ID
|
||||||
AT ( LEFTCOL+10 PREVBOTTOM + 2 )
|
AT ( LEFTCOL+10 PREVBOTTOM + 2 )
|
||||||
FIELD XW_CONNS_COOKIE_FIELD_ID CONNS_FIELD_LEFT PREVTOP 70 AUTO \
|
FIELD XW_CONNS_INVITE_FIELD_ID CONNS_FIELD_LEFT PREVTOP 70 AUTO \
|
||||||
SINGLELINE EDITABLE UNDERLINED MAXCHARS 32
|
SINGLELINE EDITABLE UNDERLINED MAXCHARS 32
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -196,8 +196,8 @@ frmObjId_2str( XP_U16 id )
|
||||||
CASESTR( XW_CONNS_TYPE_LIST_ID );
|
CASESTR( XW_CONNS_TYPE_LIST_ID );
|
||||||
#ifdef XWFEATURE_RELAY
|
#ifdef XWFEATURE_RELAY
|
||||||
CASESTR( XW_CONNS_RELAY_LABEL_ID );
|
CASESTR( XW_CONNS_RELAY_LABEL_ID );
|
||||||
CASESTR( XW_CONNS_COOKIE_FIELD_ID );
|
CASESTR( XW_CONNS_INVITE_FIELD_ID );
|
||||||
CASESTR( XW_CONNS_COOKIE_LABEL_ID );
|
CASESTR( XW_CONNS_INVITE_LABEL_ID );
|
||||||
CASESTR( XW_CONNS_PORT_LABEL_ID );
|
CASESTR( XW_CONNS_PORT_LABEL_ID );
|
||||||
CASESTR( XW_CONNS_RELAY_FIELD_ID );
|
CASESTR( XW_CONNS_RELAY_FIELD_ID );
|
||||||
CASESTR( XW_CONNS_PORT_FIELD_ID );
|
CASESTR( XW_CONNS_PORT_FIELD_ID );
|
||||||
|
|
|
@ -351,8 +351,8 @@
|
||||||
#define XW_CONNS_TYPE_LIST_ID 2903
|
#define XW_CONNS_TYPE_LIST_ID 2903
|
||||||
#ifdef XWFEATURE_RELAY
|
#ifdef XWFEATURE_RELAY
|
||||||
# define XW_CONNS_RELAY_LABEL_ID 2904
|
# define XW_CONNS_RELAY_LABEL_ID 2904
|
||||||
# define XW_CONNS_COOKIE_FIELD_ID 2905
|
# define XW_CONNS_INVITE_FIELD_ID 2905
|
||||||
# define XW_CONNS_COOKIE_LABEL_ID 2906
|
# define XW_CONNS_INVITE_LABEL_ID 2906
|
||||||
# define XW_CONNS_PORT_LABEL_ID 2907
|
# define XW_CONNS_PORT_LABEL_ID 2907
|
||||||
# define XW_CONNS_RELAY_FIELD_ID 2908
|
# define XW_CONNS_RELAY_FIELD_ID 2908
|
||||||
# define XW_CONNS_PORT_FIELD_ID 2909
|
# define XW_CONNS_PORT_FIELD_ID 2909
|
||||||
|
|
|
@ -956,7 +956,7 @@ CookieRef::_PrintCookieInfo( string& out )
|
||||||
out += Cookie();
|
out += Cookie();
|
||||||
out += "\n";
|
out += "\n";
|
||||||
out += "connName=";
|
out += "connName=";
|
||||||
char buf[MAX_CONNNAME_LEN+MAX_COOKIE_LEN];
|
char buf[MAX_CONNNAME_LEN+MAX_INVITE_LEN];
|
||||||
|
|
||||||
snprintf( buf, sizeof(buf), "%s\n", ConnName() );
|
snprintf( buf, sizeof(buf), "%s\n", ConnName() );
|
||||||
out += buf;
|
out += buf;
|
||||||
|
|
|
@ -280,7 +280,7 @@ send_with_length_unsafe( int socket, unsigned char* buf, int bufLen )
|
||||||
static bool
|
static bool
|
||||||
processConnect( unsigned char* bufp, int bufLen, int socket )
|
processConnect( unsigned char* bufp, int bufLen, int socket )
|
||||||
{
|
{
|
||||||
char cookie[MAX_COOKIE_LEN+1];
|
char cookie[MAX_INVITE_LEN+1];
|
||||||
unsigned char* end = bufp + bufLen;
|
unsigned char* end = bufp + bufLen;
|
||||||
bool success = false;
|
bool success = false;
|
||||||
|
|
||||||
|
@ -330,7 +330,7 @@ processReconnect( unsigned char* bufp, int bufLen, int socket )
|
||||||
if ( err != XWRELAY_ERROR_NONE ) {
|
if ( err != XWRELAY_ERROR_NONE ) {
|
||||||
denyConnection( socket, err );
|
denyConnection( socket, err );
|
||||||
} else {
|
} else {
|
||||||
char cookie[MAX_COOKIE_LEN+1];
|
char cookie[MAX_INVITE_LEN+1];
|
||||||
char connName[MAX_CONNNAME_LEN+1];
|
char connName[MAX_CONNNAME_LEN+1];
|
||||||
HostID srcID;
|
HostID srcID;
|
||||||
unsigned char nPlayersH;
|
unsigned char nPlayersH;
|
||||||
|
|
|
@ -99,7 +99,7 @@ typedef unsigned char XWRELAY_Cmd;
|
||||||
#define HOST_ID_NONE 0
|
#define HOST_ID_NONE 0
|
||||||
#define HOST_ID_SERVER 1
|
#define HOST_ID_SERVER 1
|
||||||
|
|
||||||
#define MAX_COOKIE_LEN 15
|
#define MAX_INVITE_LEN 15
|
||||||
#define MAX_MSG_LEN 256 /* 100 is more like it */
|
#define MAX_MSG_LEN 256 /* 100 is more like it */
|
||||||
#define MAX_CONNNAME_LEN 35 /* host id plus a small integer, typically */
|
#define MAX_CONNNAME_LEN 35 /* host id plus a small integer, typically */
|
||||||
|
|
||||||
|
|
|
@ -55,8 +55,8 @@ ceControlsToAddrRec( HWND hDlg, CeConnDlgState* state )
|
||||||
state->addrRec.u.ip_relay.hostName, &len );
|
state->addrRec.u.ip_relay.hostName, &len );
|
||||||
state->addrRec.u.ip_relay.port =
|
state->addrRec.u.ip_relay.port =
|
||||||
(XP_U16)ceGetDlgItemNum( hDlg, RELAYPORT_EDIT );
|
(XP_U16)ceGetDlgItemNum( hDlg, RELAYPORT_EDIT );
|
||||||
len = sizeof(state->addrRec.u.ip_relay.cookie);
|
len = sizeof(state->addrRec.u.ip_relay.invite);
|
||||||
ceGetDlgItemText( hDlg, COOKIE_EDIT, state->addrRec.u.ip_relay.cookie,
|
ceGetDlgItemText( hDlg, INVITE_EDIT, state->addrRec.u.ip_relay.invite,
|
||||||
&len );
|
&len );
|
||||||
#endif
|
#endif
|
||||||
} else if ( state->addrRec.conType == COMMS_CONN_IP_DIRECT ) {
|
} else if ( state->addrRec.conType == COMMS_CONN_IP_DIRECT ) {
|
||||||
|
@ -113,9 +113,9 @@ static void
|
||||||
adjustForConnType( HWND hDlg, CeConnDlgState* state, XP_Bool useFromState )
|
adjustForConnType( HWND hDlg, CeConnDlgState* state, XP_Bool useFromState )
|
||||||
{
|
{
|
||||||
XP_U16 relayIds[] = {
|
XP_U16 relayIds[] = {
|
||||||
IDC_COOKIE_LAB,
|
IDC_INVITE_LAB,
|
||||||
#ifdef XWFEATURE_RELAY
|
#ifdef XWFEATURE_RELAY
|
||||||
COOKIE_EDIT,IDC_CRELAYHINT_LAB,IDC_CRELAYNAME_LAB,RELAYNAME_EDIT,
|
INVITE_EDIT,IDC_CRELAYHINT_LAB,IDC_CRELAYNAME_LAB,RELAYNAME_EDIT,
|
||||||
IDC_CRELAYPORT_LAB, RELAYPORT_EDIT,
|
IDC_CRELAYPORT_LAB, RELAYPORT_EDIT,
|
||||||
#endif
|
#endif
|
||||||
0 };
|
0 };
|
||||||
|
@ -218,9 +218,9 @@ ceControlsFromAddrRec( HWND hDlg, const CeConnDlgState* state )
|
||||||
ceSetDlgItemNum( hDlg, RELAYPORT_EDIT,
|
ceSetDlgItemNum( hDlg, RELAYPORT_EDIT,
|
||||||
state->addrRec.u.ip_relay.port );
|
state->addrRec.u.ip_relay.port );
|
||||||
ids[nIds++] = RELAYPORT_EDIT;
|
ids[nIds++] = RELAYPORT_EDIT;
|
||||||
ceSetDlgItemText( hDlg, COOKIE_EDIT,
|
ceSetDlgItemText( hDlg, INVITE_EDIT,
|
||||||
state->addrRec.u.ip_relay.cookie );
|
state->addrRec.u.ip_relay.invite );
|
||||||
ids[nIds++] = COOKIE_EDIT;
|
ids[nIds++] = INVITE_EDIT;
|
||||||
#endif
|
#endif
|
||||||
} else if ( state->addrRec.conType == COMMS_CONN_IP_DIRECT ) {
|
} else if ( state->addrRec.conType == COMMS_CONN_IP_DIRECT ) {
|
||||||
#ifdef XWFEATURE_IP_DIRECT
|
#ifdef XWFEATURE_IP_DIRECT
|
||||||
|
|
|
@ -464,8 +464,8 @@ ce_sockwrap_send( CeSocketWrapper* self, const XP_U8* buf, XP_U16 len,
|
||||||
XP_ASSERT( addr->conType == COMMS_CONN_RELAY );
|
XP_ASSERT( addr->conType == COMMS_CONN_RELAY );
|
||||||
if ( 0 != XP_STRCMP( addr->u.ip_relay.hostName,
|
if ( 0 != XP_STRCMP( addr->u.ip_relay.hostName,
|
||||||
self->addrRec.u.ip_relay.hostName )
|
self->addrRec.u.ip_relay.hostName )
|
||||||
|| 0 != XP_STRCMP( addr->u.ip_relay.cookie,
|
|| 0 != XP_STRCMP( addr->u.ip_relay.invite,
|
||||||
self->addrRec.u.ip_relay.cookie )
|
self->addrRec.u.ip_relay.invite )
|
||||||
|| addr->u.ip_relay.port != self->addrRec.u.ip_relay.port ) {
|
|| addr->u.ip_relay.port != self->addrRec.u.ip_relay.port ) {
|
||||||
closeConnection( self );
|
closeConnection( self );
|
||||||
XP_MEMCPY( &self->addrRec, addr, sizeof(self->addrRec) );
|
XP_MEMCPY( &self->addrRec, addr, sizeof(self->addrRec) );
|
||||||
|
|
|
@ -604,8 +604,8 @@ BEGIN
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef XWFEATURE_RELAY
|
#ifdef XWFEATURE_RELAY
|
||||||
LTEXT "COOKIE:",IDC_COOKIE_LAB,LAB_COL,CONN_ROW_3,40,ROW_HEIGHT // <- translate COOKIE:
|
LTEXT "INVITE:",IDC_INVITE_LAB,LAB_COL,CONN_ROW_3,40,ROW_HEIGHT // <- translate INVITE:
|
||||||
EDITTEXT COOKIE_EDIT,CTRL_COL,CONN_ROW_4,CTRL_COL_WIDTH,ROW_HEIGHT,
|
EDITTEXT INVITE_EDIT,CTRL_COL,CONN_ROW_4,CTRL_COL_WIDTH,ROW_HEIGHT,
|
||||||
ES_AUTOHSCROLL
|
ES_AUTOHSCROLL
|
||||||
|
|
||||||
LTEXT "RELAY NAME (RARELY CHANGES):",IDC_CRELAYNAME_LAB, // <- translate RELAY NAME (RARELY CHANGES):
|
LTEXT "RELAY NAME (RARELY CHANGES):",IDC_CRELAYNAME_LAB, // <- translate RELAY NAME (RARELY CHANGES):
|
||||||
|
@ -617,7 +617,7 @@ BEGIN
|
||||||
EDITTEXT RELAYPORT_EDIT,CTRL_COL,CONN_ROW_8,CTRL_COL_WIDTH,ROW_HEIGHT,
|
EDITTEXT RELAYPORT_EDIT,CTRL_COL,CONN_ROW_8,CTRL_COL_WIDTH,ROW_HEIGHT,
|
||||||
ES_AUTOHSCROLL | ES_NUMBER
|
ES_AUTOHSCROLL | ES_NUMBER
|
||||||
#else
|
#else
|
||||||
LTEXT "RELAY CONNECTION NOT SUPPORTED.",IDC_COOKIE_LAB, // <- translate RELAY CONNECTION NOT SUPPORTED
|
LTEXT "RELAY CONNECTION NOT SUPPORTED.",IDC_INVITE_LAB, // <- translate RELAY CONNECTION NOT SUPPORTED
|
||||||
LAB_COL,CONN_ROW_3,40,40
|
LAB_COL,CONN_ROW_3,40,40
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -612,8 +612,8 @@ BEGIN
|
||||||
XWCOMBO(IDC_CONNECT_COMBO, CTRL_COL,CONN_ROW_2,CTRL_COL_WIDTH,ROW_HEIGHT,0,58,0)
|
XWCOMBO(IDC_CONNECT_COMBO, CTRL_COL,CONN_ROW_2,CTRL_COL_WIDTH,ROW_HEIGHT,0,58,0)
|
||||||
#endif
|
#endif
|
||||||
#ifdef XWFEATURE_RELAY
|
#ifdef XWFEATURE_RELAY
|
||||||
LTEXT "Cookie:",IDC_COOKIE_LAB,LAB_COL,CONN_ROW_3,40,ROW_HEIGHT
|
LTEXT "Invite:",IDC_INVITE_LAB,LAB_COL,CONN_ROW_3,40,ROW_HEIGHT
|
||||||
EDITTEXT COOKIE_EDIT,CTRL_COL,CONN_ROW_4,CTRL_COL_WIDTH,ROW_HEIGHT,
|
EDITTEXT INVITE_EDIT,CTRL_COL,CONN_ROW_4,CTRL_COL_WIDTH,ROW_HEIGHT,
|
||||||
ES_AUTOHSCROLL
|
ES_AUTOHSCROLL
|
||||||
|
|
||||||
LTEXT "Nom du relai (change rarement):",IDC_CRELAYNAME_LAB,
|
LTEXT "Nom du relai (change rarement):",IDC_CRELAYNAME_LAB,
|
||||||
|
@ -625,7 +625,7 @@ BEGIN
|
||||||
EDITTEXT RELAYPORT_EDIT,CTRL_COL,CONN_ROW_8,CTRL_COL_WIDTH,ROW_HEIGHT,
|
EDITTEXT RELAYPORT_EDIT,CTRL_COL,CONN_ROW_8,CTRL_COL_WIDTH,ROW_HEIGHT,
|
||||||
ES_AUTOHSCROLL | ES_NUMBER
|
ES_AUTOHSCROLL | ES_NUMBER
|
||||||
#else
|
#else
|
||||||
LTEXT "Connexion non supportée.",IDC_COOKIE_LAB,
|
LTEXT "Connexion non supportée.",IDC_INVITE_LAB,
|
||||||
LAB_COL,CONN_ROW_3,40,40
|
LAB_COL,CONN_ROW_3,40,40
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -618,8 +618,8 @@ BEGIN
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef XWFEATURE_RELAY
|
#ifdef XWFEATURE_RELAY
|
||||||
LTEXT "Ciasteczko:",IDC_COOKIE_LAB,LAB_COL,CONN_ROW_3,40,ROW_HEIGHT
|
LTEXT "Ciasteczko:",IDC_INVITE_LAB,LAB_COL,CONN_ROW_3,40,ROW_HEIGHT
|
||||||
EDITTEXT COOKIE_EDIT,CTRL_COL,CONN_ROW_4,CTRL_COL_WIDTH,ROW_HEIGHT,
|
EDITTEXT INVITE_EDIT,CTRL_COL,CONN_ROW_4,CTRL_COL_WIDTH,ROW_HEIGHT,
|
||||||
ES_AUTOHSCROLL
|
ES_AUTOHSCROLL
|
||||||
|
|
||||||
LTEXT "Nazwa proxy (raczej niezmienna):",IDC_CRELAYNAME_LAB,
|
LTEXT "Nazwa proxy (raczej niezmienna):",IDC_CRELAYNAME_LAB,
|
||||||
|
@ -631,7 +631,7 @@ BEGIN
|
||||||
EDITTEXT RELAYPORT_EDIT,CTRL_COL,CONN_ROW_8,CTRL_COL_WIDTH,ROW_HEIGHT,
|
EDITTEXT RELAYPORT_EDIT,CTRL_COL,CONN_ROW_8,CTRL_COL_WIDTH,ROW_HEIGHT,
|
||||||
ES_AUTOHSCROLL | ES_NUMBER
|
ES_AUTOHSCROLL | ES_NUMBER
|
||||||
#else
|
#else
|
||||||
LTEXT "Połączenie przez proxy niedostępne.",IDC_COOKIE_LAB,
|
LTEXT "Połączenie przez proxy niedostępne.",IDC_INVITE_LAB,
|
||||||
LAB_COL,CONN_ROW_3,40,40
|
LAB_COL,CONN_ROW_3,40,40
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -183,7 +183,7 @@
|
||||||
# define IDC_CCONVIA_LAB 1106
|
# define IDC_CCONVIA_LAB 1106
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define IDC_COOKIE_LAB 1107
|
#define IDC_INVITE_LAB 1107
|
||||||
#ifdef XWFEATURE_RELAY
|
#ifdef XWFEATURE_RELAY
|
||||||
# define IDC_CRELAYNAME_LAB 1108
|
# define IDC_CRELAYNAME_LAB 1108
|
||||||
# define IDC_CRELAYPORT_LAB 1109
|
# define IDC_CRELAYPORT_LAB 1109
|
||||||
|
@ -192,7 +192,7 @@
|
||||||
/* # define IDC_CONNECTCOMBO 1111 */
|
/* # define IDC_CONNECTCOMBO 1111 */
|
||||||
# define RELAYNAME_EDIT 1112
|
# define RELAYNAME_EDIT 1112
|
||||||
# define RELAYPORT_EDIT 1113
|
# define RELAYPORT_EDIT 1113
|
||||||
# define COOKIE_EDIT 1114
|
# define INVITE_EDIT 1114
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -621,9 +621,9 @@ BEGIN
|
||||||
XWCOMBO(IDC_CONNECT_COMBO,CTRL_COL,CONN_ROW_2,CTRL_COL_WIDTH,ROW_HEIGHT,0,58,0)
|
XWCOMBO(IDC_CONNECT_COMBO,CTRL_COL,CONN_ROW_2,CTRL_COL_WIDTH,ROW_HEIGHT,0,58,0)
|
||||||
#endif
|
#endif
|
||||||
#ifdef XWFEATURE_RELAY
|
#ifdef XWFEATURE_RELAY
|
||||||
LTEXT "Cookie (must match other devices in the game):",
|
LTEXT "Invite (must match other devices in the game):",
|
||||||
IDC_COOKIE_LAB,LAB_COL,CONN_ROW_3,100,(ROW_HEIGHT*2)
|
IDC_INVITE_LAB,LAB_COL,CONN_ROW_3,100,(ROW_HEIGHT*2)
|
||||||
EDITTEXT COOKIE_EDIT,CTRL_COL,CONN_ROW_4,CTRL_COL_WIDTH,ROW_HEIGHT,
|
EDITTEXT INVITE_EDIT,CTRL_COL,CONN_ROW_4,CTRL_COL_WIDTH,ROW_HEIGHT,
|
||||||
ES_AUTOHSCROLL
|
ES_AUTOHSCROLL
|
||||||
|
|
||||||
LTEXT "Relay name (rarely changes):",IDC_CRELAYNAME_LAB,LAB_COL,CONN_ROW_5,120,ROW_HEIGHT
|
LTEXT "Relay name (rarely changes):",IDC_CRELAYNAME_LAB,LAB_COL,CONN_ROW_5,120,ROW_HEIGHT
|
||||||
|
@ -633,7 +633,7 @@ BEGIN
|
||||||
EDITTEXT RELAYPORT_EDIT,CTRL_COL,CONN_ROW_8,CTRL_COL_WIDTH,ROW_HEIGHT,
|
EDITTEXT RELAYPORT_EDIT,CTRL_COL,CONN_ROW_8,CTRL_COL_WIDTH,ROW_HEIGHT,
|
||||||
ES_AUTOHSCROLL | ES_NUMBER
|
ES_AUTOHSCROLL | ES_NUMBER
|
||||||
#else
|
#else
|
||||||
LTEXT "Relay connection not supported.",IDC_COOKIE_LAB,LAB_COL,CONN_ROW_3,40,40
|
LTEXT "Relay connection not supported.",IDC_INVITE_LAB,LAB_COL,CONN_ROW_3,40,40
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef XWFEATURE_IP_DIRECT
|
#ifdef XWFEATURE_IP_DIRECT
|
||||||
|
|
Loading…
Reference in a new issue