• Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

Code Mut: Per Server Stats

So here's some information into setting up server news page and what tags are supported.

Few notes though:
Colour tags are supported with following formats:
#HEX - Hex definition of font color.
RBG(RRR,GGG,BBB) - 0-255 color values for RBG, i.e: RBG(255,0,0) for red.
Color name: RED, BLUE, GREEN, YELLOW, BLACK, WHITE.

Font size can be defined either with a value relative to screen resolution (0-16), where largest values are for smaller font size. Or then with negative numbers (-1 to -9) for size regardless of screen resolution on client, where -1 is smallest and -9 is largest font size.

All images you use must be from in-game only (I can't make it download binary files from websites). So image names must match with some texture from in-game or it will show as Engine.DefaultTexture, as example:
<IMG SRC="2K4Menus.DemoHeaderBar">

Following tags are available:
<P> - Paragraphs, simply ends text with 2 line breaks (same as using <BR><BR>).
<BR> - Line break.
<BODY> - Setup news page body, with additional settings:
BGCOLOR= - Background color.
LINK= - Link color.
ALINK= - Focused link color (when you hover your mouse over it).
TEXT= - Default text color.
SIZE= - Default font size.
IMG= - Background texture, has following params:
IMGSTYLE= - Background image style, supports following styles:
FIT - Default, stretch out the texture to cover entire screen.
FITX - Stretch out texture to fit screen horizontally while keeping texture aspect ratio.
FITY - Same as above but fit screen vertically.
TILED - Tile the texture by repeating it over and over, that contains following params:
TILEX= - X scaling of the image (default to texture U size).
TILEY= - Y scaling of the image (default to texture V size).​
IMGLOCK= - Lock the image in place when scrolling the news page up and down (default to 1, but can be set to 0 to enable it scroll off background).​
<CENTER>Abc</CENTER> - Center alignment on a segment of text.
<RIGHT>Abc</Right> - Right alignment on a segment of text.
<H1>Abc</H1> - Header text (center alignment + font size 5).
<FONT>Abc</FONT> - Change font with following params:
COLOR= - Text color.
SIZE= - Text size.​
<TAB X=64>Abc</TAB> - Indent text with that many pixels.
<TITLE>Abc</TITLE> - Set news page title.
<A HREF="http://www.google.com">Google</A> - Set a link, supports following protocols:
http:// - Will launch up standard internet explorer with the site and minimize the game.
kfurl:// - Will change page on the news page explorer.
kf:// - Will launch URL within game (can be IP-address or a map, kf://KF-Manor or kf://12.12.12.12:1234).​
<IMG> - Show a texture on the page with following params available:
SRC= - Texture name.
VSPACE= - X pixels offset from current location (default 0).
HSPACE= - Y pixels offset from current location.
WIDTH= - X pixels size (default USize of image).
HEIGHT= - Y pixels size.
ALIGN= - Alignment of the image:
LEFT - Place on left side of screen.
CENTER - Place in center of screen.
RIGHT - Place on right side of screen.
Defaults to directly after text at current position.​
STYLE= - Image style:
NORMAL - Stretch it out normally (default).
STRETCH - Draw it stretched like GUI buttons or so, see here for reference.
TILEDX - Tile it on X axis and stretch on Y.
TILEDY - Tile it on Y axis and stretch on X.
TILED - Tile it on both axis.​

Here is an example rules page:
<TITLE>Killing Floor server</TITLE><BODY BGCOLOR=rgb(160,160,160) SIZE=4 IMG="2K4Menus.menuBackground">
<BR>
<BR>
<CENTER><FONT SIZE=-6 COLOR=black>RULES<IMG SRC="2K4Menus.DemoHeaderBar" WIDTH=500 HEIGHT=38 HSPACE=-8 ALIGN=CENTER STYLE=STRETCH></CENTER></FONT><BR>
<TAB X=20><BR><BR>
1. No cheating!<BR>
2. No dying!<BR>
3. No Lying!<BR>
<BR>
<BR>
<BR>
<BR>
Visit our <A HREF="http://forums.tripwireinteractive.com">forums</A> for more information.
Shows up as:
Spoiler!
 
Upvote 0
Appears that the non-FTP database no longer works, after upgrading to the latest it shows that the server connected to the database correctly and with the correct password but it does not load any perks nor any stats, it does the same in Solo except the perks appear but they are N/A no matter what
 
Last edited:
Upvote 0
Thank you Marco for this great update and thank you for maintaining SP in general!

We successfully ported our perk stats to FTP server and everything works like a charm. Some extra advises for server admins, who want to do the same:
  • Set RemotePort=21 (default for FTP or whatever your FTP server uses).
  • If you thousands of player stats in your db, then I suggest to setup temporary FTP server on your local PC, migrate stats, and then copy result files to the destination using FTP client. It can save a lot of time for you.
 
Upvote 0
So what exactly is this ftp support now? There is many many different ways this can be worked so can someone explain in more detail?

Perks stats are stored on FTP server, 1 file per player. When player joins the game, SP downloads his file (<steamid>.txt) from FTP server and loads it). When saving stats, SP uploads changed stat files back to the FTP.

Pros:
  • No need to run PerkDB program anymore, which was esp. painful on Linux servers.
  • No need to worry about growing amount of players (growing DB).
  • You can easy check how many unique players had played on your server during last period of time by checking file dates.

Cons:
  • If you don't have a local access to FTP server files, it is harder (or at least longer) to create backups of the stats.
 
Upvote 0
Perks stats are stored on FTP server, 1 file per player. When player joins the game, SP downloads his file (<steamid>.txt) from FTP server and loads it). When saving stats, SP uploads changed stat files back to the FTP.

Pros:
  • No need to run PerkDB program anymore, which was esp. painful on Linux servers.
  • No need to worry about growing amount of players (growing DB).
  • You can easy check how many unique players had played on your server during last period of time by checking file dates.

Cons:
  • If you don't have a local access to FTP server files, it is harder (or at least longer) to create backups of the stats.
So basically we need to use a FTP software to allow this to occur and unblock the ftp from the firewall? Sorry, i'm still a little confused. Probably too much thinking going on lol. Sounds really efficient though. I'm wondering if it'll be better off on my server. Also another question is you said the stats are sent from when they join, so I could edit it but if they reconnect after the edit, the new stat changes will take effect?
 
Upvote 0
Getting a odd crash when using the FTP database, this crash happens after any map change

Code:
FTPTcpLink KF-Deck16][-fix.FTPTcpLink (Function ServerPerksMut.FTPTcpLink.OpenDataConnection:010C) gethostbyname failed (NO_ERROR) ... can't get local IP.
FTPTcpLink KF-Deck16][-fix.FTPTcpLink (Function ServerPerksMut.FTPTcpLink.OpenDataConnection:010C) gethostbyname failed (NO_ERROR) ... can't get local IP.
FTPTcpLink KF-Deck16][-fix.FTPTcpLink (Function ServerPerksMut.FTPTcpLink.OpenDataConnection:010C) gethostbyname failed (NO_ERROR) ... can't get local IP.
FTPTcpLink KF-Deck16][-fix.FTPTcpLink (Function ServerPerksMut.FTPTcpLink.OpenDataConnection:010C) gethostbyname failed (NO_ERROR) ... can't get local IP.
FTPTcpLink KF-Deck16][-fix.FTPTcpLink (Function ServerPerksMut.FTPTcpLink.OpenDataConnection:010C) BindPort: bind failed
Open: An error occured while attempting to connect: 88
FTPTcpLink KF-Deck16][-fix.FTPTcpLink (Function ServerPerksMut.FTPTcpLink.OpenDataConnection:010C) gethostbyname failed (NO_ERROR) ... can't get local IP.
Unknown FTP code '221': Goodbye.
Close TcpipConnection 76.122.62.238:61878 Mon Dec  9 12:09:11 2013
Open myLevel Mon Dec  9 12:09:21 2013 76.122.62.238:61878
Close TcpipConnection 96.227.235.58:55983 Mon Dec  9 12:09:29 2013
Close TcpipConnection 96.59.235.148:59668 Mon Dec  9 12:09:35 2013
ProcessServerTravel: KF-Mario_Bunker?Game=TwistedSPerks.ForrestGametype?Mutator=MutLoader.MutLoader?Difficulty=5
PreClientTravel
Server switch level: KF-Mario_Bunker?Game=TwistedSPerks.ForrestGametype?Mutator=MutLoader.MutLoader?Difficulty=5
Browse: KF-Mario_Bunker?Name=KFPlayer?Class=Engine.Pawn?Character=Corporal_Lewis?team=1?Sex=M?Game=TwistedSPerks.ForrestGametype?VACSecured=true?Mutator=MutLoader.MutLoader?CM=1?Difficulty=5
Close TcpipConnection 161.45.13.164:49446 Mon Dec  9 12:10:08 2013
Bugsy logged out.
Close TcpipConnection 98.114.198.23:52086 Mon Dec  9 12:10:08 2013
Close TcpipConnection 70.190.217.220:61308 Mon Dec  9 12:10:08 2013
Close TcpipConnection 94.41.94.214:53467 Mon Dec  9 12:10:08 2013
Close TcpipConnection 87.101.76.246:41706 Mon Dec  9 12:10:08 2013
Game WON
Close TcpipConnection 81.225.162.193:59129 Mon Dec  9 12:10:08 2013
Close TcpipConnection 94.215.54.67:54407 Mon Dec  9 12:10:08 2013
Close TcpipConnection 76.122.62.238:61878 Mon Dec  9 12:10:08 2013
Socket shut down
seek Failed 64795/3114363: 3114363 0
Executing UObject::StaticShutdownAfterError
seek Failed 64795/3114363: 3114363 0

History: 

Exiting due to error
Exiting.
FileManager: Reading 0 GByte 1003 MByte 59 KByte 59 Bytes from HD took 2.851858 seconds (1.759530 reading, 1.092327 seeking).
FileManager: 0.000000 seconds spent with misc. duties
Name subsystem shut down
 
Upvote 0
Setting up basic FTP server is simple both under Windows or Linux. If your all KF servers are running on one machine, then it is the best to set up FTP server on the same machine too without opening any extra ports in firewall.

But if you have only one server, then using the old good ServerPerksStat.ini is the best choice for you imo.
 
Upvote 0
  • Set RemotePort=21 (default for FTP or whatever your FTP server uses).

Just a note for those considering setting up a remote FTP server for SP stats, I don't recommend using the default port. A more secure solution is to choose an unused port in the registered range (1024-49151), since FTP is a commonly targeted service.

If you don't know how to do this, then I'd stick with defaults.
 
Upvote 0
poosh: я так понял ServerPerksHost больше не получится использовать? только фтп?
если да, то подскажи фтп хороший :) буду пробовать ставить...

И о переносе статистики из Data.ini подробнее можно рассказать? :)
 
Upvote 0
poosh: я так понял ServerPerksHost больше не получится использовать? только фтп?
если да, то подскажи фтп хороший :) буду пробовать ставить...

И о переносе статистики из Data.ini подробнее можно рассказать? :)

По-видимому, у всех такая проблемма, что ServerPerks v7 не работает с ServerPerksHost. Но это баг, и я надеюсь, что он будет исправлен.


English:
I said that I seems like ServerPerks v7 doesn't work with ServerPerksHost. But this is a bug and I hope it'll be fixed.
 
Upvote 0
Getting a odd crash when using the FTP database, this crash happens after any map change

Code:
FTPTcpLink KF-Deck16][-fix.FTPTcpLink (Function ServerPerksMut.FTPTcpLink.OpenDataConnection:010C) gethostbyname failed (NO_ERROR) ... can't get local IP.
FTPTcpLink KF-Deck16][-fix.FTPTcpLink (Function ServerPerksMut.FTPTcpLink.OpenDataConnection:010C) gethostbyname failed (NO_ERROR) ... can't get local IP.
FTPTcpLink KF-Deck16][-fix.FTPTcpLink (Function ServerPerksMut.FTPTcpLink.OpenDataConnection:010C) gethostbyname failed (NO_ERROR) ... can't get local IP.
FTPTcpLink KF-Deck16][-fix.FTPTcpLink (Function ServerPerksMut.FTPTcpLink.OpenDataConnection:010C) gethostbyname failed (NO_ERROR) ... can't get local IP.
FTPTcpLink KF-Deck16][-fix.FTPTcpLink (Function ServerPerksMut.FTPTcpLink.OpenDataConnection:010C) BindPort: bind failed
Open: An error occured while attempting to connect: 88
FTPTcpLink KF-Deck16][-fix.FTPTcpLink (Function ServerPerksMut.FTPTcpLink.OpenDataConnection:010C) gethostbyname failed (NO_ERROR) ... can't get local IP.
Unknown FTP code '221': Goodbye.
Close TcpipConnection 76.122.62.238:61878 Mon Dec  9 12:09:11 2013
Open myLevel Mon Dec  9 12:09:21 2013 76.122.62.238:61878
Close TcpipConnection 96.227.235.58:55983 Mon Dec  9 12:09:29 2013
Close TcpipConnection 96.59.235.148:59668 Mon Dec  9 12:09:35 2013
ProcessServerTravel: KF-Mario_Bunker?Game=TwistedSPerks.ForrestGametype?Mutator=MutLoader.MutLoader?Difficulty=5
PreClientTravel
Server switch level: KF-Mario_Bunker?Game=TwistedSPerks.ForrestGametype?Mutator=MutLoader.MutLoader?Difficulty=5
Browse: KF-Mario_Bunker?Name=KFPlayer?Class=Engine.Pawn?Character=Corporal_Lewis?team=1?Sex=M?Game=TwistedSPerks.ForrestGametype?VACSecured=true?Mutator=MutLoader.MutLoader?CM=1?Difficulty=5
Close TcpipConnection 161.45.13.164:49446 Mon Dec  9 12:10:08 2013
Bugsy logged out.
Close TcpipConnection 98.114.198.23:52086 Mon Dec  9 12:10:08 2013
Close TcpipConnection 70.190.217.220:61308 Mon Dec  9 12:10:08 2013
Close TcpipConnection 94.41.94.214:53467 Mon Dec  9 12:10:08 2013
Close TcpipConnection 87.101.76.246:41706 Mon Dec  9 12:10:08 2013
Game WON
Close TcpipConnection 81.225.162.193:59129 Mon Dec  9 12:10:08 2013
Close TcpipConnection 94.215.54.67:54407 Mon Dec  9 12:10:08 2013
Close TcpipConnection 76.122.62.238:61878 Mon Dec  9 12:10:08 2013
Socket shut down
seek Failed 64795/3114363: 3114363 0
Executing UObject::StaticShutdownAfterError
seek Failed 64795/3114363: 3114363 0

History: 

Exiting due to error
Exiting.
FileManager: Reading 0 GByte 1003 MByte 59 KByte 59 Bytes from HD took 2.851858 seconds (1.759530 reading, 1.092327 seeking).
FileManager: 0.000000 seconds spent with misc. duties
Name subsystem shut down

That is not the only thing happening on your server, you are also getting errors popping up inside the server
 
Upvote 0