Пример #1
0
        public long GetSessionForUser(string userName)
        {
            Dictionary <long, sessionHandler> .Enumerator myEnum = mSessions.GetEnumerator();

            while (myEnum.MoveNext())
            {
                sessionHandler session = myEnum.Current.Value;
                if (session.mUser != null)
                {
                    if (session.mUser.usuario.ToLower() == userName)
                    {
                        return(session.mSessionID);
                    }
                }
            }

            return(-1);
        }
Пример #2
0
        public long GetSessionForUser(int userId)
        {
            Dictionary <long, sessionHandler> .Enumerator myEnum = mSessions.GetEnumerator();

            while (myEnum.MoveNext())
            {
                sessionHandler session = myEnum.Current.Value;
                if (session.mUser != null)
                {
                    if (session.mUser.id == userId)
                    {
                        return(session.mSessionID);
                    }
                }
            }

            return(-1);
        }