Discovery.h File Reference#include "G3D/platform.h"
#include "G3D/G3DGameUnits.h"
#include "G3D/NetworkDevice.h"
#include "G3D/Log.h"
#include <time.h>
Detailed Description
Discovery
Discovery is the process by which computers on a Local Area Network (LAN) find one another. The Discovery API allows clients to make a list of servers running the same application. The application typically presents this list to the user so he can choose which server to connect to.
Features of the Discovery API:
Low network traffic
- Broadcasts mainly occur only when a new machine enters/leaves the network
Responsive
- Servers appear immediately after launching
- Servers disappear immedatiately after they shut down
Extensible
- Add your own game information (e.g. score, num players, map name)
Versioned
- Tracks incompatible servers so end-users know to upgrade their client/server
Using the Discovery API
Subclass DiscoveryAdvertisement to add fields describing a server running your application. For a game, these might be the current map name and the number of players.
On the client, create an instance of DiscoveryClient<your advertisement subclass>. On the server, create an instance of DiscoveryServer and initialize it with an instance of your advertisement subclass. From your main loop, call doNetwork() on the client and server instances. When your server shuts down, invoke cleanup() on it.
- Maintainer:
- Morgan McGuire, matrix@graphics3d.com
- Created:
- 2003-06-26
- Last modified:
- 2005-02-24
Define Documentation
| #define G3D_DISCOVERY_PROTOCOL_NAME "G3D DISC" |
Different versions of G3D discovery protocols can't communicate with each other.
| #define G3D_DISCOVERY_PROTOCOL_VERSION 1 |
Generated on Thu Aug 2 11:40:42 2007 for G3D by
1.5.2
Hosted by
|