Пример #1
0
        /// <summary>
        /// Disconnect event
        /// </summary>
        /// <param name="stopCalled"></param>
        /// <returns></returns>
        public override Task OnDisconnected(bool stopCalled)
        {
            long accountId = AccountSession.AccountID;

            if (accountId < 1)
            {
                accountId = AccountSession.GetAccountID(Context);
            }

            GameSession.Session.Disconnect(accountId, Context.ConnectionId);

            return(base.OnDisconnected(stopCalled));
        }
Пример #2
0
 private long GetAccountId(HubCallerContext context)
 {
     return(ConnectionIdAccountId.GetOrAdd(context.ConnectionId, _accountId => AccountSession.GetAccountID(context)));
 }