Skip to content
This repository has been archived by the owner on Oct 25, 2023. It is now read-only.

Commit

Permalink
add get/set playername, add on say2 filter callback
Browse files Browse the repository at this point in the history
  • Loading branch information
huoji120 committed Oct 19, 2023
1 parent 254d0e1 commit af727ea
Show file tree
Hide file tree
Showing 7 changed files with 195 additions and 37 deletions.
32 changes: 32 additions & 0 deletions csgo2/hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,31 @@ Host_Say_t original_Host_Say = NULL;
StartupServer_t origin_StartServer = NULL;
GameFrame_t origin_GameFrame = NULL;
CCSWeaponBase_Spawn_t origin_CCSWeaponBase_Spawn = NULL;
UTIL_SayText2Filter_t origin_UTIL_SayText2Filter = NULL;
void __fastcall hook_UTIL_SayText2Filter(
IRecipientFilter& filter, CCSPlayerController* pEntity,
uint64_t eMessageType, const char* messeageName, const char* param1,
const char* param2, const char* param3, const char* param4) {
const auto entIndex =
PlayerSlot_to_EntityIndex(filter.GetRecipientIndex(0).Get());
/*
LOG("UTIL_SayText2Filter: %s\n", messeageName);
LOG("entIndex: %d\n", entIndex);
LOG("param1: %s\n", param1);
LOG("param2: %s\n", param2);
LOG("param3: %s\n", param3);
LOG("param4: %s\n", param4);
LOG("eMessageType: %d\n", eMessageType);
*/
const auto isHandle = ScriptCallBacks::luCall_onSayText2Filter(
entIndex, eMessageType, messeageName, param1, param2, param3, param4);
if (isHandle == false) {
origin_UTIL_SayText2Filter(filter, pEntity, eMessageType, messeageName,
param1, param2, param3, param4);
}
}
// https://github.com/Source2ZE/CS2Fixes/blob/main/src/commands.cpp#L494
void __fastcall hook_CCSWeaponBase_Spawn(CBaseEntity* pThis, void* a2) {
const char* pszClassName = pThis->m_pEntity()->m_designerName;
Expand Down Expand Up @@ -250,6 +275,13 @@ auto initMinHook() -> bool {
LOG("MH_CreateHook origin_CCSWeaponBase_Spawn\n");
break;
}
if (MH_CreateHook((LPVOID)Offset::FnUTIL_SayText2FilterPtr,
&hook_UTIL_SayText2Filter,
reinterpret_cast<LPVOID*>(
&origin_UTIL_SayText2Filter)) != MH_OK) {
LOG("MH_CreateHook origin_UTIL_SayText2Filter\n");
break;
}
// 启用钩子
if (MH_EnableHook(MH_ALL_HOOKS) != MH_OK) {
LOG("MH_EnableHook \n");
Expand Down
31 changes: 22 additions & 9 deletions csgo2/hooks.h
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
#pragma once
#include "head.h"

typedef bool(__fastcall* FireEventServerSide_t)(CGameEventManager*, IGameEvent*, bool);
class IRecipientFilter;
typedef bool(__fastcall* FireEventServerSide_t)(CGameEventManager*, IGameEvent*,
bool);
typedef void(__fastcall* Host_Say_t)(void*, void*, bool, int, const char*);
typedef void(__fastcall* OnClientConnect_t)(void*, CPlayerSlot, const char*, uint64_t, const char*, const char*, bool);
typedef void(__fastcall* OnClientDisconnect_t)(void*, CPlayerSlot, int, const char*, uint64_t, const char*);
typedef void(__fastcall* StartupServer_t)(void*, const GameSessionConfiguration_t&, ISource2WorldSession*, const char*);
typedef void(__fastcall* OnClientConnect_t)(void*, CPlayerSlot, const char*,
uint64_t, const char*, const char*,
bool);
typedef void(__fastcall* OnClientDisconnect_t)(void*, CPlayerSlot, int,
const char*, uint64_t,
const char*);
typedef void(__fastcall* StartupServer_t)(void*,
const GameSessionConfiguration_t&,
ISource2WorldSession*, const char*);
typedef void(__fastcall* GameFrame_t)(void*, bool, bool, bool);
typedef void(__fastcall* UTIL_SayText2Filter_t)(IRecipientFilter&,
CCSPlayerController*, uint64_t,
const char*, const char*,
const char*, const char*,
const char*);

namespace hooks {
extern Host_Say_t original_Host_Say;
auto init() -> bool;
auto unload() -> void;
}
extern Host_Say_t original_Host_Say;
auto init() -> bool;
auto unload() -> void;
} // namespace hooks
29 changes: 19 additions & 10 deletions csgo2/offset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ uint64_t CCSGameRulesInterFacePtr;
uint64_t Host_SayPtr;
uint64_t Module_tier0;
uint64_t MaxPlayerNumsPtr;
uint64_t FnUTIL_SayText2FilterPtr;
PlayerChangeName_t FnPlayerChangeName;
HashFunction_t FnServerHashFunction;
StateChanged_t FnStateChanged;
NetworkStateChanged_t FnNetworkStateChanged;
Expand Down Expand Up @@ -67,32 +69,36 @@ auto Init() -> bool {
server.FindPattern(pattern_FireEventServerSide).Get(FireEventServerSidePtr);
server.FindPattern(pattern_NetworkStateChanged).Get(FnNetworkStateChanged);
server.FindPattern(pattern_FnStateChangedPtr).Get(FnStateChanged);
server.FindPattern(pattern_PlayerChangeName).Get(FnPlayerChangeName);

server.FindPattern(pattern_CGameEventManager)
.ToAbsolute(3, 0)
.Get(CGameEventManagerPtr);
server.FindPattern(pattern_CreateCCSGameRulesInterFacePtr)
.ToAbsolute(3, 0)
.Get(CCSGameRulesInterFacePtr);
server.FindPattern(pattern_FnRespawnPlayerInDeathMatch).Get(FnRespawnPlayerInDeathMatch);
server.FindPattern(pattern_FnRespawnPlayerInDeathMatch)
.Get(FnRespawnPlayerInDeathMatch);
server.FindPattern(pattern_FnEntityRemove).Get(FnEntityRemove);
server.FindPattern(pattern_FnGiveNamedItemPtr).Get(FnGiveNamedItem);
server.FindPattern(pattern_fnHost_SayPtr).Get(Host_SayPtr);
//server.FindPattern(pattern_ServerHashFunctionPtr).Get(FnServerHashFunction);
// server.FindPattern(pattern_ServerHashFunctionPtr).Get(FnServerHashFunction);
server.FindPattern(pattern_UTIL_ClientPrintAll).Get(FnUTIL_ClientPrintAll);
server.FindPattern(pattern_FnClientPrint).Get(FnClientPrint);

server.FindPattern(pattern_FnUTIL_SayTextFilter).Get(FnUTIL_SayTextFilter);
server.FindPattern(pattern_CCSWeaponBase_Spawn).Get(FnCCSWeaponBase_Spawn);
server.FindPattern(pattern_FnUTIL_SayText2FilterPtr)
.Get(FnUTIL_SayText2FilterPtr);

InterFaces::SchemaSystem = reinterpret_cast<CSchemaSystem*>(
schemasystem.FindInterface("SchemaSystem_001").Get());
// InterFaces::GameEventManager = reinterpret_cast<IGameEventManager2*>(
// engine.FindInterface("GameEventSystemServerV001").Get());
InterFaces::ILocalize = reinterpret_cast<CLocalize*>(
localize.FindInterface("Localize_001").Get());
InterFaces::IVEngineCvar = reinterpret_cast<ICvar*>(
tier0.FindInterface("VEngineCvar007").Get());
InterFaces::IVEngineCvar =
reinterpret_cast<ICvar*>(tier0.FindInterface("VEngineCvar007").Get());

InterFaces::GameResourceServiceServer =
reinterpret_cast<CGameResourceService*>(
Expand All @@ -106,7 +112,6 @@ auto Init() -> bool {
server.FindInterface("Source2GameClients001").Get());
InterFaces::ISource2ServerInterFace = reinterpret_cast<ISource2Server*>(
server.FindInterface("Source2Server001").Get());

if (InterFaces::ISource2ServerInterFace) {
InterFaces::GameEventManager =
(IGameEventManager2*)(CALL_VIRTUAL(
Expand All @@ -124,13 +129,16 @@ auto Init() -> bool {
LOG("[huoji]FireEventServerSidePtr : %llx \n", FireEventServerSidePtr);
LOG("[huoji]Host_SayPtr : %llx \n", Host_SayPtr);
LOG("[huoji]FnNetworkStateChanged : %llx \n", FnNetworkStateChanged);
//LOG("[huoji]FnServerHashFunction : %llx \n", FnServerHashFunction);
// LOG("[huoji]FnServerHashFunction : %llx \n", FnServerHashFunction);
LOG("[huoji]FnStateChanged : %llx \n", FnStateChanged);
LOG("[huoji]FnRespawnPlayerInDeathMatch : %llx \n", FnRespawnPlayerInDeathMatch);
LOG("[huoji]FnRespawnPlayerInDeathMatch : %llx \n",
FnRespawnPlayerInDeathMatch);
LOG("[huoji]FnGiveNamedItem : %llx \n", FnGiveNamedItem);
LOG("[huoji]FnClientPrint : %llx \n", FnClientPrint);
LOG("[huoji]FnUTIL_ClientPrintAll : %llx \n", FnUTIL_ClientPrintAll);
LOG("[huoji]FnCCSWeaponBase_Spawn : %llx \n", FnCCSWeaponBase_Spawn);
LOG("[huoji]FnPlayerChangeName : %llx \n", FnPlayerChangeName);
LOG("[huoji]FnUTIL_SayText2FilterPtr : %llx \n", FnUTIL_SayText2FilterPtr);

LOG("[huoji]MaxGlobals : %d \n", global::MaxPlayers);

Expand All @@ -147,8 +155,7 @@ auto Init() -> bool {
InterFaces::IVEngineServer);
LOG("[huoji]InterFaces::ISource2ServerInterFace : %llx \n",
InterFaces::ISource2ServerInterFace);
LOG("[huoji]InterFaces::IVEngineCvar : %llx \n",
InterFaces::IVEngineCvar);
LOG("[huoji]InterFaces::IVEngineCvar : %llx \n", InterFaces::IVEngineCvar);
LOG("[huoji] CGameEntitySystem::GetInstance : %llx \n",
CGameEntitySystem::GetInstance());
LOG("init offset success !\n");
Expand All @@ -157,7 +164,9 @@ auto Init() -> bool {
0, NULL);
// LOG("FnServerHashFunction: %llx \n", FnServerHashFunction("here",
// sizeof("here") - 1, 0x31415926));
return FnCCSWeaponBase_Spawn && FnEntityRemove && FnRespawnPlayerInDeathMatch && FnGiveNamedItem && Host_SayPtr && InterFaces::IVEngineServer &&
return FnPlayerChangeName && FnCCSWeaponBase_Spawn && FnEntityRemove &&
FnRespawnPlayerInDeathMatch && FnGiveNamedItem && Host_SayPtr &&
InterFaces::IVEngineServer &&
InterFaces::GameResourceServiceServer &&
InterFaces::IServerGameClient && InterFaces::GameEventManager &&
InterFaces::SchemaSystem && FireEventServerSidePtr &&
Expand Down
38 changes: 30 additions & 8 deletions csgo2/offset.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,15 @@ typedef void*(__fastcall* EntityRemove_t)(CGameEntitySystem*, void*, void*,
uint64_t);
typedef void*(__fastcall* UTIL_SayTextFilter_t)(IRecipientFilter&, const char*,
CCSPlayerController*, uint64_t);
typedef void(__fastcall* UTIL_ClientPrintAll_t)(int msg_dest, const char* msg_name, const char* param1, const char* param2, const char* param3, const char* param4);
typedef void(__fastcall* ClientPrint_t)(CCSPlayerController* player, int msg_dest, const char* msg_name, const char* param1, const char* param2, const char* param3, const char* param4);
typedef void(__fastcall* UTIL_ClientPrintAll_t)(
int msg_dest, const char* msg_name, const char* param1, const char* param2,
const char* param3, const char* param4);
typedef void(__fastcall* ClientPrint_t)(CCSPlayerController* player,
int msg_dest, const char* msg_name,
const char* param1, const char* param2,
const char* param3, const char* param4);
typedef void(__fastcall* CCSWeaponBase_Spawn_t)(CBaseEntity*, void*);
typedef void(__fastcall* PlayerChangeName_t)(CBaseEntity*, char*);
class CSchemaSystem;
class CGameResourceService;
class CLocalize;
Expand All @@ -44,7 +50,15 @@ extern ISource2Server* ISource2ServerInterFace;
extern CCSGameRules* CCSGameRulesInterFace;
extern ICvar* IVEngineCvar;
}; // namespace InterFaces
static const auto pattern_VscriptPath = THE_GAME_SIG("BE 01 ?? ?? ?? 2B D6 74 ?? 3B D6");
static const auto pattern_FnUTIL_SayText2FilterPtr = THE_GAME_SIG(
"48 89 5C 24 ?? 55 56 57 48 8D 6C 24 ?? 48 81 EC ?? ?? ?? ?? 41 0F B6 F8");
static const auto pattern_PlayerChangeName = THE_GAME_SIG(
"4C 8B DC 55 56 41 54 49 8D ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? 48 8B F1 "
"41 ?? ?? ?? ?? ?? 8B 89 ?? ?? ?? ?? 4C 8B D2 41 3B CC 0F ?? ?? ?? ?? ?? "
"4C ?? ?? ?? ?? ?? ?? 4D 85 C0 0F ?? ?? ?? ?? ?? 83 ?? ?? 0F ?? ?? ?? ?? "
"?? 8B C1 25 ?? ?? ?? ??");
static const auto pattern_VscriptPath =
THE_GAME_SIG("BE 01 ?? ?? ?? 2B D6 74 ?? 3B D6");
static const auto pattern_CGameEventManager = THE_GAME_SIG(
"48 ?? ?? ?? ?? ?? ?? 48 89 ?? ?? ?? 48 89 01 48 8B D9 48 ?? ?? ?? ?? ?? "
"?? 48 89 ?? ?? E8 ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ??");
Expand Down Expand Up @@ -79,7 +93,9 @@ static const auto pattern_CreateCCSGameRulesInterFacePtr = THE_GAME_SIG(
"?? ?? 4C 8D ?? ?? ?? 49 8B ?? ?? 49 8B ?? ?? 49 8B ?? ?? 49 8B E3 41 5F "
"41 5E 5F C3");
static const auto pattern_FnRespawnPlayer = THE_GAME_SIG(
"48 89 ?? ?? ?? 48 89 ?? ?? ?? 56 48 ?? ?? ?? ?? ?? ?? 48 8B DA 48 8B E9 48 85 D2 0F ?? ?? ?? ?? ?? 48 8B 02 48 8B CA FF ?? ?? ?? ?? ?? 84 C0 0F ?? ?? ?? ?? ?? 83 BB ?? ?? ?? ?? ?? 0F ?? ?? ?? ?? ??");
"48 89 ?? ?? ?? 48 89 ?? ?? ?? 56 48 ?? ?? ?? ?? ?? ?? 48 8B DA 48 8B E9 "
"48 85 D2 0F ?? ?? ?? ?? ?? 48 8B 02 48 8B CA FF ?? ?? ?? ?? ?? 84 C0 0F "
"?? ?? ?? ?? ?? 83 BB ?? ?? ?? ?? ?? 0F ?? ?? ?? ?? ??");
static const auto pattern_FnRespawnPlayerInDeathMatch = THE_GAME_SIG(
"48 89 ?? ?? ?? 57 48 ?? ?? ?? 48 8D ?? ?? ?? 48 8B F9 E8 ?? ?? ?? ?? 83 "
"?? ?? 74 ?? 48 ?? ?? ?? ?? ?? ?? 48 8B CF 48 8B 10 48 8B ?? ?? ?? ?? ?? "
Expand All @@ -92,15 +108,20 @@ static const auto pattern_FnEntityRemove = THE_GAME_SIG(
static const auto pattern_FnUTIL_SayTextFilter = THE_GAME_SIG(
"48 89 5C 24 ?? 55 56 57 48 8D 6C 24 ?? 48 81 EC ?? ?? ?? ?? 49 8B D8");
static const auto pattern_UTIL_ClientPrintAll = THE_GAME_SIG(
"48 89 5C 24 08 48 89 6C 24 10 48 89 74 24 18 57 48 81 EC 70 01 ?? ?? 8B E9");
static const auto pattern_FnClientPrint = THE_GAME_SIG(
"48 85 C9 0F 84 ?? ?? ?? ?? 48 8B C4 48 89 58 18");
static const auto pattern_CCSWeaponBase_Spawn = THE_GAME_SIG("48 89 5C 24 08 48 89 6C 24 18 48 89 74 24 20 57 48 83 EC 30 48 8B DA 48 8B E9 E8 ?? ?? ?? ??");
"48 89 5C 24 08 48 89 6C 24 10 48 89 74 24 18 57 48 81 EC 70 01 ?? ?? 8B "
"E9");
static const auto pattern_FnClientPrint =
THE_GAME_SIG("48 85 C9 0F 84 ?? ?? ?? ?? 48 8B C4 48 89 58 18");
static const auto pattern_CCSWeaponBase_Spawn = THE_GAME_SIG(
"48 89 5C 24 08 48 89 6C 24 18 48 89 74 24 20 57 48 83 EC 30 48 8B DA 48 "
"8B E9 E8 ?? ?? ?? ??");
extern uint64_t GameResourceServicePtr;
extern uint64_t FireEventServerSidePtr;
extern uint64_t Module_tier0;
extern uint64_t Host_SayPtr;
extern uint64_t MaxPlayerNumsPtr;
extern uint64_t FnUTIL_SayText2FilterPtr;

extern HashFunction_t FnServerHashFunction;
extern StateChanged_t FnStateChanged;
extern NetworkStateChanged_t FnNetworkStateChanged;
Expand All @@ -111,6 +132,7 @@ extern UTIL_SayTextFilter_t FnUTIL_SayTextFilter;
extern UTIL_ClientPrintAll_t FnUTIL_ClientPrintAll;
extern ClientPrint_t FnClientPrint;
extern CCSWeaponBase_Spawn_t FnCCSWeaponBase_Spawn;
extern PlayerChangeName_t FnPlayerChangeName;
extern bool InitOffsetSuccess;
auto Init() -> bool;
}; // namespace Offset
64 changes: 55 additions & 9 deletions csgo2/script_apis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ auto ExcutePlayerAction(int playerIndex,
function(playerController);
} while (false);
}
// 返回是返回值数量,返回值内容要自己push到stack上
// �����Ƿ���ֵ����,����ֵ����Ҫ�Լ�push��stack��
auto luaApi_ListenToGameEvent(lua_State* luaVm) -> int {
const auto eventName = lua_tostring(luaVm, 1);
do {
Expand All @@ -73,7 +73,7 @@ auto luaApi_ListenToGameEvent(lua_State* luaVm) -> int {
LOG("luaApi_ListenToGameEvent unknown event name: %s\n", eventName);
break;
}
// 将回调添加到映射中
// ���ص����ӵ�ӳ����
std::unique_lock lock(ScriptCallBacks::mutex_callbackList);
ScriptCallBacks::callbackList[luaVm][callbackType] =
luaL_ref(luaVm, LUA_REGISTRYINDEX);
Expand All @@ -82,7 +82,7 @@ auto luaApi_ListenToGameEvent(lua_State* luaVm) -> int {
eventName);
} while (false);

lua_pop(luaVm, 2); // 清理堆栈
lua_pop(luaVm, 2); // ������ջ
return 0;
}
auto luaApi_SetPlayerCurrentWeaponAmmo(lua_State* luaVm) -> int {
Expand Down Expand Up @@ -593,7 +593,8 @@ auto luaApi_SendToPlayerChat(lua_State* luaVm) -> int {
const auto playerIndex = lua_tointeger(luaVm, 1);
const auto hudType = lua_tointeger(luaVm, 2);
const auto message = lua_tostring(luaVm, 3);
if (hudType >= static_cast<int>(_HubType::kMax) || hudType < static_cast<int>(_HubType::kNotify)) {
if (hudType >= static_cast<int>(_HubType::kMax) ||
hudType < static_cast<int>(_HubType::kNotify)) {
lua_pop(luaVm, 3);
return 0;
}
Expand All @@ -608,7 +609,8 @@ auto luaApi_SentToAllPlayerChat(lua_State* luaVm) -> int {
// param: playerIndex:int, message:string
const auto message = lua_tostring(luaVm, 1);
const auto hudType = lua_tointeger(luaVm, 2);
if (hudType >= static_cast<int>(_HubType::kMax) || hudType < static_cast<int>(_HubType::kNotify)) {
if (hudType >= static_cast<int>(_HubType::kMax) ||
hudType < static_cast<int>(_HubType::kNotify)) {
lua_pop(luaVm, 3);
return 0;
}
Expand Down Expand Up @@ -719,11 +721,52 @@ auto luaApi_RunClientCommand(lua_State* luaVm) -> int {
const auto command = lua_tostring(luaVm, 2);

ExcutePlayerAction(playerIndex, [&](CCSPlayerController* playerController) {
Offset::InterFaces::IVEngineServer->ClientCommand(EntityIndex_to_PlayerSlot(playerIndex), command);
Offset::InterFaces::IVEngineServer->ClientCommand(
EntityIndex_to_PlayerSlot(playerIndex), command);
});
lua_pop(luaVm, 2);
return 0;
}
auto luaApi_SetPlayerName(lua_State* luaVm) -> int {
const auto playerIndex = lua_tointeger(luaVm, 1);
const auto playerName = lua_tostring(luaVm, 2);

if (playerName != nullptr) {
ExcutePlayerAction(
playerIndex, [&](CCSPlayerController* playerController) {
Offset::FnPlayerChangeName(playerController->m_hPawn().Get(),
(char*)playerName);
});
}
lua_pop(luaVm, 2);
return 0;
}
auto luaApi_SetPlayerNameSlient(lua_State* luaVm) -> int {
const auto playerIndex = lua_tointeger(luaVm, 1);
const auto playerName = lua_tostring(luaVm, 2);

if (playerName != nullptr) {
ExcutePlayerAction(
playerIndex, [&](CCSPlayerController* playerController) {
const auto playerNameAddress =
&playerController->m_iszPlayerName();
const auto playerNameLength = min(strlen(playerName) + 1, 127);
memcpy(playerNameAddress, playerName, playerNameLength);
});
}
lua_pop(luaVm, 2);
return 0;
}
auto luaApi_GetPlayerName(lua_State* luaVm) -> int {
const auto playerIndex = lua_tointeger(luaVm, 1);
std::string playerName;
ExcutePlayerAction(playerIndex, [&](CCSPlayerController* playerController) {
playerName = &playerController->m_iszPlayerName();
});
lua_pop(luaVm, 1);
lua_pushstring(luaVm, playerName.c_str());
return 1;
}
auto luaApi_GetPlayerSteamId(lua_State* luaVm) -> int {
const auto playerIndex = lua_tointeger(luaVm, 1);
std::string steamid;
Expand Down Expand Up @@ -907,8 +950,7 @@ auto luaApi_GetConVarString(lua_State* luaVm) -> int {
auto luaApi_GetConVarInt(lua_State* luaVm) -> int {
// param: convarObject:int
const auto inputData = lua_tointeger(luaVm, 1);
if (inputData)
{
if (inputData) {
ConVarHandle theConvarHandle{};
theConvarHandle.Set(inputData);
int value = -1;
Expand Down Expand Up @@ -984,6 +1026,10 @@ auto initFunciton(lua_State* luaVm) -> void {
lua_register(luaVm, "luaApi_GetConVarInt", luaApi_GetConVarInt);
lua_register(luaVm, "luaApi_GetPlayerSteamId", luaApi_GetPlayerSteamId);
lua_register(luaVm, "luaApi_RunClientCommand", luaApi_RunClientCommand);
lua_register(luaVm, "luaApi_SetPlayerName", luaApi_SetPlayerName);
lua_register(luaVm, "luaApi_GetPlayerName", luaApi_GetPlayerName);
lua_register(luaVm, "luaApi_SetPlayerNameSlient",
luaApi_SetPlayerNameSlient);

// lua_register(luaVm, "luaApi_TeleportPlayer", luaApi_TeleportPlayer);

Expand All @@ -999,7 +1045,7 @@ auto initFunciton(lua_State* luaVm) -> void {
.addData("weaponIndex", &_luaApi_WeaponInfo::weaponIndex)
.endClass()
.addFunction("luaApi_GetPlayerWeaponInfo", &luaApi_GetPlayerWeaponInfo);
// 我不喜欢他
// �Ҳ�ϲ����
luabridge::getGlobalNamespace(luaVm)
.beginClass<_luaApi_WeaponInfo>("WeaponInfo")
.addConstructor<void (*)(void)>()
Expand Down
Loading

0 comments on commit af727ea

Please sign in to comment.