Skip to content

Commit

Permalink
Player list GeoIP and skip webadmin patches in classic
Browse files Browse the repository at this point in the history
Fixes #59
Fixes #41
  • Loading branch information
bviktor committed Dec 22, 2022
1 parent 86231c1 commit 4995c95
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 27 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

* Add AlmaLinux, Fedora, Ubuntu support
* Remove CentOS support
* Add GeoIP links in webadmin player list
* Port installer and uninstaller to Ansible
* Add `killinuxfloor apply` command
* Update Node.js to 18
Expand Down
54 changes: 33 additions & 21 deletions roles/install/files/serveradmin.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
diff -ruN --strip-trailing-cr ServerAdmin.orig/current_change.html ServerAdmin/current_change.html
--- ServerAdmin.orig/current_change.html 2019-02-02 15:01:14.469571884 +0100
+++ ServerAdmin/current_change.html 2019-02-02 15:01:32.972537118 +0100
diff -ruN ServerAdmin.orig/current_change.html ServerAdmin/current_change.html
--- ServerAdmin.orig/current_change.html 2022-12-22 01:43:19.509416046 +0100
+++ ServerAdmin/current_change.html 2022-12-22 01:43:52.990541726 +0100
@@ -25,13 +25,13 @@
</div>
</fieldset>
Expand Down Expand Up @@ -40,9 +40,9 @@ diff -ruN --strip-trailing-cr ServerAdmin.orig/current_change.html ServerAdmin/c
</div>

<!-- #include file="navigation.inc" -->
diff -ruN --strip-trailing-cr ServerAdmin.orig/current_player_row.inc ServerAdmin/current_player_row.inc
--- ServerAdmin.orig/current_player_row.inc 2019-02-02 15:01:14.476571871 +0100
+++ ServerAdmin/current_player_row.inc 2019-02-02 15:01:32.972537118 +0100
diff -ruN ServerAdmin.orig/current_player_row.inc ServerAdmin/current_player_row.inc
--- ServerAdmin.orig/current_player_row.inc 2022-12-22 01:43:19.509416046 +0100
+++ ServerAdmin/current_player_row.inc 2022-12-22 01:43:52.990541726 +0100
@@ -1,7 +1,7 @@
<tr class="<%evenodd%>">
<td style="background: <%player.teamcolor%>; color: <%player.teamcolor%>;"><%player.teamid%>&#160;</td>
Expand All @@ -52,9 +52,21 @@ diff -ruN --strip-trailing-cr ServerAdmin.orig/current_player_row.inc ServerAdmi
<td class="right"><%player.score%></td>
<td class="right"><%player.pawn.health%></td>
<td class="right"><%player.kills%></td>
diff -ruN --strip-trailing-cr ServerAdmin.orig/current_rules.inc ServerAdmin/current_rules.inc
--- ServerAdmin.orig/current_rules.inc 2019-02-02 15:01:14.475571873 +0100
+++ ServerAdmin/current_rules.inc 2019-02-02 15:01:32.972537118 +0100
diff -ruN ServerAdmin.orig/current_players_row.inc ServerAdmin/current_players_row.inc
--- ServerAdmin.orig/current_players_row.inc 2022-12-22 01:43:19.509416046 +0100
+++ ServerAdmin/current_players_row.inc 2022-12-22 02:12:24.402731660 +0100
@@ -2,7 +2,7 @@
<td style="background: <%player.teamcolor%>; color: <%player.teamcolor%>;"><%player.teamid%>&#160;</td>
<td><%player.name%></td>
<td class="right"><%player.ping%></td>
- <td><%player.ip%></td>
+ <td><a href="https://geoiplookup.net/ip/<%player.ip%>" target="_blank"><%player.ip%></a></td>
<td><%player.uniqueid%></td>
<td><%player.steamid%></td>
<td><%player.steamname%></td>
diff -ruN ServerAdmin.orig/current_rules.inc ServerAdmin/current_rules.inc
--- ServerAdmin.orig/current_rules.inc 2022-12-22 01:43:19.509416046 +0100
+++ ServerAdmin/current_rules.inc 2022-12-22 01:43:52.990541726 +0100
@@ -1,3 +1,7 @@
+<dt>Wave</dt>
+<dd><%wave.num%></dd>
Expand All @@ -63,9 +75,9 @@ diff -ruN --strip-trailing-cr ServerAdmin.orig/current_rules.inc ServerAdmin/cur
<dt>Players</dt>
<dd><%rules.numplayers%>/<%rules.maxplayers%></dd>
<dt>Minimum to Start</dt>
diff -ruN --strip-trailing-cr ServerAdmin.orig/default_maplist.html ServerAdmin/default_maplist.html
--- ServerAdmin.orig/default_maplist.html 2019-02-02 15:01:14.473571876 +0100
+++ ServerAdmin/default_maplist.html 2019-02-02 15:06:59.442923705 +0100
diff -ruN ServerAdmin.orig/default_maplist.html ServerAdmin/default_maplist.html
--- ServerAdmin.orig/default_maplist.html 2022-12-22 01:43:19.509416046 +0100
+++ ServerAdmin/default_maplist.html 2022-12-22 01:43:52.990541726 +0100
@@ -2,6 +2,8 @@

<div id="content">
Expand Down Expand Up @@ -120,9 +132,9 @@ diff -ruN --strip-trailing-cr ServerAdmin.orig/default_maplist.html ServerAdmin/
});

//]]>
diff -ruN --strip-trailing-cr ServerAdmin.orig/gamesummary.inc ServerAdmin/gamesummary.inc
--- ServerAdmin.orig/gamesummary.inc 2019-02-02 15:01:14.471571880 +0100
+++ ServerAdmin/gamesummary.inc 2019-02-02 15:01:32.972537118 +0100
diff -ruN ServerAdmin.orig/gamesummary.inc ServerAdmin/gamesummary.inc
--- ServerAdmin.orig/gamesummary.inc 2022-12-22 01:43:19.509416046 +0100
+++ ServerAdmin/gamesummary.inc 2022-12-22 01:43:52.990541726 +0100
@@ -4,6 +4,8 @@
<dd class="gs_map"><%map.title.safe%></dd>
<dt class="gs_players">Players</dt>
Expand All @@ -135,9 +147,9 @@ diff -ruN --strip-trailing-cr ServerAdmin.orig/gamesummary.inc ServerAdmin/games
+ <dd class="gs_wave"><%wave.monsters.dead%>/<%wave.monsters.total%></dd>
</dl>
\ No newline at end of file
diff -ruN --strip-trailing-cr ServerAdmin.orig/policy_bans.html ServerAdmin/policy_bans.html
--- ServerAdmin.orig/policy_bans.html 2019-02-02 15:01:14.486571852 +0100
+++ ServerAdmin/policy_bans.html 2019-02-02 15:01:32.972537118 +0100
diff -ruN ServerAdmin.orig/policy_bans.html ServerAdmin/policy_bans.html
--- ServerAdmin.orig/policy_bans.html 2022-12-22 01:43:19.509416046 +0100
+++ ServerAdmin/policy_bans.html 2022-12-22 01:43:52.990541726 +0100
@@ -2,6 +2,8 @@

<div id="content">
Expand Down Expand Up @@ -174,9 +186,9 @@ diff -ruN --strip-trailing-cr ServerAdmin.orig/policy_bans.html ServerAdmin/poli

</div>

diff -ruN --strip-trailing-cr ServerAdmin.orig/policy_bans_row.inc ServerAdmin/policy_bans_row.inc
--- ServerAdmin.orig/policy_bans_row.inc 2019-02-02 15:01:14.484571856 +0100
+++ ServerAdmin/policy_bans_row.inc 2019-02-02 15:01:32.972537118 +0100
diff -ruN ServerAdmin.orig/policy_bans_row.inc ServerAdmin/policy_bans_row.inc
--- ServerAdmin.orig/policy_bans_row.inc 2022-12-22 01:43:19.509416046 +0100
+++ ServerAdmin/policy_bans_row.inc 2022-12-22 01:43:52.990541726 +0100
@@ -1,15 +1,15 @@
<tr>
<!--<td><%ban.playername%></td>-->
Expand Down
12 changes: 6 additions & 6 deletions roles/install/tasks/systemd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
state: latest

- name: Install KF2 services
copy:
src: "{{ item }}"
dest: "/etc/systemd/system/{{ item }}"
template:
src: "{{ item }}.service.j2"
dest: "/etc/systemd/system/{{ item }}.service"
owner: root
group: root
mode: '0644'
loop:
- kf2.service
- kf2autokick.service
- kf2watchdog.service
- kf2
- kf2autokick
- kf2watchdog
notify: Reload systemd configuration

- name: Prepare systemd folder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ StandardOutput=file:/home/steam/Steam/logs/kf2.txt
# nevermind, the + preffix runs the command with full privileges
# prefer truncate, that way klf log keeps working even after a service restart
ExecStartPre=+/usr/bin/truncate --size=0 /home/steam/Steam/logs/kf2.txt
{% if not kf2_classic %}
# make sure our patches work, wildcards are prohibited so use subshell
ExecStartPre=/bin/sh -c '/bin/dos2unix /home/steam/Steam/KF2Server/KFGame/Web/ServerAdmin/*'
# apply the patch, ignore if already applied
ExecStartPre=-/bin/patch --forward -r /tmp/kf2-patch.rej -p1 -d /home/steam/Steam/KF2Server/KFGame/Web/ServerAdmin -i /etc/systemd/system/kf2.service.d/serveradmin.patch
{% endif %}
# make sure KF2 uses the Steam provided library, not the ones it bundles
ExecStartPre=/bin/ln -sTf /home/steam/Steam/linux64/steamclient.so /home/steam/Steam/KF2Server/Binaries/Win64/lib64/steamclient.so
# these appear to be gone, thankfully
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 4995c95

Please sign in to comment.