public BListController(Socketserver server, string world) { protzones = new Protectionzones(false); this.server = server; parser = new XMLParser(); hitList = new ArrayList(); healList = new ArrayList(); strTop300 = getTop300(world); updateEnemys(); timerPickTarget.Elapsed += new ElapsedEventHandler(run); timerPickTarget.Interval = 1000; timerPickTarget.Start(); timerSendRadar.Elapsed += new ElapsedEventHandler(sendRadar); timerSendRadar.Interval = 1000; timerSendRadar.Start(); timerUpdateTargets.Elapsed += new ElapsedEventHandler(updateTargets); timerUpdateTargets.Interval = 100; timerUpdateTargets.Start(); timerUpdateManashield.Elapsed += new ElapsedEventHandler(updateManashield); timerUpdateManashield.Interval = 100; timerUpdateManashield.Start(); }
public void handleInfo(string PstrInfo, int id) { PstrInfo = PstrInfo.Replace("\n", ""); PstrInfo = PstrInfo.Replace("\r", ""); XMLParser parser = new XMLParser(); XMLElement mainelement = parser.ParseXML(PstrInfo); XMLElement currentelement = mainelement.getChild("SELF;NAME", true, 0); string strSelfName = currentelement.Value; currentelement = mainelement.getChild("SELF;MAGICLVL", true, 0); string strSelfMgcLvl = currentelement.Value; currentelement = mainelement.getChild("SELF;LVL", true, 0); string strLvl = currentelement.Value; currentelement = mainelement.getChild("SELF;HP", true, 0); string strHp = currentelement.Value; currentelement = mainelement.getChild("SELF;HPPER", true, 0); string strHpPer = currentelement.Value; currentelement = mainelement.getChild("SELF;XYZ", true, 0); string strxyz = currentelement.Value; currentelement = mainelement.getChild("SELF;SKILL", true, 0); string strskill = currentelement.Value; int i = 0; ArrayList targetList = new ArrayList(); while ((currentelement = mainelement.getChild("TARGET", true, i)) != null) { ArrayList list = new ArrayList(); for(int i2 = 0; i2 < currentelement.Elements.Length; i2++) { XMLElement newElement = currentelement.Elements[i2]; list.Add(newElement.Value); } targetList.Add(list); i++; } blist.submitList(strSelfName, strLvl, strHp, strHpPer, strSelfMgcLvl, strxyz, strskill, targetList, id); }