remove "room" from relay stuff

which is going away anyway....
This commit is contained in:
Eric House 2022-01-17 20:22:27 -08:00
parent 6d56f2c82c
commit 924511ac82
5 changed files with 8 additions and 32 deletions

View file

@ -241,7 +241,7 @@ cgl_draw( CursGameList* cgl )
mvwaddstr( win, 0, cgl->width-1, "+" );
}
const char* cols[] = {"#", "RowID", "Lang", "Scores", "GameID", "Role", "Room",
const char* cols[] = {"#", "RowID", "Lang", "Scores", "GameID", "Role",
"nTot", "nMiss", "Seed", "#Mv", "Turn", "nPend", "DupTimer" };
int nShown = nGames <= cgl->height - 2 ? nGames : cgl->height - 2;
@ -259,7 +259,6 @@ cgl_draw( CursGameList* cgl )
data[line][col++] = g_strdup( gi->scores );
data[line][col++] = g_strdup_printf( "%d", gi->gameID );
data[line][col++] = g_strdup_printf( "%d", gi->role );
data[line][col++] = g_strdup( gi->room );
data[line][col++] = g_strdup_printf( "%d", gi->nTotal );
data[line][col++] = g_strdup_printf( "%d", countBits(gi->nMissing) );
data[line][col++] = g_strdup_printf( "%d", gi->seed );

View file

@ -164,7 +164,7 @@ createTables( sqlite3* pDb )
",game BLOB"
",snap BLOB"
",inviteInfo BLOB"
",room VARCHAR(32)"
",room VARCHAR(32)" /* no longer used */
",connvia VARCHAR(32)"
",relayid VARCHAR(32)"
",ended INT(1)"
@ -333,7 +333,6 @@ gdb_summarize( CommonGlobals* cGlobals )
XP_LangCode dictLang = gi->dictLang;
XP_ASSERT( 0 != gameID );
CommsAddrRec addr = {0};
gchar* room = "";
// gchar* connvia = "local";
gchar connvia[128] = {0};
@ -367,7 +366,6 @@ gdb_summarize( CommonGlobals* cGlobals )
}
switch( typ) {
case COMMS_CONN_RELAY:
room = addr.u.ip_relay.invite;
strcat( connvia, "Relay" );
break;
case COMMS_CONN_SMS:
@ -401,7 +399,6 @@ gdb_summarize( CommonGlobals* cGlobals )
gchar* pairs[40];
int indx = 0;
pairs[indx++] = g_strdup_printf( "room='%s'", room );
pairs[indx++] = g_strdup_printf( "ended=%d", gameOver?1:0 );
pairs[indx++] = g_strdup_printf( "turn=%d", turn);
pairs[indx++] = g_strdup_printf( "local=%d", isLocal?1:0);
@ -532,7 +529,7 @@ XP_Bool
gdb_getGameInfo( sqlite3* pDb, sqlite3_int64 rowid, GameInfo* gib )
{
XP_Bool success = XP_FALSE;
const char* fmt = "SELECT room, ended, turn, local, nmoves, ntotal, nmissing, "
const char* fmt = "SELECT ended, turn, local, nmoves, ntotal, nmissing, "
"dictlang, seed, connvia, gameid, lastMoveTime, dupTimerExpires, relayid, scores, nPending, role, created, snap "
"FROM games WHERE rowid = %lld";
XP_UCHAR query[256];
@ -545,8 +542,6 @@ gdb_getGameInfo( sqlite3* pDb, sqlite3_int64 rowid, GameInfo* gib )
if ( SQLITE_ROW == result ) {
success = XP_TRUE;
int col = 0;
int len = sizeof(gib->room);
getColumnText( ppStmt, col++, gib->room, &len );
gib->rowid = rowid;
gib->gameOver = 1 == sqlite3_column_int( ppStmt, col++ );
gib->turn = sqlite3_column_int( ppStmt, col++ );
@ -556,7 +551,7 @@ gdb_getGameInfo( sqlite3* pDb, sqlite3_int64 rowid, GameInfo* gib )
gib->nMissing = sqlite3_column_int( ppStmt, col++ );
gib->dictLang = sqlite3_column_int( ppStmt, col++ );
gib->seed = sqlite3_column_int( ppStmt, col++ );
len = sizeof(gib->conn);
int len = sizeof(gib->conn);
getColumnText( ppStmt, col++, gib->conn, &len );
gib->gameID = sqlite3_column_int( ppStmt, col++ );
gib->lastMoveTime = sqlite3_column_int( ppStmt, col++ );

View file

@ -30,7 +30,6 @@
typedef struct _GameInfo {
sqlite3_int64 rowid;
XP_UCHAR name[128];
XP_UCHAR room[128];
XP_UCHAR conn[128];
XP_UCHAR scores[128];
XP_UCHAR relayID[32];

View file

@ -209,31 +209,17 @@ static GtkWidget*
makeRelayPage( GtkConnsState* state, PageData* data )
{
GtkWidget* vbox = boxWithUseCheck( state, data );
const gchar* hint = NULL;
if ( SERVER_ISSERVER == state->role ) {
hint = "As host, you pick the room name for the game, and must "
"connect first";
} else {
XP_ASSERT( SERVER_ISCLIENT == state->role );
hint = "As guest, you get the room name from the host. Be sure to "
"let the host connect first to validate the name.";
}
gtk_box_pack_start( GTK_BOX(vbox), gtk_label_new( hint ), FALSE, TRUE, 0 );
GtkWidget* hbox = makeLabeledField( "Room", &state->invite, NULL );
XP_Bool hasRelay = addr_hasType( state->addr, COMMS_CONN_RELAY );
if ( hasRelay ) {
gtk_entry_set_text( GTK_ENTRY(state->invite),
gtk_entry_set_text( GTK_ENTRY(state->invite),
state->addr->u.ip_relay.invite );
}
gtk_box_pack_start( GTK_BOX(vbox), hbox, FALSE, TRUE, 0 );
gtk_widget_set_sensitive( state->invite, !state->readOnly );
hbox = makeLabeledField( "Relay address", &state->hostName, NULL );
GtkWidget* hbox = makeLabeledField( "Relay address", &state->hostName, NULL );
if ( hasRelay ) {
gtk_entry_set_text( GTK_ENTRY(state->hostName),
gtk_entry_set_text( GTK_ENTRY(state->hostName),
state->addr->u.ip_relay.hostName );
}
gtk_box_pack_start( GTK_BOX(vbox), hbox, FALSE, TRUE, 0 );

View file

@ -81,7 +81,7 @@ findOpenGame( const GtkAppGlobals* apg, sqlite3_int64 rowid )
return result;
}
enum { ROW_ITEM, ROW_THUMB, NAME_ITEM, CREATED_ITEM, ROOM_ITEM, GAMEID_ITEM,
enum { ROW_ITEM, ROW_THUMB, NAME_ITEM, CREATED_ITEM, GAMEID_ITEM,
LANG_ITEM, SEED_ITEM, ROLE_ITEM, CONN_ITEM, RELAYID_ITEM, OVER_ITEM, TURN_ITEM,
LOCAL_ITEM, NMOVES_ITEM, NTOTAL_ITEM, MISSING_ITEM, LASTTURN_ITEM,
DUPTIMER_ITEM,
@ -174,7 +174,6 @@ init_games_list( GtkAppGlobals* apg )
addImageColumn( list, "Snap", ROW_THUMB );
addTextColumn( list, "Name", NAME_ITEM );
addTextColumn( list, "Created", CREATED_ITEM );
addTextColumn( list, "Room", ROOM_ITEM );
addTextColumn( list, "GameID", GAMEID_ITEM );
addTextColumn( list, "Lang", LANG_ITEM );
addTextColumn( list, "Seed", SEED_ITEM );
@ -195,7 +194,6 @@ init_games_list( GtkAppGlobals* apg )
GDK_TYPE_PIXBUF,/* ROW_THUMB */
G_TYPE_STRING, /* NAME_ITEM */
G_TYPE_STRING, /* CREATED_ITEM */
G_TYPE_STRING, /* ROOM_ITEM */
G_TYPE_INT, /* GAMEID_ITEM */
G_TYPE_STRING, /* LANG_ITEM */
G_TYPE_INT, /* SEED_ITEM */
@ -269,7 +267,6 @@ add_to_list( GtkWidget* list, sqlite3_int64 rowid, XP_Bool isNew,
ROW_THUMB, gib->snap,
NAME_ITEM, gib->name,
CREATED_ITEM, createdStr,
ROOM_ITEM, gib->room,
GAMEID_ITEM, gib->gameID,
LANG_ITEM, lcToLocale(gib->dictLang),
SEED_ITEM, gib->seed,