Skip to content

Commit

Permalink
Start to implement the game library
Browse files Browse the repository at this point in the history
  • Loading branch information
RaphaelIT7 committed Apr 5, 2024
1 parent 1f609a3 commit ce559e2
Show file tree
Hide file tree
Showing 9 changed files with 768 additions and 1 deletion.
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,24 @@ This only works on Linux because on Windows creating a ILuaInterface on another
- [x] resource (untested!)
- [x] system (untested!)
- [x] gmod (untested!)
- [ ] game (untested!)
- - [ ] game.AddDecal
- - [ ] game.CleanUpMap
- - [ ] game.GetGlobalCounter
- - [ ] game.GetGlobalState
- - [ ] game.GetMapNext
- - [ ] game.GetSkillLevel
- - [ ] game.GetTimeScale
- - [ ] game.GetWorld
- - [ ] game.KickID
- - [ ] game.LoadNextMap
- - [ ] game.MountGMA
- - [ ] game.RemoveRagdolls
- - [ ] game.SetGlobalCounter
- - [ ] game.SetGlobalState
- - [ ] game.SetSkillLevel
- - [ ] game.SetTimeScale
- - [ ] game.StartSpot

### Classes
- [x] Angle (untested)
Expand Down Expand Up @@ -81,7 +99,6 @@ I listed all Libraries below that are serverside. Regardless if they are impleme
- - [ ] duplicator
- - [ ] effects
- - [ ] ents
- - [ ] game
- - [ ] gamemode
- - [ ] gmsave
- - [ ] hook
Expand Down
8 changes: 8 additions & 0 deletions source/detours.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ void* g_pGlobalLuaLibraryFactory;
ConCommand_IsBlocked func_ConCommand_IsBlocked;
TUTIL_GetCommandClient func_UTIL_GetCommandClient;
TEditor_SendCommand func_Editor_SendCommand;
TGMOD_LoadParticleConfigFile func_GMOD_LoadParticleConfigFile;
TGetAmmoDef func_GetAmmoDef;

CLuaGameCallback_CreateLuaObject func_CLuaGameCallback_CreateLuaObject;
CLuaGameCallback_DestroyLuaObject func_CLuaGameCallback_DestroyLuaObject;
Expand Down Expand Up @@ -184,6 +186,12 @@ void Symbols_Init()
func_Editor_SendCommand = (TEditor_SendCommand)FindFunction(server_loader.GetModule(), Editor_SendCommandSym);
CheckFunction(func_Editor_SendCommand, "Editor_SendCommand");

func_GMOD_LoadParticleConfigFile = (TGMOD_LoadParticleConfigFile)FindFunction(server_loader.GetModule(), GMOD_LoadParticleConfigFileSym);
CheckFunction(func_GMOD_LoadParticleConfigFile, "GMOD_LoadParticleConfigFile");

func_GetAmmoDef = (TGetAmmoDef)FindFunction(server_loader.GetModule(), GetAmmoDefSym);
CheckFunction(func_GetAmmoDef, "GetAmmoDef");

/*
CLuaGameCallback stuff
*/
Expand Down
8 changes: 8 additions & 0 deletions source/detours.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,14 @@ const std::vector<Symbol> Editor_SendCommandSym = {
Symbol::FromName("_Z18Editor_SendCommandPKcb"),
};

typedef void* (*TGMOD_LoadParticleConfigFile)(const char*, bool);
extern TGMOD_LoadParticleConfigFile func_GMOD_LoadParticleConfigFile;
const Symbol GMOD_LoadParticleConfigFileSym = Symbol::FromName("_Z27GMOD_LoadParticleConfigFilePKcb");

typedef void* (*TGetAmmoDef)();
extern TGetAmmoDef func_GetAmmoDef;
const Symbol GetAmmoDefSym = Symbol::FromName("_Z10GetAmmoDefv");

/*
CLuaGameCallback stuff
*/
Expand Down
Loading

0 comments on commit ce559e2

Please sign in to comment.