CommonFunctions.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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 "RakNetTime.h"
  18. #include "GetTime.h"
  19. #include "DebugTools.h"
  20. #include "RakTimer.h"
  21. using namespace RakNet;
  22. class CommonFunctions
  23. {
  24. public:
  25. CommonFunctions(void);
  26. ~CommonFunctions(void);
  27. static bool WaitAndConnect(RakPeerInterface *peer,char* ip,unsigned short int port,int millisecondsToWait);
  28. static bool WaitForMessageWithID(RakPeerInterface *reciever,int id,int millisecondsToWait);
  29. static Packet * WaitAndReturnMessageWithID(RakPeerInterface *reciever,int id,int millisecondsToWait);
  30. static void DisconnectAndWait(RakPeerInterface *peer,char* ip,unsigned short int port);
  31. static bool ConnectionStateMatchesOptions(RakPeerInterface *peer, SystemAddress currentSystem, bool isConnected, bool isConnecting=false, bool isPending=false, bool isDisconnecting=false, bool isNotConnected=false, bool isLoopBack=false, bool isSilentlyDisconnecting=false);
  32. };
粤ICP备19079148号