Shadowrun: Awakened 29 September 2011 - Build 871
NatTypeDetectionClient.h
Go to the documentation of this file.
00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 #include "NativeFeatureIncludes.h"
00009 #if _RAKNET_SUPPORT_NatTypeDetectionClient==1
00010 
00011 #ifndef __NAT_TYPE_DETECTION_CLIENT_H
00012 #define __NAT_TYPE_DETECTION_CLIENT_H
00013 
00014 #include "RakNetTypes.h"
00015 #include "Export.h"
00016 #include "PluginInterface2.h"
00017 #include "PacketPriority.h"
00018 #include "SocketIncludes.h"
00019 #include "DS_OrderedList.h"
00020 #include "RakString.h"
00021 #include "NatTypeDetectionCommon.h"
00022 
00023 namespace RakNet
00024 {
00026 class RakPeerInterface;
00027 struct Packet;
00028 
00037     class RAK_DLL_EXPORT NatTypeDetectionClient : public PluginInterface2
00038     {
00039     public:
00040 
00041         // GetInstance() and DestroyInstance(instance*)
00042         STATIC_FACTORY_DECLARATIONS(NatTypeDetectionClient)
00043 
00044         // Constructor
00045         NatTypeDetectionClient();
00046 
00047         // Destructor
00048         virtual ~NatTypeDetectionClient();
00049 
00054         void DetectNATType(SystemAddress _serverAddress);
00055 
00057         virtual void Update(void);
00058 
00060         virtual PluginReceiveResult OnReceive(Packet *packet);
00061 
00062         virtual void OnClosedConnection(const SystemAddress &systemAddress, RakNetGUID rakNetGUID, PI2_LostConnectionReason lostConnectionReason );
00063 
00064     protected:
00065         SOCKET c2;
00066         unsigned short c2Port;
00067         void Shutdown(void);
00068         void OnCompletion(NATTypeDetectionResult result);
00069         bool IsInProgress(void) const;
00070 
00071         void OnTestPortRestricted(Packet *packet);
00072         SystemAddress serverAddress;
00073     };
00074 
00075 
00076 }
00077 
00078 
00079 #endif
00080 
00081 #endif // _RAKNET_SUPPORT_*

Copyright © 2007-2010 by The Shadowrun: Awakened Team. This work is licensed under the GNU Lesser General Public License 3.

GNU Lesser General Public License 3 Sourceforge.net