コード例 #1
0
        /// <summary>
        ///     Creates a new session.
        /// </summary>
        internal static NetAvatarSession Create(AvatarAccount avatarAccount, byte[] sessionId)
        {
            NetAvatarSession session = new NetAvatarSession(avatarAccount, sessionId);

            NetAvatarSessionManager._sessions.Add(sessionId, session);
            return(session);
        }
コード例 #2
0
        /// <summary>
        ///     Tries to remove the specified session.
        /// </summary>
        internal static bool TryRemove(byte[] sessionId, out NetAvatarSession session)
        {
            if (NetAvatarSessionManager._sessions.TryGetValue(sessionId, out session))
            {
                return(NetAvatarSessionManager._sessions.Remove(sessionId));
            }

            return(false);
        }
コード例 #3
0
 /// <summary>
 ///     Tries to get the specified session.
 /// </summary>
 internal static bool TryGet(byte[] sessionId, out NetAvatarSession session)
 {
     return(NetAvatarSessionManager._sessions.TryGetValue(sessionId, out session));
 }