예제 #1
0
        public bool canIBuild()
        {
            if (StarryboundServer.serverConfig.useDefaultWorldCoordinate && StarryboundServer.config.spawnWorldProtection)
            {
                if (loc != null)
                {
                    if ((StarryboundServer.spawnPlanet.Equals(loc)) && !group.hasPermission("admin.spawnbuild") && !inPlayerShip)
                    {
                        return(false);
                    }
                }
                else
                {
                    return(false);
                }
            }
            else if (!hasPermission("world.build"))
            {
                return(false);
            }
            else if (!canBuild)
            {
                return(false);
            }
            if (this.hasPermission("admin.ignoreshipaccess"))
            {
                return(true);                                              //Admins can ignore claims
            }
            var player = Claims.GetStakeOwner(loc);

            if (player == this.name)
            {
                return(true);
            }
            if (player != null)
            {
                List <String> whiteList = StarryboundServer.getClientWhitelist(player);

                if (!whiteList.Contains(this.name))
                {
                    return(false);                                //Players need to specificly whitelist players to ignore claims
                }
            }
            return(true);
        }