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); }
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); }