aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmma Miler <27428383+emma-miler@users.noreply.github.com>2022-03-28 23:51:56 +0200
committerGitHub <noreply@github.com>2022-03-28 23:51:56 +0200
commit52f3f5795fa516862c0a4030df8d43f4c0cbda65 (patch)
tree2749e64310032f24bdc11f33d8fb3a7268c445f8
parentb8a7feabea6456f7fa5e8403c8d9bd2630401045 (diff)
downloadNorthstarLauncher-1.6.0-rc4.tar.gz
NorthstarLauncher-1.6.0-rc4.zip
-rw-r--r--NorthstarDedicatedTest/plugins.cpp17
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",