Skip to content

Commit 1800d85

Browse files
Plugin update, color fixes
1 parent d97b09a commit 1800d85

File tree

2 files changed

+38
-29
lines changed

2 files changed

+38
-29
lines changed

PLUGIN/plugin.sma

Lines changed: 33 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,15 @@
99

1010
#define PLUGIN "Unreal Demo Plugin"
1111
#define AUTHOR "karaulov"
12-
#define VERSION "1.62"
12+
#define VERSION "1.63"
1313

1414
// IF NEED REDUCE TRAFFIC USAGE UNCOMMENT THIS LINE
1515
// ЕСЛИ НЕОБХОДИМО БОЛЬШЕ ДЕТЕКТОВ (НО ТАК ЖЕ БОЛЬШЕ ТРАФИКА) ЗАКОММЕНТИРУЙТЕ ЭТУ СТРОКУ
1616
#define SMALL_TRAFFIC
1717

1818
new g_iDemoHelperInitStage[33] = {0,...};
1919
new g_iFrameNum[33] = {0,...};
20+
new g_iJumpCount[33] = {0,...};
2021
new g_bNeedResend[33] = {false,...};
2122

2223
new Float:g_flLastEventTime[33] = {0.0,...};
@@ -32,7 +33,12 @@ public plugin_init()
3233
{
3334
register_plugin(PLUGIN, VERSION, AUTHOR);
3435
register_cvar("unreal_demoplug", VERSION, FCVAR_SERVER | FCVAR_SPONLY | FCVAR_UNLOGGED);
35-
register_clcmd("fullupdate", "UnrealDemoHelpInitialize");
36+
37+
#if REAPI_VERSION < 524309
38+
RegisterHookChain(RH_SV_AllowPhysent, "UnrealDemoHelpInitialize");
39+
#else
40+
RegisterHookChain(RH_ExecuteServerStringCmd, "UnrealDemoHelpInitialize");
41+
#endif
3642

3743
RegisterHookChain(RG_PM_Move, "PM_Move", .post = false);
3844
RegisterHookChain(RG_CBasePlayer_Jump, "HC_CBasePlayer_Jump_Pre", .post = false);
@@ -61,6 +67,7 @@ public client_disconnected(id)
6167
g_flLastSendTime[id] = -1.0;
6268
g_flStartCmdTime[id] = -1.0;
6369
g_iFrameNum[id] = 0;
70+
g_iJumpCount[id] = 0;
6471
g_iDemoHelperInitStage[id] = 0;
6572
g_flDelay1Msec[id] = -1.0;
6673
g_flDelay2Time[id] = -1.0;
@@ -92,11 +99,6 @@ public HC_CBasePlayer_Jump_Pre(id)
9299
{
93100
new iFlags = get_entvar(id,var_flags);
94101

95-
if (g_iDemoHelperInitStage[id] != -1)
96-
{
97-
return HC_CONTINUE;
98-
}
99-
100102
if (iFlags & FL_WATERJUMP)
101103
{
102104
return HC_CONTINUE;
@@ -123,9 +125,11 @@ public HC_CBasePlayer_Jump_Pre(id)
123125
}
124126

125127
if (get_entvar(id, var_oldbuttons) & IN_JUMP || get_entvar(id, var_button) & IN_JUMP)
126-
WriteDemoInfo(id, "UDS/JMP/2");
128+
WriteDemoInfo(id, "UDS/JMP/2/%i", g_iJumpCount[id]);
127129
else
128-
WriteDemoInfo(id, "UDS/JMP/1");
130+
WriteDemoInfo(id, "UDS/JMP/1/%i", g_iJumpCount[id]);
131+
132+
g_iJumpCount[id]++;
129133

130134
return HC_CONTINUE;
131135
}
@@ -180,25 +184,30 @@ public PM_Move(const id)
180184
return HC_CONTINUE;
181185
}
182186

183-
public UnrealDemoHelpInitialize(id)
187+
public UnrealDemoHelpInitialize(const cmd[], source, id)
184188
{
185-
if (is_user_connected(id))
189+
if (id > 0 && id <= MaxClients)
186190
{
187-
if (task_exists(id))
188-
{
189-
g_bNeedResend[id] = true;
190-
}
191-
else
191+
new fullcmd[256];
192+
read_argv(0, fullcmd, charsmax(fullcmd));
193+
if (equal(fullcmd,"fullupdate"))
192194
{
193-
g_flLastEventTime[id] = 0.0;
194-
g_flLastSendTime[id] = 0.0;
195-
g_iFrameNum[id] = 0;
196-
g_iDemoHelperInitStage[id] = 0;
197-
198-
remove_task(id);
199-
if (!is_user_hltv(id) && !is_user_bot(id))
195+
if (task_exists(id))
196+
{
197+
g_bNeedResend[id] = true;
198+
}
199+
else
200200
{
201-
set_task(1.25,"DemoHelperInitializeTask",id);
201+
g_flLastEventTime[id] = 0.0;
202+
g_flLastSendTime[id] = 0.0;
203+
g_iFrameNum[id] = 0;
204+
g_iDemoHelperInitStage[id] = 0;
205+
206+
remove_task(id);
207+
if (!is_user_hltv(id) && !is_user_bot(id))
208+
{
209+
set_task(1.25,"DemoHelperInitializeTask",id);
210+
}
202211
}
203212
}
204213
}

UnrealDemoScanner/UnrealDemoScanner.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace DemoScanner.DG
2626
public static class DemoScanner
2727
{
2828
public const string PROGRAMNAME = "Unreal Demo Scanner";
29-
public const string PROGRAMVERSION = "1.73.2b";
29+
public const string PROGRAMVERSION = "1.73.3b";
3030

3131
public static bool DEMOSCANNER_HLTV = false;
3232

@@ -9814,23 +9814,23 @@ public static void ProcessPluginMessage(string cmd)
98149814
if (IsRussia)
98159815
{
98169816
DemoScanner_AddWarn("[Ошибка] Не получено приветствие от плагина!", true, false, true,
9817-
true);
9817+
true, true);
98189818
}
98199819
else
98209820
{
98219821
DemoScanner_AddWarn("[Error] No found 'auth' message from module!", true, false, true,
9822-
true);
9822+
true, true);
98239823
}
98249824

98259825
if (IsRussia)
98269826
{
98279827
DemoScanner_AddWarn("[WARN] Автоматический сброс версии плагина в 1.60", true, false, true,
9828-
true);
9828+
true, true);
98299829
}
98309830
else
98319831
{
98329832
DemoScanner_AddWarn("[WARN] Auto detect module version set to 1.60", true, false, true,
9833-
true);
9833+
true, true);
98349834
}
98359835

98369836
PluginVersion = "1.60";

0 commit comments

Comments
 (0)