Exemple #1
0
        public override void OnAllModulesLoaded()
        {
            CommandListHeld = new Dictionary <string, List <string[]> >();
            foreach (BaseModule module in modulehandler.GetAllModules())
            {
                string[] HeaderNames = { "Command Type", "Command Name" };

                List <string[]> CommandList = new List <string[]>();

                foreach (BaseCommand command in module.commands)
                {
                    foreach (string entry in command.GetCommmand())
                    {
                        CommandList.Add(new string[] { "User Command", entry });
                    }
                }

                foreach (BaseCommand command in module.adminCommands)
                {
                    foreach (string entry in command.GetCommmand())
                    {
                        CommandList.Add(new string[] { "Admin Command", entry });
                    }
                }
                CommandListHeld.Add(module.GetType().Name.ToString(), CommandList);

                HTMLFileFromArray filefromarray = new HTMLFileFromArray();
                filefromarray.Headernames = HeaderNames;
                filefromarray.Data        = CommandList;
                filefromarray.TableKey    = module.GetType().Name.ToString();
                HtmlHandler.HandleCommand(filefromarray);
            }
        }
        private void UpdateList()
        {
            foreach (Maplist entry in Maplists)
            {
                HTMLFileFromArray HtmlFromArray = new HTMLFileFromArray();
                HtmlFromArray.Data        = ParseSummarisedListToHTMLTable(SummariseEntries(MapTests, entry.Maps, entry.ListKind));
                HtmlFromArray.Headernames = Header;
                HtmlFromArray.TableKey    = entry.ListName;

                listiner.HandleCommand(HtmlFromArray);
            }
        }
        private void Export()
        {
            List <string[]> Data = new List <string[]>();

            string[] header = { "MapName", "IP", "Playercount", "TimeEntered" };
            foreach (KeyValuePair <string, List <PlayEntry> > Item in MapTests)
            {
                foreach (PlayEntry PlayCache in Item.Value)
                {
                    string[] DataEntry = { Item.Key, PlayCache.ServerIP, PlayCache.PlayerCount, PlayCache.TimeEntered };
                    Data.Add(DataEntry);
                }

                HTMLFileFromArray HtmlFromArray = new HTMLFileFromArray();
                HtmlFromArray.Data        = Data;
                HtmlFromArray.Headernames = header;
                HtmlFromArray.TableKey    = "ExportedData";

                listiner.HandleCommand(HtmlFromArray);
            }
        }