コード例 #1
0
ファイル: Zone.cs プロジェクト: WCellFR/WCellFR
		public Zone(Region rgn, ZoneInfo info)
		{
			Region = rgn;
			Info = info;
			if (info.WorldStates != null)
			{
				WorldStates = new WorldStateCollection(this, info.WorldStates);
			}

			CreateChatChannels();
		}
コード例 #2
0
    private Path CalculateScore(Candidate candidate)
    {
        List <LocationClue> clues = candidate.IncorporateOtherClues();

        if (clues.Count < 2)
        {
            return(null); //if we do not have more than two location clues about this candidate
        }
        float        score       = 0;
        float        murderTime  = GameController.GetInstanceTimeController().GetMurderTime();
        int          murderZone  = GameController.GetInstanceLevelController().GetMurderZone();
        LocationClue origin      = LocationClue.GetOriginClue(clues, murderTime);
        LocationClue destination = LocationClue.GetDestinationClue(clues, murderTime);

        if (origin == null || destination == null)
        {
            return(null); //not enough information about the agent either before or after the murder
        }

        List <ZoneInfo> zones = GameController.GetInstanceLevelController().GetZoneInfos();

        ZoneInfo start = zones[origin.zoneID]; //set the starting zone to origin

        int[] prev = FindPath(start, zones.Count);
        Path  originToMurderZone = Path.CreatePath(prev, murderZone, origin.zoneID, murderTime, origin.timeInt);

        start = zones[murderZone]; //set the starting zone to murder zone
        prev  = FindPath(start, zones.Count);
        Path murderZoneToDest = Path.CreatePath(prev, destination.zoneID, murderZone, destination.timeInt, murderTime);

        Path combinedPath = Path.CombinePaths(originToMurderZone, murderZoneToDest);
        //calculating actual time elapsed from origin to destination
        float timeElapsed = destination.timeInt - origin.timeInt;

        //how close is the score of the path compared to the actual time elapsed
        //will show us how likely the candidate took a path going through the murder zone
        score = 100 - (Mathf.Abs(combinedPath.GetScore() - timeElapsed));
        combinedPath.SetScore(score);
        return(combinedPath);
    }
コード例 #3
0
        public IList <ZoneInfo> GetList(int pageIndex, int pageSize, string sqlWhere, params SqlParameter[] cmdParms)
        {
            StringBuilder sb         = new StringBuilder(500);
            int           startIndex = (pageIndex - 1) * pageSize + 1;
            int           endIndex   = pageIndex * pageSize;

            sb.Append(@"select * from(select row_number() over(order by LastUpdatedDate desc) as RowNumber,
			           Id,UserId,ZoneCode,ZoneName,Square,Descr,LastUpdatedDate
					   from Zone "                    );
            if (!string.IsNullOrEmpty(sqlWhere))
            {
                sb.AppendFormat(" where 1=1 {0} ", sqlWhere);
            }
            sb.AppendFormat(@")as objTable where RowNumber between {0} and {1} ", startIndex, endIndex);

            IList <ZoneInfo> list = new List <ZoneInfo>();

            using (SqlDataReader reader = SqlHelper.ExecuteReader(SqlHelper.WmsDbConnString, CommandType.Text, sb.ToString(), cmdParms))
            {
                if (reader != null && reader.HasRows)
                {
                    while (reader.Read())
                    {
                        ZoneInfo model = new ZoneInfo();
                        model.Id              = reader.GetGuid(1);
                        model.UserId          = reader.GetGuid(2);
                        model.ZoneCode        = reader.GetString(3);
                        model.ZoneName        = reader.GetString(4);
                        model.Square          = reader.GetString(5);
                        model.Descr           = reader.GetString(6);
                        model.LastUpdatedDate = reader.GetDateTime(7);

                        list.Add(model);
                    }
                }
            }

            return(list);
        }
コード例 #4
0
        public virtual void logic_rpc_Handle(GetBatchZonesInfoRequest req, OnRpcReturn <GetBatchZonesInfoResponse> cb)
        {
            GetBatchZonesInfoResponse rsp = new GetBatchZonesInfoResponse();

            rsp.snapDic = new HashMap <int, List <ZoneInfoSnap> >();

            foreach (var item in req.mapIDList)
            {
                var lt = GetZoneList(req.servergroupID, item);

                if (lt != null)
                {
                    ZoneInfoSnap snap = null;
                    ZoneInfo     info = null;

                    List <ZoneInfoSnap> snaps = new List <ZoneInfoSnap>();

                    for (int i = 0; i < lt.Count; i++)
                    {
                        //获取所有线的信息.
                        info = lt[i];
                        if (info != null && info.close == false)
                        {
                            snap = new ZoneInfoSnap();
                            snap.curPlayerCount  = info.currentRoleCount;
                            snap.playerMaxCount  = info.map_data.max_players;
                            snap.lineIndex       = info.lineIndex;
                            snap.playerFullCount = info.map_data.full_players;
                            snap.uuid            = info.uuid;
                            snaps.Add(snap);
                        }
                    }
                    rsp.snapDic.Add(item, snaps);
                }
            }
            cb(rsp);
        }
コード例 #5
0
        public ActionResult RegisterZonePass(long zone, long sensor, long rfid)
        {
            if (zone < 0)
            {
                return(BadRequest("zone id must be positive and not null"));
            }
            if (sensor < 0)
            {
                return(BadRequest("sensor id must be positive and not null"));
            }
            if (rfid < 0)
            {
                return(BadRequest("rfid must not be null"));
            }

            Console.WriteLine($"Recieved register for car {rfid}, entering zone {zone} from sensor {sensor}");

            var zoneReg = new ZoneInfo
            {
                Zone   = zone,
                Sensor = sensor,
                Rfid   = rfid
            };

            try
            {
                _zoneHandler.RegisterZone(zoneReg);
            }
            catch (Exception)
            {
                Console.WriteLine("Problem detected when registering Zone Pass");
                return(StatusCode(500));
            }

            return(Ok());
        }
コード例 #6
0
 private ProjectionParameter[] GetProjectionParameters(ZoneInfo coordSystemZoneInfo) =>
 new[]
 {
     new ProjectionParameter()
     {
         Name = ORIGIN_LATITUDE, Value = coordSystemZoneInfo.OriginLatitude.LatRadiansToDegrees()
     },
     new ProjectionParameter()
     {
         Name = ORIGIN_LONGITUDE, Value = coordSystemZoneInfo.OriginLongitude.LonRadiansToDegrees()
     },
     new ProjectionParameter()
     {
         Name = ORIGIN_NORTH, Value = coordSystemZoneInfo.OriginNorth
     },
     new ProjectionParameter()
     {
         Name = ORIGIN_EAST, Value = coordSystemZoneInfo.OriginEast
     },
     new ProjectionParameter()
     {
         Name = ORIGIN_SCALE, Value = coordSystemZoneInfo.OriginScale
     }
 };
コード例 #7
0
    private void GatherZoneMarkers()
    {
        zoneMarkersTransforms = new List <Transform>();
        zoneInfoList          = new List <ZoneInfo>();
        GameObject[] zoneObjects = GameObject.FindGameObjectsWithTag("ZoneMarker");

        for (int i = 0; i < zoneObjects.Length; i++)
        {
            GameObject markerObj = zoneObjects[i];
            ZoneInfo   info      = markerObj.GetComponent <ZoneInfo>();
            if (info == null)
            {
                Debug.LogError(string.Format("ERROR:gameobject({0}) at {1} is missing a ZoneInfo component"
                                             , markerObj.name, markerObj.transform.position.ToString()));
                continue;
            }
            info.zoneNum = zoneMarkersTransforms.Count;
            TextMesh mesh   = markerObj.transform.parent.Find("HoverText").GetComponent <TextMesh>();
            Vector3  objPos = markerObj.transform.position;
            mesh.text = string.Format("Zone {0}", info.zoneNum);
            zoneMarkersTransforms.Add(markerObj.transform);
            zoneInfoList.Add(info);
        }
    }
コード例 #8
0
ファイル: MainClass.cs プロジェクト: Jacobth/wow_auto_walk
        private static void Arguments(string arg, string op, ZoneInfo info)
        {
            if (arg.Equals("mine") && op != "")
            {
                Mine     m = new Mine();
                OreLists o = new OreLists();

                Rotation mage = new MageRotate();

                List <Point> ores = o.MineMap(op);

                int zone = o.MineZone(op);

                bool sameZone = zone == info.GetContinent(GameInfo.GetMapId());

                if (!sameZone)
                {
                    Console.WriteLine("Error: Ores in different continent");
                }

                else if (ores.Count > 0)
                {
                    m.GatherOres(ores, mage);
                }
            }

            else if (arg.Equals("walk"))
            {
                Travel t = new Travel();
                t.TravelWalk(op);
            }

            else if (arg.Equals("fly"))
            {
            }
        }
コード例 #9
0
        public IList <ZoneInfo> GetList(string sqlWhere, params SqlParameter[] cmdParms)
        {
            StringBuilder sb = new StringBuilder(500);

            sb.Append(@"select Id,UserId,ZoneCode,ZoneName,Square,Descr,LastUpdatedDate
                        from Zone ");
            if (!string.IsNullOrEmpty(sqlWhere))
            {
                sb.AppendFormat(" where 1=1 {0} ", sqlWhere);
            }
            sb.Append("order by LastUpdatedDate desc ");

            IList <ZoneInfo> list = new List <ZoneInfo>();

            using (SqlDataReader reader = SqlHelper.ExecuteReader(SqlHelper.WmsDbConnString, CommandType.Text, sb.ToString(), cmdParms))
            {
                if (reader != null && reader.HasRows)
                {
                    while (reader.Read())
                    {
                        ZoneInfo model = new ZoneInfo();
                        model.Id              = reader.GetGuid(0);
                        model.UserId          = reader.GetGuid(1);
                        model.ZoneCode        = reader.GetString(2);
                        model.ZoneName        = reader.GetString(3);
                        model.Square          = reader.GetString(4);
                        model.Descr           = reader.GetString(5);
                        model.LastUpdatedDate = reader.GetDateTime(6);

                        list.Add(model);
                    }
                }
            }

            return(list);
        }
コード例 #10
0
        private void btnAddPoint_Click(object sender, EventArgs e)
        {
            ZoneInfo     zone = SelectedZone();
            PointInfo    addedPoint;
            AddPointForm addForm = new AddPointForm();
            var          result  = addForm.ShowDialog();

            if (result == DialogResult.OK)
            {
                addedPoint = addForm.PointInfo;
                if (zone.PointList != null)
                {
                    var pointList = zone.PointList.ToList();
                    pointList.Add(addedPoint);
                    zone.PointList = pointList.ToArray();
                }
                else//1st point
                {
                    zone.PointList = new PointInfo[] { addedPoint };
                }
                lbPoint.Items.Add(addedPoint);
                lbPoint.SelectedItem = addedPoint;
            }
        }
コード例 #11
0
    public static EffectZone CreateEffect(ZoneInfo zoneInfo, Constants.EffectOrigin location, GameObject source)
    {
        EffectZone result = null;

        Vector3 spawnPoint;

        if (location != Constants.EffectOrigin.MousePointer)
        {
            Transform point = source.Entity().EffectDelivery.GetOriginPoint(location);
            spawnPoint = point.position;
        }
        else
        {
            Debug.LogError("Add Raycasting for MouseLocation effect creation");
            spawnPoint = source.transform.position;
        }

        GameObject zoneObject = LoadAndSpawnZonePrefab(zoneInfo, spawnPoint, Quaternion.identity);

        if (zoneObject == null)
        {
            return(null);
        }

        EntityMovement.FacingDirection facing = source.Entity().Movement.Facing;

        if (facing == EntityMovement.FacingDirection.Left)
        {
            zoneObject.transform.localScale = new Vector3(zoneObject.transform.localScale.x * -1, zoneObject.transform.localScale.y, zoneObject.transform.localScale.z);
        }


        result = ConfigureZone(zoneInfo, ref zoneObject, ref result);

        return(result);
    }
コード例 #12
0
        public Zone(ZoneInfo zoneInfo, UchuServer uchuServer, ushort instanceId = default, uint cloneId = default)
        {
            Zone       = this;
            ZoneInfo   = zoneInfo;
            UchuServer = uchuServer;
            InstanceId = instanceId;
            CloneId    = cloneId;

            EarlyPhysics  = new Event();
            LatePhysics   = new Event();
            OnPlayerLoad  = new Event <Player>();
            OnObject      = new Event <Object>();
            OnTick        = new Event();
            OnChatMessage = new Event <Player, string>();

            ScriptManager       = new ScriptManager(this);
            ManagedScriptEngine = new ManagedScriptEngine();
            UpdatedObjects      = new List <UpdatedObject>();
            ManagedObjects      = new List <Object>();
            SpawnedObjects      = new List <GameObject>();
            Simulation          = new PhysicsSimulation();

            Listen(OnDestroyed, () => { _running = false; });
        }
コード例 #13
0
 public void Play(ZoneInfo zone)
 {
     SceneManager.LoadScene(zone.level, LoadSceneMode.Single);
     hud.SetLevelDetails(zone);
 }
コード例 #14
0
        private void FillList()
        {
            this.dgvGpmember.DataSource = null;
            DataTable dataTable = new DataTable();

            dataTable.Columns.Add("objID", typeof(string));
            switch (this.cboType.SelectedIndex)
            {
            case 0:
            {
                dataTable.Columns.Add(EcoLanguage.getMsg(LangRes.Group_NMZone, new string[0]), typeof(string));
                System.Collections.ArrayList   allZone    = ZoneInfo.getAllZone();
                System.Collections.IEnumerator enumerator = allZone.GetEnumerator();
                try
                {
                    while (enumerator.MoveNext())
                    {
                        ZoneInfo zoneInfo = (ZoneInfo)enumerator.Current;
                        string   text     = zoneInfo.ZoneID.ToString();
                        string[] values   = new string[]
                        {
                            text,
                            zoneInfo.ZoneName
                        };
                        dataTable.Rows.Add(values);
                    }
                    goto IL_46A;
                }
                finally
                {
                    System.IDisposable disposable = enumerator as System.IDisposable;
                    if (disposable != null)
                    {
                        disposable.Dispose();
                    }
                }
                break;
            }

            case 1:
                break;

            case 2:
                goto IL_285;

            case 3:
                goto IL_36E;

            default:
                goto IL_46A;
            }
            dataTable.Columns.Add(EcoLanguage.getMsg(LangRes.Group_NMRack, new string[0]), typeof(string));
            dataTable.Columns.Add(EcoLanguage.getMsg(LangRes.Group_NMZone, new string[0]), typeof(string));
            System.Collections.ArrayList   allZone2        = ZoneInfo.getAllZone();
            System.Collections.ArrayList   allRack_NoEmpty = RackInfo.GetAllRack_NoEmpty();
            System.Collections.IEnumerator enumerator2     = allRack_NoEmpty.GetEnumerator();
            try
            {
                while (enumerator2.MoveNext())
                {
                    RackInfo rackInfo        = (RackInfo)enumerator2.Current;
                    string   displayRackName = rackInfo.GetDisplayRackName(EcoGlobalVar.RackFullNameFlag);
                    string   text2           = rackInfo.RackID.ToString();
                    bool     flag            = false;
                    string   text3           = "";
                    foreach (ZoneInfo zoneInfo2 in allZone2)
                    {
                        text3 = zoneInfo2.ZoneName;
                        string[] source = zoneInfo2.RackInfo.Split(new char[]
                        {
                            ','
                        });
                        if (source.Contains(text2))
                        {
                            flag = true;
                            break;
                        }
                    }
                    string[] values;
                    if (flag)
                    {
                        values = new string[]
                        {
                            text2,
                            displayRackName,
                            text3
                        };
                    }
                    else
                    {
                        values = new string[]
                        {
                            text2,
                            displayRackName,
                            ""
                        };
                    }
                    dataTable.Rows.Add(values);
                }
                goto IL_46A;
            }
            finally
            {
                System.IDisposable disposable3 = enumerator2 as System.IDisposable;
                if (disposable3 != null)
                {
                    disposable3.Dispose();
                }
            }
IL_285:
            dataTable.Columns.Add(EcoLanguage.getMsg(LangRes.Group_NMDev, new string[0]), typeof(string));
            dataTable.Columns.Add(EcoLanguage.getMsg(LangRes.Group_NMRack, new string[0]), typeof(string));
            System.Collections.Generic.List <DeviceInfo> allDevice = DeviceOperation.GetAllDevice();
            using (System.Collections.Generic.List <DeviceInfo> .Enumerator enumerator4 = allDevice.GetEnumerator())
            {
                while (enumerator4.MoveNext())
                {
                    DeviceInfo current          = enumerator4.Current;
                    string     deviceName       = current.DeviceName;
                    string     text4            = current.DeviceID.ToString();
                    RackInfo   rackByID         = RackInfo.getRackByID(current.RackID);
                    string     displayRackName2 = rackByID.GetDisplayRackName(EcoGlobalVar.RackFullNameFlag);
                    string[]   values           = new string[]
                    {
                        text4,
                        deviceName,
                        displayRackName2
                    };
                    dataTable.Rows.Add(values);
                }
                goto IL_46A;
            }
IL_36E:
            dataTable.Columns.Add(EcoLanguage.getMsg(LangRes.Group_NMOutlet, new string[0]), typeof(string));
            dataTable.Columns.Add(EcoLanguage.getMsg(LangRes.Group_NMDev, new string[0]), typeof(string));
            allDevice = DeviceOperation.GetAllDevice();
            foreach (DeviceInfo current2 in allDevice)
            {
                System.Collections.Generic.List <PortInfo> portInfo = current2.GetPortInfo();
                foreach (PortInfo current3 in portInfo)
                {
                    string[] values = new string[]
                    {
                        current3.ID.ToString(),
                                  current3.PortName,
                                  current2.DeviceName
                    };
                    dataTable.Rows.Add(values);
                }
            }
IL_46A:
            this.dgvGpmember.DataSource = dataTable;
            this.dgvGpmember.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
            this.dgvGpmember.Columns[0].Visible = false;
            int selectedIndex = this.cboType.SelectedIndex;

            if (selectedIndex == 0)
            {
                this.dgvGpmember.Columns[1].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
                return;
            }
            this.dgvGpmember.Columns[1].Width        = 140;
            this.dgvGpmember.Columns[2].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
        }
コード例 #15
0
 private void AddZone(ZoneInfo zone)
 {
     lbZone.Items.Add(zone);
 }
コード例 #16
0
ファイル: ChatChannelGroup.cs プロジェクト: pallmall/WCell
		/// <summary>
		/// Creates a zone channel, which is a constant, non-moderated channel specific to one or more Zones.
		/// </summary>
		internal ChatChannel CreateLocalDefenseChannel(ZoneInfo zone)
		{
			var name = string.Format("LocalDefense - {0}", zone.Name);

			ChatChannel channel;
			if (!m_Channels.TryGetValue(name, out channel))
			{
				channel = new ChatChannel(this, name, LocalDefenseFlags, true, null)
				{
					Announces = false
				};
				m_Channels.Add(channel.Name, channel);
			}
			return channel;
		}
コード例 #17
0
ファイル: Client.cs プロジェクト: tiger0-0/gamemachine
 public void OnGetZones(ZoneInfos infos)
 {
     zoneInfos = infos;
     zones.Clear();
     foreach (ZoneInfo info in zoneInfos.zoneInfo) {
         zones.Add(info.id);
         if (info.current) {
             zoneInfo = info;
             currentZone = info.id;
         }
     }
     Debug.Log("Zones loaded");
 }
コード例 #18
0
ファイル: Zone.cs プロジェクト: songfang/Wms
 public int Update(ZoneInfo model)
 {
     return(dal.Update(model));
 }
コード例 #19
0
ファイル: IWorldLocation.cs プロジェクト: pallmall/WCell
		public ZoneWorldLocation(Region region, Vector3 pos, ZoneInfo zone)
			: base(region, pos)
		{
			ZoneInfo = zone;
		}
コード例 #20
0
        private static ZoneInfo CreateEntityFromReader(IDataReader reader)
        {
            var item = new ZoneInfo();

            try { if (!reader.IsDBNull(reader.GetOrdinal("Zone_ID")))
                  {
                      item.Zone_ID = ConvertUtility.ToInt32(reader["Zone_ID"]);
                  }
            }
            catch { }
            try { if (!reader.IsDBNull(reader.GetOrdinal("Zone_ParentID")))
                  {
                      item.Zone_ParentID = ConvertUtility.ToInt32(reader["Zone_ParentID"]);
                  }
            }
            catch { }
            try { if (!reader.IsDBNull(reader.GetOrdinal("Zone_Name")))
                  {
                      item.Zone_Name = ConvertUtility.ToString(reader["Zone_Name"]);
                  }
            }
            catch { }
            try { if (!reader.IsDBNull(reader.GetOrdinal("Zone_Description")))
                  {
                      item.Zone_Description = ConvertUtility.ToString(reader["Zone_Description"]);
                  }
            }
            catch { }
            try { if (!reader.IsDBNull(reader.GetOrdinal("Zone_FriendlyUrl")))
                  {
                      item.Zone_FriendlyUrl = ConvertUtility.ToString(reader["Zone_FriendlyUrl"]);
                  }
            }
            catch { }
            try { if (!reader.IsDBNull(reader.GetOrdinal("Zone_RealUrl")))
                  {
                      item.Zone_RealUrl = ConvertUtility.ToString(reader["Zone_RealUrl"]);
                  }
            }
            catch { }
            try { if (!reader.IsDBNull(reader.GetOrdinal("Zone_Avatar")))
                  {
                      item.Zone_Avatar = ConvertUtility.ToString(reader["Zone_Avatar"]);
                  }
            }
            catch { }
            try { if (!reader.IsDBNull(reader.GetOrdinal("Zone_Priority")))
                  {
                      item.Zone_Priority = ConvertUtility.ToInt32(reader["Zone_Priority"]);
                  }
            }
            catch { }
            try { if (!reader.IsDBNull(reader.GetOrdinal("Zone_MetaDescription")))
                  {
                      item.Zone_MetaDescription = ConvertUtility.ToString(reader["Zone_MetaDescription"]);
                  }
            }
            catch { }
            try { if (!reader.IsDBNull(reader.GetOrdinal("Zone_MetaKeywords")))
                  {
                      item.Zone_MetaKeywords = ConvertUtility.ToString(reader["Zone_MetaKeywords"]);
                  }
            }
            catch { }
            try { if (!reader.IsDBNull(reader.GetOrdinal("Zone_Layout")))
                  {
                      item.Zone_Layout = ConvertUtility.ToString(reader["Zone_Layout"]);
                  }
            }
            catch { }
            try { if (!reader.IsDBNull(reader.GetOrdinal("Zone_SubcategoryDisplay")))
                  {
                      item.Zone_SubcategoryDisplay = ConvertUtility.ToString(reader["Zone_SubcategoryDisplay"]);
                  }
            }
            catch { }
            try { if (!reader.IsDBNull(reader.GetOrdinal("Zone_ContentListingDisplay")))
                  {
                      item.Zone_ContentListingDisplay = ConvertUtility.ToString(reader["Zone_ContentListingDisplay"]);
                  }
            }
            catch { }
            try { if (!reader.IsDBNull(reader.GetOrdinal("Zone_VisibleInMainNav")))
                  {
                      item.Zone_VisibleInMainNav = ConvertUtility.ToBoolean(reader["Zone_VisibleInMainNav"]);
                  }
            }
            catch { }
            try { if (!reader.IsDBNull(reader.GetOrdinal("Zone_VisibleInLeftNav")))
                  {
                      item.Zone_VisibleInLeftNav = ConvertUtility.ToBoolean(reader["Zone_VisibleInLeftNav"]);
                  }
            }
            catch { }
            try { if (!reader.IsDBNull(reader.GetOrdinal("Zone_VisibleInTopNav")))
                  {
                      item.Zone_VisibleInTopNav = ConvertUtility.ToBoolean(reader["Zone_VisibleInTopNav"]);
                  }
            }
            catch { }
            try { if (!reader.IsDBNull(reader.GetOrdinal("Zone_VisibleInFooterNav")))
                  {
                      item.Zone_VisibleInFooterNav = ConvertUtility.ToBoolean(reader["Zone_VisibleInFooterNav"]);
                  }
            }
            catch { }
            try { if (!reader.IsDBNull(reader.GetOrdinal("Zone_ExcludeFromNav")))
                  {
                      item.Zone_ExcludeFromNav = ConvertUtility.ToBoolean(reader["Zone_ExcludeFromNav"]);
                  }
            }
            catch { }
            try { if (!reader.IsDBNull(reader.GetOrdinal("Zone_Visible")))
                  {
                      item.Zone_Visible = ConvertUtility.ToBoolean(reader["Zone_Visible"]);
                  }
            }
            catch { }
            try { if (!reader.IsDBNull(reader.GetOrdinal("Zone_Disable")))
                  {
                      item.Zone_Disable = ConvertUtility.ToBoolean(reader["Zone_Disable"]);
                  }
            }
            catch { }
            try { if (!reader.IsDBNull(reader.GetOrdinal("Zone_Lang")))
                  {
                      item.Zone_Lang = ConvertUtility.ToString(reader["Zone_Lang"]);
                  }
            }
            catch { }
            try { if (!reader.IsDBNull(reader.GetOrdinal("Zone_IsStandAloneBox")))
                  {
                      item.Zone_IsStandAloneBox = ConvertUtility.ToBoolean(reader["Zone_IsStandAloneBox"]);
                  }
            }
            catch { }
            return(item);
        }
コード例 #21
0
ファイル: SC_ZoneInfo.cs プロジェクト: mizzouse/Battalion
        internal void Process()
        {
            Console.WriteLine("Receiving Zone assets");
            //Get the packet data

            ZoneInfo info = new ZoneInfo();

            info.AllowPrivateArena     = msg.ReadBoolean();
            info.CashShareRadius       = msg.ReadInt32();
            info.enemyShowAlias        = msg.ReadBoolean();
            info.enemyShowBounty       = msg.ReadBoolean();
            info.enemyShowEnergy       = msg.ReadBoolean();
            info.enemyShowHealth       = msg.ReadBoolean();
            info.ExperienceShareRadius = msg.ReadInt32();
            info.FixedBounty           = msg.ReadInt32();
            info.FixedCash             = msg.ReadInt32();
            info.FixedExperience       = msg.ReadInt32();
            info.FixedPoints           = msg.ReadInt32();

            info.LOSAngle                      = msg.ReadInt32();
            info.LOSDistance                   = msg.ReadInt32();
            info.LOSShare                      = msg.ReadBoolean();
            info.MaxArenas                     = msg.ReadInt32();
            info.MaxPlayers                    = msg.ReadInt32();
            info.PercentBountyToAssit          = msg.ReadInt32();
            info.PercentBountyToKiller         = msg.ReadInt32();
            info.PercentCashToAssit            = msg.ReadInt32();
            info.PercentCashToKiller           = msg.ReadInt32();
            info.PercentExperienceToAssit      = msg.ReadInt32();
            info.PercentExperienceToKiller     = msg.ReadInt32();
            info.PercentPointsToAssit          = msg.ReadInt32();
            info.PercentPointsToKiller         = msg.ReadInt32();
            info.playerShowAlias               = msg.ReadBoolean();
            info.playerShowBounty              = msg.ReadBoolean();
            info.playerShowEnergy              = msg.ReadBoolean();
            info.playerShowHealth              = msg.ReadBoolean();
            info.PointsShareRadius             = msg.ReadInt32();
            info.spectatorShowEnergy           = msg.ReadBoolean();
            info.spectatorShowEnergyShowAlias  = msg.ReadBoolean();
            info.spectatorShowEnergyShowBounty = msg.ReadBoolean();
            info.spectatorShowEnergyShowHealth = msg.ReadBoolean();

            info.Teams.AllowPrivateTeams      = msg.ReadBoolean();
            info.Teams.AllowTeamKills         = msg.ReadBoolean();
            info.Teams.AllowTeamSwitch        = msg.ReadBoolean();
            info.Teams.EnergyRequiredToSwitch = msg.ReadInt32();
            info.Teams.ForceEvenTeams         = msg.ReadBoolean();
            info.Teams.MaxPrivatePlayers      = msg.ReadInt32();
            info.Teams.MaxPublicPlayers       = msg.ReadInt32();

            count = msg.ReadInt32();
            for (int i = 0; i < count; i++)
            {
                TeamInfo.Team t = new TeamInfo.Team();

                t.Color = msg.ReadString();
                t.Name  = msg.ReadString();

                info.Teams.PublicTeams.Add(t);
            }

            count = msg.ReadInt32();
            for (int i = 0; i < count; i++)
            {
                FlagInfo f = new FlagInfo(0);
                //f.DrawScale = msg.ReadInt32();
                f.ID = msg.ReadInt32();
                //f.ModelID = msg.ReadInt32();
                f.Name       = msg.ReadString();
                f.Position.X = msg.ReadInt32();
                f.Position.Y = msg.ReadInt32();
                f.Position.Z = msg.ReadInt32();

                info.Flags.Add(f);
            }

            /*    info.Flags = msg.ReadBoolean();
             *  info.GameTypes = msg.ReadBoolean();
             *  info.Teams = msg.ReadBoolean();
             *  info.Terrains = msg.ReadBoolean();
             *  info.Warps = msg.ReadBoolean();
             */

            AssetInfo.zone = info;
        }
コード例 #22
0
        private IDictionary <string, IList <WebPartZone> > LoadConfig()
        {
            if (null == this.Agent)
            {
                throw new InvalidOperationException("Agent not set");
            }

            Dictionary <string, IList <WebPartZone> > zones = new Dictionary <string, IList <WebPartZone> >();
            XmlDocument doc = new XmlDocument();

            if (!this.Agent.HasKey(configFile))
            {
                CreateEmptyConfig();
            }
            doc.LoadXml(this.Agent.Read(configFile));
            XmlNode rootNode = doc.SelectSingleNode("zones");

            if (null == rootNode)
            {
                throw new ApplicationException(String.Format("The config file '{0}' has no zones element", configFile));
            }
            foreach (XmlNode node in rootNode.ChildNodes)
            {
                if (null == node.Attributes["id"])
                {
                    throw new ApplicationException("Missing attribute 'id' in zone's configuration element");
                }
                if (null == node.Attributes["title"])
                {
                    throw new ApplicationException("Missing attribute 'title' in zone's configuration element");
                }
                if (null == node.Attributes["screen"])
                {
                    throw new ApplicationException("Missing attribute 'screen' in zone's configuration element");
                }
                if (null == node.Attributes["type"])
                {
                    throw new ApplicationException("Missing attribute 'type' in zone's configuration element");
                }

                string      id     = node.Attributes["id"].Value;
                string      title  = node.Attributes["title"].Value;
                string      screen = node.Attributes["screen"].Value;
                string      type   = node.Attributes["type"].Value;
                WebPartZone zone   = ReflectionServices.CreateInstance(type) as WebPartZone;
                if (null == zone)
                {
                    throw new ApplicationException(String.Format("Failed to create WebPartZone for zone '{0}' from type '{1}'", id, type));
                }

                zone.ID         = id;
                zone.HeaderText = title;
                if (!zones.ContainsKey(screen))
                {
                    zones.Add(screen, new List <WebPartZone>());
                }
                zones[screen].Add(zone);

                if (!this.Extras.ContainsKey(zone))
                {
                    this.Extras.Add(zone, new ZoneInfo());
                }
                ZoneInfo zoneInfo = this.Extras[zone];
                foreach (XmlNode extraNode in node.ChildNodes)
                {
                    if ("parent" == extraNode.Name && null != extraNode.Attributes["id"])
                    {
                        zoneInfo.ParentID = extraNode.Attributes["id"].Value;
                    }
                }
            }

            cache.Remove(configFile);
            cache.Insert(configFile, zones, new CacheDependency(configFile));

            return(zones);
        }
コード例 #23
0
 public void SetLevelDetails(ZoneInfo info)
 {
     nameText.text  = info.creator;
     levelText.text = info.zoneName;
 }
コード例 #24
0
ファイル: Game.cs プロジェクト: caughmmg/255-SlipstreamJumper
 public void Play(ZoneInfo zone) {
     SceneManager.LoadScene(zone.level, LoadSceneMode.Single);
     currentZone = zone;
 }
コード例 #25
0
ファイル: Client.cs プロジェクト: tiger0-0/gamemachine
 public void OnSetZone(ZoneInfo info)
 {
     NetworkSettings.instance.character.zone = info.number;
     if (info.hostname == NetworkSettings.instance.hostname) {
         if (forceReconnectOnZone) {
             Reconnect();
         } else {
             ZoneApi.instance.GetZones(this);
         }
     } else {
         NetworkSettings.instance.hostname = info.hostname;
         Reconnect();
     }
 }
コード例 #26
0
ファイル: Zone.cs プロジェクト: songfang/Wms
 public int InsertByOutput(ZoneInfo model)
 {
     return(dal.InsertByOutput(model));
 }
コード例 #27
0
ファイル: Character.Fields.cs プロジェクト: Skizot/WCell
		public bool IsZoneExplored(ZoneInfo zone)
		{
			return IsZoneExplored(zone.ExplorationBit);
		}
コード例 #28
0
ファイル: Character.Fields.cs プロジェクト: Skizot/WCell
		public void SetZoneExplored(ZoneInfo zone, bool gainXp)
		{
			var index = zone.ExplorationBit >> 5;
			if (index >= UpdateFieldMgr.ExplorationZoneFieldSize * 4)
			{
				return;
			}

			//var intVal = GetUInt32((int)PlayerFields.EXPLORED_ZONES_1 + (int)index);
			var byteVal = m_record.ExploredZones[index];
			var bit = (zone.ExplorationBit - 1) % 8;
			if ((byteVal & (1 << bit)) == 0)
			{
				if (gainXp)
				{
					var xp = XpGenerator.GetExplorationXp(zone, this);
					if (xp > 0)
					{
						if (Level >= RealmServerConfiguration.MaxCharacterLevel)
						{
							CharacterHandler.SendExplorationExperience(this, zone.Id, 0);
						}
						else
						{
							GainXp(xp, false);
							CharacterHandler.SendExplorationExperience(this, zone.Id, xp);
						}
					}
				}

				var value = (byte)(byteVal | (1 << bit));
				SetByte((int)PlayerFields.EXPLORED_ZONES_1 + (zone.ExplorationBit >> 5), index % 4, value);
				m_record.ExploredZones[index] = value;
			}

			foreach (var child in zone.ChildZones)
			{
				SetZoneExplored(child, gainXp);
			}
		}
コード例 #29
0
        private void init_Avail_data()
        {
            System.Collections.Generic.Dictionary <long, string> dictionary = new System.Collections.Generic.Dictionary <long, string>();
            if (this.m_groupID >= 0L)
            {
                GroupInfo groupByID  = GroupInfo.GetGroupByID(this.m_groupID);
                string    memberList = groupByID.GetMemberList();
                if (memberList != null && memberList.Length > 0)
                {
                    string[] array = memberList.Split(new string[]
                    {
                        ","
                    }, System.StringSplitOptions.RemoveEmptyEntries);
                    string[] array2 = array;
                    for (int i = 0; i < array2.Length; i++)
                    {
                        string value = array2[i];
                        long   key   = (long)System.Convert.ToInt32(value);
                        dictionary.Add(key, "");
                    }
                }
            }
            this.dgvAvail.DataSource = null;
            this.Avail_tb            = new DataTable();
            this.Avail_tb.Columns.Add("objID", typeof(string));
            this.Avail_tb.PrimaryKey = new DataColumn[]
            {
                this.Avail_tb.Columns[0]
            };
            string groupType;

            if ((groupType = this.m_groupType) != null)
            {
                if (cct == null)
                {
                    cct = new System.Collections.Generic.Dictionary <string, int>(7)
                    {
                        {
                            "zone",
                            0
                        },

                        {
                            "rack",
                            1
                        },

                        {
                            "allrack",
                            2
                        },

                        {
                            "dev",
                            3
                        },

                        {
                            "alldev",
                            4
                        },

                        {
                            "outlet",
                            5
                        },

                        {
                            "alloutlet",
                            6
                        }
                    };
                }
                int num;
                if (cct.TryGetValue(groupType, out num))
                {
                    switch (num)
                    {
                    case 0:
                    {
                        this.Avail_tb.Columns.Add(EcoLanguage.getMsg(LangRes.Group_NMZone, new string[0]), typeof(string));
                        System.Collections.ArrayList   allZone    = ZoneInfo.getAllZone();
                        System.Collections.IEnumerator enumerator = allZone.GetEnumerator();
                        try
                        {
                            while (enumerator.MoveNext())
                            {
                                ZoneInfo zoneInfo = (ZoneInfo)enumerator.Current;
                                string   text     = zoneInfo.ZoneID.ToString();
                                if (!dictionary.ContainsKey(zoneInfo.ZoneID))
                                {
                                    string[] values = new string[]
                                    {
                                        text,
                                        zoneInfo.ZoneName
                                    };
                                    this.Avail_tb.Rows.Add(values);
                                }
                            }
                            return;
                        }
                        finally
                        {
                            System.IDisposable disposable = enumerator as System.IDisposable;
                            if (disposable != null)
                            {
                                disposable.Dispose();
                            }
                        }
                        break;
                    }

                    case 1:
                    case 2:
                        break;

                    case 3:
                    case 4:
                        goto IL_401;

                    case 5:
                    case 6:
                        goto IL_50F;

                    default:
                        return;
                    }
                    this.Avail_tb.Columns.Add(EcoLanguage.getMsg(LangRes.Group_NMRack, new string[0]), typeof(string));
                    this.Avail_tb.Columns.Add(EcoLanguage.getMsg(LangRes.Group_NMZone, new string[0]), typeof(string));
                    System.Collections.ArrayList   allZone2        = ZoneInfo.getAllZone();
                    System.Collections.ArrayList   allRack_NoEmpty = RackInfo.GetAllRack_NoEmpty();
                    System.Collections.IEnumerator enumerator2     = allRack_NoEmpty.GetEnumerator();
                    try
                    {
                        while (enumerator2.MoveNext())
                        {
                            RackInfo rackInfo = (RackInfo)enumerator2.Current;
                            if (!dictionary.ContainsKey(rackInfo.RackID))
                            {
                                string displayRackName = rackInfo.GetDisplayRackName(EcoGlobalVar.RackFullNameFlag);
                                string text2           = rackInfo.RackID.ToString();
                                bool   flag            = false;
                                string text3           = "";
                                foreach (ZoneInfo zoneInfo2 in allZone2)
                                {
                                    text3 = zoneInfo2.ZoneName;
                                    string[] source = zoneInfo2.RackInfo.Split(new char[]
                                    {
                                        ','
                                    });
                                    if (source.Contains(text2))
                                    {
                                        flag = true;
                                        break;
                                    }
                                }
                                string[] values;
                                if (flag)
                                {
                                    values = new string[]
                                    {
                                        text2,
                                        displayRackName,
                                        text3
                                    };
                                }
                                else
                                {
                                    values = new string[]
                                    {
                                        text2,
                                        displayRackName,
                                        ""
                                    };
                                }
                                this.Avail_tb.Rows.Add(values);
                            }
                        }
                        return;
                    }
                    finally
                    {
                        System.IDisposable disposable3 = enumerator2 as System.IDisposable;
                        if (disposable3 != null)
                        {
                            disposable3.Dispose();
                        }
                    }
IL_401:
                    this.Avail_tb.Columns.Add(EcoLanguage.getMsg(LangRes.Group_NMDev, new string[0]), typeof(string));
                    this.Avail_tb.Columns.Add(EcoLanguage.getMsg(LangRes.Group_NMRack, new string[0]), typeof(string));
                    System.Collections.Generic.List <DeviceInfo> allDevice = DeviceOperation.GetAllDevice();
                    using (System.Collections.Generic.List <DeviceInfo> .Enumerator enumerator4 = allDevice.GetEnumerator())
                    {
                        while (enumerator4.MoveNext())
                        {
                            DeviceInfo current = enumerator4.Current;
                            if (!dictionary.ContainsKey((long)current.DeviceID))
                            {
                                string   deviceName       = current.DeviceName;
                                string   text4            = current.DeviceID.ToString();
                                RackInfo rackByID         = RackInfo.getRackByID(current.RackID);
                                string   displayRackName2 = rackByID.GetDisplayRackName(EcoGlobalVar.RackFullNameFlag);
                                string[] values           = new string[]
                                {
                                    text4,
                                    deviceName,
                                    displayRackName2
                                };
                                this.Avail_tb.Rows.Add(values);
                            }
                        }
                        return;
                    }
IL_50F:
                    this.Avail_tb.Columns.Add(EcoLanguage.getMsg(LangRes.Group_NMOutlet, new string[0]), typeof(string));
                    this.Avail_tb.Columns.Add(EcoLanguage.getMsg(LangRes.Group_NMDev, new string[0]), typeof(string));
                    allDevice = DeviceOperation.GetAllDevice();
                    foreach (DeviceInfo current2 in allDevice)
                    {
                        System.Collections.Generic.List <PortInfo> portInfo = current2.GetPortInfo();
                        foreach (PortInfo current3 in portInfo)
                        {
                            if (!dictionary.ContainsKey((long)current3.ID))
                            {
                                string[] values = new string[]
                                {
                                    current3.ID.ToString(),
                                          current3.PortName,
                                          current2.DeviceName
                                };
                                this.Avail_tb.Rows.Add(values);
                            }
                        }
                    }
                }
            }
        }
コード例 #30
0
ファイル: Game.cs プロジェクト: nickworks/255-Outbreak
 /// <summary>
 /// Unpauses the game, sets the Time.timeScale to 1, and clears Game.main.currentZone
 /// </summary>
 private void ClearZone()
 {
     SetPause(false);
     Time.timeScale = 1;
     currentZone    = new ZoneInfo();
 }
コード例 #31
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            if (hddID.Value == "")
            {
                return;
            }

            ZoneInfo info = ZoneDB.GetInfo(ConvertUtility.ToInt32(hddID.Value));

            if (info == null)
            {
                Reset();
                return;
            }

            if (txtName.Text.Trim() == "")
            {
                lblStatusUpdate.Text = AppEnv.NoticeRequired(lang, "TÊN MỤC");
                return;
            }


            info.Zone_ParentID    = ConvertUtility.ToInt32(dropZones.SelectedValue);
            info.Zone_Name        = txtName.Text.Trim();
            info.Zone_Description = txtDescription.Text;
            info.Zone_FriendlyUrl = UnicodeUtility.UnicodeToFriendlyUrl(txtName.Text);
            info.Zone_RealUrl     = txtRealUrl.Text.Trim();
            info.Zone_Avatar      = txtAvatar.Text.Trim();
            //priority field
            info.Zone_MetaDescription       = txtDescription.Text;
            info.Zone_MetaKeywords          = txtMetaKeywords.Text;
            info.Zone_Layout                = dropLayout.SelectedValue;
            info.Zone_SubcategoryDisplay    = dropSubcategoryDisplay.SelectedValue;
            info.Zone_ContentListingDisplay = dropContentDisplay.SelectedValue;
            info.Zone_VisibleInMainNav      = chkMainNav.Checked;
            info.Zone_VisibleInLeftNav      = chkLeftNav.Checked;
            info.Zone_VisibleInTopNav       = chkTopNav.Checked;
            info.Zone_VisibleInFooterNav    = chkFooterNav.Checked;
            info.Zone_ExcludeFromNav        = chkExcludeFromNav.Checked;
            info.Zone_Visible               = chkVisible.Checked;
            info.Zone_Disable               = chkDisable.Checked;
            info.Zone_Lang = lang;

            if (info.Zone_ID == info.Zone_ParentID)
            {
                lblStatusUpdate.Text = "<font color='red'>" + (lang == "vi-VN" ? " Trùng mục cha, chọn mục cha khác !" : "The same Index Parent,Select other index Parent !") + "</font>";
                return;
            }
            if (ZoneDB.Update(info))
            {
                lblStatusUpdate.Text = AppEnv.NoticeEdit(lang, true);
                hddID.Value          = "";
                btnUpdate.Enabled    = false;
                btnDelete.Enabled    = false;
                Reset();
            }
            else
            {
                lblStatusUpdate.Text = AppEnv.NoticeEdit(lang, false);
            }

            LoadZones();
        }
コード例 #32
0
ファイル: Structs.cs プロジェクト: WilliamO7/pk3DS
        public Zone(byte[][] Zone)
        {
            // A ZO is comprised of 4-5 files.

            // Array 0 is [Map Info]
            Info = new ZoneInfo(Zone[0]);
            // Array 1 is [Overworld Entities & their Scripts]
            Entities = new ZoneEntities(Zone[1]);
            // Array 2 is [Map Script]
            MapScript = new ZoneScript(Zone[2]);
            // Array 3 is [Wild Encounters]
            Encounters = new ZoneEncounters(Zone[3]);
            // Array 4 is [???] - May not be present in all.
            if (Zone.Length <= 4)
                return;
            File5 = new ZoneUnknown(Zone[4]);
        }
コード例 #33
0
ファイル: XpGenerator.cs プロジェクト: pallmall/WCell
		public static int GetExplorationXp(ZoneInfo zone, Character character)
		{
			return ExplorationXpFactor * (zone.AreaLevel * 20);
		}
コード例 #34
0
ファイル: MainClass.cs プロジェクト: Jacobth/wow_auto_walk
        static void Main(string[] args)
        {
            ZoneInfo zoneInfo = new ZoneInfo();

            while (true)
            {
                string line;

                line = Console.ReadLine();
                string[] lines = line.Split(' ');
                string   arg   = lines[0];
                string   op    = "";

                if (lines.Count() == 0)
                {
                    Console.WriteLine("Error: Specify action");
                }

                else if (lines.Count() == 1)
                {
                    Console.WriteLine("Error: Specify arguments");
                }


                else
                {
                    op = lines[1];
                    Arguments(arg, op, zoneInfo);
                }
            }

            //  Mine m = new Mine();

            //MageRotation mage = new MageRotation();

            //   OreLists o = new OreLists();

            /*  while(true)
             * {
             *    Console.WriteLine(GameInfo.GetMapId() + " z: " + GameInfo.GetPlayerZ());
             * }
             *
             * Thread.Sleep(3000);
             *
             * var bmpScreenshot = new Bitmap(Screen.PrimaryScreen.Bounds.Width / 4,
             *                 Screen.PrimaryScreen.Bounds.Height / 4,
             *                 PixelFormat.Format32bppArgb);
             *
             * // Create a graphics object from the bitmap.
             * var gfxScreenshot = Graphics.FromImage(bmpScreenshot);
             *
             * int width = (int)(-Screen.PrimaryScreen.Bounds.Width * 0.9f);
             *
             * // Take the screenshot from the upper left corner to the right bottom corner.
             * gfxScreenshot.CopyFromScreen(Screen.PrimaryScreen.Bounds.X,
             *                          Screen.PrimaryScreen.Bounds.Y,
             *                          width,
             *                          0,
             *                          Screen.PrimaryScreen.Bounds.Size,
             *                          CopyPixelOperation.SourceCopy);
             *
             * // Save the screenshot to the specified path that the user has chosen.
             * bmpScreenshot.Save("C:/Users/jacobth/World of Warcraft 3.3.5a/Screenshots/Screenshot.jpg", ImageFormat.Jpeg);
             *
             * Bitmap b = new Bitmap("C:/Users/jacobth/World of Warcraft 3.3.5a/Screenshots/WoWScrnShot_022517_150147.jpg");
             *
             * bool tmp = ImageColor.ContainsColor(bmpScreenshot, 233, 196, 66);
             * Console.WriteLine(tmp);
             * Thread.Sleep(100000);*/


            //    Travel t = new Travel();
            //mage.Attack();
            // t.Capture();
            //    t.TravelWalk("ironforge");
            // t.click();
            // t.TravelFly("Shattrath");
            //t.TravelFly("Dalaran");
        }
コード例 #35
0
ファイル: commDev.cs プロジェクト: Jackjet/ECOSingle
        public static bool updateZoneforRack(RackInfo pRack)
        {
            if (pRack == null)
            {
                return(false);
            }
            System.Collections.ArrayList allZone = ZoneInfo.getAllZone();
            bool   result       = false;
            string text         = pRack.RackID.ToString();
            int    startPoint_X = pRack.StartPoint_X;
            int    startPoint_Y = pRack.StartPoint_Y;
            int    endPoint_X   = pRack.EndPoint_X;
            int    arg_3A_0     = pRack.EndPoint_Y;
            int    num;

            if (startPoint_X == endPoint_X)
            {
                num = 0;
            }
            else
            {
                num = 1;
            }
            foreach (ZoneInfo zoneInfo in allZone)
            {
                string   rackInfo = zoneInfo.RackInfo;
                string[] array    = rackInfo.Split(new char[]
                {
                    ','
                });
                int    startPointX = zoneInfo.StartPointX;
                int    startPointY = zoneInfo.StartPointY;
                int    endPointX   = zoneInfo.EndPointX;
                int    endPointY   = zoneInfo.EndPointY;
                bool   flag        = false;
                string text2       = "";
                bool   flag2       = false;
                if (((startPoint_X <= startPointX && startPoint_X >= endPointX) || (startPoint_X >= startPointX && startPoint_X <= endPointX)) && ((startPoint_Y <= startPointY && startPoint_Y >= endPointY) || (startPoint_Y >= startPointY && startPoint_Y <= endPointY)))
                {
                    flag2 = true;
                }
                else
                {
                    if (num == 0)
                    {
                        if (((startPoint_X <= startPointX && startPoint_X >= endPointX) || (startPoint_X >= startPointX && startPoint_X <= endPointX)) && ((startPoint_Y + 1 <= startPointY && startPoint_Y + 1 >= endPointY) || (startPoint_Y + 1 >= startPointY && startPoint_Y + 1 <= endPointY)))
                        {
                            flag2 = true;
                        }
                    }
                    else
                    {
                        if (num == 1 && ((startPoint_X + 1 <= startPointX && startPoint_X + 1 >= endPointX) || (startPoint_X + 1 >= startPointX && startPoint_X + 1 <= endPointX)) && ((startPoint_Y <= startPointY && startPoint_Y >= endPointY) || (startPoint_Y >= startPointY && startPoint_Y <= endPointY)))
                        {
                            flag2 = true;
                        }
                    }
                }
                if (flag2)
                {
                    if (array.Contains(text))
                    {
                        continue;
                    }
                    if (array.Length == 1 && array[0].Equals(string.Empty))
                    {
                        text2 = text;
                    }
                    else
                    {
                        string[] array2 = array;
                        for (int i = 0; i < array2.Length; i++)
                        {
                            string text3 = array2[i];
                            if (text2.Equals(string.Empty))
                            {
                                text2 = text3;
                            }
                            else
                            {
                                text2 = text2 + "," + text3;
                            }
                        }
                        if (text2.Equals(string.Empty))
                        {
                            text2 = text;
                        }
                        else
                        {
                            text2 = text2 + "," + text;
                        }
                    }
                    flag = true;
                }
                else
                {
                    if (array.Contains(text))
                    {
                        string[] array3 = array;
                        for (int j = 0; j < array3.Length; j++)
                        {
                            string text4 = array3[j];
                            if (!text4.Equals(text))
                            {
                                if (text2.Equals(string.Empty))
                                {
                                    text2 = text4;
                                }
                                else
                                {
                                    text2 = text2 + "," + text4;
                                }
                            }
                        }
                        flag = true;
                    }
                }
                if (flag)
                {
                    result            = true;
                    zoneInfo.RackInfo = text2;
                    zoneInfo.UpdateZone();
                }
            }
            return(result);
        }
コード例 #36
0
        //------------------------------------------------------//
        //--------------BASE EXTENSIONS CLASS-------------------//
        //------------------------------------------------------//
        // Contains various methods added to existing classes   //
        // to make modding easier, or to create shorthands.     //
        //                                                      //
        // if you decide to use any of these, be warned: they   //
        // will ONLY work if you put AAMod as a dependency.   //
        //------------------------------------------------------//
        //  Author(s): Grox the Great                           //
        //------------------------------------------------------//

        public static bool InZone(this Player p, string zoneName, ZoneInfo info = null)
        {
            if (info != null)
            {
                bool inZ = info.InZone(p, zoneName);
                if (inZ)
                {
                    return(true);
                }
            }
            switch (zoneName)
            {
            //TODO: ADD IN BIOMES
            case "Space": return(p.position.Y / 16 < Main.worldSurface * 0.1f);

            case "Sky": return(p.position.Y / 16 > Main.worldSurface * 0.1f && p.position.Y / 16 < Main.worldSurface * 0.4f);

            case "Surface": return(p.position.Y / 16 > Main.worldSurface * 0.4f && p.position.Y / 16 < Main.worldSurface);

            case "DirtLayer":
            case "Underground": return(p.position.Y / 16 > Main.worldSurface && p.position.Y / 16 < Main.rockLayer);

            case "RockLayer":
            case "Cavern": return(p.position.Y / 16 > Main.rockLayer && p.position.Y / 16 < Main.maxTilesY - 200);

            case "Hell": return(p.position.Y / 16 > Main.maxTilesY - 200);

            case "BelowSurface": return(p.position.Y / 16 > Main.worldSurface);

            case "BelowDirtLayer":
            case "BelowUnderground": return(p.position.Y / 16 > Main.rockLayer);

            case "Rain": return(p.ZoneRain);

            case "Desert": return(p.ZoneDesert);

            case "UndergroundDesert":
            case "UGDesert": return(p.ZoneUndergroundDesert);

            case "Sandstorm": return(p.ZoneSandstorm);

            case "Ocean": return(p.ZoneBeach);

            case "Jungle": return(p.ZoneJungle);

            case "Snow": return(p.ZoneSnow);

            case "Purity": return(!p.ZoneTowerSolar && !p.ZoneTowerVortex && !p.ZoneTowerNebula && !p.ZoneTowerStardust && !p.ZoneBeach && !p.ZoneDesert && !p.ZoneUndergroundDesert && !p.ZoneSnow && !p.ZoneDungeon && !p.ZoneJungle && !p.ZoneCorrupt && !p.ZoneCrimson && !p.ZoneHoly && !p.ZoneMeteor && !p.ZoneGlowshroom);

            case "Meteor":
            case "Meteorite": return(p.ZoneMeteor);

            //case "Granite": return p.ZoneGranite;
            //case "Marble": return p.ZoneMarble;
            case "GlowingMushroom":
            case "Glowshroom": return(p.ZoneGlowshroom);

            case "Corrupt":
            case "Corruption": return(p.ZoneCorrupt);

            case "Crim":
            case "Crimson": return(p.ZoneCrimson);

            case "Hallow": return(p.ZoneHoly);

            case "Dungeon": return(p.ZoneDungeon);

            case "TowerAny": return(p.ZoneTowerSolar || p.ZoneTowerVortex || p.ZoneTowerNebula || p.ZoneTowerStardust);

            case "TowerSolar": return(p.ZoneTowerSolar);

            case "TowerVortex": return(p.ZoneTowerVortex);

            case "TowerNebula": return(p.ZoneTowerNebula);

            case "TowerStardust": return(p.ZoneTowerStardust);

                //case "Lihzahrd": return p.ZoneLihzahrd;

                /*
                 *  ZoneCorrupt
                 *  ZoneHoly
                 *  ZoneMeteor
                 *  ZoneJungle
                 *  ZoneSnow
                 *  ZoneCrimson
                 *  ZoneWaterCandle
                 *  ZonePeaceCandle
                 *  ZoneTowerSolar
                 *  ZoneTowerVortex
                 *  ZoneTowerNebula
                 *  ZoneTowerStardust
                 *  ZoneDesert
                 *  ZoneGlowshroom
                 *  ZoneUndergroundDesert
                 *  ZoneSkyHeight
                 *  ZoneOverworldHeight
                 *  ZoneDirtLayerHeight
                 *  ZoneRockLayerHeight
                 *  ZoneUnderworldHeight
                 *  ZoneBeach
                 *  ZoneRain
                 *  ZoneSandstorm
                 */
            }
            return(false);
        }
コード例 #37
0
 public EditZoneNameForm(ZoneInfo info)
 {
     InitializeComponent();
     _zoneInfo = info;
 }
コード例 #38
0
        public int addZone(string zoneNm, Color color)
        {
            string text = "";
            int    num  = System.Math.Min(this.zonedef_startR, this.zonedef_endR);
            int    num2 = System.Math.Max(this.zonedef_startR, this.zonedef_endR);
            int    num3 = System.Math.Min(this.zonedef_startC, this.zonedef_endC);
            int    num4 = System.Math.Max(this.zonedef_startC, this.zonedef_endC);

            for (int i = num; i <= num2; i++)
            {
                for (int j = num3; j <= num4; j++)
                {
                    DataGridViewSpanCell dataGridViewSpanCell = (DataGridViewSpanCell)this.dgvSetDevice.Rows[i].Cells[j];
                    if (dataGridViewSpanCell.GetRowSpan() != 0 || dataGridViewSpanCell.GetColumnSpan() != 0)
                    {
                        string str = dataGridViewSpanCell.Tag.ToString();
                        text = text + str + ",";
                    }
                }
            }
            text = commUtil.uniqueIDs(text);
            if (text.Length > 0)
            {
                text = text.Substring(0, text.Length - 1);
            }
            this.zonedef_cancel();
            int result = ZoneInfo.CreateZoneInfo(zoneNm, text, num, num3, num2, num4, color.ToArgb().ToString());

            switch (result)
            {
            case -2:
            case -1:
                EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.OPfail, new string[0]));
                break;

            case 1:
            {
                string valuePair = ValuePairs.getValuePair("Username");
                if (!string.IsNullOrEmpty(valuePair))
                {
                    LogAPI.writeEventLog("0430020", new string[]
                        {
                            zoneNm,
                            valuePair
                        });
                }
                else
                {
                    LogAPI.writeEventLog("0430020", new string[]
                        {
                            zoneNm
                        });
                }
                EcoGlobalVar.setDashBoardFlg(256uL, "", 0);
                EcoMessageBox.ShowInfo(EcoLanguage.getMsg(LangRes.OPsucc, new string[0]));
                this.treeMenuInit();
                this.treeMenuSelect(zoneNm);
                this.butAdd.Enabled = false;
                EcoGlobalVar.gl_DevManPage.FlushFlg_ZoneBoard = 1;
                break;
            }
            }
            return(result);
        }
コード例 #39
0
ファイル: Zone.cs プロジェクト: ngochoanhbr/dahuco
        public static ZoneInfo GetArea(string strProvince, string strCity, string strCounty)
        {
            List <ZoneInfo> zoneList = Zone.GetZoneList();
            ZoneInfo        result;

            if (!string.IsNullOrEmpty(strProvince) && string.IsNullOrEmpty(strCity) && string.IsNullOrEmpty(strCounty))
            {
                result = (from p in zoneList
                          where p.ZoneName.Equals(strProvince) && p.Depth.Equals(1)
                          select p).FirstOrDefault <ZoneInfo>();
            }
            else if (!string.IsNullOrEmpty(strProvince) && !string.IsNullOrEmpty(strCity) && string.IsNullOrEmpty(strCounty))
            {
                ZoneInfo province = (from p in zoneList
                                     where p.ZoneName.Equals(strProvince) && p.Depth.Equals(1)
                                     select p).Take(1).FirstOrDefault <ZoneInfo>();
                result = zoneList.Where(delegate(ZoneInfo p)
                {
                    int arg_50_0;
                    if (p.ZoneName.Equals(strCity))
                    {
                        int num = p.Depth;
                        if (num.Equals(2))
                        {
                            num      = p.ParentID;
                            arg_50_0 = (num.Equals((province == null) ? 0 : province.AutoID) ? 1 : 0);
                            return(arg_50_0 != 0);
                        }
                    }
                    arg_50_0 = 0;
                    return(arg_50_0 != 0);
                }).FirstOrDefault <ZoneInfo>();
            }
            else if (!string.IsNullOrEmpty(strProvince) && !string.IsNullOrEmpty(strCity) && !string.IsNullOrEmpty(strCounty))
            {
                ZoneInfo city = (from p in zoneList
                                 where p.ZoneName.Equals(strCity) && p.Depth.Equals(2)
                                 select p).Take(1).FirstOrDefault <ZoneInfo>();
                result = zoneList.Where(delegate(ZoneInfo p)
                {
                    int arg_50_0;
                    if (p.ZoneName.Equals(strCounty))
                    {
                        int num = p.Depth;
                        if (num.Equals(3))
                        {
                            num      = p.ParentID;
                            arg_50_0 = (num.Equals((city == null) ? 0 : city.AutoID) ? 1 : 0);
                            return(arg_50_0 != 0);
                        }
                    }
                    arg_50_0 = 0;
                    return(arg_50_0 != 0);
                }).FirstOrDefault <ZoneInfo>();
            }
            else
            {
                result = null;
            }
            return(result);
        }