Skip to content

Commit

Permalink
Some changes
Browse files Browse the repository at this point in the history
  • Loading branch information
RaphaelIT7 committed Apr 5, 2024
1 parent 58493d5 commit 714b879
Show file tree
Hide file tree
Showing 7 changed files with 137 additions and 122 deletions.
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -314,4 +314,20 @@ Contains module base and manages everything for Init and Shutdown.

Files:
- `lua_threaded.h`
- `lua_threaded.cpp`
- `lua_threaded.cpp`


## Some notes

### NW
For the NW System I'm going to need CLuaNetworkedVars.
CLuaNetworkedVars::FindEntityVar -- Returns a LuaNetworkedVar_t. GetNW* and GetGlobal functions are gonna require this.
CLuaNetworkedVars::SetNetworkedVar -- Give it everything it needs and it'll do the rest. Probably going to need to add a mutex to it.
Als going to need LuaNetworkedVarEnts_t and going to recreate BuildNetworkVarTable & BuildEntityNetworkVarTable
[This could become useful](https://github.com/11Lee1/gmsv_extra/blob/294dbc1e31eca6f086605767e0495cf64348bd85/gmsv_extra/Garry's%20Mod/GLUA/LuaNetworkedVars.h)

### NW2
This is going to be pain.
Going to need g_pServerWorldTable, SetDataTableVar, IGMODDataTable, CGMODVariant.
Already got: [IGMODDataTable](https://github.com/danielga/sourcesdk-minimal/blob/1cacb57cd36ee5b77c970e91fff374046aa8574d/public/GarrysMod/IGMODDataTable.h#L5)
ToDo: Find out what the CGMODVariant is.
6 changes: 3 additions & 3 deletions source/CLuaGameCallback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
#include "Color.h"
#include "detours.h"

ILuaObject* CLuaGameCallback::CreateLuaObject()
GarrysMod::Lua::ILuaObject* CLuaGameCallback::CreateLuaObject()
{
return func_CLuaGameCallback_CreateLuaObject(this);
}

void CLuaGameCallback::DestroyLuaObject(ILuaObject* pObject)
void CLuaGameCallback::DestroyLuaObject(GarrysMod::Lua::ILuaObject* pObject)
{
func_CLuaGameCallback_DestroyLuaObject(this, pObject);
}
Expand All @@ -32,4 +32,4 @@ void CLuaGameCallback::LuaError(const CLuaError* error)
func_CLuaGameCallback_LuaError(this, (void*)error);
}

void CLuaGameCallback::InterfaceCreated(ILuaInterface* iface) {} // Unused
void CLuaGameCallback::InterfaceCreated(GarrysMod::Lua::ILuaInterface* iface) {} // Unused
11 changes: 4 additions & 7 deletions source/CLuaGameCallback.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
#include <GarrysMod/Lua/LuaGameCallback.h>
#include <string>
#include <vector>

using namespace GarrysMod::Lua;

struct CLuaError
{
struct StackEntry
Expand All @@ -19,14 +16,14 @@ struct CLuaError
std::vector<StackEntry> stack;
};

class CLuaGameCallback : public ILuaGameCallback
class CLuaGameCallback : public GarrysMod::Lua::ILuaGameCallback
{
public:
ILuaObject *CreateLuaObject();
void DestroyLuaObject(ILuaObject* pObject);
GarrysMod::Lua::ILuaObject *CreateLuaObject();
void DestroyLuaObject(GarrysMod::Lua::ILuaObject* pObject);
void ErrorPrint(const char* error, bool);
void Msg(const char* msg, bool);
void MsgColour(const char* msg, const Color& color);
void LuaError(const CLuaError* error);
void InterfaceCreated(ILuaInterface* iface);
void InterfaceCreated(GarrysMod::Lua::ILuaInterface* iface);
};
Loading

0 comments on commit 714b879

Please sign in to comment.