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);
        }
Exemple #2
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);
        }
        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);
            }
        }