SLikeNet 0.1.3

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UDPProxyCommon.h
Go to the documentation of this file.
1 /*
2 * Copyright (c) 2014, Oculus VR, Inc.
3 * All rights reserved.
4 *
5 * This source code is licensed under the BSD-style license found in the
6 * RakNet License.txt file in the licenses directory of this source tree. An additional grant
7 * of patent rights can be found in the RakNet Patents.txt file in the same directory.
8 *
9 */
10
11 #ifndef __UDP_PROXY_COMMON_H
12 #define __UDP_PROXY_COMMON_H
13
14 // System flow:
15 /*
16 UDPProxyClient: End user
17 UDPProxyServer: open server, to route messages from end users that can't connect to each other using UDPForwarder class.
18 UDPProxyCoordinator: Server somewhere, connected to by RakNet, to maintain a list of UDPProxyServer
19
20 UDPProxyServer
21 On startup, log into UDPProxyCoordinator and register self
22
23 UDPProxyClient
24 Wish to open route to X
25 Send message to UDPProxyCoordinator containing X, desired timeout
26 Wait for success or failure
27
28 UDPProxyCoordinator:
29 * Get openRouteRequest
30 If no servers registered, return failure
31 Add entry to memory
32 chooseBestUDPProxyServer() (overridable, chooses at random by default)
33 Query this server to StartForwarding(). Return success or failure
34 If failure, choose another server from the remaining list. If none remaining, return failure. Else return success.
35 * Disconnect:
36 If disconnected system is pending client on openRouteRequest, delete that request
37 If disconnected system is UDPProxyServer, remove from list. For each pending client for this server, choose from remaining servers.
38 * Login:
39 Add to UDPProxyServer list, validating password if set
40 */
41
42 // Stored in the second byte after ID_UDP_PROXY_GENERAL
43 // Otherwise MessageIdentifiers.h is too cluttered and will hit the limit on enumerations in a single byte
44 enum UDPProxyMessages
45 {
46 ID_UDP_PROXY_FORWARDING_SUCCEEDED,
47 ID_UDP_PROXY_FORWARDING_NOTIFICATION,
48 ID_UDP_PROXY_NO_SERVERS_ONLINE,
49 ID_UDP_PROXY_RECIPIENT_GUID_NOT_CONNECTED_TO_COORDINATOR,
50 ID_UDP_PROXY_ALL_SERVERS_BUSY,
51 ID_UDP_PROXY_IN_PROGRESS,
52 ID_UDP_PROXY_FORWARDING_REQUEST_FROM_CLIENT_TO_COORDINATOR,
53 ID_UDP_PROXY_PING_SERVERS_FROM_COORDINATOR_TO_CLIENT,
54 ID_UDP_PROXY_PING_SERVERS_REPLY_FROM_CLIENT_TO_COORDINATOR,
55 ID_UDP_PROXY_FORWARDING_REQUEST_FROM_COORDINATOR_TO_SERVER,
56 ID_UDP_PROXY_FORWARDING_REPLY_FROM_SERVER_TO_COORDINATOR,
57 ID_UDP_PROXY_LOGIN_REQUEST_FROM_SERVER_TO_COORDINATOR,
58 ID_UDP_PROXY_LOGIN_SUCCESS_FROM_COORDINATOR_TO_SERVER,
59 ID_UDP_PROXY_ALREADY_LOGGED_IN_FROM_COORDINATOR_TO_SERVER,
60 ID_UDP_PROXY_NO_PASSWORD_SET_FROM_COORDINATOR_TO_SERVER,
61 ID_UDP_PROXY_WRONG_PASSWORD_FROM_COORDINATOR_TO_SERVER
62 };
63
64
65 #define UDP_FORWARDER_MAXIMUM_TIMEOUT (60000 * 10)
66
67 #endif