aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDLL/scriptjson.cpp
diff options
context:
space:
mode:
authorBobTheBob9 <for.oliver.kirkham@gmail.com>2022-09-15 00:20:56 +0100
committerBobTheBob9 <for.oliver.kirkham@gmail.com>2022-09-15 00:20:56 +0100
commitba26be9bea801f219fa6340178fd6b13f02d574e (patch)
treef50e67e06f7174daca0c97cf95659c7cbcef8151 /NorthstarDLL/scriptjson.cpp
parentd2907aa522d56a4baacec1c17426f7d6f1fae3a2 (diff)
downloadNorthstarLauncher-ba26be9bea801f219fa6340178fd6b13f02d574e.tar.gz
NorthstarLauncher-ba26be9bea801f219fa6340178fd6b13f02d574e.zip
clang format, fix issues with server registration and rpak loading
Diffstat (limited to 'NorthstarDLL/scriptjson.cpp')
-rw-r--r--NorthstarDLL/scriptjson.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/NorthstarDLL/scriptjson.cpp b/NorthstarDLL/scriptjson.cpp
index 62074587..a9767615 100644
--- a/NorthstarDLL/scriptjson.cpp
+++ b/NorthstarDLL/scriptjson.cpp
@@ -97,8 +97,10 @@ DecodeJsonTable(HSquirrelVM* sqvm, rapidjson::GenericValue<rapidjson::UTF8<char>
}
}
-template <ScriptContext context>
-void EncodeJSONTable(SQTable* table, rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<SourceAllocator>>* obj, rapidjson::MemoryPoolAllocator<SourceAllocator>& allocator)
+template <ScriptContext context> void EncodeJSONTable(
+ SQTable* table,
+ rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<SourceAllocator>>* obj,
+ rapidjson::MemoryPoolAllocator<SourceAllocator>& allocator)
{
for (int i = 0; i < table->_numOfNodes; i++)
{
@@ -257,7 +259,11 @@ template <ScriptContext context> SQRESULT SQ_EncodeJSON(HSquirrelVM* sqvm)
ON_DLL_LOAD_CLIENT_RELIESON("client.dll", ClientScriptJSON, ClientSquirrel, (CModule module))
{
g_pSquirrel<ScriptContext::CLIENT>->AddFuncRegistration(
- "table", "DecodeJSON", "string json, bool fatalParseErrors = false", "converts a json string to a squirrel table", SQ_DecodeJSON<ScriptContext::CLIENT>);
+ "table",
+ "DecodeJSON",
+ "string json, bool fatalParseErrors = false",
+ "converts a json string to a squirrel table",
+ SQ_DecodeJSON<ScriptContext::CLIENT>);
g_pSquirrel<ScriptContext::CLIENT>->AddFuncRegistration(
"string", "EncodeJSON", "table data", "converts a squirrel table to a json string", SQ_EncodeJSON<ScriptContext::CLIENT>);
@@ -273,4 +279,4 @@ ON_DLL_LOAD_RELIESON("server.dll", ServerScriptJSON, ServerSquirrel, (CModule mo
"table", "DecodeJSON", "string json", "converts a json string to a squirrel table", SQ_DecodeJSON<ScriptContext::SERVER>);
g_pSquirrel<ScriptContext::SERVER>->AddFuncRegistration(
"string", "EncodeJSON", "table data", "converts a squirrel table to a json string", SQ_EncodeJSON<ScriptContext::SERVER>);
-} \ No newline at end of file
+}