aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/squirrel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'NorthstarDedicatedTest/squirrel.cpp')
-rw-r--r--NorthstarDedicatedTest/squirrel.cpp65
1 files changed, 65 insertions, 0 deletions
diff --git a/NorthstarDedicatedTest/squirrel.cpp b/NorthstarDedicatedTest/squirrel.cpp
index a0680d9a..4d305ee2 100644
--- a/NorthstarDedicatedTest/squirrel.cpp
+++ b/NorthstarDedicatedTest/squirrel.cpp
@@ -94,6 +94,12 @@ sq_getboolType ServerSq_getbool;
sq_getType ClientSq_sq_get;
sq_getType ServerSq_sq_get;
+sq_newSlotType ServerSq_newSlot;
+sq_newSlotType ClientSq_newSlot;
+
+sq_newTableType ServerSq_newTable;
+sq_newTableType ClientSq_newTable;
+
template <ScriptContext context> void ExecuteCodeCommand(const CCommand& args);
// inits
@@ -153,6 +159,10 @@ void InitialiseClientSquirrel(HMODULE baseAddress)
ClientSq_defconst = (sq_defconst)((char*)baseAddress + 0x12120);
+ // Table functions
+ ClientSq_newTable = (sq_newTableType)((char*)baseAddress + 0x5940);
+ ClientSq_newSlot = (sq_newSlotType)((char*)baseAddress + 0x70B0);
+
ENABLER_CREATEHOOK(
hook,
(char*)baseAddress + 0x26130,
@@ -210,6 +220,9 @@ void InitialiseServerSquirrel(HMODULE baseAddress)
ServerSq_defconst = (sq_defconst)((char*)baseAddress + 0x1F550);
+ ServerSq_newSlot = (sq_newSlotType)((char*)baseAddress + 0x7080);
+ ServerSq_newTable = (sq_newTableType)((char*)baseAddress + 0x3960);
+
ENABLER_CREATEHOOK(
hook,
(char*)baseAddress + 0x1FE90,
@@ -499,6 +512,58 @@ template <ScriptContext context> int64_t RegisterSquirrelFuncHook(void* sqvm, SQ
return ClientRegisterSquirrelFunc(sqvm, funcReg, unknown);
}
+const char* sq_getTypeName(int type)
+{
+ switch (type)
+ {
+ case OT_ASSET:
+ return "asset";
+ case OT_INTEGER:
+ return "int";
+ case OT_BOOL:
+ return "bool";
+ case SQOBJECT_NUMERIC:
+ return "float or int";
+ case OT_NULL:
+ return "null";
+ case OT_VECTOR:
+ return "vector";
+ case 0:
+ return "var";
+ case OT_USERDATA:
+ return "userdata";
+ case OT_FLOAT:
+ return "float";
+ case OT_STRING:
+ return "string";
+ case 0x8000040:
+ return "array";
+ case 0x8000200:
+ return "function";
+ case 0x8100000:
+ return "structdef";
+ case OT_THREAD:
+ return "thread";
+ case OT_FUNCPROTO:
+ return "function";
+ case OT_CLAAS:
+ return "class";
+ case OT_WEAKREF:
+ return "weakref";
+ case 0x8080000:
+ return "unimplemented function";
+ case 0x8200000:
+ return "struct instance";
+ case 0xA000020:
+ return "table";
+ case 0xA008000:
+ return "instance";
+ case 0xA400000:
+ return "entity";
+ }
+ return "";
+}
+
SQReturnTypeEnum GetReturnTypeEnumFromString(const char* returnTypeString)
{