SCG Banner
icon
Unknown Account
This post is not tied to an account, it may be from before the JB
Discussion: Website server print system : A technical overview posted in Archives

Hello, what I have here today is a technical overview of SCG's website! More specifically, the pages that render server information! It's something I've wanted to share with anyone interested in technical inner working stuff and if I someday allow people to work on the SCG website SVN, then whomever does can get an idea of how I work!

So without delay, let's go!

[hr]

[size=14pt]The master server record[/size]

First thing to take a look at is the master server record file, which is listed on server_list.json , a .json file located in our data asset folder. Because I don't want to spoil any upcoming stuff, I'll just toss out an example of what it looks like!

"server_names": {
    "Chocolate": {
        "short_name": "tf2",
        "game_name": "team_fortress_2"
    },
    "Strawberry": {
        "short_name": "tf2",
        "game_name": "team_fortress_2"
    },
    "Rainbow": {
        "short_name": "tf2",
        "game_name": "team_fortress_2"
    },
    "Vanilla": {
        "short_name": "tf2",
        "game_name": "team_fortress_2"
    },
    "Fudge": {
        "short_name": "tf2",
        "game_name": "team_fortress_2"
    },
    "Heraberry": {
        "short_name": "mc",
        "game_name": "minecraft"
    },
    "TEST": {
        "short_name": "mc",
        "game_name": "minecraft"
    }
},

What you see here is the first section, the calls for the various servers and their associated games. Only two attributes are used here. Short name and game name.

short_name : The short name is what the server page looks up when it loads a style sheet. The values for these aren't pre-defined, it's whatever I may need it to be.
game_name: This is used to refer to the server list it will look for the server name in.

Next, the second section, there are only two by the way. This is where the real meat of things takes place. Each part of the second section is split into games, for instance, Tf2 has a block, Minecraft does, and Teamspeak does. Inside those blocks, it picks up any style info it needs, and then gets the servers / server info from there. Let's look at the top example for Tf2 - > Chocolate.

"servers": {
    "team_fortress_2": {
        "game_name": "Team Fortress 2",
        "servers": {
            "Chocolate": {
    "title": "Chocolate",
    "title_short": "chocolate",
    "title_url": "Chocolate",
    "ip": "198.144.183.135:27015",
    "vanity_ip": "tf2.furfortress.com:27015",
    "banner_image": "XXX/tf2banner.jpg",
    "sum_id": "0",
    "map_type": "2",
    "map_file": "XXX/chocolate_maplist.txt",
    "serverhop_id": "1",
    "sb_id": "10",
    "server_board": "71",
    "topic_id": "774",
    "desc": "General server, stock modes with some custom maps mixed in. Widely regarded as the "regular" server."
            },

What is all this? This is any important data for each server split into different attributes. These get used on the server pages to load various blocks of info. You may ask, why keep this all in a .json over anything else? Two reasons! I prefer it this way, it's easy to edit on the fly, it's quick loading, and the unforeseen third reason, in case I need to use it elsewhere!

What are these attributes?
Servers, Tream fortress 2, game name name and then servers again are pretty self explanatory. It calls the servers, then each one in the group.

title: Self explanatory, it's the title of the server.
title_short: short version, for instance Front Line Fudge gets called as "flf"
title_url: url version, used for the web address / css styling.
ip: self explanatory, it's the ip of the server.
vanity_ip: Again, it's the ip of the server but the url version. This is the one you should favorite, in case it changes!
banner_image: Link to the server's banner, in the event that it differs per server. This isn't really used yet.
sum_id: Ignore this, this was left in from the transistion from the old progress system to this one. Still there as I use it kind of, it's temporary.
map_type: 1 is for minecraft maps. An additional flag called map_link is used. Will be replaced with map_file soon.
2 is for Tf2 map files that have a lot of rules on them, i.e. Chocolate and Rainbow's.
3 is for the very simple plain text files, like Flf or Vanilla

map_file: The url of where the map's copy is. This was a recent edit, to allow a map file to be outside of the SCG web server so Tellah could edit it.
serverhop_id: The ID of the server hop listing for the server, this is used to call in the current map, player count, next map, etc.
sb_id: The sourcebans ID of the server, this is unused currently but may be used at a later time.
server_board: The server board ID, used to call in the board plugins / data.
topic_id: This is used to get the general thread for the particular server
desc: This is used as a quicky text shown on the servers page.

[hr]

[size=12pt]The forums intergration[/size]

The server description pages use the forums to hold the info for them. Why do this you ask? It started out as a way for me to be lazy about editing and not need to make a WYSIWYG editor for myself and use them instead. It finished with having two sources of information ; but with the benefit of having one spot to edit them both. The server pages on the main website just take the posts from the forums and output them in a neater, cleaner way!

There is a sub board for each individual server, with a "general" thread in each. This general thread has the base info, stuff about the server, bug reports, FAQ stuff, and every post after all that is updates which get shown at the bottom of the page. The latest post in the thread acts as the latest update. This is also condensed into a quicker readable form that you can view from the server itself!

In the thread for each server, every post in there aside from the general thread is a plugin thread. The first post is the quick explanation, this gets posted on the main server page. The second post is a more elaborate (If needed) description. And every post after that is individual plugin updates. In case you needed to read one in particular and not the whole giant text list.

I'm still working on the plugin section to see if I can make it cleaner to navigate!

[hr]

[size=14pt]Notes[/size]

  1. The post ID's for Bugs and FAQ are 2 and 3 respectively rather than 3 and 2. This was due to the FAQ being a last minute addition that I didn't want to go back and edit as I was too far in design and was lazy. The forums show them as Bugs - FAQ while the site says FAQ - BUGS.

  2. Originally, when opening a server page without a correctly functioning / missing map index, it would take the code of the 404 page and attempt to split that into viewable maps. It was scary. This was fixed (sadly) when I put in support for offsite map lists.

Last edited : by Administration

This discussion has no replies...yet.