| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- using System;
- using System.Collections.Generic;
- using System.Net;
- using System.Threading.Tasks;
- namespace Microsoft.Xna.Framework.Net
- {
- /// <summary>
- /// Represents an available network session that can be joined.
- /// </summary>
- public class AvailableNetworkSession
- {
- public AvailableNetworkSession(
- string sessionName,
- string hostGamertag,
- int currentGamerCount,
- int openPublicGamerSlots,
- int openPrivateGamerSlots,
- NetworkSessionType sessionType,
- IDictionary<string, object> sessionProperties,
- string sessionId,
- IPEndPoint hostEndpoint = null)
- {
- SessionName = sessionName;
- HostGamertag = hostGamertag;
- CurrentGamerCount = currentGamerCount;
- OpenPublicGamerSlots = openPublicGamerSlots;
- OpenPrivateGamerSlots = openPrivateGamerSlots;
- SessionType = sessionType;
- SessionProperties = new Dictionary<string, object>(sessionProperties);
- SessionId = sessionId;
- HostEndpoint = hostEndpoint;
- }
- /// <summary>
- /// Gets the unique session ID.
- /// </summary>
- public string SessionId { get; }
- /// <summary>
- /// Gets the name of the session.
- /// </summary>
- public string SessionName { get; }
- /// <summary>
- /// Gets the gamertag of the host.
- /// </summary>
- public string HostGamertag { get; }
- /// <summary>
- /// Gets the current number of gamers in the session.
- /// </summary>
- public int CurrentGamerCount { get; }
- /// <summary>
- /// Gets the number of open public gamer slots.
- /// </summary>
- public int OpenPublicGamerSlots { get; }
- /// <summary>
- /// Gets the number of open private gamer slots.
- /// </summary>
- public int OpenPrivateGamerSlots { get; }
- /// <summary>
- /// Gets the type of the session.
- /// </summary>
- public NetworkSessionType SessionType { get; }
- /// <summary>
- /// Gets the session properties.
- /// </summary>
- public IDictionary<string, object> SessionProperties { get; }
- /// <summary>
- /// Gets the quality of service information.
- /// </summary>
- public QualityOfService QualityOfService { get; internal set; } = new QualityOfService();
- /// <summary>
- /// Gets the host's network endpoint for SystemLink (LAN) sessions.
- /// </summary>
- public IPEndPoint HostEndpoint { get; }
- }
- }
|