public void SendCommand(string alias, OrbClientInfo client, OrbCommandArgs args)
 {
     if (OnExecuteCommand != null)
     {
         OnExecuteCommand(alias, client, args);
     }
 }
        public OrbResponse SendRequest(string alias, OrbClientInfo client, OrbRequestArgs args)
        {
            OrbResponse response = null;

            try
            {
                if (OnExecuteRequest != null)
                {
                    response = OnExecuteRequest(alias, client, args);
                }
            }
            catch
            {
            }

            return(response);
        }
        public LoginResult LoginToServer(OrbClientInfo clientInfo, string password)
        {
            LoginCodes code;
            string     message   = null;
            Exception  exception = null;

            if (OnLogin != null)
            {
                try
                {
                    code = OnLogin(clientInfo, password);

                    switch (code)
                    {
                    case LoginCodes.InvalidAccount:
                        message = "Invalid username or password";
                        break;

                    case LoginCodes.NotAuthorized:
                        message = "This account has been blocked by the server admin.";
                        break;

                    case LoginCodes.ConnectionFailure:
                        message = "Connection to the server failed.";
                        break;
                    }
                }
                catch (Exception e)
                {
                    code      = LoginCodes.ConnectionFailure;
                    message   = "Login failed. Connection Lost.";
                    exception = e;
                }
            }
            else
            {
                code    = LoginCodes.ConnectionFailure;
                message = "Login failed. Connection Lost.";
            }

            return(new LoginResult(code, message, exception));
        }
Exemple #4
0
 public abstract void OnCommand(OrbClientInfo clientInfo, OrbCommandArgs args);
Exemple #5
0
 public abstract void OnRequest(OrbClientInfo clientInfo, OrbRequestArgs args);