Skip to content

Commit

Permalink
fix: NetMessages after game update
Browse files Browse the repository at this point in the history
Thanks Nanoman for reporting this
  • Loading branch information
ThisAMJ committed Jun 5, 2024
1 parent c14c604 commit 6c743a9
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
11 changes: 9 additions & 2 deletions docs/cvars.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
|sar_cheat_hud|1|Display a warning in the HUD when cheats are active. 0 = disable, 1 = display if sv_cheats off, 2 = display always|
|sar_cheat_hud_x|-4|X position of the cheat warning HUD.|
|sar_cheat_hud_y|4|Y position of the cheat warning HUD.|
|sar_check_update|cmd|sar_check_update [release\|pre] - check whether the latest version of SAR is being used|
|sar_check_update|cmd|sar_check_update [release\|pre\|canary] - check whether the latest version of SAR is being used|
|sar_clear_lines|cmd|sar_clear_lines - clears all active drawline overlays|
|sar_cm_rightwarp|0|Fix CM wrongwarp.|
|sar_command_debug|0|Output debugging information to the console related to commands. **Breaks svar_capture**|
Expand Down Expand Up @@ -358,6 +358,12 @@
|sar_on_pb|cmd|sar_on_pb \<command> [args]... - registers a command to be run when auto-submitter detects PB|
|sar_on_pb_clear|cmd|sar_on_pb_clear - clears commands registered on event "pb"|
|sar_on_pb_list|cmd|sar_on_pb_list - lists commands registered on event "pb"|
|sar_on_renderer_finish|cmd|sar_on_renderer_finish \<command> [args]... - registers a command to be run when renderer finishes|
|sar_on_renderer_finish_clear|cmd|sar_on_renderer_finish_clear - clears commands registered on event "renderer_finish"|
|sar_on_renderer_finish_list|cmd|sar_on_renderer_finish_list - lists commands registered on event "renderer_finish"|
|sar_on_renderer_start|cmd|sar_on_renderer_start \<command> [args]... - registers a command to be run when renderer starts|
|sar_on_renderer_start_clear|cmd|sar_on_renderer_start_clear - clears commands registered on event "renderer_start"|
|sar_on_renderer_start_list|cmd|sar_on_renderer_start_list - lists commands registered on event "renderer_start"|
|sar_on_session_end|cmd|sar_on_session_end \<command> [args]... - registers a command to be run on session end|
|sar_on_session_end_clear|cmd|sar_on_session_end_clear - clears commands registered on event "session_end"|
|sar_on_session_end_list|cmd|sar_on_session_end_list - lists commands registered on event "session_end"|
Expand Down Expand Up @@ -595,7 +601,8 @@
|sar_trace_teleport_eye|cmd|sar_trace_teleport_eye \<tick> [player slot] [trace name] - teleports the player to the eye position at the given trace tick on the given trace (defaults to hovered one or the first one ever made) in the given slot (defaults to 0).|
|sar_trace_use_shot_eyeoffset|1|Uses eye offset and angles accurate for portal shooting.|
|sar_transition_timer|0|Output how slow your dialogue fade was.|
|sar_update|cmd|sar_update [release\|pre] [exit] [force] - update SAR to the latest version. If exit is given, exit the game upon successful update; if force is given, always re-install, even if it may be a downgrade|
|sar_unlocked_chapters|-1|Max unlocked chapter.|
|sar_update|cmd|sar_update [release\|pre\|canary] [exit] [force] - update SAR to the latest version. If exit is given, exit the game upon successful update; if force is given, always re-install, even if it may be a downgrade|
|sar_velocitygraph|0|Shows velocity graph.|
|sar_velocitygraph_background|0|Background of velocity graph.|
|sar_velocitygraph_font_index|21|Font index of velocity graph.|
Expand Down
3 changes: 3 additions & 0 deletions src/Features/Cvars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ void Cvars::Lock() {
gameui_preventescape.Lock();
setpause.Lock();
snd_ducktovolume.Lock();
say.Lock();

this->locked = true;
}
Expand Down Expand Up @@ -286,13 +287,15 @@ void Cvars::Unlock() {
gameui_preventescape.Unlock(false);
setpause.Unlock(false);
snd_ducktovolume.Unlock(false);
say.Unlock(false);
soundfade.AddFlag(FCVAR_CLIENTCMD_CAN_EXECUTE);
leaderboard_open.AddFlag(FCVAR_CLIENTCMD_CAN_EXECUTE | FCVAR_SERVER_CAN_EXECUTE);
gameui_activate.AddFlag(FCVAR_CLIENTCMD_CAN_EXECUTE | FCVAR_SERVER_CAN_EXECUTE);
gameui_allowescape.AddFlag(FCVAR_CLIENTCMD_CAN_EXECUTE | FCVAR_SERVER_CAN_EXECUTE);
gameui_preventescape.AddFlag(FCVAR_CLIENTCMD_CAN_EXECUTE | FCVAR_SERVER_CAN_EXECUTE);
setpause.AddFlag(FCVAR_SERVER_CAN_EXECUTE);
snd_ducktovolume.AddFlag(FCVAR_SERVER_CAN_EXECUTE);
say.AddFlag(FCVAR_CLIENTCMD_CAN_EXECUTE | FCVAR_SERVER_CAN_EXECUTE);

this->locked = false;
}
Expand Down
3 changes: 3 additions & 0 deletions src/Modules/Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,15 @@ Variable r_PortalTestEnts;
Variable r_portalsopenall;
Variable r_drawviewmodel;

// some of these are actually commands but that's fine, dw about it :)
Variable soundfade;
Variable leaderboard_open;
Variable gameui_activate;
Variable gameui_allowescape;
Variable gameui_preventescape;
Variable setpause;
Variable snd_ducktovolume;
Variable say;

Variable sar_disable_coop_score_hud("sar_disable_coop_score_hud", "0", "Disables the coop score HUD which appears in demo playback.\n");
Variable sar_disable_save_status_hud("sar_disable_save_status_hud", "0", "Disables the saving/saved HUD which appears when you make a save.\n");
Expand Down Expand Up @@ -1091,6 +1093,7 @@ bool Client::Init() {
gameui_preventescape = Variable("gameui_preventescape");
setpause = Variable("setpause");
snd_ducktovolume = Variable("snd_ducktovolume");
say = Variable("say");

CVAR_HOOK_AND_CALLBACK(cl_fov);

Expand Down
1 change: 1 addition & 0 deletions src/Modules/Client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,5 +195,6 @@ extern Variable gameui_allowescape;
extern Variable gameui_preventescape;
extern Variable setpause;
extern Variable snd_ducktovolume;
extern Variable say;

extern Command sar_workshop_skip;

0 comments on commit 6c743a9

Please sign in to comment.