Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit fca5bae
Author: LinGe <[email protected]>
Date:   Sat Jun 11 18:18:49 2022 +0800

    更新插件 2.7.0

    插件可以让玩家在发出“看”的指令时自动触发标记功能

commit 4b4a78f
Author: LinGe <[email protected]>
Date:   Sat Jun 11 13:55:42 2022 +0800

    每秒检查一次 sv_maxplayers 好了,不再需要插件了触发更新

commit 858f6b0
Author: LinGe <[email protected]>
Date:   Sat Jun 11 13:49:17 2022 +0800

    把提示的默认持续时间改短

commit 4cd2f99
Author: LinGe <[email protected]>
Date:   Sat Jun 11 13:01:22 2022 +0800

    修改代码结构和协议文本

commit 2881f77
Author: LinGe <[email protected]>
Date:   Sat Jun 11 02:37:06 2022 +0800

    放一个可爱的水波在这里

commit 4c1658e
Author: LinGe <[email protected]>
Date:   Sat Jun 11 02:36:51 2022 +0800

    为绝大多数物品的标记加上特定的图标

commit 0927b2c
Author: LinGe <[email protected]>
Date:   Fri Jun 10 23:51:39 2022 +0800

    应该是没有bug了……

commit 474a239
Author: LinGe <[email protected]>
Date:   Thu Jun 9 09:35:31 2022 +0800

    优化配置保存功能

commit c9d3a4e
Author: LinGe <[email protected]>
Date:   Fri Jun 10 18:27:21 2022 +0800

    修复优化一些功能

commit 4c74379
Author: LinGe <[email protected]>
Date:   Fri Jun 10 17:35:23 2022 +0800

    把空格缩进转为制表符

commit 8001ba1
Author: LinGe <[email protected]>
Date:   Thu Jun 9 15:56:36 2022 +0800

    让判断是否是生还者更加准确

commit 3575239
Author: LinGe <[email protected]>
Date:   Thu Jun 9 14:40:05 2022 +0800

    变量名与指令名统一

commit 5aa3d49
Author: LinGe <[email protected]>
Date:   Thu Jun 9 14:36:13 2022 +0800

    功能完善

    1.还是加回了路径标记
    2.可以标记所有特感类型
    3.提示武器标记的命中率(需测试)
    4.队友状态提示不应在某些情况下出现
    5.配置文件结构修改

commit 5a9b6e6
Author: LinGe <[email protected]>
Date:   Thu Jun 9 11:18:47 2022 +0800

    Update HUD.nut

commit abd6688
Author: LinGe <[email protected]>
Date:   Thu Jun 9 08:53:40 2022 +0800

    完善功能

commit 644d847
Author: LinGe <[email protected]>
Date:   Wed Jun 8 23:11:31 2022 +0800

    完善标记功能

commit 6160109
Author: LinGe <[email protected]>
Date:   Wed Jun 8 23:11:24 2022 +0800

    自杀指令独立为一个模块

commit 7a94f32
Author: LinGe <[email protected]>
Date:   Wed Jun 8 22:04:00 2022 +0800

    修复新功能的一些bug

commit 075111f
Author: LinGe <[email protected]>
Date:   Wed Jun 8 21:52:40 2022 +0800

    Update easylogic.nut

commit cbb2d3b
Author: LinGe <[email protected]>
Date:   Wed Jun 8 21:51:30 2022 +0800

    修复某些情况下会访问到无效句柄的问题

    任何延时后的操作都应重新检查句柄的有效性

commit ee4e53e
Author: LinGe <[email protected]>
Date:   Wed Jun 8 20:16:01 2022 +0800

    更新打包方式,创意工坊后续将发布分离的功能MOD

commit c7e7735
Author: LinGe <[email protected]>
Date:   Wed Jun 8 19:36:35 2022 +0800

    玩家主动标记功能完成

commit 24379e3
Author: LinGe <[email protected]>
Date:   Sun Jun 5 19:24:26 2022 +0800

    标记功能(未完成)

commit 67c8d95
Author: LinGe <[email protected]>
Date:   Sun Jun 5 16:26:45 2022 +0800

    玩家状态提示功能基本完成

commit 7f43e22
Author: LinGe <[email protected]>
Date:   Sun Jun 5 16:12:54 2022 +0800

    修复RemoveInArray的一个错误

commit bc70daf
Author: LinGe <[email protected]>
Date:   Sun Jun 5 11:34:53 2022 +0800

    为每种HUD元素都增加开关

commit b233a2a
Author: LinGe <[email protected]>
Date:   Sun Jun 5 00:47:19 2022 +0800

    玩家状态提示模式更换,作为独立模块

    Hint 功能尚未完全实现
  • Loading branch information
Lin515 committed Jun 11, 2022
1 parent ed1fc75 commit b6a11c3
Show file tree
Hide file tree
Showing 27 changed files with 4,838 additions and 433 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
/release/*
!/release/plugin.bat
!/release/vpk.bat
!/release/addoninfo.txt
!/release/*-addoninfo.txt

/plugin/*-build
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[使用说明](https://lin515.com/archives/182.html)

[创意工坊](https://steamcommunity.com/sharedfiles/filedetails/?id=2587952986)
[创意工坊](https://steamcommunity.com/sharedfiles/filedetails/?id=2587952986)

![Rena](doc/0Rena.png)
Binary file added doc/0Rena.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
109 changes: 55 additions & 54 deletions plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,73 +12,74 @@ set(HL2PUB ${HL2SDKL4D2}/public)
set(HL2GAME ${HL2SDKL4D2}/game)

if(WIN32)
link_directories(${HL2SDKL4D2}/lib/public)
set(LINK_LIBRARY
tier0
vstdlib
tier1
tier2
tier3
mathlib
legacy_stdio_definitions # vc++2015及以上需链接此库
)
add_compile_options(/wd4819) # 禁止字符集警告
# 静态链接到CRT库
string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_MINSIZEREL ${CMAKE_CXX_FLAGS_MINSIZEREL})
string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS_RELWITHDEBINFO})
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /NODEFAULTLIB:libc")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /NODEFAULTLIB:libcd")
# set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /NODEFAULTLIB:libcmt") # 如果动态链接到CRT库,需要忽略libcmt
link_directories(${HL2SDKL4D2}/lib/public)
set(LINK_LIBRARY
tier0
vstdlib
tier1
tier2
tier3
mathlib
legacy_stdio_definitions # vc++2015及以上需链接此库
)
add_compile_options(/wd4819) # 禁止字符集警告
# 静态链接到CRT库
string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_MINSIZEREL ${CMAKE_CXX_FLAGS_MINSIZEREL})
string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS_RELWITHDEBINFO})
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /NODEFAULTLIB:libc")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /NODEFAULTLIB:libcd")
# set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /NODEFAULTLIB:libcmt") # 如果动态链接到CRT库,需要忽略libcmt
elseif(UNIX)
link_directories(${L4D2BIN}) # 不要设置到 ${HL2SDKL4D2}/lib/linux .so需使用服务器最新
get_filename_component(ABSLIB ${HL2SDKL4D2}/lib/linux ABSOLUTE)
set(LINK_LIBRARY
libtier0_srv.so
libvstdlib_srv.so
${ABSLIB}/tier1_i486.a
${ABSLIB}/tier2_i486.a
${ABSLIB}/tier3_i486.a
${ABSLIB}/mathlib_i486.a
)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_LINUX -DL4D2 -m32 \
-Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp \
-Dstrnicmp=strncasecmp -D_snprintf=snprintf -D_vsnprintf=vsnprintf \
-D_alloca=alloca -Dstrcmpi=strcasecmp -Wall -Wno-switch \
-Wno-error=uninitialized -Wno-unused -Wno-error=delete-non-virtual-dtor \
-mfpmath=sse -msse -DHAVE_STDINT_H \
-Wno-non-virtual-dtor -fno-rtti -fno-threadsafe-statics \
-Wno-overloaded-virtual -fpermissive \
-m32 -ldl -lm -static-libgcc -static-libstdc++ -shared"
)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -funroll-loops -pipe -fno-strict-aliasing")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}")
link_directories(${L4D2BIN}) # 不要设置到 ${HL2SDKL4D2}/lib/linux .so需使用服务器最新
get_filename_component(ABSLIB ${HL2SDKL4D2}/lib/linux ABSOLUTE)
set(LINK_LIBRARY
libtier0_srv.so
libvstdlib_srv.so
${ABSLIB}/tier1_i486.a
${ABSLIB}/tier2_i486.a
${ABSLIB}/tier3_i486.a
${ABSLIB}/mathlib_i486.a
)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_LINUX -DL4D2 -m32 \
-Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp \
-Dstrnicmp=strncasecmp -D_snprintf=snprintf -D_vsnprintf=vsnprintf \
-D_alloca=alloca -Dstrcmpi=strcasecmp -Wall -Wno-switch \
-Wno-error=uninitialized -Wno-unused -Wno-error=delete-non-virtual-dtor \
-mfpmath=sse -msse -DHAVE_STDINT_H \
-Wno-non-virtual-dtor -fno-rtti -fno-threadsafe-statics \
-Wno-overloaded-virtual -fpermissive \
-m32 -ldl -lm -static-libgcc -static-libstdc++ -shared"
)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -funroll-loops -pipe -fno-strict-aliasing")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}")
endif()

# 创建库
add_library(LinGe_VScripts SHARED)

if(UNIX)
set_target_properties(LinGe_VScripts PROPERTIES PREFIX "") # 去掉输出文件名的lib前缀
set_target_properties(LinGe_VScripts PROPERTIES PREFIX "") # 去掉输出文件名的lib前缀
endif()

target_sources(LinGe_VScripts PRIVATE
LinGe_VScripts.cpp
sdkapi/MemoryUtils/MemoryUtils.cpp
sdkapi/sdkapi.cpp
sdkapi/signature.cpp
LinGe_VScripts.cpp
sdkapi/MemoryUtils/MemoryUtils.cpp
sdkapi/sdkapi.cpp
sdkapi/signature.cpp
)

target_include_directories(LinGe_VScripts PRIVATE
${HL2PUB}
${HL2PUB}/tier0
${HL2PUB}/tier1
${HL2PUB}/tier2
${HL2PUB}/tier3
${HL2GAME}/shared
${HL2GAME}/server
${HL2GAME}/client
${HL2PUB}
${HL2PUB}/tier0
${HL2PUB}/tier1
${HL2PUB}/tier2
${HL2PUB}/tier3
${HL2GAME}/shared
${HL2GAME}/server
${HL2GAME}/client
${HL2SDKL4D2}/common
)

target_link_libraries(LinGe_VScripts PRIVATE ${LINK_LIBRARY})
103 changes: 61 additions & 42 deletions plugin/LinGe_VScripts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,6 @@
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*
* As a special exception, AlliedModders LLC gives you permission to link the
* code of this program (as well as its derivative works) to "Half-Life 2," the
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
* by the Valve Corporation. You must obey the GNU General Public License in
* all respects for all other code used. Additionally, AlliedModders LLC grants
* this exception to all derivative works. AlliedModders LLC defines further
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
* or <http://www.sourcemod.net/license.php>.
*/
#include <stdio.h>
#include <time.h>
Expand All @@ -34,14 +25,14 @@ LinGe_VScripts plugin;
EXPOSE_SINGLE_INTERFACE_GLOBALVAR(LinGe_VScripts, IServerPluginCallbacks, INTERFACEVERSION_ISERVERPLUGINCALLBACKS, plugin);

// ConVar
ConVar *cv_pSvMaxplayers = nullptr;
ConVar cv_time("linge_time", "", FCVAR_PRINTABLEONLY, "Server system time.");
ConVar cv_format("linge_time_format", "%Y-%m-%d %H:%M:%S", FCVAR_SERVER_CAN_EXECUTE, "linge_time format string, see also:https://www.runoob.com/cprogramming/c-function-strftime.html", false, 0.0, false, 0.0, LinGe_VScripts::OnTimeFormatChanged);
ConVar cv_vscriptReturn("linge_vscript_return", "", FCVAR_HIDDEN|FCVAR_SPONLY, "Return VScript values.");
ConVar cv_lookPing("linge_look_ping", "1", FCVAR_NOTIFY, "PlayerPing is executed when the 'vocalize smartlook' command is issued.", true, 0.0, true, 1.0, LinGe_VScripts::OnLookPingChanged);
ConVar cv_time("linge_time", "", FCVAR_PRINTABLEONLY|FCVAR_SPONLY, "Server system time.");
ConVar cv_format("linge_time_format", "%Y-%m-%d %H:%M:%S", FCVAR_NONE, "linge_time format string, see also:https://www.runoob.com/cprogramming/c-function-strftime.html", false, 0.0, false, 0.0, LinGe_VScripts::OnTimeFormatChanged);
char g_sTimeFormat[50] = "%Y-%m-%d %H:%M:%S";
bool g_bLookPing = true;

LinGe_VScripts::LinGe_VScripts() :
m_iMaxClients(0),
m_bIsFristStart(true)
LinGe_VScripts::LinGe_VScripts() : m_iClientCommandIndex(0), m_bPlayerPingLoaded(false)
{
}
LinGe_VScripts::~LinGe_VScripts() {}
Expand All @@ -52,11 +43,13 @@ bool LinGe_VScripts::Load(CreateInterfaceFn interfaceFactory, CreateInterfaceFn

ConVar_Register();

_Msg("Loaded.\n");
PL_Msg("Loaded.\n");
return true;
}
void LinGe_VScripts::Unload(void)
{
SDKAPI::iGameEventManager->RemoveListener(this);

ConVar_Unregister();
SDKAPI::UnInitialize();
}
Expand All @@ -81,55 +74,81 @@ void LinGe_VScripts::GameFrame(bool simulating)
}
}

void LinGe_VScripts::ServerActivate(edict_t *pEdictList, int edictCount, int clientMax)
void LinGe_VScripts::LevelInit(char const *pMapName) {
SDKAPI::iGameEventManager->AddListener(this, "round_start", true);
}
void LinGe_VScripts::LevelShutdown(void) {
SDKAPI::iGameEventManager->RemoveListener(this);
}

void LinGe_VScripts::FireGameEvent(IGameEvent * event)
{
m_iMaxClients = clientMax;
// sv_maxplayers 参数是 l4dtoolz 插件创建的,其通过 metamod 加载
// 本插件一定比 l4dtoolz 先载入,所以不能在插件载入时就去获取 sv_maxplayers
if (m_bIsFristStart)
const char *name = event->GetName();
if (Q_stricmp(name, "round_start") == 0)
{
cv_pSvMaxplayers = SDKAPI::iCvar->FindVar("sv_maxplayers");
if (cv_pSvMaxplayers)
// 验证根表下是否存在 LinPlayerPing
SDKAPI::L4D2_RunScript("Convars.SetValue(\"linge_vscript_return\", getroottable().rawin(\"LinPlayerPing\"));");
if (cv_vscriptReturn.GetBool())
{
// 保存原有 callback,然后安装自己的 callback
// 直接访问 m_fnChangeCallback 需要修改 hl2sdk-l4d2/public/tier1/convar.h
// 将 m_fnChangeCallback 声明为 public
SvMaxplayersCallback = cv_pSvMaxplayers->m_fnChangeCallback;
cv_pSvMaxplayers->InstallChangeCallback(LinGe_VScripts::OnSvMaxplayersChanged);
m_bPlayerPingLoaded = true;
PL_DevMsg("LinPlayerPing found.\n");
}
else
{
m_bPlayerPingLoaded = false;
PL_DevMsg("LinPlayerPing not found.\n");
}
m_bIsFristStart = false;
}
}

// sv_maxplayers 发生改变
FnChangeCallback_t LinGe_VScripts::SvMaxplayersCallback = nullptr;
void LinGe_VScripts::OnSvMaxplayersChanged(IConVar *var, const char *pOldValue, float flOldValue)
void LinGe_VScripts::ServerActivate(edict_t *pEdictList, int edictCount, int clientMax) {}

// 监测 vocalize smartlook
PLUGIN_RESULT LinGe_VScripts::ClientCommand(edict_t *pEntity, const CCommand &args)
{
SvMaxplayersCallback(var, pOldValue, flOldValue);
if (!SDKAPI::L4D2_RunScript("::LinGe.Base.UpdateMaxplayers()"))
_Warning("L4D2_RunScript ::LinGe.Base.UpdateMaxplayers() Failed\n");
if ( !pEntity || pEntity->IsFree() )
return PLUGIN_CONTINUE;
if (m_bPlayerPingLoaded && g_bLookPing)
{
if ( Q_stricmp(args[0], "vocalize") == 0
&& Q_stricmp(args[1], "smartlook") == 0
&& (args.ArgC() == 2 || Q_stricmp(args[2], "auto") != 0))
// 游戏自动让人物发出该指令时,第三个参数会为 auto
{
IPlayerInfo *player = SDKAPI::iPlayerInfoManager->GetPlayerInfo(pEntity);
if (player->IsPlayer() && player->GetTeamIndex() == 2
&& !player->IsFakeClient() && !player->IsDead())
{
PL_DevMsg("%s PlayerPing\n", player->GetName());
SDKAPI::L4D2_RunScript("::LinPlayerPing(%d);", player->GetUserID());
}
}
}

return PLUGIN_CONTINUE;
}

// 插件控制台变量发生改变
void LinGe_VScripts::OnLookPingChanged(IConVar *var, const char *pOldValue, float flOldValue)
{
g_bLookPing = cv_lookPing.GetBool();
}
void LinGe_VScripts::OnTimeFormatChanged(IConVar *var, const char *pOldValue, float flOldValue)
{
strncpy(g_sTimeFormat, cv_format.GetString(), sizeof(g_sTimeFormat) - 1);
g_sTimeFormat[sizeof(g_sTimeFormat) - 1] = '\0';
}

PLUGIN_RESULT LinGe_VScripts::ClientCommand(edict_t *pEntity, const CCommand &args) {
return PLUGIN_CONTINUE;
}
void LinGe_VScripts::LevelInit(char const *pMapName) {}
void LinGe_VScripts::LevelShutdown(void) {}
void LinGe_VScripts::Pause(void) {}
void LinGe_VScripts::UnPause(void) {}
void LinGe_VScripts::ClientActive(edict_t *pEntity) {}
void LinGe_VScripts::ClientDisconnect(edict_t *pEntity) {}
void LinGe_VScripts::OnQueryCvarValueFinished(QueryCvarCookie_t iCookie, edict_t *pPlayerEntity,
EQueryCvarValueStatus eStatus, const char *pCvarName, const char *pCvarValue) {}
void LinGe_VScripts::ClientPutInServer(edict_t *pEntity, const char *playername) {}
void LinGe_VScripts::SetCommandClient(int index) {}
void LinGe_VScripts::SetCommandClient(int index) {
m_iClientCommandIndex = index;
}
void LinGe_VScripts::ClientSettingsChanged(edict_t *pEdict) {}
PLUGIN_RESULT LinGe_VScripts::ClientConnect(bool *bAllowConnect, edict_t *pEntity, const char *pszName, const char *pszAddress, char *reject, int maxrejectlen) {
return PLUGIN_CONTINUE;
Expand All @@ -138,4 +157,4 @@ PLUGIN_RESULT LinGe_VScripts::NetworkIDValidated(const char *pszUserName, const
return PLUGIN_CONTINUE;
}
void LinGe_VScripts::OnEdictAllocated(edict_t *edict) {}
void LinGe_VScripts::OnEdictFreed(const edict_t *edict) {}
void LinGe_VScripts::OnEdictFreed(const edict_t *edict) {}
48 changes: 19 additions & 29 deletions plugin/LinGe_VScripts.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,20 @@
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*
* As a special exception, AlliedModders LLC gives you permission to link the
* code of this program (as well as its derivative works) to "Half-Life 2," the
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
* by the Valve Corporation. You must obey the GNU General Public License in
* all respects for all other code used. Additionally, AlliedModders LLC grants
* this exception to all derivative works. AlliedModders LLC defines further
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
* or <http://www.sourcemod.net/license.php>.
*/
#pragma once
#include <engine/iserverplugin.h>
#include <igameevents.h>
#include <tier1.h>
#define PLNAME "LinGe_VScripts"
#define PLVER "v2.6"
#define PLVER "v2.7.0"

#define _Msg(format, ...) Msg(PLNAME ": " format, ## __VA_ARGS__)
#define _Warning(format, ...) Warning(PLNAME ": " format, ## __VA_ARGS__)
#define _Error(format, ...) Error(PLNAME ": " format, ## __VA_ARGS__)
#define PL_Msg(format, ...) Msg(PLNAME ": " format, ## __VA_ARGS__)
#define PL_Warning(format, ...) Warning(PLNAME ": " format, ## __VA_ARGS__)
#define PL_Error(format, ...) Error(PLNAME ": " format, ## __VA_ARGS__)
#define PL_DevMsg(format, ...) DevMsg(PLNAME ": " format, ## __VA_ARGS__)

class LinGe_VScripts : public IServerPluginCallbacks
class LinGe_VScripts : public IServerPluginCallbacks, public IGameEventListener2
{
public:
LinGe_VScripts();
Expand All @@ -45,7 +38,7 @@ class LinGe_VScripts : public IServerPluginCallbacks
virtual void Unload(void);
virtual void Pause(void);
virtual void UnPause(void);
virtual const char *GetPluginDescription(void);
virtual const char * GetPluginDescription(void);
virtual void LevelInit(char const *pMapName);
virtual void ServerActivate(edict_t *pEdictList, int edictCount, int clientMax);
virtual void GameFrame(bool simulating);
Expand All @@ -64,19 +57,16 @@ class LinGe_VScripts : public IServerPluginCallbacks
virtual void OnEdictAllocated(edict_t *edict);
virtual void OnEdictFreed(const edict_t *edict);

public:
static void OnSvMaxplayersChanged(IConVar *var, const char *pOldValue, float flOldValue);
static void OnTimeFormatChanged(IConVar *var, const char *pOldValue, float flOldValue);

public:
static FnChangeCallback_t SvMaxplayersCallback;

int m_iMaxClients;
// IGameEventListener Interface
virtual void FireGameEvent( IGameEvent * event );
virtual int GetEventDebugID() { return EVENT_DEBUG_ID_INIT; }
virtual int GetCommandIndex() { return m_iClientCommandIndex; }

protected:
bool m_bIsFristStart;
};
private:
int m_iClientCommandIndex;
bool m_bPlayerPingLoaded;

extern ConVar *cv_pSvMaxplayers;
extern ConVar cv_time;
extern ConVar cv_format;
public:
static void OnLookPingChanged(IConVar *var, const char *pOldValue, float flOldValue);
static void OnTimeFormatChanged(IConVar *var, const char *pOldValue, float flOldValue);
};
Loading

0 comments on commit b6a11c3

Please sign in to comment.