AvailableNetworkSession.cs 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Threading.Tasks;
  4. namespace Microsoft.Xna.Framework.Net
  5. {
  6. /// <summary>
  7. /// Represents an available network session that can be joined.
  8. /// </summary>
  9. public class AvailableNetworkSession
  10. {
  11. public AvailableNetworkSession(
  12. string sessionName,
  13. string hostGamertag,
  14. int currentGamerCount,
  15. int openPublicGamerSlots,
  16. int openPrivateGamerSlots,
  17. NetworkSessionType sessionType,
  18. IDictionary<string, object> sessionProperties,
  19. string sessionId)
  20. {
  21. SessionName = sessionName;
  22. HostGamertag = hostGamertag;
  23. CurrentGamerCount = currentGamerCount;
  24. OpenPublicGamerSlots = openPublicGamerSlots;
  25. OpenPrivateGamerSlots = openPrivateGamerSlots;
  26. SessionType = sessionType;
  27. SessionProperties = new Dictionary<string, object>(sessionProperties);
  28. SessionId = sessionId;
  29. }
  30. /// <summary>
  31. /// Gets the unique session ID.
  32. /// </summary>
  33. public string SessionId { get; }
  34. /// <summary>
  35. /// Gets the name of the session.
  36. /// </summary>
  37. public string SessionName { get; }
  38. /// <summary>
  39. /// Gets the gamertag of the host.
  40. /// </summary>
  41. public string HostGamertag { get; }
  42. /// <summary>
  43. /// Gets the current number of gamers in the session.
  44. /// </summary>
  45. public int CurrentGamerCount { get; }
  46. /// <summary>
  47. /// Gets the number of open public gamer slots.
  48. /// </summary>
  49. public int OpenPublicGamerSlots { get; }
  50. /// <summary>
  51. /// Gets the number of open private gamer slots.
  52. /// </summary>
  53. public int OpenPrivateGamerSlots { get; }
  54. /// <summary>
  55. /// Gets the type of the session.
  56. /// </summary>
  57. public NetworkSessionType SessionType { get; }
  58. /// <summary>
  59. /// Gets the session properties.
  60. /// </summary>
  61. public IDictionary<string, object> SessionProperties { get; }
  62. /// <summary>
  63. /// Gets the quality of service information.
  64. /// </summary>
  65. public QualityOfService QualityOfService { get; internal set; } = new QualityOfService();
  66. }
  67. }