commit 51b55acce77a77640c955dc442a724f9ca1b25ca
parent 0e228bac539b2890789b2c8457a0cd62f427a5cd
Author: Ben Webb <ben@salilab.org>
Date: Thu, 12 Nov 2020 23:44:40 -0800
Fix no-network builds
Diffstat:
4 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/src/curses_client/curses_client.c b/src/curses_client/curses_client.c
@@ -2662,7 +2662,9 @@ void CursesLoop(struct CMDLINE *cmdline)
BackupConfig();
start_curses();
+#ifdef NETWORKING
CurlInit(&MetaConn);
+#endif
Width = COLS;
Depth = LINES;
@@ -2693,5 +2695,7 @@ void CursesLoop(struct CMDLINE *cmdline)
} while (c == 'Y');
FirstClient = RemovePlayer(Play, FirstClient);
end_curses();
+#ifdef NETWORKING
CurlCleanup(&MetaConn);
+#endif
}
diff --git a/src/gui_client/gtk_client.c b/src/gui_client/gtk_client.c
@@ -2334,11 +2334,15 @@ gboolean GtkLoop(int *argc, char **argv[],
SetIcon(window, dopewars_pill_xpm);
+#ifdef NETWORKING
CurlInit(&MetaConn);
+#endif
gtk_main();
+#ifdef NETWORKING
CurlCleanup(&MetaConn);
+#endif
/* Free the main player */
FirstClient = RemovePlayer(ClientData.Play, FirstClient);
diff --git a/src/gui_client/newgamedia.c b/src/gui_client/newgamedia.c
@@ -400,6 +400,7 @@ static void CloseNewGameDia(GtkWidget *widget, gpointer data)
NewGameType = gtk_notebook_get_current_page(GTK_NOTEBOOK(stgam.notebook));
}
+#ifdef NETWORKING
static void metalist_row_select(GtkWidget *clist, gint row, gint column,
GdkEvent *event, GtkWidget *conn_button)
{
@@ -411,6 +412,7 @@ static void metalist_row_unselect(GtkWidget *clist, gint row, gint column,
{
gtk_widget_set_sensitive(conn_button, FALSE);
}
+#endif
#ifdef NETWORKING
void NewGameDialog(Player *play, NBCallBack sockstat, CurlConnection *MetaConn)
@@ -419,12 +421,12 @@ void NewGameDialog(Player *play)
#endif
{
GtkWidget *vbox, *vbox2, *hbox, *label, *entry, *notebook;
- GtkWidget *frame, *button, *dialog, *defbutton;
+ GtkWidget *frame, *button, *dialog;
GtkAccelGroup *accel_group;
guint AccelKey;
#ifdef NETWORKING
- GtkWidget *clist, *scrollwin, *table, *hbbox;
+ GtkWidget *clist, *scrollwin, *table, *hbbox, *defbutton;
gchar *server_titles[5], *ServerEntry, *text;
gboolean UpdateMeta = FALSE;
SetCurlCallback(MetaConn, glib_timeout, glib_socket);
diff --git a/src/serverside.c b/src/serverside.c
@@ -3678,7 +3678,9 @@ long GetMinimumTimeout(GSList *First)
time_t timenow;
timenow = time(NULL);
+#ifdef NETWORKING
curl_multi_timeout(MetaConn.multi, &mintime);
+#endif
if (AddTimeout(MetaMinTimeout, timenow, &mintime))
return 0;
if (AddTimeout(MetaUpdateTimeout, timenow, &mintime))