private static OrbResponse OnExecuteRequest(string alias, OrbClientInfo clientInfo, OrbRequestArgs args) { OrbClientState client = GetClientState(clientInfo); if (client == null) { return(null); } OrbRequest request = GetRequest(alias, client); OrbResponse response = null; if (request != null) { ManualResetEvent reset = new ManualResetEvent(false); request.ResetEvent = reset; new RequestSyncTimer(client, request, args).Start(); reset.WaitOne(); response = request.Response; } return(response); }
private static OrbResponse OnExecuteRequest(string alias, OrbClientInfo clientInfo, OrbRequestArgs args) { OrbClientState client = GetClientState(clientInfo); if (client == null) { return(null); } OrbResponse response = null; try { OrbRequest request = GetRequest(alias, client); if (request != null) { ManualResetEvent reset = new ManualResetEvent(false); request.ResetEvent = reset; new RequestSyncTimer(client, request, args).Start(); reset.WaitOne(); response = request.Response; } } catch (Exception e) { Console.WriteLine("Exception occurred for OrbServer request {0}\nMessage: {1}", alias, e.Message); } return(response); }
private static void OnExecuteCommand(string alias, OrbClientInfo clientInfo, OrbCommandArgs args) { OrbClientState client = GetClientState(clientInfo); if (client == null) { return; } OrbCommand command = GetCommand(alias, client); if (command != null) { new CommandSyncTimer(client, command, args).Start(); } }
private static bool CanConnectionAccess(OrbClientState client, OrbRegistryEntry entry) { bool authorized = false; if (entry.RequiresLogin) { if (client.OnlineMobile != null) { authorized = IsAccessAllowed(client.OnlineMobile, entry.RequiredLevel); } } else { authorized = IsAccessAllowed(client.Account, entry.RequiredLevel); } return(authorized); }
private static OrbCommand GetCommand(string alias, OrbClientState client) { OrbRegistryEntry entry = (OrbRegistryEntry)m_Registry[alias]; OrbCommand command = null; if (entry != null) { if (CanConnectionAccess(client, entry)) { try { command = (OrbCommand)Activator.CreateInstance(entry.Type); } catch (Exception e) { Console.WriteLine("OrbServer Exception: " + e.Message); } } } return(command); }
private static OrbRequest GetRequest(string alias, OrbClientState client) { OrbRegistryEntry entry = (OrbRegistryEntry)m_Registry[alias]; OrbRequest request = null; if (entry != null) { if (CanConnectionAccess(client, entry)) { try { request = (OrbRequest)Activator.CreateInstance(entry.Type); } catch (Exception e) { Misc.ExceptionLogging.WriteLine(e); } } } return(request); }
private static void OnExecuteCommand(string alias, OrbClientInfo clientInfo, OrbCommandArgs args) { OrbClientState client = GetClientState(clientInfo); if (client == null) { return; } try { OrbCommand command = GetCommand(alias, client); if (command != null) { new CommandSyncTimer(client, command, args).Start(); } } catch (Exception e) { Console.WriteLine("Exception occurred for OrbServer command {0}\nMessage: {1}", alias, e.Message); } }
public CommandSyncTimer(OrbClientState client, OrbCommand command, OrbCommandArgs args) : base(TimeSpan.FromMilliseconds(20.0), TimeSpan.FromMilliseconds(20.0)) { m_Client = client; m_Command = command; m_Args = args; }
public RequestSyncTimer(OrbClientState client, OrbRequest request, OrbRequestArgs args) : base(TimeSpan.FromMilliseconds(20.0), TimeSpan.FromMilliseconds(20.0)) { m_Client = client; m_Request = request; m_Args = args; }
private static bool CanConnectionAccess(OrbClientState client, OrbRegistryEntry entry) { bool authorized = false; if(entry.RequiresLogin) { if(client.OnlineMobile != null) { authorized = IsAccessAllowed(client.OnlineMobile, entry.RequiredLevel); } } else { authorized = IsAccessAllowed(client.Account, entry.RequiredLevel); } return authorized; }
private static OrbCommand GetCommand(string alias, OrbClientState client) { OrbRegistryEntry entry = (OrbRegistryEntry)m_Registry[alias]; OrbCommand command = null; if(entry != null) { if(CanConnectionAccess(client, entry)) { try { command = (OrbCommand)Activator.CreateInstance(entry.Type); } catch(Exception e) { Console.WriteLine("OrbServer Exception: " + e.Message); } } } return command; }
public CommandSyncTimer(OrbClientState client, OrbCommand command, OrbCommandArgs args) : base(TimeSpan.FromMilliseconds(20.0), TimeSpan.FromMilliseconds(20.0)) { m_Client = client; m_Command = command; m_Args = args; }
public RequestSyncTimer(OrbClientState client, OrbRequest request, OrbRequestArgs args) : base(TimeSpan.FromMilliseconds(20.0), TimeSpan.FromMilliseconds(20.0)) { m_Client = client; m_Request = request; m_Args = args; }