You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.1 KiB

  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.Networking;
  5. namespace Multiplayer
  6. {
  7. public static class ChannelConfig
  8. {
  9. public static QosType[] GetDefaultChannels()
  10. {
  11. QosType[] retVal = new QosType[3];
  12. retVal[0] = QosType.Reliable;
  13. retVal[1] = QosType.StateUpdate;
  14. retVal[2] = QosType.UnreliableSequenced;
  15. return retVal;
  16. }
  17. public static HostTopology DefaultTopology()
  18. {
  19. ConnectionConfig config = DefaultConfig();
  20. return new HostTopology(config, 8);
  21. }
  22. public static ConnectionConfig DefaultConfig()
  23. {
  24. ConnectionConfig DefaultConfig = new ConnectionConfig();
  25. QosType[] Channels = GetDefaultChannels();
  26. foreach (QosType channel in Channels)
  27. DefaultConfig.AddChannel(channel);
  28. return DefaultConfig;
  29. }
  30. }
  31. public enum ServerChannel
  32. {
  33. Reliable = 0,
  34. StateUpdate = 1,
  35. UnreliableSequenced = 2,
  36. }
  37. }