sv_neo_restore_... - Give XP/deaths to players, restore from backup#1880
sv_neo_restore_... - Give XP/deaths to players, restore from backup#1880nullsystem wants to merge 3 commits into
sv_neo_restore_... - Give XP/deaths to players, restore from backup#1880Conversation
ab33a72 to
5b230b8
Compare
.givexp/.givexpall - Give XP to players from authorized spec …sv_neo_force_... - Give XP/deaths to players, restore from backup
5b230b8 to
470e8ff
Compare
sv_neo_force_... - Give XP/deaths to players, restore from backupsv_neo_restore_... - Give XP/deaths to players, restore from backup
d228e68 to
565f240
Compare
6bff179 to
00bfcda
Compare
ae245ea to
9851d32
Compare
Native implementation of XP/deaths restoration, with an extra to automatically backup and manually restore whole session. ConVars: * `sv_neo_restore_xp_death_any_round` - Allow setting XP/session anytime * `sv_neo_restore_session_allow_name_match` - Allow name matching in session restore Commands: * `sv_neo_restore_session` - Restore entire session from backup * `sv_neo_restore_round_number` - Force round number * `sv_neo_restore_rounds_won` - Force Jinrai/NSF rounds won * `sv_neo_restore_team_scores` - Force Jinrai/NSF scores * `sv_neo_restore_xp` - Force XP on a player * fixes NeotokyoRebuild#1878
9851d32 to
10740de
Compare
|
We already have commands for setting team score introduced in #1638. Might want to remove those to avoid confusion? |
| static inline bool InLiveState() | ||
| { | ||
| return (NEORules()->GetRoundStatus() == RoundLive || NEORules()->GetRoundStatus() == PostRound); | ||
| } |
There was a problem hiding this comment.
Would it make more sense to put the above two in neo_gamerules?
| { | ||
| if (iRoundNumber < 0) | ||
| { | ||
| Msg("%s: error: Cannot have negative round number\n", pszFuncName); |
There was a problem hiding this comment.
Use void Error(const tchar *pMsg, ...) for error messages
There was a problem hiding this comment.
Just thought id note may not want to use error for this case and the ones below unless you actually think it should stop the program, warning is probably better
There was a problem hiding this comment.
if error is the really dark red one and warning the light red one then yeah warning is probably better
There was a problem hiding this comment.
ah i see Error doesn't return
| { | ||
| if (iRoundsWonJinrai < 0 || iRoundsWonNSF < 0) | ||
| { | ||
| Msg("%s: error: Cannot have negative rounds won\n", pszFuncName); |
There was a problem hiding this comment.
ditto void Error(const tchar *pMsg, ...)
| { | ||
| if (false == sv_neo_restore_xp_death_any_round.GetBool() && false == InReadyUpState()) | ||
| { | ||
| Msg("%s: error: Cannot set XPs if not idle and in a ready up lobby\n", __func__); |
There was a problem hiding this comment.
ditto void Error(const tchar *pMsg, ...)
| KeyValues *kv = new KeyValues(GIVEXP_SESSION_RESTORE_KV_ROOT); | ||
| if (false == kv->LoadFromFile(g_pFullFileSystem, "scripts/" GIVEXP_SESSION_RESTORE_FNAME)) | ||
| { | ||
| Msg("%s: error: No restore session file found\n", __func__); |
There was a problem hiding this comment.
ditto void Error(const tchar *pMsg, ...)
|
|
||
| const char *pszNameFind = args[1]; | ||
| const int iXP = V_atoi(args[2]); | ||
| if (false == IN_BETWEEN_EQ(-99, iXP, 1000)) |
| { | ||
| Msg((iDeaths < 0) | ||
| ? "%s: error: Death count must be positive\n" | ||
| : "%s: error: Unresonable death count\n" |
| const int iDeaths = (args.ArgC() == 4) ? V_atoi(args[3]) : -1; | ||
| if (4 == args.ArgC() && false == IN_BETWEEN_EQ(0, iDeaths, 1000)) | ||
| { | ||
| Msg((iDeaths < 0) |
There was a problem hiding this comment.
ditto void Error(const tchar *pMsg, ...)
|
|
||
| if (false == sv_neo_restore_xp_death_any_round.GetBool() && false == InReadyUpState()) | ||
| { | ||
| Msg("%s: error: Cannot set XPs if not idle and in a ready up lobby\n", __func__); |
There was a problem hiding this comment.
ditto void Error(const tchar *pMsg, ...)
| } | ||
| } | ||
|
|
||
| Msg("%s: error: Cannot find player \"%s\"\n", __func__, pszNameFind); |
There was a problem hiding this comment.
ditto void Error(const tchar *pMsg, ...)
Description
Native implementation of XP/deaths restoration, with an extra to automatically backup and manually restore whole session.
ConVars:
sv_neo_restore_xp_death_any_round- Allow setting XP/session anytimesv_neo_restore_session_allow_name_match- Allow name matchingin session restore
Commands:
sv_neo_restore_session- Restore entire session from backupsv_neo_restore_round_number- Force round numbersv_neo_restore_rounds_won- Force Jinrai/NSF rounds wonsv_neo_restore_team_scores- Force Jinrai/NSF scoressv_neo_restore_xp- Force XP on a playerRemoved commands:
sv_neo_score_set_[jinrai/nsf]- Replaced bysv_neo_restore_...equivalentToolchain
Linked Issues