RNLobby: RNLobby Index Page

RNLobby Index Page

1

Introduction

The namespace RNLobby provides classes for lobby related functionality. This version of RNLobby is in the alpha stage of development and as such may be subject to substantial changes until beta.

Using RNLobby

Include files are in the Includes directory "RNLobby/Inc/".

Using RNLobby

Libraries for static linking are called:
RNLobbyDM and RNLobbyRM for debug and release multi-threaded applications.
RNLobbyDMDLL and RNLobbyRMDLL for debug and release multi-threaded DLL applications.
There is no single threaded support for this library.

The memory tracking header ("RNPlatform/Inc/MemoryTracking.h") can be auto included by defining REPLICANET_ALWAYSDOMEMORYTRACKING for non-dll based builds.
Generated on Sun Oct 30 01:12:43 2005 for RNLobby by doxygen 1.4.1


RNLobby: File Index

RNLobby File List

Here is a list of all documented files with brief descriptions:
CodeClient.h [code]
CodeServer.h [code]
Patcher.h [code]


RNLobby: Class List

Here are the classes, structs, unions and interfaces with brief descriptions:
RNReplicaNet::RNLobby::CodeClient | This code client queries for the validity of codes with the RNLobby::CodeServer
RNReplicaNet::RNLobby::CodeServer |
RNReplicaNet::RNLobby::Patcher |


RNLobby: RNReplicaNet::RNLobby::CodeClient Class Reference

RNReplicaNet::RNLobby::CodeClient

RNReplicaNet::RNLobby::CodeClient Class Reference

This code client queries for the validity of codes with the RNLobby::CodeServer. More...

#include <CodeClient.h>

List of all members.

Public Member Functions

bool | Start (const char *code, const int nOnce1=0, const int nOnce2=0)
bool | Stop (bool hardware=false)
bool | GetCompleted (void)
CodeServer::Reply | GetReply (void)
int | GetUserSuppliedReply (void)
void | GetNOnces (int &nOnce1, int &nOnce2)
When there is a successful reply two random integers are generated by the CodeServer.
void | SetEncryptionKey (const void *data, const int length)
void | SetServer (const XPAddress address)

Detailed Description

This code client queries for the validity of codes with the RNLobby::CodeServer.

Member Function Documentation

bool RNReplicaNet::RNLobby::CodeClient::GetCompleted ( void )

Tests the completion state of the last query. When the query completes the result can be retrieved by using GetReply()

Returns:
A completed query returns true, a pending query returns false.

CodeServer::Reply RNReplicaNet::RNLobby::CodeClient::GetReply ( void )

Returns the last reply from a completed query.

Returns:
The last reply from a completed query.

int RNReplicaNet::RNLobby::CodeClient::GetUserSuppliedReply ( void )

Returns the last user supplied reply value from a completed query. See CodeServer::AddCode() for more details about a user supplied reply.

Returns:
The user supplied reply.

void RNReplicaNet::RNLobby::CodeClient::SetEncryptionKey | ( | const void * | data,
 |  | const int | length
 | ) |

Sets the encryption key to be used by all queries for this client. The same key must be used with any RNLobby::CodeServer responding to queries from this client. The default encryption key is the same for RNLobby::CodeServer and RNLobby::CodeClient.

Parameters:
data | the data to use as a seed for the key. This can be NULL to use the default key.
length | the length of the data to use for creating the key

void RNReplicaNet::RNLobby::CodeClient::SetServer ( const XPAddress address )

Sets the address and port of the server. The default for the instance of the class is localhost and port CodeServer::kDefaultPort

Parameters:
address The new address and port number to use for the server

bool RNReplicaNet::RNLobby::CodeClient::Start | ( | const char * | code,
 |  | const int | nOnce1 = 0,
 |  | const int | nOnce2 = 0
 | ) |

Starts a code query. This query is asynchronous and can be stopped by using Stop(). If a code is requested for the same key within the CodeServer timeout period without supplying valid nonce values the key query will result in kReply_KeyInUse. If these values are used for future CodeClient::Start() calls with the same code value then the result will be a successful key query.

Parameters:
code | The code to query with the server. This buffer must be a null terminated string. The buffer contents is copied by a pending query so it can be deallocated after using this call.
nOnce1 | The first nonce.
nOnce2 | The second nonce.
Returns:
Success returns true, failure returns false.

bool RNReplicaNet::RNLobby::CodeClient::Stop ( bool hardware = false )

Stops the current code query thread.

Parameters:
hardware If true this stops the network hardware. The default is false.
Returns:
Success returns true, failure returns false.

The documentation for this class was generated from the following file:
  • CodeClient.h
Generated on Sun Oct 30 01:12:44 2005 for RNLobby by doxygen 1.4.1


RNLobby: RNReplicaNet::RNLobby::CodeServer Class Reference

RNReplicaNet::RNLobby::CodeServer

RNReplicaNet::RNLobby::CodeServer Class Reference

#include <CodeServer.h>

List of all members.

Public Types

enum Reply {
kReply_ValidKey = 0, kReply_UnspecifiedError, kReply_InvalidKey, kReply_KeyInUse,
kReply_Timeout, kReply_CorruptReply
}
enum | { kDefaultPort = 20001 }

Public Member Functions

bool | ReadCodeFile (const char *filename, const bool duplicateCodeCheck=false)
bool | AddCode (const char *code, const bool duplicateCodeCheck=false, const int userSuppliedReply=0)
bool | RemoveCode (const char *code=0)
bool | Start (const int UDPPort=CodeServer::kDefaultPort)
bool | Stop (bool hardware=false)
void | SetEncryptionKey (const void *data, const int length)
void | SetCodeTimeout (const float time=(60.0f *30.0f))
float | GetCodeTimeout (void) const
virtual void | CallbackDataReceived (void *data, int &length, const int maxLength, XPAddress &address)
virtual void | CallbackVersion (const int version)
virtual void | CallbackKeyData (char *keyData, const int maxLength, int &nOnce1, int &nOnce2, bool &updateDatabase)
virtual void | CallbackQueryReply (Reply &reply, int &userSuppliedReply, int &nOnce1, int &nOnce2)
virtual void | CallbackDataSend (void *data, int &length, const int maxLength, XPAddress &address)
virtual void | CallbackQueryReplyTime (const float seconds)

Protected Attributes

RegistryManagerMap< std::string,
CodeEntry, CodeEntry::ThisLess > 		mCodes
MutexClass | mCodesMutex

Classes

class | CodeEntry

Detailed Description

This code server uses a UDP socket to respond to queries for the validity of codes. The codes are stored in a file with one code per line. Use the RNLobby::CodeClient class to make queries to this server.

Member Function Documentation

bool RNReplicaNet::RNLobby::CodeServer::AddCode | ( | const char * | code,
 |  | const bool | duplicateCodeCheck = false,
 |  | const int | userSuppliedReply = 0
 | ) |

Adds a code to the database in memory. Each code must be no longer than 255 characters. This function may be used when the code server has been started.

Parameters:
code | The code to add.
duplicateCodeCheck | If this is true then the code is checked to make sure it is not a duplicate code already stored in the database. The default is false, which disables the duplicate code check and makes adding codes slightly faster.
userSuppliedReply | This is returned from CodeClient::GetUserSuppliedReply(). This is useful if the key server wishes to communicate that the key has billing problems, been suspended etc. To update userReply for an existing key you may enable duplicateCodeCheck or use RemoveCode() and AddCode().
Returns:
Success returns true, failure returns false.

virtual void RNReplicaNet::RNLobby::CodeServer::CallbackDataReceived | ( | void * | data,
 |  | int & | length,
 |  | const int | maxLength,
 |  | XPAddress & | address
 | ) | [inline, virtual]

This callback may be used to alter data after it has been received and before the data is processed.

Parameters:
data | The pointer to the data.
length | The length of the data. If the output length changes then this variable can be used to pass the value back by reference. A returned length of zero discards the packet.
maxLength | The maximum length of the data buffer. Parameter length must not be greater than this value.
address | The network address for this data packet. The contents of the address may be changed if required.

virtual void RNReplicaNet::RNLobby::CodeServer::CallbackDataSend | ( | void * | data,
 |  | int & | length,
 |  | const int | maxLength,
 |  | XPAddress & | address
 | ) | [inline, virtual]

This callback may be used to alter any data in a reply, just before it gets sent.

Parameters:
data | The pointer to the data.
length | The length of the data. If the output length changes then this variable can be used to pass the value back by reference. A returned length of zero discards the packet.
maxLength | The maximum length of the data buffer. Parameter length must not be greater than this value.
address | The network address for this data packet. The contents of the address may be changed if required.

virtual void RNReplicaNet::RNLobby::CodeServer::CallbackKeyData | ( | char * | keyData,
 |  | const int | maxLength,
 |  | int & | nOnce1,
 |  | int & | nOnce2,
 |  | bool & | updateDatabase
 | ) | [inline, virtual]

This callback may be used to alter the actual key queried before it is matched with the database.

Parameters:
keyData | The pointer to a null terminated char string.
maxLength | The maximum length of the data buffer, including the null termination character.
nOnce1 | The first nonce.
nOnce2 | The second nonce.
updateDatabase | This defaults to true, meaning that the query will update the database with the results of the search. If this is changed to be false the query will only be read only. A read only query does not require correct nonce values to be able to return kReply_ValidKey.

virtual void RNReplicaNet::RNLobby::CodeServer::CallbackQueryReply | ( | Reply & | reply,
 |  | int & | userSuppliedReply,
 |  | int & | nOnce1,
 |  | int & | nOnce2
 | ) | [inline, virtual]

This callback may be used to alter the CodeServer::Reply.

Parameters:
reply | The reply from the key query.
userSuppliedReply | The user supplied reply.
nOnce1 | The first reply nonce.
nOnce2 | The second reply nonce.

virtual void RNReplicaNet::RNLobby::CodeServer::CallbackQueryReplyTime ( const float seconds ) [inline, virtual]

This callback reports how long an query and reply took starting from when packet data was received until the packet data is sent.

Parameters:
seconds The time in seconds.

virtual void RNReplicaNet::RNLobby::CodeServer::CallbackVersion ( const int version ) [inline, virtual]

This callback may be used to ascertain the version of the request made.

Parameters:
version The version of the request.

float RNReplicaNet::RNLobby::CodeServer::GetCodeTimeout ( void ) const

Gets the value configured by SetCodeTimeout()

Returns:
The value configured by SetCodeTimeout()

bool RNReplicaNet::RNLobby::CodeServer::ReadCodeFile | ( | const char * | filename,
 |  | const bool | duplicateCodeCheck = false
 | ) |

Reads codes from a file and stores the codes in a database in memory. Each code must be in a separate line. This function may be used when the code server has been started. Each call to this function will add codes to the database held in memory. Each code must be no longer than 255 characters.

Parameters:
filename | The filename to read.
duplicateCodeCheck | If this is true then each code is checked to make sure it is not a duplicate code already stored in the database. The default is false, which disables the duplicate code check and makes adding codes slightly faster.
Returns:
Success returns true, failure returns false.

bool RNReplicaNet::RNLobby::CodeServer::RemoveCode ( const char * code = 0 )

Removes codes from the database in memory. This function may be used when the code server has been started.

Parameters:
code If the code is supplied the code is removed from the database in memory. If there is no code supplied then all codes are removed from the database in memory.
Returns:
Success returns true, failure returns false.

void RNReplicaNet::RNLobby::CodeServer::SetCodeTimeout ( const float time = (60.0f *30.0f) )

This sets the time period that a code will be flagged as being used and kReply_KeyInUse will be returned from CodeClient::GetReply(). After this time period has elapsed a request to validate the same code will be allowed.

Parameters:
time The time in seconds. The default value is (60.0f * 30.0f) which is 30 minutes.

void RNReplicaNet::RNLobby::CodeServer::SetEncryptionKey | ( | const void * | data,
 |  | const int | length
 | ) |

Sets the encryption key to be used by all queries for this server. The same key must be used with any RNLobby::CodeClient querying this server. The default encryption key is the same for RNLobby::CodeServer and RNLobby::CodeClient.

Parameters:
data | The data to use as a seed for the key. This can be NULL to use the default key.
length | The length of the data to use for creating the key.

bool RNReplicaNet::RNLobby::CodeServer::Start ( const int UDPPort = CodeServer::kDefaultPort )

Starts the code server thread and processes code queries. If not already started the network hardware is started.

Returns:
Success returns true, failure returns false.

bool RNReplicaNet::RNLobby::CodeServer::Stop ( bool hardware = false )

Stops the code server thread and stops processing code queries.

Parameters:
hardware If true this stops the network hardware. The default is false.
Returns:
Success returns true, failure returns false.

The documentation for this class was generated from the following file:
  • CodeServer.h
Generated on Sun Oct 30 01:12:44 2005 for RNLobby by doxygen 1.4.1


RNLobby: RNReplicaNet::RNLobby::Patcher Class Reference

RNReplicaNet::RNLobby::Patcher

RNReplicaNet::RNLobby::Patcher Class Reference

#include <Patcher.h>

List of all members.

Public Member Functions

int | GeneratePatch (const char *sourcePath, const char *newPath, const char *patchPath)
bool | PatchFile (const char *sourcePath, const char *patchPath, const char *destinationPath)

Detailed Description

This class generates minimal patches for binary files and also patches files to produce new versions. No checking of file integrity is carried out before a patch is applied because this is a file version problem which is the domain of another set of support classes.

Member Function Documentation

int RNReplicaNet::RNLobby::Patcher::GeneratePatch | ( | const char * | sourcePath,
 |  | const char * | newPath,
 |  | const char * | patchPath
 | ) |

Generates a patch from sourcePath compared with newPath and stores the result in patchPath.

Parameters:
sourcePath | The original file path.
newPath | The new file path.
patchPath | The destination file path for the patch file.
Returns:
The length of the generated patch file. This can be zero and indicates the two files are identical. A negative value indicates an error occured.

bool RNReplicaNet::RNLobby::Patcher::PatchFile | ( | const char * | sourcePath,
 |  | const char * | patchPath,
 |  | const char * | destinationPath
 | ) |

Combines a file from sourcePath with a patch file from patchPath and stores the resultant file in destinationPath.

Parameters:
sourcePath | The original file path.
patchPath | The patch file path.
destinationPath | The destination file path for the combined file.
Returns:
Success returns true. False indicates an error occurred.

The documentation for this class was generated from the following file:
  • Patcher.h
Generated on Sun Oct 30 01:12:44 2005 for RNLobby by doxygen 1.4.1


RNLobby: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

  • AddCode() : RNReplicaNet::RNLobby::CodeServer
  • CallbackDataReceived() : RNReplicaNet::RNLobby::CodeServer
  • CallbackDataSend() : RNReplicaNet::RNLobby::CodeServer
  • CallbackKeyData() : RNReplicaNet::RNLobby::CodeServer
  • CallbackQueryReply() : RNReplicaNet::RNLobby::CodeServer
  • CallbackQueryReplyTime() : RNReplicaNet::RNLobby::CodeServer
  • CallbackVersion() : RNReplicaNet::RNLobby::CodeServer
  • GeneratePatch() : RNReplicaNet::RNLobby::Patcher
  • GetCodeTimeout() : RNReplicaNet::RNLobby::CodeServer
  • GetCompleted() : RNReplicaNet::RNLobby::CodeClient
  • GetNOnces() : RNReplicaNet::RNLobby::CodeClient
  • GetReply() : RNReplicaNet::RNLobby::CodeClient
  • GetUserSuppliedReply() : RNReplicaNet::RNLobby::CodeClient
  • PatchFile() : RNReplicaNet::RNLobby::Patcher
  • ReadCodeFile() : RNReplicaNet::RNLobby::CodeServer
  • RemoveCode() : RNReplicaNet::RNLobby::CodeServer
  • SetCodeTimeout() : RNReplicaNet::RNLobby::CodeServer
  • SetEncryptionKey() : RNReplicaNet::RNLobby::CodeServer, RNReplicaNet::RNLobby::CodeClient
  • SetServer() : RNReplicaNet::RNLobby::CodeClient
  • Start() : RNReplicaNet::RNLobby::CodeServer, RNReplicaNet::RNLobby::CodeClient
  • Stop() : RNReplicaNet::RNLobby::CodeServer, RNReplicaNet::RNLobby::CodeClient


RNLobby: Directory Hierarchy

RNLobby Directories

This directory hierarchy is sorted roughly, but not completely, alphabetically:
  • ReplicaNetWork
    • RNLobby
      • Inc
Generated on Sun Oct 30 01:12:44 2005 for RNLobby by doxygen 1.4.1


RNLobby: C:/Work/ReplicaNetWork/ Directory Reference

ReplicaNetWork

ReplicaNetWork Directory Reference

Directories

directory RNLobby


RNLobby: C:/Work/ReplicaNetWork/RNLobby/ Directory Reference

RNLobby Directory Reference

Directories

directory | Inc

Files

file | RNLobbyDoc.cpp
Generated on Sun Oct 30 01:12:44 2005 for RNLobby by doxygen 1.4.1


RNLobby: C:/Work/ReplicaNetWork/RNLobby/Inc/ Directory Reference

Inc Directory Reference

Files

file | CodeClient.h [code]
file | CodeServer.h [code]
file | Patcher.h [code]


RNLobby: Member List

RNReplicaNet::RNLobby::CodeClient Member List

This is the complete list of members for RNReplicaNet::RNLobby::CodeClient, including all inherited members.

CodeClient() (defined in RNReplicaNet::RNLobby::CodeClient) | RNReplicaNet::RNLobby::CodeClient |
GetCompleted(void) | RNReplicaNet::RNLobby::CodeClient |
GetNOnces(int &nOnce1, int &nOnce2) | RNReplicaNet::RNLobby::CodeClient |
GetReply(void) | RNReplicaNet::RNLobby::CodeClient |
GetUserSuppliedReply(void) | RNReplicaNet::RNLobby::CodeClient |
SetEncryptionKey(const void *data, const int length) | RNReplicaNet::RNLobby::CodeClient |
SetServer(const XPAddress address) | RNReplicaNet::RNLobby::CodeClient |
Start(const char *code, const int nOnce1=0, const int nOnce2=0) | RNReplicaNet::RNLobby::CodeClient |
Stop(bool hardware=false) | RNReplicaNet::RNLobby::CodeClient |
~CodeClient() (defined in RNReplicaNet::RNLobby::CodeClient) | RNReplicaNet::RNLobby::CodeClient | [virtual]

Generated on Sun Oct 30 01:12:44 2005 for RNLobby by doxygen 1.4.1


RNLobby: Member List

RNReplicaNet::RNLobby::CodeServer Member List

This is the complete list of members for RNReplicaNet::RNLobby::CodeServer, including all inherited members.

AddCode(const char *code, const bool duplicateCodeCheck=false, const int userSuppliedReply=0) | RNReplicaNet::RNLobby::CodeServer |
CallbackDataReceived(void *data, int &length, const int maxLength, XPAddress &address) | RNReplicaNet::RNLobby::CodeServer | [inline, virtual]
CallbackDataSend(void *data, int &length, const int maxLength, XPAddress &address) | RNReplicaNet::RNLobby::CodeServer | [inline, virtual]
CallbackKeyData(char *keyData, const int maxLength, int &nOnce1, int &nOnce2, bool &updateDatabase) | RNReplicaNet::RNLobby::CodeServer | [inline, virtual]
CallbackQueryReply(Reply &reply, int &userSuppliedReply, int &nOnce1, int &nOnce2) | RNReplicaNet::RNLobby::CodeServer | [inline, virtual]
CallbackQueryReplyTime(const float seconds) | RNReplicaNet::RNLobby::CodeServer | [inline, virtual]
CallbackVersion(const int version) | RNReplicaNet::RNLobby::CodeServer | [inline, virtual]
CodeServer() (defined in RNReplicaNet::RNLobby::CodeServer) | RNReplicaNet::RNLobby::CodeServer |
GetCodeTimeout(void) const | RNReplicaNet::RNLobby::CodeServer |
kDefaultPort enum value (defined in RNReplicaNet::RNLobby::CodeServer) | RNReplicaNet::RNLobby::CodeServer |
kReply_CorruptReply enum value (defined in RNReplicaNet::RNLobby::CodeServer) | RNReplicaNet::RNLobby::CodeServer |
kReply_InvalidKey enum value (defined in RNReplicaNet::RNLobby::CodeServer) | RNReplicaNet::RNLobby::CodeServer |
kReply_KeyInUse enum value (defined in RNReplicaNet::RNLobby::CodeServer) | RNReplicaNet::RNLobby::CodeServer |
kReply_Timeout enum value (defined in RNReplicaNet::RNLobby::CodeServer) | RNReplicaNet::RNLobby::CodeServer |
kReply_UnspecifiedError enum value (defined in RNReplicaNet::RNLobby::CodeServer) | RNReplicaNet::RNLobby::CodeServer |
kReply_ValidKey enum value (defined in RNReplicaNet::RNLobby::CodeServer) | RNReplicaNet::RNLobby::CodeServer |
mCodes (defined in RNReplicaNet::RNLobby::CodeServer) | RNReplicaNet::RNLobby::CodeServer | [protected]
mCodesMutex (defined in RNReplicaNet::RNLobby::CodeServer) | RNReplicaNet::RNLobby::CodeServer | [protected]
ReadCodeFile(const char *filename, const bool duplicateCodeCheck=false) | RNReplicaNet::RNLobby::CodeServer |
RemoveCode(const char *code=0) | RNReplicaNet::RNLobby::CodeServer |
Reply enum name (defined in RNReplicaNet::RNLobby::CodeServer) | RNReplicaNet::RNLobby::CodeServer |
SetCodeTimeout(const float time=(60.0f *30.0f)) | RNReplicaNet::RNLobby::CodeServer |
SetEncryptionKey(const void *data, const int length) | RNReplicaNet::RNLobby::CodeServer |
Start(const int UDPPort=CodeServer::kDefaultPort) | RNReplicaNet::RNLobby::CodeServer |
Stop(bool hardware=false) | RNReplicaNet::RNLobby::CodeServer |
~CodeServer() (defined in RNReplicaNet::RNLobby::CodeServer) | RNReplicaNet::RNLobby::CodeServer | [virtual]

Generated on Sun Oct 30 01:12:44 2005 for RNLobby by doxygen 1.4.1


RNLobby: Member List

RNReplicaNet::RNLobby::Patcher Member List

This is the complete list of members for RNReplicaNet::RNLobby::Patcher, including all inherited members.

GeneratePatch(const char *sourcePath, const char *newPath, const char *patchPath) | RNReplicaNet::RNLobby::Patcher |
Patcher() (defined in RNReplicaNet::RNLobby::Patcher) | RNReplicaNet::RNLobby::Patcher |
PatchFile(const char *sourcePath, const char *patchPath, const char *destinationPath) | RNReplicaNet::RNLobby::Patcher |
~Patcher() (defined in RNReplicaNet::RNLobby::Patcher) | RNReplicaNet::RNLobby::Patcher | [virtual]

Generated on Sun Oct 30 01:12:44 2005 for RNLobby by doxygen 1.4.1


RNLobby: CodeClient.h Source File

CodeClient.h

00001 /* START_LICENSE_HEADER
00002
00003 Copyright (C) 2000 Martin Piper, original design and program code
00004 Copyright (C) 2001-2005 Replica Software
00005
00006 This program file is copyright (C) Replica Software and can only be used under license.
00007 For more information visit: http://www.replicanet.com/
00008 Or email: info@replicanet.com
00009
00010 END_LICENSE_HEADER */
00011 #ifndef _CODECLIENT_H_
00012 #define _CODECLIENT_H_
00013 #include "RNPlatform/Inc/DLLExportAPI.h"
00014 #include "RNPlatform/Inc/Encryption.h"
00015 #include "RNPlatform/Inc/ThreadClass.h"
00016 #include "RNPlatform/Inc/Thread.h"
00017 #include "RNXPSockets/Inc/XPSockets.h"
00018 #include "RNLobby/Inc/CodeServer.h"
00019 #include "RNPlatform/Inc/SysTime.h"
00020
00021 namespace RNReplicaNet
00022 {
00023
00024 namespace RNLobby
00025 {
00026
00028 class CodeClient : private ThreadClass , private Thread
00029 {
00030 public:
00031     CodeClient();
00032     virtual ~CodeClient();
00033
00041     bool Start(const char *code,const int nOnce1 = 0,const int nOnce2 = 0);
00042
00046     bool Stop(bool hardware = false);
00047
00050     bool GetCompleted(void);
00051
00054     CodeServer::Reply GetReply(void);
00055
00058     int GetUserSuppliedReply(void);
00059
00061     void GetNOnces(int &nOnce1,int &nOnce2);
00062
00067     void SetEncryptionKey(const void *data,const int length);
00068
00071     void SetServer(const XPAddress address);
00072
00073 private:
00074
00075     virtual int ThreadEntry(void);
00076     void CleanQuery(void);
00077
00078     Encryption::Key mCryptoKey;
00079
00080     volatile CodeServer::Reply mReply;
00081     volatile bool mGotReply;
00082     char *mCode;
00083     XPSocketUrgent *mSend;
00084     XPAddress mAddress;
00085     int mUserSuppliedReply;
00086     int mNOnce1;
00087     int mNOnce2;
00088 };
00089
00090 };
00091
00092 };
00093
00094 #endif
Generated on Sun Oct 30 01:12:43 2005 for RNLobby by doxygen 1.4.1


RNLobby: CodeServer.h Source File

CodeServer.h

00001 /* START_LICENSE_HEADER
00002
00003 Copyright (C) 2000 Martin Piper, original design and program code
00004 Copyright (C) 2001-2005 Replica Software
00005
00006 This program file is copyright (C) Replica Software and can only be used under license.
00007 For more information visit: http://www.replicanet.com/
00008 Or email: info@replicanet.com
00009
00010 END_LICENSE_HEADER */
00011 #ifndef _CODESERVER_H_
00012 #define _CODESERVER_H_
00013 #include "RNPlatform/Inc/DLLExportAPI.h"
00014 #include "RNPlatform/Inc/RegistryManagerMap.h"
00015 #include "RNPlatform/Inc/Encryption.h"
00016 #include "RNPlatform/Inc/ThreadClass.h"
00017 #include "RNPlatform/Inc/Thread.h"
00018 #include "RNXPSockets/Inc/XPSockets.h"
00019
00020 namespace RNReplicaNet
00021 {
00022
00023 namespace RNLobby
00024 {
00025
00028 class CodeServer : private ThreadClass , private Thread
00029 {
00030 public:
00031     class CodeEntry
00032     {
00033     public:
00034         struct ThisLess
00035         {
00036             bool operator()(const std::string &s1, const std::string &s2) const
00037             {
00038                 return strcmp(s1.c_str(), s2.c_str()) < 0;
00039             }
00040         };
00041         CodeEntry();
00042
00043         // ctor variables
00044         XPAddress mLastAddress;
00045         float mLastTime;
00046         int mUserSuppliedReply;
00047         int mLastNOnce1,mLastNOnce2;
00048
00049         // ctor body variables
00050         std::string mTheCode;
00051     };
00052
00053     enum Reply
00054     {
00055         kReply_ValidKey = 0,
00056         kReply_UnspecifiedError,
00057         kReply_InvalidKey,
00058         kReply_KeyInUse,
00059         kReply_Timeout,
00060         kReply_CorruptReply
00061     };
00062     enum
00063     {
00064         kDefaultPort = 20001
00065     };
00066
00067
00068     CodeServer();
00069     virtual ~CodeServer();
00070
00076     bool ReadCodeFile(const char *filename, const bool duplicateCodeCheck = false);
00077
00084     bool AddCode(const char *code, const bool duplicateCodeCheck = false,const int userSuppliedReply = 0);
00085
00090     bool RemoveCode(const char *code = 0);
00091
00094     bool Start(const int UDPPort = CodeServer::kDefaultPort);
00095
00099     bool Stop(bool hardware = false);
00100
00105     void SetEncryptionKey(const void *data,const int length);
00106
00110     void SetCodeTimeout(const float time = (60.0f * 30.0f));
00111
00114     float GetCodeTimeout(void) const;
00115
00121     virtual void CallbackDataReceived(void *data,int &length,const int maxLength,XPAddress &address) {}
00122
00125     virtual void CallbackVersion(const int version) {}
00126
00134     virtual void CallbackKeyData(char *keyData,const int maxLength,int &nOnce1,int &nOnce2,bool &updateDatabase) {}
00135
00141     virtual void CallbackQueryReply(Reply &reply,int &userSuppliedReply,int &nOnce1,int &nOnce2) {}
00142
00148     virtual void CallbackDataSend(void *data,int &length,const int maxLength,XPAddress &address) {}
00149
00152     virtual void CallbackQueryReplyTime(const float seconds) {}
00153
00154 private:
00155     virtual int ThreadEntry(void);
00156
00157 protected:
00158     RegistryManagerMap<std::string,CodeEntry,CodeEntry::ThisLess> mCodes;
00159     MutexClass mCodesMutex;
00160 private:
00161     XPSocketUrgent *mListen;
00162
00163     Encryption::Key mCryptoKey;
00164     float mCodeTimeout;
00165 };
00166
00167 };
00168
00169 };
00170
00171 #endif
Generated on Sun Oct 30 01:12:43 2005 for RNLobby by doxygen 1.4.1


RNLobby: Class Members - Functions

  • AddCode() : RNReplicaNet::RNLobby::CodeServer
  • CallbackDataReceived() : RNReplicaNet::RNLobby::CodeServer
  • CallbackDataSend() : RNReplicaNet::RNLobby::CodeServer
  • CallbackKeyData() : RNReplicaNet::RNLobby::CodeServer
  • CallbackQueryReply() : RNReplicaNet::RNLobby::CodeServer
  • CallbackQueryReplyTime() : RNReplicaNet::RNLobby::CodeServer
  • CallbackVersion() : RNReplicaNet::RNLobby::CodeServer
  • GeneratePatch() : RNReplicaNet::RNLobby::Patcher
  • GetCodeTimeout() : RNReplicaNet::RNLobby::CodeServer
  • GetCompleted() : RNReplicaNet::RNLobby::CodeClient
  • GetNOnces() : RNReplicaNet::RNLobby::CodeClient
  • GetReply() : RNReplicaNet::RNLobby::CodeClient
  • GetUserSuppliedReply() : RNReplicaNet::RNLobby::CodeClient
  • PatchFile() : RNReplicaNet::RNLobby::Patcher
  • ReadCodeFile() : RNReplicaNet::RNLobby::CodeServer
  • RemoveCode() : RNReplicaNet::RNLobby::CodeServer
  • SetCodeTimeout() : RNReplicaNet::RNLobby::CodeServer
  • SetEncryptionKey() : RNReplicaNet::RNLobby::CodeServer, RNReplicaNet::RNLobby::CodeClient
  • SetServer() : RNReplicaNet::RNLobby::CodeClient
  • Start() : RNReplicaNet::RNLobby::CodeServer, RNReplicaNet::RNLobby::CodeClient
  • Stop() : RNReplicaNet::RNLobby::CodeServer, RNReplicaNet::RNLobby::CodeClient


RNLobby: Graph Legend

Graph Legend

This page explains how to interpret the graphs that are generated by doxygen.

Consider the following example:

/*! Invisible class because of truncation */
class Invisible { };

/*! Truncated class, inheritance relation is hidden */
class Truncated : public Invisible { };

/* Class not documented with doxygen comments */
class Undocumented { };

/*! Class that is inherited using public inheritance */
class PublicBase : public Truncated { };

/*! A template class */
template<class T> class Templ { };

/*! Class that is inherited using protected inheritance */
class ProtectedBase { };

/*! Class that is inherited using private inheritance */
class PrivateBase { };

/*! Class that is used by the Inherited class */
class Used { };

/*! Super class that inherits a number of other classes */
class Inherited : public PublicBase,
                  protected ProtectedBase,
                  private PrivateBase,
                  public Undocumented
                  public Templ<int>
{
  private:
    Used *m_usedClass;
};
If the MAX_DOT_GRAPH_HEIGHT tag in the configuration file is set to 240 this will result in the following graph:

The boxes in the above graph have the following meaning:

  • A filled black box represents the struct or class for which the graph is generated.
  • A box with a black border denotes a documented struct or class.
  • A box with a grey border denotes an undocumented struct or class.
  • A box with a red border denotes a documented struct or class forwhich not all inheritance/containment relations are shown. A graph is truncated if it does not fit within the specified boundaries.
The arrows have the following meaning:
  • A dark blue arrow is used to visualize a public inheritance relation between two classes.
  • A dark green arrow is used for protected inheritance.
  • A dark red arrow is used for private inheritance.
  • A purple dashed arrow is used if a class is contained or used by another class. The arrow is labeled with the variable(s) through which the pointed class or struct is accessible.
  • A yellow dashed arrow denotes a relation between a template instance and the template class it was instantiated from. The arrow is labeled with the template parameters of the instance.
Generated on Sun Oct 30 01:12:44 2005 for RNLobby by doxygen 1.4.1


RNLobby: Patcher.h Source File

Patcher.h

00001 /* START_LICENSE_HEADER
00002
00003 Copyright (C) 2000 Martin Piper, original design and program code
00004 Copyright (C) 2001-2005 Replica Software
00005
00006 This program file is copyright (C) Replica Software and can only be used under license.
00007 For more information visit: http://www.replicanet.com/
00008 Or email: info@replicanet.com
00009
00010 END_LICENSE_HEADER */
00011 #ifndef _PATCHER_H_
00012 #define _PATCHER_H_
00013 #include "RNPlatform/Inc/DLLExportAPI.h"
00014
00015 namespace RNReplicaNet
00016 {
00017
00018 namespace RNLobby
00019 {
00020
00021 class PatcherPrivate;
00022
00026 class Patcher
00027 {
00028 public:
00029     Patcher();
00030     virtual ~Patcher();
00031
00037     int GeneratePatch(const char *sourcePath,const char *newPath,const char *patchPath);
00038
00044     bool PatchFile(const char *sourcePath,const char *patchPath,const char *destinationPath);
00045
00046 private:
00047     PatcherPrivate &mData;
00048 };
00049
00050 };
00051
00052 };
00053
00054 #endif
Generated on Sun Oct 30 01:12:43 2005 for RNLobby by doxygen 1.4.1