public void Login() { if (Data.Villages.Count > 0) Data.Save(); Data = new TraviData(); Data.Load(); //if (TraviBase.Data.Villages.Count == 0) try { Navigate("login.php?del_cookie"); GetBasicInfo(); } catch { MessageBox.Show(Globals.Translator["Login failed!"]); Application.Exit(); } }
public void Login() { if (Data.Villages.Count > 0) { Data.Save(); } Data = new TraviData(); Data.Load(); //if (TraviBase.Data.Villages.Count == 0) try { Navigate("login.php?del_cookie"); GetBasicInfo(); } catch { MessageBox.Show(Globals.Translator["Login failed!"]); Application.Exit(); } }
/// <summary> /// Beszerzi a legfrisebb térképet, szétparszolja, és elrakja /// ToDo: Csak akkor kéne elrakni, ha különbözik az előzőtől /// Ijen egy sor: /// INSERT INTO `x_world` VALUES (188644,8,165,1,45770,'Mr G faluja',30778,'Mr G',0,'',3); /// </summary> /// <param name="url">Innen töltike lefelé</param> /// <param name="Data">Ide kell elrakni</param> public static void Collect(string url, TraviData Data) { System.Net.WebClient Client = new System.Net.WebClient(); Stream strm = Client.OpenRead(url); StreamReader sr = new StreamReader(strm); string line; string[] details; DateTime now = DateTime.Now; do { line = sr.ReadLine(); if (line != null) { line = line.Substring(30, line.Length - 32); details = line.Split(','); MapElement me = new MapElement(); me.TimeStamp = now; try { me.Id = int.Parse(details[0]); me.X = int.Parse(details[1]); me.Y = int.Parse(details[2]); me.Tid = int.Parse(details[3]); me.Vid = int.Parse(details[4]); me.Village = details[5].Trim('\''); me.Uid = int.Parse(details[6]); me.Player = details[7].Trim('\''); me.Aid = int.Parse(details[8]); me.Alliance = details[9].Trim('\''); me.Population = int.Parse(details[10]); } catch { } Data.Map.Add(me); } } while (line != null); strm.Close(); }
/// <summary> /// Beszerzi a legfrisebb térképet, szétparszolja, és elrakja /// ToDo: Csak akkor kéne elrakni, ha különbözik az előzőtől /// Ijen egy sor: /// INSERT INTO `x_world` VALUES (188644,8,165,1,45770,'Mr G faluja',30778,'Mr G',0,'',3); /// </summary> /// <param name="url">Innen töltike lefelé</param> /// <param name="Data">Ide kell elrakni</param> public static void Collect(string url, TraviData Data) { System.Net.WebClient Client = new System.Net.WebClient(); Stream strm = Client.OpenRead(url); StreamReader sr = new StreamReader(strm); string line; string[] details; DateTime now = DateTime.Now; do { line = sr.ReadLine(); if (line != null) { line = line.Substring(30, line.Length - 32); details = line.Split(','); MapElement me = new MapElement(); me.TimeStamp = now; try { me.Id = int.Parse(details[0]); me.X = int.Parse(details[1]); me.Y = int.Parse(details[2]); me.Tid = int.Parse(details[3]); me.Vid = int.Parse(details[4]); me.Village = details[5].Trim('\''); me.Uid = int.Parse(details[6]); me.Player = details[7].Trim('\''); me.Aid = int.Parse(details[8]); me.Alliance = details[9].Trim('\''); me.Population = int.Parse(details[10]); } catch { } Data.Map.Add(me); } }while (line != null); strm.Close(); }
public Overall( TraviData data ) { this.data = data; }
public Overall(TraviData data) { this.data = data; }