Ejemplo n.º 1
0
        //For legacy reasons
        void IHTMLFileFromArrayListiners.HTMLFileFromArray(string[] Headernames, List <string[]> Data, string TableKey)
        {
            TableData ThisTableData = new TableData();

            TableDataValue[] Header = new TableDataValue[Headernames.Length];
            for (int i = 0; i < Headernames.Length; i++)
            {
                Header[i] = new TableDataValue();
                Header[i].VisibleValue = Headernames[i];
            }

            ThisTableData.Header = Header;

            foreach (string[] Row in Data)
            {
                TableDataValue[] DataEntries = new TableDataValue[Row.Length];

                for (int i = 0; i < Row.Length; i++)
                {
                    DataEntries[i] = new TableDataValue();
                    DataEntries[i].VisibleValue = Row[i];
                }

                ThisTableData.TableValues.Add(DataEntries);
            }

            AddTableFromEntry(TableKey, ThisTableData);
        }
Ejemplo n.º 2
0
        public MapCollection(ObservableCollection <Map> inputlist, IHTMLFileFromArrayPasser HtmlListiner)
        {
            this.mapList  = inputlist;
            this.listiner = HtmlListiner;

            mapList.CollectionChanged += MapList_CollectionChanged;

            TableDataValue MapEntry = new TableDataValue();

            MapEntry.VisibleValue = "Map Name";

            TableDataValue ReasonEntry = new TableDataValue();

            ReasonEntry.VisibleValue = "Extra info";

            TableDataValue Owner = new TableDataValue();

            Owner.VisibleValue = "Owner";

            TableDataValue[] Data = new TableDataValue[] { MapEntry, ReasonEntry, Owner };



            SetTableHeader TableHandler = new SetTableHeader();

            TableHandler.TableIdentifier = tablename;
            TableHandler.Header          = Data;

            HtmlListiner.HandleCommand(TableHandler);

            AllowOnlyUploadedMaps = false;
        }
Ejemplo n.º 3
0
        public void RemoveMap(Map map, string reason)
        {
            TableDataValue Owner = new TableDataValue();

            Owner.VisibleValue = map.SubmitterName;
            Owner.HoverText    = map.Submitter.ToString();

            mapList.Remove(map);
            TableDataValue MapEntry = new TableDataValue();

            MapEntry.VisibleValue = map.Filename;

            TableDataValue ReasonEntry = new TableDataValue();

            ReasonEntry.VisibleValue = reason;

            TableDataValue[] Data = new TableDataValue[] { MapEntry, ReasonEntry, Owner };

            AddWebsiteEntry AddEntryCommand = new AddWebsiteEntry();

            AddEntryCommand.Identifier = tablename;
            AddEntryCommand.Data       = Data;
            AddEntryCommand.limit      = 10;

            listiner.HandleCommand(AddEntryCommand);
        }
Ejemplo n.º 4
0
        private void ConvertMaplistToTable()
        {
            List <TableDataValue[]> Entries = new List <TableDataValue[]>();

            foreach (Map entry in mapList.GetAllMaps())
            {
                TableDataValue[] Values = new TableDataValue[4];
                Values[0] = new TableDataValue();
                Values[1] = new TableDataValue();
                Values[2] = new TableDataValue();
                Values[3] = new TableDataValue();

                Values[0].VisibleValue = entry.Filename;

                Values[1].VisibleValue = entry.DownloadURL;
                Values[1].Link         = entry.DownloadURL;

                Values[2].VisibleValue = entry.Notes;

                Values[3].VisibleValue = entry.SubmitterName;
                Values[3].HoverText    = entry.Submitter.ToString();

                if (string.IsNullOrEmpty(entry.SubmitterContact))
                {
                }
                else
                {
                    Values[3].Link = entry.SubmitterContact;
                }

                Entries.Add(Values);

                AddWebsiteEntry WebsiteEntry = new AddWebsiteEntry();
                WebsiteEntry.Identifier = TableName;
                WebsiteEntry.Data       = Values;
                WebsiteEntry.limit      = 0;

                HTMLlistiner.HandleCommand(WebsiteEntry);
            }

            TableData data = new TableData();

            data.Header      = GetMapListTableHeader();
            data.TableValues = Entries;

            MakeTableFromEntry TableFromEntry = new MakeTableFromEntry();

            TableFromEntry.TableKey = TableName;
            TableFromEntry.Data     = data;

            HTMLlistiner.HandleCommand(TableFromEntry);
        }
Ejemplo n.º 5
0
        public override void OnAllModulesLoaded()
        {
            //Setup Table

            TableDataValue UsernameHeader = new TableDataValue();

            UsernameHeader.VisibleValue = "Username";
            TableDataValue Message = new TableDataValue();

            Message.VisibleValue = "Message";

            handler.SetTableHeader("Requests", new TableDataValue[] { UsernameHeader, Message });
        }
Ejemplo n.º 6
0
        private TableDataValue[] GetMapListTableHeader()
        {
            TableDataValue[] HeaderName = new TableDataValue[4];
            HeaderName[0] = new TableDataValue(); //There's gotta be a way to fix this
            HeaderName[1] = new TableDataValue(); //Too long, too useless
            HeaderName[2] = new TableDataValue();
            HeaderName[3] = new TableDataValue();

            HeaderName[0].VisibleValue = "Filename";
            HeaderName[1].VisibleValue = "Url";
            HeaderName[2].VisibleValue = "Notes";
            HeaderName[3].VisibleValue = "Submitter";

            return(HeaderName);
        }
Ejemplo n.º 7
0
            protected override string exec(MessageEventArgs Msg, string param)
            {
                if (!param.Equals("!Request"))
                {
                    TableDataValue Username = new TableDataValue();
                    Username.VisibleValue = Msg.Sender.identifier.ToString();
                    TableDataValue Message = new TableDataValue();
                    Message.VisibleValue = param;

                    TableDataValue[] Data = new TableDataValue[] { Username, Message };
                    module.handler.AddWebsiteEntry("Requests", Data, 0);
                    module.handler.AddWebsiteEntry("RequestsWithLimit", Data, 3);

                    return("Added Entry");
                }
                else
                {
                    return("Actually put in something");
                }
            }
        private void ServerTrackingModule_ServerMapChanged(object sender, TrackingServerInfo e)
        {
            string TableLabel = e.tag + " History";

            TableDataValue HeaderName = new TableDataValue();

            HeaderName.VisibleValue = "Map Name";

            TableDataValue HeaderNamePlayerCount = new TableDataValue();

            HeaderNamePlayerCount.VisibleValue = "PlayerCount";

            TableDataValue HeaderTime = new TableDataValue();

            HeaderTime.VisibleValue = "Time (UTC)";

            SetTableHeader tableheaderSetter = new SetTableHeader();

            tableheaderSetter.TableIdentifier = TableLabel;
            tableheaderSetter.Header          = new TableDataValue[] { HeaderName, HeaderNamePlayerCount, HeaderTime };
            WebServer.HandleCommand(tableheaderSetter);

            TableDataValue MapName = new TableDataValue();

            MapName.VisibleValue = e.currentMap;

            TableDataValue PlayerCount = new TableDataValue();

            PlayerCount.VisibleValue = e.playerCount.ToString();

            TableDataValue Time = new TableDataValue();

            Time.VisibleValue = DateTime.UtcNow.ToLongDateString() + " " + DateTime.UtcNow.ToLongTimeString();

            AddWebsiteEntry AddSiteEntry = new AddWebsiteEntry();

            AddSiteEntry.Data       = new TableDataValue[] { MapName, PlayerCount, Time };
            AddSiteEntry.limit      = 10;
            AddSiteEntry.Identifier = TableLabel;
            WebServer.HandleCommand(AddSiteEntry);

            if (e.playerCount > 8)
            {
                userhandler.BroadcastMessageProcessEvent(e.ToString());

                TableDataValue HeaderServer = new TableDataValue();
                HeaderServer.VisibleValue = "Server";

                TableDataValue ServerLabel = new TableDataValue();
                ServerLabel.VisibleValue = e.tag;
                ServerLabel.Link         = "steam://connect/" + e.serverIP + ":" + e.port;

                string RecentlyTestedTableLabel = "Recently Tested";

                SetTableHeader tableheader = new SetTableHeader();
                tableheader.TableIdentifier = RecentlyTestedTableLabel;
                tableheader.Header          = new TableDataValue[] { HeaderName, HeaderNamePlayerCount, HeaderTime, HeaderServer };

                WebServer.HandleCommand(tableheader);

                AddWebsiteEntry WebSiteEntryToAdd = new AddWebsiteEntry();
                WebSiteEntryToAdd.Data       = new TableDataValue[] { MapName, PlayerCount, Time, ServerLabel };
                WebSiteEntryToAdd.limit      = 10;
                WebSiteEntryToAdd.Identifier = RecentlyTestedTableLabel;

                WebServer.HandleCommand(WebSiteEntryToAdd);
            }
        }