-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 1a9133e
Showing
3 changed files
with
739 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"; | ||
} | ||
} |
Oops, something went wrong.