using System.Threading.Tasks; using WingsAPI.Communication.Player; using WingsEmu.Game.Networking; namespace WingsEmu.Game.Managers; public class StaticSessionManager { public static ISessionManager Instance { get; private set; } public static void Initialize(ISessionManager manager) { Instance = manager; } } public interface ISessionManager : IBroadcaster { int SessionsCount { get; } ValueTask GetOnlineCharacterById(long characterId); ClusterCharacterInfo GetOnlineCharacterByName(string characterName); bool IsOnline(string charName); bool IsOnline(long characterId); void AddOnline(ClusterCharacterInfo clusterCharacterInfo); void RemoveOnline(string charName, long characterId); /// /// Disconnects all sessions from the current channel /// /// Task DisconnectAllAsync(); /// /// Returns the IClientSession specified /// by the character name passed as parameter /// /// /// IClientSession GetSessionByCharacterName(string name); /// /// Kicks a player using the character name /// passed as parameter /// /// /// Task KickAsync(string characterName); /// /// Kicks a player using the account id /// passed as parameter /// /// /// Task KickAsync(long accountId); /// /// Returns the IClientSession based on the CharacterId provided as parameter /// /// /// IClientSession GetSessionByCharacterId(long id); /// /// Registers a new session /// /// void RegisterSession(IClientSession session); /// /// Unregisters a session /// /// void UnregisterSession(IClientSession session); }