Skip to content

Commit 815ff2d

Browse files
authored
Merge branch 'master' into vscript
2 parents 1c8a507 + 309cdf3 commit 815ff2d

File tree

17 files changed

+307
-60
lines changed

17 files changed

+307
-60
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ jobs:
3939
wget https://github.com/FortyTwoFortyTwo/VScript/archive/refs/tags/1.10.0.90.tar.gz
4040
tar --strip-components=1 -xvzf 1.10.0.90.tar.gz -C addons/sourcemod
4141
rm -rf *.zip *.tar.gz addons/sourcemod/{.git*,LICENSE,plugins,scripts,scripting/vscript_test.sp,README.md}
42+
rm -rf *.zip *.tar.gz addons/sourcemod/.git* addons/sourcemod/LICENSE
43+
wget https://github.com/srcwr/eventqueuefixfix/releases/download/v1.0.1/eventqueuefixfix-v1.0.1-def5b0e-windows-x32.zip
44+
unzip eventqueuefixfix-v1.0.1-def5b0e-windows-x32.zip "addons/sourcemod/extensions/*"
45+
rm "addons/sourcemod/extensions/eventqueuefixfix.pdb"
46+
wget https://github.com/srcwr/srcwrfloppy/releases/download/v2.0.3/srcwrfloppy-v2.0.3.zip
47+
unzip -qO UTF-8 srcwrfloppy-v2.0.3.zip "addons/sourcemod/extensions/*"
48+
rm "addons/sourcemod/extensions/srcwr💾.pdb"
4249
4350
- name: Run compiler
4451
shell: bash

CHANGELOG.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,16 @@ Note: Dates are UTC+0.
33

44

55

6-
# v3.?.? - ? - 2025-06-?? - rtldg
7-
- shavit-mapchooser timerified (more) https://github.com/shavitush/bhoptimer/pull/1242 @mourningsickness
6+
# v3.?.? - ? - 2025-0?-? - rtldg
7+
what will go here? hmm i wonder... maybe vscript pull request? maybe updating tf2 gamedata because i forgot? who knows...
8+
9+
10+
11+
# v3.5.1 - small things - 2025-06-24 - rtldg
12+
- fix olivia's name in the author lists https://github.com/shavitush/bhoptimer/commit/f0ccf6dc0aa45aa72d7c428d5c8866aae28467e4
13+
- shavit-wr.sp - add back buttons to !delete menus (QoL) https://github.com/shavitush/bhoptimer/commit/877b71aa4d8a7735ee0eec189dd0ef6a72249180 @mourningsickness @rtldg
14+
- Keep all menus open forever https://github.com/shavitush/bhoptimer/commit/bb09568d9797b61b1a0cd290b56545f8a928b8e8
15+
- a few that were missed in a pass a couple years ago
816

917

1018

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ Includes a records system, map zones (start/end marks etc), bonuses, HUD with us
2525
* [eventqueuefix](https://github.com/hermansimensen/eventqueue-fix)
2626
* Allows for timescaling boosters and is used to fix some exploits. (Use this instead of `boosterfix`)
2727
* (included in bhoptimer release zips)
28+
* Along with using [eventqueuefixfix](https://github.com/srcwr/eventqueuefixfix) at the same time to fix eventqueuefix on Windows after the 2025-02-18 update.
29+
* [srcwr💾](https://github.com/srcwr/srcwrfloppy)
30+
* Saves replays asynchronously (read: doesn't lag the server when saving a replay).
31+
* (included in bhoptimer release zips)
2832
* [SteamWorks](https://forums.alliedmods.net/showthread.php?t=229556)
2933
* Used to grab `{serverip}` in advertisements.
3034
* [DynamicChannels](https://github.com/Vauff/DynamicChannels)

addons/sourcemod/gamedata/shavit.games.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,13 @@
162162
}
163163
// search "sv_maxusrcmdprocessticks_warning at server" to find CPlayerMove::RunCommand
164164
// then sig the the `mov REG1,dword ptr [REG2 + OFFSET_TO_BUTTON_DISABLED_HERE]`
165+
// looks like these in decompiled form:
166+
// (windows) `param_3[0xc] = param_3[0xc] & ~param_2[0x32b];`
167+
// (linux) `*(uint *)(param_3 + 0x30) = uVar12 & ~param_2[0x331];`
165168
"CBasePlayer->m_afButtonDisabled"
166169
{
167-
"windows" "\x8B\x87\x2A\x2A\x2A\x2A\xF7\xD0\x21\x43"
168-
"linux" "\x8B\x83\x2A\x2A\x2A\x2A\xF7\xD0"
170+
"windows" "\x8B\x86\x2A\x2A\x2A\x2A\xF7\xD0\x21\x47"
171+
"linux" "\x8b\x93\x2A\x2A\x2A\x2A\xF7\xD2\x21\xd0"
169172
}
170173
}
171174
}

addons/sourcemod/scripting/include/shavit/checkpoints.inc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* shavit's Timer - Checkpoints
3-
* by: shavit, kidfearless, Nairda, GAMMA CASE, rtldg, sh4hrazad, Ciallo-Ani, OliviaMourning
3+
* by: shavit, kidfearless, Nairda, GAMMA CASE, rtldg, sh4hrazad, Ciallo-Ani, olivia
44
*
55
* This file is part of shavit's Timer (https://github.com/shavitush/bhoptimer)
66
*
@@ -301,10 +301,11 @@ native bool Shavit_LoadCheckpointCache(int client, any[] cache, int index, int s
301301
* @param cache Output cp_cache_t
302302
* @param index -1 if you want the cp_cache_t to be saved as "persistent data". 0 if not. greater-than-zero if you what you're doing and intentionally want to spoof the cp_cache_t creation as a checkpoint index for some reason... I recommend looking at shavit-checkpoints.sp to see how "index" and "isPersistentData" are used to see what kind of difference there is.
303303
* @param size sizeof(cp_cache_t) to mostly ensure the calling plugin has a matching cp_cache_t.
304+
* @param saveReplay Whether or not replay frames will be saved.
304305
*
305306
* @noreturn
306307
*/
307-
native void Shavit_SaveCheckpointCache(int saver, int target, any[] cache, int index, int size = sizeof(cp_cache_t));
308+
native void Shavit_SaveCheckpointCache(int saver, int target, any[] cache, int index, int size = sizeof(cp_cache_t), bool saveReplay = false);
308309

309310
public SharedPlugin __pl_shavit_checkpoints =
310311
{

addons/sourcemod/scripting/include/shavit/core.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#endif
2525
#define _shavit_core_included
2626

27-
#define SHAVIT_VERSION "3.5.1a"
27+
#define SHAVIT_VERSION "3.5.2a"
2828
#define STYLE_LIMIT 256
2929

3030
// god i fucking hate sourcemod. NULL_VECTOR isn't const so it's not guaranteed to be 0,0,0

addons/sourcemod/scripting/include/shavit/replay-file.inc

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,35 @@ stock void WriteReplayHeader(File fFile, int style, int track, float time, int s
365365
fFile.WriteInt32(view_as<int>(fZoneOffset[1]));
366366
}
367367

368+
stock void cell2buf(char[] buf, int& pos, int cell)
369+
{
370+
buf[pos++] = cell & 0xFF;
371+
buf[pos++] = (cell >> 8) & 0xFF;
372+
buf[pos++] = (cell >> 16) & 0xFF;
373+
buf[pos++] = (cell >> 24) & 0xFF;
374+
}
375+
376+
stock int WriteReplayHeaderToBuffer(char[] buf, int style, int track, float time, int steamid, int preframes, int postframes, float fZoneOffset[2], int totalframes, float tickrate, const char[] sMap)
377+
{
378+
int pos = FormatEx(buf, 512, "%d:%s\n%s", REPLAY_FORMAT_SUBVERSION, REPLAY_FORMAT_FINAL, sMap);
379+
pos += 1; // skip past NUL
380+
buf[pos++] = style & 0xFF;
381+
buf[pos++] = track & 0xFF;
382+
cell2buf(buf, pos, preframes);
383+
384+
cell2buf(buf, pos, totalframes - preframes - postframes);
385+
cell2buf(buf, pos, view_as<int>(time));
386+
cell2buf(buf, pos, steamid);
387+
388+
cell2buf(buf, pos, postframes);
389+
cell2buf(buf, pos, view_as<int>(tickrate));
390+
391+
cell2buf(buf, pos, view_as<int>(fZoneOffset[0]));
392+
cell2buf(buf, pos, view_as<int>(fZoneOffset[1]));
393+
394+
return pos;
395+
}
396+
368397
// file_a is usually used as the wr replay file.
369398
// file_b is usually used as the duplicate/backup replay file.
370399
stock void WriteReplayFrames(ArrayList playerrecording, int iSize, File file_a, File file_b)

addons/sourcemod/scripting/include/shavit/replay-recorder.inc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,9 @@ forward Action Shavit_ShouldSaveReplayCopy(int client, int style, float time, in
4848

4949
/**
5050
* Called when either a WR replay or a copy of a replay has been saved.
51+
* NOTE: Can be called with a delay after a run is finished due to asynchronous replay saving through extensions.
5152
*
52-
* @param client Client index.
53+
* @param client Client index. Can be 0 if the replay was saved asynchronously & the client disconnected super duper quick...
5354
* @param style Style the record was done on.
5455
* @param time Record time.
5556
* @param jumps Jumps amount.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// SPDX-License-Identifier: GPL-3.0-or-later
2+
// Copyright 2025 rtldg <rtldg@protonmail.com>
3+
4+
#if defined _srcwrfloppy_included
5+
#endinput
6+
#endif
7+
#define _srcwrfloppy_included
8+
#pragma semicolon 1
9+
10+
11+
typeset ReplaySavedCallback {
12+
function void(bool saved, any value, char[] sPath);
13+
}
14+
15+
16+
// Don't modify the `playerrecording` ArrayList until the ReplaySavedCallback is called... OR ELSE!!!!
17+
native void SRCWRFloppy_AsyncSaveReplay(
18+
ReplaySavedCallback callback // what to call when saved
19+
, any value // what to pass along to the callback
20+
, char[] wrpath
21+
, char[] copypath
22+
, char[] header
23+
, int headersize
24+
, ArrayList playerrecording
25+
, int totalframes
26+
);
27+
28+
29+
public Extension __ext_srcwrfloppy =
30+
{
31+
name = "srcwr💾",
32+
file = "srcwr💾.ext",
33+
#if defined AUTOLOAD_EXTENSIONS
34+
autoload = 1,
35+
#else
36+
autoload = 0,
37+
#endif
38+
#if defined REQUIRE_EXTENSIONS
39+
required = 1,
40+
#else
41+
required = 0,
42+
#endif
43+
};
44+
45+
#if !defined REQUIRE_EXTENSIONS
46+
public void __ext_srcwrfloppy_SetNTVOptional()
47+
{
48+
MarkNativeAsOptional("SRCWRFloppy_AsyncSaveReplay");
49+
}
50+
#endif

addons/sourcemod/scripting/shavit-checkpoints.sp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* shavit's Timer - Checkpoints
3-
* by: shavit, kidfearless, Nairda, GAMMA CASE, rumour, rtldg, sh4hrazad, Ciallo-Ani, OliviaMourning, Nuko, yupi2
3+
* by: shavit, kidfearless, Nairda, GAMMA CASE, rumour, rtldg, sh4hrazad, Ciallo-Ani, olivia, Nuko, yupi2
44
*
55
* This file is part of shavit's Timer (https://github.com/shavitush/bhoptimer)
66
*
@@ -132,7 +132,7 @@ StringMap gH_VScript_Checkpoint_CustomData[MAXPLAYERS+1];
132132
public Plugin myinfo =
133133
{
134134
name = "[shavit] Checkpoints",
135-
author = "shavit, KiD Fearless, Nairda, GAMMA CASE, rumour, rtldg, sh4hrazad, Ciallo-Ani, OliviaMourning, Nuko, yupi2",
135+
author = "shavit, KiD Fearless, Nairda, GAMMA CASE, rumour, rtldg, sh4hrazad, Ciallo-Ani, olivia, Nuko, yupi2",
136136
description = "Checkpoints for shavit's bhop timer.",
137137
version = SHAVIT_VERSION,
138138
url = "https://github.com/shavitush/bhoptimer"
@@ -1602,7 +1602,7 @@ bool SaveCheckpoint(int client, bool duplicate = false)
16021602
return true;
16031603
}
16041604

1605-
void SaveCheckpointCache(int saver, int target, cp_cache_t cpcache, int index, Handle plugin)
1605+
void SaveCheckpointCache(int saver, int target, cp_cache_t cpcache, int index, Handle plugin, bool saveReplay = false)
16061606
{
16071607
GetClientAbsOrigin(target, cpcache.fPosition);
16081608
GetClientEyeAngles(target, cpcache.fAngles);
@@ -1716,7 +1716,7 @@ void SaveCheckpointCache(int saver, int target, cp_cache_t cpcache, int index, H
17161716
cpcache.aSnapshot = snapshot;
17171717
cpcache.bSegmented = CanSegment(target);
17181718

1719-
if (cpcache.bSegmented && gB_ReplayRecorder && index != -1 && cpcache.aFrames == null)
1719+
if (saveReplay || (cpcache.bSegmented && gB_ReplayRecorder && index != -1 && cpcache.aFrames == null))
17201720
{
17211721
ArrayList frames = Shavit_GetReplayData(target, false);
17221722

@@ -2286,7 +2286,8 @@ public any Native_SaveCheckpointCache(Handle plugin, int numParams)
22862286
int target = GetNativeCell(2);
22872287
cp_cache_t cache;
22882288
int index = GetNativeCell(4);
2289-
SaveCheckpointCache(saver, target, cache, index, plugin);
2289+
bool saveReplay = (numParams >= 6 && GetNativeCell(5));
2290+
SaveCheckpointCache(saver, target, cache, index, plugin, saveReplay);
22902291
return SetNativeArray(3, cache, sizeof(cp_cache_t));
22912292
}
22922293

0 commit comments

Comments
 (0)