![]() |
Shadowrun: Awakened 29 September 2011 - Build 871
|
00001 #ifndef __UDP_PROXY_COMMON_H 00002 #define __UDP_PROXY_COMMON_H 00003 00004 // System flow: 00005 /* 00006 UDPProxyClient: End user 00007 UDPProxyServer: open server, to route messages from end users that can't connect to each other using UDPForwarder class. 00008 UDPProxyCoordinator: Server somewhere, connected to by RakNet, to maintain a list of UDPProxyServer 00009 00010 UDPProxyServer 00011 On startup, log into UDPProxyCoordinator and register self 00012 00013 UDPProxyClient 00014 Wish to open route to X 00015 Send message to UDPProxyCoordinator containing X, desired timeout 00016 Wait for success or failure 00017 00018 UDPProxyCoordinator: 00019 * Get openRouteRequest 00020 If no servers registered, return failure 00021 Add entry to memory 00022 chooseBestUDPProxyServer() (overridable, chooses at random by default) 00023 Query this server to StartForwarding(). Return success or failure 00024 If failure, choose another server from the remaining list. If none remaining, return failure. Else return success. 00025 * Disconnect: 00026 If disconnected system is pending client on openRouteRequest, delete that request 00027 If disconnected system is UDPProxyServer, remove from list. For each pending client for this server, choose from remaining servers. 00028 * Login: 00029 Add to UDPProxyServer list, validating password if set 00030 */ 00031 00032 // Stored in the second byte after ID_UDP_PROXY_GENERAL 00033 // Otherwise MessageIdentifiers.h is too cluttered and will hit the limit on enumerations in a single byte 00034 enum UDPProxyMessages 00035 { 00036 ID_UDP_PROXY_FORWARDING_SUCCEEDED, 00037 ID_UDP_PROXY_FORWARDING_NOTIFICATION, 00038 ID_UDP_PROXY_NO_SERVERS_ONLINE, 00039 ID_UDP_PROXY_RECIPIENT_GUID_NOT_CONNECTED_TO_COORDINATOR, 00040 ID_UDP_PROXY_ALL_SERVERS_BUSY, 00041 ID_UDP_PROXY_IN_PROGRESS, 00042 ID_UDP_PROXY_FORWARDING_REQUEST_FROM_CLIENT_TO_COORDINATOR, 00043 ID_UDP_PROXY_PING_SERVERS_FROM_COORDINATOR_TO_CLIENT, 00044 ID_UDP_PROXY_PING_SERVERS_REPLY_FROM_CLIENT_TO_COORDINATOR, 00045 ID_UDP_PROXY_FORWARDING_REQUEST_FROM_COORDINATOR_TO_SERVER, 00046 ID_UDP_PROXY_FORWARDING_REPLY_FROM_SERVER_TO_COORDINATOR, 00047 ID_UDP_PROXY_LOGIN_REQUEST_FROM_SERVER_TO_COORDINATOR, 00048 ID_UDP_PROXY_LOGIN_SUCCESS_FROM_COORDINATOR_TO_SERVER, 00049 ID_UDP_PROXY_ALREADY_LOGGED_IN_FROM_COORDINATOR_TO_SERVER, 00050 ID_UDP_PROXY_NO_PASSWORD_SET_FROM_COORDINATOR_TO_SERVER, 00051 ID_UDP_PROXY_WRONG_PASSWORD_FROM_COORDINATOR_TO_SERVER 00052 }; 00053 00054 00055 #define UDP_FORWARDER_MAXIMUM_TIMEOUT (60000 * 10) 00056 00057 #endif
Copyright © 2007-2010 by The Shadowrun: Awakened Team. This work is licensed under the GNU Lesser General Public License 3.