protected void LaunchProcess(string processType, string args)
 {
     if (Ip.Equals("localhost") || Ip.Equals("127.0.0.1"))
     {
         if (Util.IsLinux)
         {
             Process.Start("mono",
                           string.Join(" ", Util.PROJECT_ROOT + processType +
                                       Util.EXE_PATH + processType + ".exe", args));
         }
         else
         {
             Process.Start(Util.PROJECT_ROOT + processType +
                           Util.EXE_PATH + processType, args);
         }
     }
     else
     {
         IPuppetMasterLauncher launcher = Activator.GetObject(
             typeof(IPuppetMasterLauncher), Util.MakeUrl("tcp",
                                                         Ip, Util.PUPPET_MASTER_PORT.ToString(), Util.PUPPET_MASTER_NAME))
                                          as IPuppetMasterLauncher;
         launcher.LaunchProcess(processType, args);
     }
 }
예제 #2
0
        /// <summary>
        /// Returns whether the specified IP address is authorized to POST snapshot
        /// data to this ASP server. All local IP address are automatically authorized.
        /// </summary>
        /// <param name="RemoteIP">The server IP to authorize</param>
        /// <returns></returns>
        public static bool IsAuthorizedGameServer(IPAddress RemoteIP)
        {
            // Local is always authorized
            if (IPAddress.IsLoopback(RemoteIP) || HttpServer.LocalIPs.Contains(RemoteIP))
            {
                return(true);
            }

            // Setup local vars
            IPAddress Ip;

            // Loop through all Config allowed game hosts, and determine if the remote host is allowed
            // to post snapshots here
            if (!String.IsNullOrWhiteSpace(Program.Config.ASP_GameHosts))
            {
                string[] Hosts = Program.Config.ASP_GameHosts.Split(',');
                foreach (string Host in Hosts)
                {
                    if (IPAddress.TryParse(Host, out Ip) && Ip.Equals(RemoteIP))
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }
예제 #3
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }
            UsuarioVO other = (UsuarioVO)obj;

            if (other == null)
            {
                return(false);
            }
            if (Ip == null)
            {
                if (other.Ip != null)
                {
                    return(false);
                }
            }
            else if (!Ip.Equals(other.Ip))
            {
                return(false);
            }
            if (!Matricula.Equals(other.Matricula))
            {
                return(false);
            }
            return(true);
        }
예제 #4
0
        public override bool Equals(object other)
        {
            if (other == null || other.GetType() != typeof(HueBridge))
            {
                return(false);
            }

            var otherOptions = (HueBridge)other;

            return(Ip.Equals(otherOptions.Ip) &&
                   AppKey.Equals(otherOptions.AppKey));
        }
예제 #5
0
        public override bool Equals(object other)
        {
            if (other == null || other.GetType() != typeof(ChromecastOptions))
            {
                return(false);
            }

            var otherOptions = (ChromecastOptions)other;

            return(Ip.Equals(otherOptions.Ip) &&
                   Name.Equals(otherOptions.Name));
        }
 public bool Equals(ImportSharelinkOptions target)
 {
     if (target == null ||
         IsImportSsShareLink != target.IsImportSsShareLink ||
         IsInjectGlobalImport != target.IsInjectGlobalImport ||
         IsBypassCnSite != target.IsBypassCnSite ||
         Mode != target.Mode ||
         !Ip.Equals(target.Ip) ||
         Port != target.Port)
     {
         return(false);
     }
     return(true);
 }
예제 #7
0
 public bool Equals(MultiServerKey other)
 {
     if (GroupName.Equals(other.GroupName) &&
         Ip.Equals(other.Ip) &&
         Port.Equals(other.Port) &&
         Database.Equals(other.Database)
         )
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
예제 #8
0
        public override bool Equals(object obj)
        {
            Server peer = (Server)obj;

            if (peer == null)
            {
                return(false);
            }
            if (ReferenceEquals(peer, this))
            {
                return(true);
            }
            bool ret = false;

            ret = (Ip == peer.Ip);
            if (!ret)
            {
                return(ret);
            }
            ret = (Enabled == peer.Enabled);
            if (!ret)
            {
                return(ret);
            }
            ret = (Port == peer.Port);
            if (!ret)
            {
                return(ret);
            }
            ret = Ip.Equals(peer.Ip);
            if (!ret)
            {
                return(ret);
            }
            return(ret);
        }
예제 #9
0
 public bool Equals(ArpEntry other)
 {
     return(Ip.Equals(other.Ip) && Mac.Equals(other.Mac));
 }
예제 #10
0
 public bool Equals(User other)
 {
     return(Ip.Equals(other.Ip));
 }
예제 #11
0
        /// <summary>
        /// TODO: description
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public override bool Equals(object obj)
        {
            XboxConnectionInformation info = obj as XboxConnectionInformation;

            return(info != null && (Name.Equals(info.Name) && Ip.Equals(info.Ip)));
        }