public override bool TakeAction() { switch (m_RequestPacket.Type) { case 1: DataTableLoader.LoadDataTables("Lobby"); m_ResponsePacket.Success = true; break; case 2: FlushKey(m_RequestPacket.Params); break; case 3: GameConfigs.Reload(); m_ResponsePacket.Success = true; break; case 4: GetOnlinePlayerCount(); break; case 5: ScriptEngines.Initialize(); break; default: return(false); } return(true); }
public void Load_ListOfRows_ColumnOrdinalsPreserved() { var target = new DataTableLoader <DependentRow>(new DataAnnotationsDefinitionProvider()); var dependentRows = new List <DependentRow> { new DependentRow { FakeDependentEntityId = 454, DependentIntegerValue = 3, DependentTimeValue = DateTimeOffset.MaxValue }, new DependentRow { FakeDependentEntityId = 455, DependentIntegerValue = 2, DependentTimeValue = DateTimeOffset.MinValue }, new DependentRow { FakeDependentEntityId = 456, DependentIntegerValue = 1, DependentTimeValue = DateTimeOffset.Now }, new DependentRow { FakeDependentEntityId = 457, DependentIntegerValue = 1, DependentTimeValue = DateTimeOffset.Now }, new DependentRow { FakeDependentEntityId = 458, DependentIntegerValue = 3, DependentTimeValue = DateTimeOffset.MaxValue } }; var actual = target.Load(dependentRows); Assert.AreEqual(nameof(DependentRow.FakeDependentEntityId), actual.Columns[0].ColumnName); Assert.AreEqual(nameof(DependentRow.DependentIntegerValue), actual.Columns[1].ColumnName); Assert.AreEqual(nameof(DependentRow.DependentTimeValue), actual.Columns[2].ColumnName); }
protected override void OnStartAffer() { DataTableLoader.LoadDataTables("Room"); GameConfigs.Reload(); RegisterRoomServer(); (new SyncTimer(UpdateServerState, 30000, 30000)).Start(); GameUtils.PrintBuddha(); }
protected CaptionedResultPane(ResultsLoaderProfile profile, DataTableLoader loader) : base(profile, loader) { this.InitializeComponent(); base.Name = "CaptionedResultPane"; if (base.ResultsLoaderProfile != null) { this.CaptionText = base.ResultsLoaderProfile.DisplayName; } }
public static void InitServer() { DataTableLoader.LoadDataTables("Lobby"); (new SyncTimer(RoomServerManager.CheckServerStates, 60000, 60000)).Start(); (new SyncTimer(Cronjobs.CheckAndDo, 60000, 60000)).Start(); (new SyncTimer(UpdateServerLoadToMaster, 60000, 60000)).Start(); (new SyncTimer(PVPLogic.ExecuteMatch, 10000, 10000)).Start(); RoomServerManager.InitRoomServerList(); RoomServerManager.InitRoomList(); GameConfigs.Reload(); ArenaRankLogic.InitRankList(); AllQualitiesOfGears.LoadGears(); InitRanking(); RegisterLobbyServer(); }
internal virtual DataTableLoader CreateDataTableLoaderForResolver() { DataTableLoader dataTableLoader = this.CreateDataTableLoader(); if (dataTableLoader.Table != null && this.ObjectPickerProfile == null) { this.MarkNonOptionalColumnsAsRequiredColumn(dataTableLoader.Table); ObjectPicker.RemoveNonRequiredColumns(dataTableLoader.Table); } if (dataTableLoader.RefreshArgument != null) { dataTableLoader.RefreshArgument = (ICloneable)dataTableLoader.ResultsLoaderProfile.CloneWithSharedInputTable(); } return(dataTableLoader); }
public static void CheckAndUpdateDataTable(object state) { DBProvider db = new DBProvider("Game"); var versions = db.Select("dataTableVersions", "Name,UsedVersion,LatestVersion", ""); foreach (var version in versions) { if ((int)version["LatestVersion"] > (int)version["UsedVersion"]) { FileInfo dtfile = new FileInfo("DataTables/" + (string)version["Name"] + ".txt"); DataTableLoader.LoadDataTableFile(dtfile); Dictionary <string, object> sqlparams = new Dictionary <string, object>(); sqlparams["UsedVersion"] = version["LatestVersion"]; db.Update("dataTableVersions", sqlparams, "Name = '" + version["Name"] + "'"); } } }
protected DataListViewResultPane(ResultsLoaderProfile profile, DataTableLoader loader) : base(profile, loader) { this.listContextMenu = base.ContextMenu; base.ContextMenu = null; base.Name = "DataListViewResultPane"; this.saveDefaultFilterCommand = new Command(); this.saveDefaultFilterCommand.Description = LocalizedString.Empty; this.saveDefaultFilterCommand.Name = "commandSaveFilter"; this.saveDefaultFilterCommand.Text = Strings.SaveAsDefaultFilterCommandText; this.saveDefaultFilterCommand.Execute += this.saveDefaultFilterCommand_Execute; base.ViewModeCommands.AddRange(new Command[] { CommandLoggingDialog.GetCommandLoggingCommand(), Command.CreateSeparator() }); base.ViewModeCommands.Add(Theme.VisualEffectsCommands); }
public override bool TakeAction() { switch (m_RequestPacket.Type) { case 1: DataTableLoader.LoadDataTables("Room"); m_ResponsePacket.Success = true; break; case 3: GameConfigs.Reload(); break; default: return(false); } return(true); }
public void Load_ListOfRows_DataMatchesExpected() { var target = new DataTableLoader <DependentRow>(new DataAnnotationsDefinitionProvider()); var dependentRows = new List <DependentRow> { new DependentRow { FakeDependentEntityId = 454, DependentIntegerValue = 3, DependentTimeValue = DateTimeOffset.MaxValue }, new DependentRow { FakeDependentEntityId = 455, DependentIntegerValue = 2, DependentTimeValue = DateTimeOffset.MinValue }, new DependentRow { FakeDependentEntityId = 456, DependentIntegerValue = 1, DependentTimeValue = DateTimeOffset.Now }, new DependentRow { FakeDependentEntityId = 457, DependentIntegerValue = 1, DependentTimeValue = DateTimeOffset.Now }, new DependentRow { FakeDependentEntityId = 458, DependentIntegerValue = 3, DependentTimeValue = DateTimeOffset.MaxValue } }; var actual = target.Load(dependentRows); Assert.AreEqual(dependentRows.Count, actual.Rows.Count); for (int i = 0; i < dependentRows.Count; i++) { var actualRow = new DependentRow { FakeDependentEntityId = (int)actual.Rows[i][nameof(DependentRow.FakeDependentEntityId)], DependentIntegerValue = (int)actual.Rows[i][nameof(DependentRow.DependentIntegerValue)], DependentTimeValue = (DateTimeOffset)actual.Rows[i][nameof(DependentRow.DependentTimeValue)] }; Assert.AreEqual(dependentRows.ElementAt(i), actualRow); } }
public TreeViewObjectPickerForm(ObjectPicker objectPicker) : this() { this.ObjectPicker = objectPicker; DataTableLoader dataTableLoader = this.ObjectPicker.DataTableLoader; this.resultDataTable = dataTableLoader.Table.Clone(); this.rootNodes = new BindingList <TreeViewObjectPickerForm.DataTreeNodeModel>(); this.queryResults = dataTableLoader.Table; this.resultTreeView.LazyExpandAll = true; this.resultTreeView.ImageList = ObjectPicker.ObjectClassIconLibrary.SmallImageList; this.resultTreeView.DataSource = this.rootNodes; this.resultTreeView.NodePropertiesMapping.Add("Text", "Name"); this.resultTreeView.NodePropertiesMapping.Add("ImageKey", "ImageKey"); this.resultTreeView.NodePropertiesMapping.Add("SelectedImageKey", "ImageKey"); this.resultTreeView.ChildRelation = "Children"; base.Load += delegate(object param0, EventArgs param1) { this.RetriveChildrenNodes(null); }; this.resultTreeView.BeforeExpand += this.resultTreeView_BeforeExpand; this.resultTreeView.AfterSelect += this.resultTreeView_AfterSelect; }
public void SetUp() { DataTableLoader.LoadDataTableFile(new FileInfo(TestConsts.DataTableDir + "Hero.txt"), typeof(DTHero)); DataTableLoader.LoadDataTableFile(new FileInfo(TestConsts.DataTableDir + "HeroBase.txt"), typeof(DTHeroBase)); m_PlayerHeroLogic = new PlayerHeroLogic(); PlayerHeros ph = new PlayerHeros() { UserId = 1, }; Hero h1 = new Hero() { HeroType = 1, HeroLv = 1, HeroExp = 0, HeroStarLevel = 1, ConsciousnessLevel = 0, ElevationLevel = 0 }; h1.SkillLevels.AddRange(new int[] { 1, 1, 1, 1, 1, 0, 0, 0, 0, 1 }); m_PlayerHeroLogic.MyHeros = ph; ph.Heros.Add(1, h1); }
public CaptionedResultPane(DataTableLoader loader) : this((loader != null) ? loader.ResultsLoaderProfile : null, loader) { }
public DataListViewResultPane(DataTableLoader loader) : this((loader != null) ? loader.ResultsLoaderProfile : null, loader) { }
protected ResultPane(ResultsLoaderProfile profile, DataTableLoader loader) { base.SuspendLayout(); this.warningCaption = new AutoHeightLabel(); this.warningCaption.BackColor = SystemColors.Info; this.warningCaption.ForeColor = SystemColors.InfoText; this.warningCaption.Image = IconLibrary.ToSmallBitmap(Icons.Warning); this.warningCaption.Dock = DockStyle.Top; this.warningCaption.Name = "warningCaption"; this.warningCaption.ImageAlign = ContentAlignment.MiddleLeft; this.warningCaption.TextAlign = ContentAlignment.MiddleLeft; this.warningCaption.Padding = new Padding(20, 2, 2, 2); this.warningCaption.Visible = false; base.Controls.Add(this.warningCaption); base.Name = "ResultPane"; base.ResumeLayout(false); Command command = Command.CreateSeparator(); command.Visible = false; this.dependentResultPanesCommandsSeparator = Command.CreateSeparator(); this.dependentResultPanesCommandsSeparator.Visible = false; this.deleteSelectionCommandsSeparator = Command.CreateSeparator(); this.deleteSelectionCommandsSeparator.Visible = false; this.showSelectionPropertiesCommandsSeparator = Command.CreateSeparator(); this.showSelectionPropertiesCommandsSeparator.Visible = false; Command command2 = Command.CreateSeparator(); command2.Visible = false; this.helpCommandSeparator = Command.CreateSeparator(); this.helpCommandSeparator.Visible = false; this.warningCaption.MouseEnter += delegate(object param0, EventArgs param1) { this.warningCaption.ForeColor = SystemColors.HighlightText; this.warningCaption.BackColor = SystemColors.Highlight; }; this.warningCaption.MouseLeave += delegate(object param0, EventArgs param1) { this.warningCaption.ForeColor = SystemColors.InfoText; this.warningCaption.BackColor = SystemColors.Info; }; this.warningCaption.Click += this.warningCaption_Click; this.DependentResultPanes.ListChanging += this.DependentResultPanes_ListChanging; this.DependentResultPanes.ListChanged += this.DependentResultPanes_ListChanged; this.CustomSelectionCommands.CommandAdded += new CommandEventHandler(this.CustomSelectionCommands_CommandAdded); this.CustomSelectionCommands.CommandRemoved += new CommandEventHandler(this.CustomSelectionCommands_CommandRemoved); this.DependentResultPaneCommands.CommandAdded += new CommandEventHandler(this.DependentResultPaneCommands_CommandAdded); this.DependentResultPaneCommands.CommandRemoved += new CommandEventHandler(this.DependentResultPaneCommands_CommandRemoved); this.DeleteSelectionCommands.CommandAdded += new CommandEventHandler(this.DeleteSelectionCommands_CommandAdded); this.DeleteSelectionCommands.CommandRemoved += new CommandEventHandler(this.DeleteSelectionCommands_CommandRemoved); this.ShowSelectionPropertiesCommands.CommandAdded += new CommandEventHandler(this.ShowSelectionPropertiesCommands_CommandAdded); this.ShowSelectionPropertiesCommands.CommandRemoved += new CommandEventHandler(this.ShowSelectionPropertiesCommands_CommandRemoved); base.SelectionCommands.AddRange(new Command[] { this.dependentResultPanesCommandsSeparator, this.deleteSelectionCommandsSeparator, this.showSelectionPropertiesCommandsSeparator }); base.ResultPaneCommands.CommandAdded += new CommandEventHandler(this.ResultPaneCommands_CommandAdded); base.ResultPaneCommands.CommandRemoved += new CommandEventHandler(this.ResultPaneCommands_CommandRemoved); base.ExportListCommands.CommandAdded += new CommandEventHandler(this.ExportListCommands_CommandAdded); base.ExportListCommands.CommandRemoved += new CommandEventHandler(this.ExportListCommands_CommandRemoved); this.viewCommand = new Command(); this.viewCommand.Text = Strings.ViewCommands; this.viewCommand.Visible = false; this.viewCommand.Name = "resultPaneViewCommand"; this.viewCommand.Icon = Icons.View; base.ViewModeCommands.CommandAdded += new CommandEventHandler(this.ViewModeCommands_CommandAdded); base.ViewModeCommands.CommandRemoved += new CommandEventHandler(this.ViewModeCommands_CommandRemoved); this.WhitespaceCommands.AddRange(new Command[] { command, this.viewCommand, command2, base.RefreshCommand }); this.ResultsLoaderProfile = profile; this.RefreshableDataSource = loader; this.SetupCommandsProfile(); this.SyncCommands(this.CommandsProfile.ResultPaneCommands, base.ResultPaneCommands); this.SyncCommands(this.CommandsProfile.CustomSelectionCommands, this.CustomSelectionCommands); this.SyncCommands(this.CommandsProfile.DeleteSelectionCommands, this.DeleteSelectionCommands); this.SubscribedRefreshCategories.Add(ResultPane.ConfigurationDomainControllerRefreshCategory); }
public static FilteredDataTableLoaderView SetFilteredDataSource(ObjectList objectList, UIPresentationProfile uiPresentationProfile, DataTableLoader dataTableLoader) { FilteredDataTableLoaderView filteredDataTableLoaderView = (dataTableLoader == null) ? null : FilteredDataTableLoaderView.Create(dataTableLoader); WinformsHelper.SetDataSource(objectList, uiPresentationProfile, filteredDataTableLoaderView); return(filteredDataTableLoaderView); }
public static DataTableLoaderView SetDataSource(DataListView dataListView, UIPresentationProfile uiPresentationProfile, DataTableLoader dataTableLoader) { DataTableLoaderView dataTableLoaderView = (dataTableLoader == null) ? null : DataTableLoaderView.Create(dataTableLoader); WinformsHelper.SetDataSource(dataListView, uiPresentationProfile, dataTableLoaderView); return(dataTableLoaderView); }
public abstract void DoPostRefreshAction(DataTableLoader loader, RefreshRequestEventArgs refreshRequest);