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

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

            return(response);
        }
예제 #3
0
        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));
        }
예제 #4
0
 public abstract void OnCommand(OrbClientInfo clientInfo, OrbCommandArgs args);
예제 #5
0
 public abstract void OnRequest(OrbClientInfo clientInfo, OrbRequestArgs args);