Files
@ r4381:c965d1f3016a
Branch filter:
Location: cpp/openttd-patchpack/source/network_gamelist.c - annotation
r4381:c965d1f3016a
1.7 KiB
text/x-c
(svn r6131) -Codechange : Complete all missing _ttdpatch_flags entries
-Feature : both unifiedmaglevmode are now set.
Maglev and monorail are not allowed to run on each other tracks and will not be.
Setting those flags will allow grfsets as the Norvegian one to be loaded
-Codechange : link the TTDPatch's irregularstations with OTTD's nonuniform_stations
-Codechange : Reformat the whole array (thanks Rubidium, it sure looks better now)
-Feature : both unifiedmaglevmode are now set.
Maglev and monorail are not allowed to run on each other tracks and will not be.
Setting those flags will allow grfsets as the Norvegian one to be loaded
-Codechange : link the TTDPatch's irregularstations with OTTD's nonuniform_stations
-Codechange : Reformat the whole array (thanks Rubidium, it sure looks better now)
r2186:5ee653b1b5e1 r2186:5ee653b1b5e1 r543:efdb197f91ad r1299:07d5483b3f76 r543:efdb197f91ad r543:efdb197f91ad r543:efdb197f91ad r543:efdb197f91ad r543:efdb197f91ad r543:efdb197f91ad r543:efdb197f91ad r543:efdb197f91ad r543:efdb197f91ad r2885:9ada664ec733 r2885:9ada664ec733 r2885:9ada664ec733 r2885:9ada664ec733 r2885:9ada664ec733 r543:efdb197f91ad r543:efdb197f91ad r2881:c5bcb1dd0332 r543:efdb197f91ad r2881:c5bcb1dd0332 r2881:c5bcb1dd0332 r2881:c5bcb1dd0332 r2881:c5bcb1dd0332 r543:efdb197f91ad r543:efdb197f91ad r2881:c5bcb1dd0332 r543:efdb197f91ad r543:efdb197f91ad r543:efdb197f91ad r543:efdb197f91ad r2881:c5bcb1dd0332 r4077:259c4c4aacad r4077:259c4c4aacad r4077:259c4c4aacad r4077:259c4c4aacad r4077:259c4c4aacad r2881:c5bcb1dd0332 r543:efdb197f91ad r543:efdb197f91ad r543:efdb197f91ad r543:efdb197f91ad r543:efdb197f91ad r543:efdb197f91ad r2885:9ada664ec733 r2885:9ada664ec733 r738:f65fde6f029e r738:f65fde6f029e r2881:c5bcb1dd0332 r738:f65fde6f029e r2881:c5bcb1dd0332 r2881:c5bcb1dd0332 r2881:c5bcb1dd0332 r4077:259c4c4aacad r4077:259c4c4aacad r4077:259c4c4aacad r4077:259c4c4aacad r4077:259c4c4aacad r738:f65fde6f029e r738:f65fde6f029e r738:f65fde6f029e r2881:c5bcb1dd0332 r738:f65fde6f029e r738:f65fde6f029e r2881:c5bcb1dd0332 r738:f65fde6f029e r738:f65fde6f029e r738:f65fde6f029e r543:efdb197f91ad | /* $Id$ */
#include "stdafx.h"
#include "debug.h"
#include "network_data.h"
#ifdef ENABLE_NETWORK
// This file handles the GameList
// Also, it handles the request to a server for data about the server
extern void UpdateNetworkGameWindow(bool unselect);
/** Add a new item to the linked gamelist. If the IP and Port match
* return the existing item instead of adding it again
* @param ip the IP-address (inet_addr) of the to-be added item
* @param port the port the server is running on
* @return a point to the newly added or already existing item */
NetworkGameList *NetworkGameListAddItem(uint32 ip, uint16 port)
{
NetworkGameList *item, *prev_item;
prev_item = NULL;
for (item = _network_game_list; item != NULL; item = item->next) {
if (item->ip == ip && item->port == port) return item;
prev_item = item;
}
item = malloc(sizeof(*item));
memset(item, 0, sizeof(*item));
item->next = NULL;
item->ip = ip;
item->port = port;
if (prev_item == NULL) {
_network_game_list = item;
} else {
prev_item->next = item;
}
DEBUG(net, 4) ("[NET][GameList] Added server to list");
UpdateNetworkGameWindow(false);
return item;
}
/** Remove an item from the gamelist linked list
* @param remove pointer to the item to be removed */
void NetworkGameListRemoveItem(NetworkGameList *remove)
{
NetworkGameList *item, *prev_item;
prev_item = NULL;
for (item = _network_game_list; item != NULL; item = item->next) {
if (remove == item) {
if (prev_item == NULL) {
_network_game_list = remove->next;
} else {
prev_item->next = remove->next;
}
free(remove);
DEBUG(net, 4) ("[NET][GameList] Removed server from list");
UpdateNetworkGameWindow(false);
return;
}
prev_item = item;
}
}
#endif /* ENABLE_NETWORK */
|