diff options
Diffstat (limited to 'NorthstarDedicatedTest')
-rw-r--r-- | NorthstarDedicatedTest/plugins.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/NorthstarDedicatedTest/plugins.cpp b/NorthstarDedicatedTest/plugins.cpp index b725a5a8..62d781bb 100644 --- a/NorthstarDedicatedTest/plugins.cpp +++ b/NorthstarDedicatedTest/plugins.cpp @@ -128,11 +128,12 @@ SQRESULT SQ_UpdateGameStateClient(void* sqvm) AcquireSRWLockExclusive(&gameStateLock); AcquireSRWLockExclusive(&serverInfoLock); gameState.players = ClientSq_getinteger(sqvm, 1); - gameState.ourScore = ClientSq_getinteger(sqvm, 2); - gameState.secondHighestScore = ClientSq_getinteger(sqvm, 3); - gameState.highestScore = ClientSq_getinteger(sqvm, 4); - serverInfo.roundBased = ClientSq_getbool(sqvm, 5); - serverInfo.scoreLimit = ClientSq_getbool(sqvm, 6); + serverInfo.maxPlayers = ClientSq_getinteger(sqvm, 2); + gameState.ourScore = ClientSq_getinteger(sqvm, 3); + gameState.secondHighestScore = ClientSq_getinteger(sqvm, 4); + gameState.highestScore = ClientSq_getinteger(sqvm, 5); + serverInfo.roundBased = ClientSq_getbool(sqvm, 6); + serverInfo.scoreLimit = ClientSq_getbool(sqvm, 7); ReleaseSRWLockExclusive(&gameStateLock); ReleaseSRWLockExclusive(&serverInfoLock); return SQRESULT_NOTNULL; @@ -174,9 +175,7 @@ SQRESULT SQ_UpdateServerInfoBetweenRounds(void* sqvm) SQRESULT SQ_UpdateTimeInfo(void* sqvm) { AcquireSRWLockExclusive(&serverInfoLock); - int endTimeFromNow = ceil(ClientSq_getfloat(sqvm, 1)); - const auto p1 = std::chrono::system_clock::now().time_since_epoch(); - serverInfo.endTime = std::chrono::duration_cast<std::chrono::seconds>(p1).count() + endTimeFromNow; + serverInfo.endTime = ceil(ClientSq_getfloat(sqvm, 1)); ReleaseSRWLockExclusive(&serverInfoLock); return SQRESULT_NOTNULL; } @@ -397,7 +396,7 @@ void InitialisePluginCommands(HMODULE baseAddress) "", SQ_UpdateGameStateUI); g_ClientSquirrelManager->AddFuncRegistration( "void", "NSUpdateGameStateClient", - "int playerCount, int outScore, int secondHighestScore, int highestScore, bool roundBased, int scoreLimit", "", + "int playerCount, int maxPlayers, int outScore, int secondHighestScore, int highestScore, bool roundBased, int scoreLimit", "", SQ_UpdateGameStateClient); g_UISquirrelManager->AddFuncRegistration( "void", "NSUpdateServerInfo", |