summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-01-16 12:59:47 +0000
committerrubidium <rubidium@openttd.org>2009-01-16 12:59:47 +0000
commitb1a33a494f7a9510f600cb18e771b35905597be6 (patch)
treeeef2f6bd0f7e1c471cd04882c93477dbfe6df764 /src/network
parentcdd3676478bc50ec10960146034e93d522c86142 (diff)
downloadopenttd-b1a33a494f7a9510f600cb18e771b35905597be6.tar.xz
(svn r15104) -Codechange: unify the resolving of the xyz kbytes/megabytes strings.
Diffstat (limited to 'src/network')
-rw-r--r--src/network/network_client.cpp8
-rw-r--r--src/network/network_gui.cpp10
-rw-r--r--src/network/network_internal.h4
3 files changed, 11 insertions, 11 deletions
diff --git a/src/network/network_client.cpp b/src/network/network_client.cpp
index ab0ff9342..c8116fc4c 100644
--- a/src/network/network_client.cpp
+++ b/src/network/network_client.cpp
@@ -556,8 +556,8 @@ DEF_CLIENT_RECEIVE_COMMAND(PACKET_SERVER_MAP)
_frame_counter = _frame_counter_server = _frame_counter_max = p->Recv_uint32();
- _network_join_kbytes = 0;
- _network_join_kbytes_total = p->Recv_uint32() / 1024;
+ _network_join_bytes = 0;
+ _network_join_bytes_total = p->Recv_uint32();
/* If the network connection has been closed due to loss of connection
* or when _network_join_kbytes_total is 0, the join status window will
@@ -565,7 +565,7 @@ DEF_CLIENT_RECEIVE_COMMAND(PACKET_SERVER_MAP)
* that. If kbytes_total is 0, the packet must be malformed as a
* savegame less than 1 kilobyte is practically impossible. */
if (MY_CLIENT->has_quit) return NETWORK_RECV_STATUS_CONN_LOST;
- if (_network_join_kbytes_total == 0) return NETWORK_RECV_STATUS_MALFORMED_PACKET;
+ if (_network_join_bytes_total == 0) return NETWORK_RECV_STATUS_MALFORMED_PACKET;
_network_join_status = NETWORK_JOIN_STATUS_DOWNLOADING;
InvalidateWindow(WC_NETWORK_STATUS_WINDOW, 0);
@@ -581,7 +581,7 @@ DEF_CLIENT_RECEIVE_COMMAND(PACKET_SERVER_MAP)
return NETWORK_RECV_STATUS_SAVEGAME;
}
- _network_join_kbytes = ftell(file_pointer) / 1024;
+ _network_join_bytes = ftell(file_pointer);
InvalidateWindow(WC_NETWORK_STATUS_WINDOW, 0);
}
diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp
index 60d63083d..e130b7770 100644
--- a/src/network/network_gui.cpp
+++ b/src/network/network_gui.cpp
@@ -1765,8 +1765,8 @@ void ShowNetworkNeedPassword(NetworkPasswordType npt)
// Vars needed for the join-GUI
NetworkJoinStatus _network_join_status;
uint8 _network_join_waiting;
-uint16 _network_join_kbytes;
-uint16 _network_join_kbytes_total;
+uint32 _network_join_bytes;
+uint32 _network_join_bytes_total;
struct NetworkJoinStatusWindow : Window {
NetworkJoinStatusWindow(const WindowDesc *desc) : Window(desc)
@@ -1791,12 +1791,12 @@ struct NetworkJoinStatusWindow : Window {
progress = 15; // third stage is 15%
break;
case NETWORK_JOIN_STATUS_DOWNLOADING:
- SetDParam(0, _network_join_kbytes);
- SetDParam(1, _network_join_kbytes_total);
+ SetDParam(0, _network_join_bytes);
+ SetDParam(1, _network_join_bytes_total);
DrawStringCentered(125, 46, STR_NETWORK_CONNECTING_DOWNLOADING, TC_GREY);
/* Fallthrough */
default: /* Waiting is 15%, so the resting receivement of map is maximum 70% */
- progress = 15 + _network_join_kbytes * (100 - 15) / _network_join_kbytes_total;
+ progress = 15 + _network_join_bytes * (100 - 15) / _network_join_bytes_total;
}
/* Draw nice progress bar :) */
diff --git a/src/network/network_internal.h b/src/network/network_internal.h
index 59b12a9db..be78ae772 100644
--- a/src/network/network_internal.h
+++ b/src/network/network_internal.h
@@ -111,8 +111,8 @@ extern bool _network_first_time;
// Vars needed for the join-GUI
extern NetworkJoinStatus _network_join_status;
extern uint8 _network_join_waiting;
-extern uint16 _network_join_kbytes;
-extern uint16 _network_join_kbytes_total;
+extern uint32 _network_join_bytes;
+extern uint32 _network_join_bytes_total;
extern uint32 _network_last_host_ip;
extern uint8 _network_reconnect;