internal void SessionReady(CytarMPSession session)
 {
     if (RootRoom != null)
     {
         session.RootContext = RootRoom;
         session.Join(RootRoom);
     }
     WaitSessionCallback?.Invoke(session);
 }
        public bool Authenticate(CytarMPSession session, string username, byte[] pwdHash)
        {
            if (CytarMPServer.AuthCallback == null)
            {
                return(true);
            }
            var authResult = CytarMPServer.AuthCallback(username, pwdHash);

            if (authResult)
            {
                session.User = new User(session, username);
                CytarMPServer.AuthPassCallback(session);
                return(true);
            }
            else
            {
                session.Exit(this);
                return(false);
            }
        }
 internal void AuthPassCallback(CytarMPSession session)
 {
     SessionReady(session);
 }
Beispiel #4
0
 public User(CytarMPSession session, string name)
 {
     Name    = name ?? throw new ArgumentNullException(nameof(name));
     Session = session ?? throw new ArgumentNullException(nameof(session));
 }