Ejemplo n.º 1
0
        public async Task <Boolean> UpdateZoneTypeAsync(string zoneId, ZoneEnum type)
        {
            using (var client = _context.Factory.Create())
            {
                var zones = await client.Cypher
                            .Match("(z:Zone)")
                            .Where((Zone z) => z.Id == zoneId)
                            .Return(z => z.As <Zone>())
                            .ResultsAsync;

                if (zones is null || !zones.Any())
                {
                    return(false);
                }

                await client.Cypher
                .Match("(z:Zone)")
                .Where((Zone z) => z.Id == zoneId)
                .Set("z.Type = {type}")
                .WithParam("type", type.ToString())
                .ExecuteWithoutResultsAsync();

                return(true);
            }
        }
 /// <summary>
 ///
 /// </summary>
 /// <param name="accessKey">七牛提供的公钥,用于识别用户</param>
 /// <param name="secretKey">七牛提供的秘钥</param>
 /// <param name="zones">空间区域</param>
 /// <param name="host">文件对外访问的主机名</param>
 /// <param name="bucket">默认空间</param>
 public QiNiuStorageConfig(string accessKey, string secretKey, ZoneEnum zones, string host, string bucket) :
     this(accessKey, secretKey)
 {
     DefaultZones  = zones;
     DefaultHost   = host;
     DefaultBucket = bucket;
 }
Ejemplo n.º 3
0
        public Zone()
        {
            //Configurable
            Name = "";
            Type = ZoneEnum.None;

            Coordinates   = Vector3D.Zero;
            CoreDirection = Vector3D.Zero;
            Radius        = 0;
            PlanetList    = new List <string>();

            UseFactionOwnership = false;
            FactionOwner        = "";
            FriendlyFactions    = new List <string>();

            UseTimer = false;
            PlayerInZoneResetsTime = false;
            MaxTimeMinutes         = 0;

            AllowFactionContest          = false;
            ContestingFaction            = "";
            ContestingFactionFriends     = new List <string>();
            ContestVictoryPointsRequired = 10;

            UseZoneAnnouncing        = false;
            ZoneEnterAnnounceMessage = "";
            ZoneEnterAnnounceSoundId = "";
            ZoneExitAnnounceMessage  = "";
            ZoneExitAnnounceSoundId  = "";

            //Non-Configurable
            ZoneMorale         = 0;
            ZoneSpawnResources = 0;
        }
Ejemplo n.º 4
0
        public async Task <ActionResult> PutTypeAsync(string id, ZoneEnum type)
        {
            if (string.IsNullOrWhiteSpace(id))
            {
                return(BadRequest());
            }

            var result = await _zoneService.UpdateZoneTypeAsync(id, type);

            if (!result)
            {
                return(NotFound());
            }
            return(CreatedAtAction(nameof(GetAsync), new { id }, null));
        }
 /// <summary>
 /// 设置默认空间信息
 /// </summary>
 /// <param name="bucket">默认空间</param>
 /// <param name="host">默认域</param>
 /// <param name="zone">默认空间区域</param>
 public void SetDefaultBucket(string bucket, string host, ZoneEnum zone)
 {
     DefaultBucket = bucket;
     DefaultHost   = host;
     DefaultZones  = zone;
 }
Ejemplo n.º 6
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="zone">空间区域</param>
 /// <returns></returns>
 internal static string GetRegion(ZoneEnum zone)
 {
     return(zone.GetCustomerObj <ENameAttribute>()?.Name ?? "");
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BuildingSite"/> class.
 /// </summary>
 /// <param name="currentZone"><see cref="CurrentZone"/> read from proper map.</param>
 /// <param name="currentTopography"><see cref="CurrentTopography"/> based on terrain type.</param>
 /// <param name="altitudeAboveSea"><see cref="AltitudeAboveSea"/> [m].</param>
 /// <seealso cref="BuildingSite.BuildingSite"/>
 /// <seealso cref="BuildingSite.BuildingSite(ZoneEnum, TopographyEnum, double, double)"/>
 public BuildingSite(ZoneEnum currentZone, TopographyEnum currentTopography, double altitudeAboveSea)
 {
     CurrentZone       = currentZone;
     CurrentTopography = currentTopography;
     AltitudeAboveSea  = altitudeAboveSea;
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BuildingSite"/> class.
 /// </summary>
 /// <param name="currentZone"><see cref="CurrentZone"/> read from proper map.</param>
 /// <param name="currentTopography"><see cref="CurrentTopography"/> based on terrain type.</param>
 /// <param name="altitudeAboveSea"><see cref="AltitudeAboveSea"/> [m].</param>
 /// <param name="exposureCoefficient"><see cref="ExposureCoefficient"/>.</param>
 /// <seealso cref="BuildingSite.BuildingSite"/>
 /// <seealso cref="BuildingSite.BuildingSite(ZoneEnum, TopographyEnum, double)"/>
 public BuildingSite(ZoneEnum currentZone, TopographyEnum currentTopography,
                     double altitudeAboveSea, double exposureCoefficient) :
     this(currentZone, currentTopography, altitudeAboveSea)
 {
     ExposureCoefficient = exposureCoefficient;
 }
Ejemplo n.º 9
0
 public async Task <Boolean> UpdateZoneTypeAsync(string zoneId, ZoneEnum type)
 {
     return(await _zoneRepository.UpdateZoneTypeAsync(zoneId, type));
 }