3 #ifdef ENABLE_NETWORK |
3 #ifdef ENABLE_NETWORK |
4 |
4 |
5 #include "../stdafx.h" |
5 #include "../stdafx.h" |
6 #include "../openttd.h" // XXX StringID |
6 #include "../openttd.h" // XXX StringID |
7 #include "../debug.h" |
7 #include "../debug.h" |
8 #include "../string.h" |
8 #include "../strings_func.h" |
9 #include "../strings.h" |
|
10 #include "network_data.h" |
9 #include "network_data.h" |
11 #include "core/tcp.h" |
10 #include "core/tcp.h" |
12 #include "../train.h" |
11 #include "../train.h" |
13 #include "../aircraft.h" |
12 #include "../aircraft.h" |
14 #include "../date.h" |
13 #include "../date_func.h" |
15 #include "table/strings.h" |
14 #include "table/strings.h" |
16 #include "../functions.h" |
|
17 #include "network_server.h" |
15 #include "network_server.h" |
18 #include "network_udp.h" |
16 #include "network_udp.h" |
19 #include "../console.h" |
17 #include "../console.h" |
20 #include "../command.h" |
18 #include "../command_func.h" |
21 #include "../saveload.h" |
19 #include "../saveload.h" |
22 #include "../vehicle.h" |
|
23 #include "../station.h" |
20 #include "../station.h" |
24 #include "../variables.h" |
21 #include "../variables.h" |
25 #include "../genworld.h" |
22 #include "../genworld.h" |
26 #include "../helpers.hpp" |
23 #include "../core/alloc_func.hpp" |
27 #include "../fileio.h" |
24 #include "../fileio.h" |
|
25 #include "../string_func.h" |
28 |
26 |
29 // This file handles all the server-commands |
27 // This file handles all the server-commands |
30 |
28 |
31 static void NetworkHandleCommandQueue(NetworkTCPSocketHandler* cs); |
29 static void NetworkHandleCommandQueue(NetworkTCPSocketHandler* cs); |
32 |
30 |
245 cs->status = STATUS_AUTH; |
245 cs->status = STATUS_AUTH; |
246 _network_game_info.clients_on++; |
246 _network_game_info.clients_on++; |
247 |
247 |
248 p = NetworkSend_Init(PACKET_SERVER_WELCOME); |
248 p = NetworkSend_Init(PACKET_SERVER_WELCOME); |
249 p->Send_uint16(cs->index); |
249 p->Send_uint16(cs->index); |
|
250 p->Send_uint32(_patches.generation_seed); |
|
251 p->Send_string(_network_unique_id); |
250 cs->Send_Packet(p); |
252 cs->Send_Packet(p); |
251 |
253 |
252 // Transmit info about all the active clients |
254 // Transmit info about all the active clients |
253 FOR_ALL_CLIENTS(new_cs) { |
255 FOR_ALL_CLIENTS(new_cs) { |
254 if (new_cs != cs && new_cs->status > STATUS_AUTH) |
256 if (new_cs != cs && new_cs->status > STATUS_AUTH) |