private TypeListDifferences ValidateRealms(ImportResultsContainer irc) { var characterRealms = irc.CharacterRows.Select(ar => ar.Realm.Split(",".ToCharArray())). SelectMany(el => el).Select(s => s.Trim()).Distinct().OrderBy(e => e).ToList(); //var dungeonRealms = irc.DungeonRows.Select(ar => ar.Realm.Split(",".ToCharArray())). // SelectMany(el => el).Select(s => s.Trim()).Distinct().OrderBy(e => e).ToList(); var eventRealms = irc.EventRows.Select(ar => ar.Realm.Split(",".ToCharArray())). SelectMany(el => el).Select(s => s.Trim()).Distinct().OrderBy(e => e).ToList(); var legendMateriaRealms = irc.LegendMateriaRows.Select(ar => ar.Realm.Split(",".ToCharArray())). SelectMany(el => el).Select(s => s.Trim()).Distinct().OrderBy(e => e).ToList(); var legendSphereRealms = irc.LegendSphereRows.Select(ar => ar.Realm.Split(",".ToCharArray())). SelectMany(el => el).Select(s => s.Trim()).Distinct().OrderBy(e => e).ToList(); var magiciteRealms = irc.MagiciteRows.Select(ar => ar.Realm.Split(",".ToCharArray())). SelectMany(el => el).Select(s => s.Trim()).Distinct().OrderBy(e => e).ToList(); var recordMateriaRealms = irc.RecordMateriaRows.Select(ar => ar.Realm.Split(",".ToCharArray())). SelectMany(el => el).Select(s => s.Trim()).Distinct().OrderBy(e => e).ToList(); var recordSphereRealms = irc.RecordSphereRows.Select(ar => ar.Realm.Split(",".ToCharArray())). SelectMany(el => el).Select(s => s.Trim()).Distinct().OrderBy(e => e).ToList(); var relicRealms = irc.RelicRows.Select(ar => ar.Realm.Split(",".ToCharArray())). SelectMany(el => el).Select(s => s.Trim()).Distinct().OrderBy(e => e).ToList(); var soulBreakRealms = irc.SoulBreakRows.Select(ar => ar.Realm.Split(",".ToCharArray())). SelectMany(el => el).Select(s => s.Trim()).Distinct().OrderBy(e => e).ToList(); var limitBreakRealms = irc.LimitBreakRows.Select(ar => ar.Realm.Split(",".ToCharArray())). SelectMany(el => el).Select(s => s.Trim()).Distinct().OrderBy(e => e).ToList(); //Realms - source var unifiedRealmsList = characterRealms.Union(eventRealms). Union(legendMateriaRealms).Union(legendSphereRealms).Union(magiciteRealms). Union(recordMateriaRealms).Union(recordSphereRealms).Union(relicRealms).Union(soulBreakRealms). Union(limitBreakRealms).OrderBy(e => e); //Realms - id list var realmList = new RealmList(); var realmListRealmNames = realmList.TypeList.Where(il => il.Key != 0).Select(kvp => kvp.Value).ToList(); TypeListDifferences realmDifferences = new TypeListDifferences() { IdListName = nameof(RealmList), ValuesMissingFromIdList = unifiedRealmsList.Except(realmListRealmNames).ToList(), ValuesSuperfluousInIdList = realmListRealmNames.Except(unifiedRealmsList).ToList(), SuggestedIdListContents = GenerateSuggestedIdListContents(unifiedRealmsList) }; return(realmDifferences); }
void Validate <T>(T value) { Console.WriteLine($"TestRealmList::Validating type {typeof(T).ToString()} with value {value}"); var list = new RealmList <T>(); Assert.NotNull(list); Assert.IsTrue(list.Count == 0, $"Expected list count to be 0 but it was ${list.Count} instead"); list.Add(value); Assert.IsFalse(list.Count == 0, $"Expected list count to not be 0 but it was ${list.Count} instead"); }
private static void HandleActivePing(NetIncomingMessage msg) { var logger = Logger.Instance(); var list = RealmList.Instance(); logger.Write(String.Format("Received ActivePing from {0}", NetUtility.ToHexString(msg.SenderConnection.RemoteUniqueIdentifier)), LogLevels.Informational); // Retrieve our ID. var id = msg.ReadInt32(); // Update our realm, if we have one. if (list.UpdateRealmStatus(id, NetUtility.ToHexString(msg.SenderConnection.RemoteUniqueIdentifier))) { logger.Write(String.Format("Realm ID: {0} connected with RemoteIdentifier: {1}", id, NetUtility.ToHexString(msg.SenderConnection.RemoteUniqueIdentifier)), LogLevels.Debug); } else { logger.Write(String.Format("Realm ID: {0} failed to provide a valid RealmId.", NetUtility.ToHexString(msg.SenderConnection.RemoteUniqueIdentifier)), LogLevels.Debug); } }
async void PesquisarMesas() { try { var resultado = await VirtumApi.Instance.BuscarReinos(new Filtro() { Nome = this.BuscaMesa }); RealmList.Clear(); foreach (Reino reino in resultado.Reinos) { RealmList.Add(reino); } } catch (Exception e) { Console.WriteLine("Exception: " + e.Message); } }
public static void AuthSuccess(NetConnection conn, Guid guid) { var data = new NetBuffer(); var list = RealmList.Instance().GetRealms(); var logger = Logger.Instance(); data.Write((Int32)Packets.Server.AuthSuccess); data.Write(guid.ToString()); data.Write(list.Count); foreach (var item in list) { data.Write(item.Value.Name); data.Write(item.Value.Hostname); data.Write(item.Value.Port); data.Write( (from c in NetServer.Instance().Connections() select NetUtility.ToHexString(c.RemoteUniqueIdentifier)) .Contains(item.Value.RemoteIdentifier) ? true : false ); } logger.Write(String.Format("Sending AuthSuccess to {0}", NetUtility.ToHexString(conn.RemoteUniqueIdentifier)), LogLevels.Debug); SendDataTo(conn, data); }
/// <summary> /// /// </summary> /// <returns></returns> public static bool BuildRecreate() { try { LOGs.WriteLine(LogMessageType.MSG_SQL, "SQL: 开始建构SQL领域..."); s_Domain = new Domain(s_ConnectionUrl, ""); //LOGs.WriteLine( LogMessageType.MSG_INFO, "SQL: 连接 {0}", s_Domain.ConnectionUrl ); LOGs.WriteLine(LogMessageType.MSG_SQL, "SQL: 信息 {0}", s_Domain.Driver.Info.Description); s_Domain.RegisterCulture(new Culture("US", "U.S. English", new CultureInfo("en-US", false))); s_Domain.RegisterCulture(new Culture("CN", "China. Chinese", new CultureInfo("zh-CN", false))); s_Domain.RegisterCulture(new Culture("TW", "Taiwan. Chinese", new CultureInfo("zh-TW", false))); s_Domain.Cultures["CN"].Default = true; s_Domain.RegisterTypes(s_RegisterTypes); LOGs.WriteLine(LogMessageType.MSG_SQL, "SQL: 注册 (NameSpace){0}", s_RegisterTypes); s_Domain.Build(DomainUpdateMode.Recreate); } catch (Exception exception) { LOGs.WriteLine(LogMessageType.MSG_FATALERROR, "SQL: 无法建构SQL领域 {0}", exception); return(false); } using (Session session = new Session(s_Domain)) { session.BeginTransaction(); Accounts accountsGM = (Accounts)session.CreateObject(typeof(Accounts)); accountsGM.AccountsGuid = accountsGM.ID; accountsGM.AccountsName = "DemoSoft"; accountsGM.Password = "******"; accountsGM.GMLevel = 300; // GM accountsGM.Locked = false; accountsGM.Banned = true; accountsGM.CreateDate = DateTime.Now; Accounts accountsTest = (Accounts)session.CreateObject(typeof(Accounts)); accountsTest.AccountsGuid = accountsTest.ID; accountsTest.AccountsName = "Test3009"; accountsTest.Password = "******"; accountsTest.GMLevel = 100; // Player accountsTest.Locked = false; accountsTest.Banned = false; accountsTest.CreateDate = DateTime.Now; RealmList RealmList01 = (RealmList)session.CreateObject(typeof(RealmList)); RealmList01.ServerGuid = RealmList01.ID; RealmList01.ServerName = "Angel"; //channelsCharacter1.Host = "218.3.85.107"; RealmList01.Host = "127.0.0.1"; RealmList01.Port = 29100; RealmList01.Icon = 0; RealmList01.Color = 1; RealmList01.Timezone = 1; RealmList01.Population = 0; RealmList RealmList02 = (RealmList)session.CreateObject(typeof(RealmList)); RealmList02.ServerGuid = RealmList02.ID; RealmList02.ServerName = "Hell"; //channelsCharacter2.Host = "218.3.85.107"; RealmList02.Host = "127.0.0.1"; RealmList02.Port = 29100; RealmList02.Icon = 0; RealmList02.Color = 1; RealmList02.Timezone = 1; RealmList02.Population = 300; RealmList RealmList03 = (RealmList)session.CreateObject(typeof(RealmList)); RealmList03.ServerGuid = RealmList03.ID; RealmList03.ServerName = "Angel-1"; //channelsWorld1.Host = "218.3.85.107"; RealmList03.Host = "127.0.0.1"; RealmList03.Port = 29200; RealmList03.Icon = 0; RealmList03.Color = 1; RealmList03.Timezone = 1; RealmList03.Population = 300; RealmList RealmList04 = (RealmList)session.CreateObject(typeof(RealmList)); RealmList04.ServerGuid = RealmList04.ID; RealmList04.ServerName = "Angel-2"; //channelsWorld2.Host = "218.3.85.107"; RealmList04.Host = "127.0.0.1"; RealmList04.Port = 29200; RealmList04.Icon = 0; RealmList04.Color = 1; RealmList04.Timezone = 1; RealmList04.Population = 300; RealmList RealmList05 = (RealmList)session.CreateObject(typeof(RealmList)); RealmList05.ServerGuid = RealmList05.ID; RealmList05.ServerName = "Hell-1"; //channelsWorld3.Host = "218.3.85.107"; RealmList05.Host = "127.0.0.1"; RealmList05.Port = 29200; RealmList05.Icon = 0; RealmList05.Color = 1; RealmList05.Timezone = 1; RealmList05.Population = 300; RealmList RealmList06 = (RealmList)session.CreateObject(typeof(RealmList)); RealmList06.ServerGuid = RealmList06.ID; RealmList06.ServerName = "Hell-2"; //channelsWorld4.Host = "218.3.85.107"; RealmList06.Host = "127.0.0.1"; RealmList06.Port = 29200; RealmList06.Icon = 0; RealmList06.Color = 1; RealmList06.Timezone = 1; RealmList06.Population = 300; session.Commit(); } LOGs.WriteLine(LogMessageType.MSG_SQL, "SQL: 完成建构SQL领域"); return(true); }
async void OpenTable(string id) { var reino = RealmList.FirstOrDefault(x => x.Id == id); await Navigation.PushAsync(new MesaPage(reino)); }