TestHelpers.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * Copyright (c) 2014, Oculus VR, Inc.
  3. * All rights reserved.
  4. *
  5. * This source code is licensed under the BSD-style license found in the
  6. * LICENSE file in the root directory of this source tree. An additional grant
  7. * of patent rights can be found in the PATENTS file in the same directory.
  8. *
  9. */
  10. #pragma once
  11. #include "RakString.h"
  12. #include "RakPeerInterface.h"
  13. #include "MessageIdentifiers.h"
  14. #include "BitStream.h"
  15. #include "RakPeer.h"
  16. #include "RakSleep.h"
  17. #include "DebugTools.h"
  18. #include "CommonFunctions.h"
  19. #include "RakTimer.h"
  20. using namespace RakNet;
  21. class TestHelpers
  22. {
  23. public:
  24. TestHelpers(void);
  25. ~TestHelpers(void);
  26. static void StandardServerPrep(RakPeerInterface *&server);
  27. static void StandardClientPrep(RakPeerInterface *&client);
  28. static void StandardServerPrep(RakPeerInterface *&server,DataStructures::List <RakPeerInterface *> &destroyList);
  29. static void StandardClientPrep(RakPeerInterface *&client,DataStructures::List <RakPeerInterface *> &destroyList);
  30. static bool WaitAndConnectTwoPeersLocally(RakPeerInterface *connector,RakPeerInterface *connectee,int millisecondsToWait);
  31. static bool ConnectTwoPeersLocally(RakPeerInterface *connector,RakPeerInterface *connectee);
  32. ///static bool BroadCastTestPacket(RakPeerInterface *sender);
  33. static bool BroadCastTestPacket(RakPeerInterface *sender,PacketReliability rel=RELIABLE_ORDERED,PacketPriority pr=HIGH_PRIORITY,int typeNum=ID_USER_PACKET_ENUM+1);
  34. static bool WaitForTestPacket(RakPeerInterface *reciever,int millisecondsToWait);
  35. static void RecieveForXTime(RakPeerInterface *reciever,int millisecondsToWait);
  36. static bool SendTestPacketDirected(RakPeerInterface *sender,char * ip,int port,PacketReliability rel=RELIABLE_ORDERED,PacketPriority pr=HIGH_PRIORITY,int typeNum=ID_USER_PACKET_ENUM+1);
  37. };
粤ICP备19079148号