Raknet
From Wikipedia, the free encyclopedia
RakNet is a cross-platform, object-oriented networking library for C++ created by RakkarSoft. It is specialized for game development, and is available under three different licenses. It uses UDP for network communications, and supports Client/Server and P2P systems. Anyone can obtain a copy of RakNet under the Creative Commons Attribution - NonCommercial 2.5 license[1] for free. A Shareware or Commercial license can be purchased for commercial usage. Shareware licenses cost $100 and up and allow you to develop one application using RakNet. Commercial licenses cost $5000 and allow development of unlimited applications using RakNet.
Contents |
[edit] Versions
[edit] RakNet 3.0 (beta)
Changelog:
- Renamed PlayerID SystemAddress
- Replaced RakClient and RakServer with RakPeer (RakPeer is more powerful and does everything the other two did)
- Removed Multiplayer class (Parse your own messages)
- Removed Static Data (Send your own per-system data if you do indeed want per-system data)
- Removed MasterServer / MasterClient (Use lightweight database instead)
- Removed ID_RESERVED9. Use ID_USER_PACKET_ENUM instead.
- Renamed PacketEnumerations MessageIdentifiers
- Renamed Disconnect Shutdown and OnDisconnect OnShutdown
- Renamed Initialize Startup
- StringCompressor now supports multiple trees, for different encodings such as different languages.
- Added existingReplica to the ReplicaManager::SetReceiveConstructionCB callback.
- Removed SystemIDToDottedIP and IPToSystemID since equivalents of both of those functions are in the SystemAddress structure itself now
- Renamed NetworkTypes.h RakNetTypes.h
- Renamed UNASSIGNED_PLAYER_ID UNASSIGNED_SYSTEM_ADDRESS
- Removed Bitstream_NoTemplate.
[edit] RakNet 2.52
Changelog:
- Fixed a bug where a system that disconnected couldn't always reconnect.
- Fixed a bug where a system couldn't connect rapidly with secure connections.
- Changed file path backslash to forward slash.
- Fixed Linux usage of findfirst.
- Fixed problem where packet format error detection code was incorrectly #ifdefed out in Release.
[edit] The Basics of Usage
First, create RakClientInterface and RakServerInterface objects in their respective applications.
[edit] Server Side
Use the Start member function of the RakServerInterface object to open the port and start listening for incoming connections. You can specify the port number and the maximum allowed number of players to be connected to the server at any one time (up to 65535) through this function. If you need to ban an IP address, you can use the AddToBanList member function to ban someone. To kick someone, use the Kick member function with the Player ID of the player to kick as a parameter. Call the Receive member function to fill a Packet structure with received data. Check the first entry ([0]) of the data member of the Packet structure against the server-specific values in the PacketEnumerations header file to find out what kind of data was received. When replying to the client, use the Send member function.
[edit] Client Side
Use the Connect member function of the RakClientInterface object to connect to the server. You can specify the server address and port number of the remote server through this function. Call the Receive member function to fill a Packet structure with received data. Check the first entry ([0]) of the data member of the Packet structure against the server-specific values in the PacketEnumerations header file to find out what kind of data was received. When you need to reply to the server, use the Send member function.
[edit] References
[edit] External links