[Freeciv-Dev] (PR#13327) Scenario and nation selection
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: |
[Freeciv-Dev] (PR#13327) Scenario and nation selection |
From: |
"Mateusz Stefek" <mstefek@xxxxxxxxx> |
Date: |
Tue, 20 Sep 2005 11:39:15 -0700 |
Reply-to: |
bugs@xxxxxxxxxxx |
<URL: http://bugs.freeciv.org/Ticket/Display.html?id=13327 >
Another(better) version.
--
mateusz
Index: server/stdinhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/stdinhand.c,v
retrieving revision 1.437
diff -u -r1.437 stdinhand.c
--- server/stdinhand.c 20 Sep 2005 12:48:35 -0000 1.437
+++ server/stdinhand.c 20 Sep 2005 18:36:59 -0000
@@ -3175,6 +3175,9 @@
read_timer_seconds_free(uloadtimer));
sanity_check();
+
+ send_game_info(game.est_connections);
+ send_rulesets(game.est_connections);
/* Everything seemed to load ok; spread the good news. */
send_load_game_info(TRUE);
Index: client/packhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/packhand.c,v
retrieving revision 1.548
diff -u -r1.548 packhand.c
--- client/packhand.c 5 Sep 2005 15:55:45 -0000 1.548
+++ client/packhand.c 20 Sep 2005 18:37:07 -0000
@@ -180,7 +180,11 @@
aconnection.id = conn_id;
agents_game_joined();
update_menus();
- set_client_page(PAGE_START);
+
+
+ if (get_client_page() == PAGE_MAIN || get_client_page() == PAGE_NETWORK) {
+ set_client_page(PAGE_START);
+ }
/* we could always use hack, verify we're local */
send_client_wants_hack(challenge_file);
Index: client/gui-gtk-2.0/pages.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/pages.c,v
retrieving revision 1.40
diff -u -r1.40 pages.c
--- client/gui-gtk-2.0/pages.c 5 Sep 2005 15:55:45 -0000 1.40
+++ client/gui-gtk-2.0/pages.c 20 Sep 2005 18:37:07 -0000
@@ -98,8 +98,7 @@
static void start_scenario_callback(GtkWidget *w, gpointer data)
{
set_client_page(PAGE_SCENARIO);
-
- start_new_game_callback(NULL, NULL);
+ client_start_server();
}
/**************************************************************************
@@ -108,8 +107,7 @@
static void load_saved_game_callback(GtkWidget *w, gpointer data)
{
set_client_page(PAGE_LOAD);
-
- start_new_game_callback(NULL, NULL);
+ client_start_server();
}
/**************************************************************************
@@ -1274,9 +1272,23 @@
{
if (!packet->load_successful) {
} else {
- update_nation_page(packet);
+ if (game.info.is_new_game) {
+ char message[MAX_LEN_MSG];
+
+ set_client_page(PAGE_START);
+
+ /* It's pregame. Create a player and connect to him */
+ my_snprintf(message, sizeof(message), "/create %s", user_name);
+ send_chat(message);
+ my_snprintf(message, sizeof(message), "/ai %s", user_name);
+ send_chat(message);
+ my_snprintf(message, sizeof(message), "/take \"%s\"", user_name);
+ send_chat(message);
- set_client_page(PAGE_NATION);
+ } else {
+ update_nation_page(packet);
+ set_client_page(PAGE_NATION);
+ }
}
}
@@ -1736,6 +1748,13 @@
return box;
}
+/**************************************************************************
+ Returns current client page
+**************************************************************************/
+enum client_pages get_client_page(void)
+{
+ return old_page;
+}
/**************************************************************************
changes the current page.
@@ -1746,6 +1765,7 @@
enum client_pages new_page;
new_page = page;
+
/* If the page remains the same, don't do anything. */
if (old_page == new_page) {
@@ -1753,12 +1773,8 @@
}
switch (old_page) {
- /* We aren't interested in showing a start page on game load or scenario. */
case PAGE_SCENARIO:
case PAGE_LOAD:
- if (new_page == PAGE_START) {
- return;
- }
break;
case PAGE_NETWORK:
if (lan_timer != 0) {
Index: client/include/pages_g.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/include/pages_g.h,v
retrieving revision 1.2
diff -u -r1.2 pages_g.h
--- client/include/pages_g.h 28 Mar 2005 17:19:27 -0000 1.2
+++ client/include/pages_g.h 20 Sep 2005 18:37:07 -0000
@@ -27,5 +27,6 @@
};
void set_client_page(enum client_pages page);
+enum client_pages get_client_page(void);
#endif /* FC__PAGES_G_H */
|
|