• Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

RPC4Plugin.h

Go to the documentation of this file.
00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 #include "NativeFeatureIncludes.h"
00009 #if _RAKNET_SUPPORT_RPC4Plugin==1
00010 
00011 
00012 #ifndef __RPC_4_PLUGIN_H
00013 #define __RPC_4_PLUGIN_H
00014 
00015 class RakPeerInterface;
00016 class NetworkIDManager;
00017 #include "PluginInterface2.h"
00018 #include "PacketPriority.h"
00019 #include "RakNetTypes.h"
00020 #include "BitStream.h"
00021 #include "RakString.h"
00022 #include "NetworkIDObject.h"
00023 #include "DS_StringKeyedHash.h"
00024 
00025 #ifdef _MSC_VER
00026 #pragma warning( push )
00027 #endif
00028 
00033 
00034 namespace RakNet
00035 {
00040         enum RPCErrorCodes
00041         {
00043                 RPC_ERROR_FUNCTION_NOT_REGISTERED,
00044         };
00045 
00050         class RPC4Plugin : public PluginInterface2
00051         {
00052         public:
00053                 // Constructor
00054                 RPC4Plugin();
00055 
00056                 // Destructor
00057                 virtual ~RPC4Plugin();
00058 
00065                 bool RegisterFunction(const char* uniqueID, void ( *functionPointer ) ( RakNet::BitStream *userData, Packet *packet ));
00066 
00070                 bool UnregisterFunction(const char* uniqueID);
00071 
00075                 void CallLoopback( const char* uniqueID, RakNet::BitStream * bitStream );
00076 
00085                 void Call( const char* uniqueID, RakNet::BitStream * bitStream, PacketPriority priority, PacketReliability reliability, char orderingChannel, const AddressOrGUID systemIdentifier, bool broadcast );
00086 
00087         protected:
00088 
00089                 // --------------------------------------------------------------------------------------------
00090                 // Packet handling functions
00091                 // --------------------------------------------------------------------------------------------
00092                 virtual PluginReceiveResult OnReceive(Packet *packet);
00093 
00094                 DataStructures::StringKeyedHash<void ( * ) ( RakNet::BitStream *, Packet * ),64> registeredFunctions;
00095 
00096         };
00097 
00098 } // End namespace
00099 
00100 #endif
00101 
00102 #ifdef _MSC_VER
00103 #pragma warning( pop )
00104 #endif
00105 
00106 #endif // _RAKNET_SUPPORT_*

Generated on Thu Sep 30 2010 01:27:28 for RakNet by  doxygen 1.7.1