Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        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);
        }
Beispiel #4
0
		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;
		}