Lobby2Plugin.cpp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. #include "Lobby2Plugin.h"
  11. using namespace RakNet;
  12. Lobby2Plugin::Lobby2Plugin()
  13. {
  14. orderingChannel=0;
  15. packetPriority=HIGH_PRIORITY;
  16. }
  17. Lobby2Plugin::~Lobby2Plugin()
  18. {
  19. }
  20. void Lobby2Plugin::SetOrderingChannel(char oc)
  21. {
  22. orderingChannel=oc;
  23. }
  24. void Lobby2Plugin::SetSendPriority(PacketPriority pp)
  25. {
  26. packetPriority=pp;
  27. }
  28. void Lobby2Plugin::SetMessageFactory(Lobby2MessageFactory *f)
  29. {
  30. msgFactory=f;
  31. }
  32. Lobby2MessageFactory* Lobby2Plugin::GetMessageFactory(void) const
  33. {
  34. return msgFactory;
  35. }
  36. void Lobby2Plugin::SetCallbackInterface(Lobby2Callbacks *cb)
  37. {
  38. ClearCallbackInterfaces();
  39. callbacks.Insert(cb, _FILE_AND_LINE_ );
  40. }
  41. void Lobby2Plugin::AddCallbackInterface(Lobby2Callbacks *cb)
  42. {
  43. RemoveCallbackInterface(cb);
  44. callbacks.Insert(cb, _FILE_AND_LINE_ );
  45. }
  46. void Lobby2Plugin::RemoveCallbackInterface(Lobby2Callbacks *cb)
  47. {
  48. unsigned long index = callbacks.GetIndexOf(cb);
  49. if (index!=MAX_UNSIGNED_LONG)
  50. callbacks.RemoveAtIndex(index);
  51. }
  52. void Lobby2Plugin::ClearCallbackInterfaces()
  53. {
  54. callbacks.Clear(false, _FILE_AND_LINE_);
  55. }
粤ICP备19079148号