Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008 #include "NativeFeatureIncludes.h"
00009 #if _RAKNET_SUPPORT_ConnectionGraph2==1
00010
00011 #ifndef __CONNECTION_GRAPH_2_H
00012 #define __CONNECTION_GRAPH_2_H
00013
00014 class RakPeerInterface;
00015 #include "RakMemoryOverride.h"
00016 #include "RakNetTypes.h"
00017 #include "PluginInterface2.h"
00018 #include "DS_List.h"
00019 #include "DS_WeightedGraph.h"
00020 #include "GetTime.h"
00021 #include "Export.h"
00022
00028 class RAK_DLL_EXPORT ConnectionGraph2 : public PluginInterface2
00029 {
00030 public:
00031
00038 bool GetConnectionListForRemoteSystem(RakNetGUID remoteSystemGuid, SystemAddress *saOut, RakNetGUID *guidOut, unsigned int *outLength);
00039
00041 bool ConnectionExists(RakNetGUID g1, RakNetGUID g2);
00042
00044 struct SystemAddressAndGuid
00045 {
00046 SystemAddress systemAddress;
00047 RakNetGUID guid;
00048 };
00050 static int SystemAddressAndGuidComp( const SystemAddressAndGuid &key, const SystemAddressAndGuid &data );
00051
00053 struct RemoteSystem
00054 {
00055 DataStructures::OrderedList<SystemAddressAndGuid,SystemAddressAndGuid,ConnectionGraph2::SystemAddressAndGuidComp> remoteConnections;
00056 RakNetGUID guid;
00057 };
00059 static int RemoteSystemComp( const RakNetGUID &key, RemoteSystem * const &data );
00060
00061 protected:
00063 virtual void OnClosedConnection(SystemAddress systemAddress, RakNetGUID rakNetGUID, PI2_LostConnectionReason lostConnectionReason );
00065 virtual void OnNewConnection(SystemAddress systemAddress, RakNetGUID rakNetGUID, bool isIncoming);
00067 virtual PluginReceiveResult OnReceive(Packet *packet);
00068
00069
00070 DataStructures::OrderedList<RakNetGUID, RemoteSystem*, ConnectionGraph2::RemoteSystemComp> remoteSystems;
00071
00072 };
00073
00074 #endif
00075
00076 #endif // _RAKNET_SUPPORT_*