equal
deleted
inserted
replaced
4 |
4 |
5 #include "../stdafx.h" |
5 #include "../stdafx.h" |
6 #include "../debug.h" |
6 #include "../debug.h" |
7 #include "network_data.h" |
7 #include "network_data.h" |
8 #include "../newgrf_config.h" |
8 #include "../newgrf_config.h" |
|
9 #include "../helpers.hpp" |
9 |
10 |
10 // This file handles the GameList |
11 // This file handles the GameList |
11 // Also, it handles the request to a server for data about the server |
12 // Also, it handles the request to a server for data about the server |
12 |
13 |
13 /** Add a new item to the linked gamelist. If the IP and Port match |
14 /** Add a new item to the linked gamelist. If the IP and Port match |
23 for (item = _network_game_list; item != NULL; item = item->next) { |
24 for (item = _network_game_list; item != NULL; item = item->next) { |
24 if (item->ip == ip && item->port == port) return item; |
25 if (item->ip == ip && item->port == port) return item; |
25 prev_item = item; |
26 prev_item = item; |
26 } |
27 } |
27 |
28 |
28 item = malloc(sizeof(*item)); |
29 MallocT(&item, 1); |
29 memset(item, 0, sizeof(*item)); |
30 memset(item, 0, sizeof(*item)); |
30 item->next = NULL; |
31 item->next = NULL; |
31 item->ip = ip; |
32 item->ip = ip; |
32 item->port = port; |
33 item->port = port; |
33 |
34 |