Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Shtoyan committed Apr 13, 2023
0 parents commit 1a9133e
Show file tree
Hide file tree
Showing 3 changed files with 739 additions and 0 deletions.
29 changes: 29 additions & 0 deletions Classes/CustomServerDetailsExtension.uc
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// CustomServerDetails Extension example
// Author : Shtoyan
// Home Repo : https://github.com/InsultingPros/CustomServerDetailsExtension
// License : https://www.gnu.org/licenses/gpl-3.0.en.html
class CustomServerDetailsExtension extends base_GR;

function getServerDetails(out GameInfo.serverResponseLine serverState) {
// let's inject game difficulty to server info
if (kfgt != none) {
addSD(serverState, "Difficulty", GetDifficultyName(kfgt.GameDifficulty));
}
}

private final function string GetDifficultyName(float GameDifficulty) {
switch (GameDifficulty) {
case 1.0:
return "Beginner";
case 2.0:
return "Normal";
case 4.0:
return "Hard";
case 5.0:
return "Suicidal";
case 7.0:
return "HOE";
default:
return "UNKNOWN DIFFICULTY";
}
}
Loading

0 comments on commit 1a9133e

Please sign in to comment.