Skip to content

Commit

Permalink
fix bug and update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jadebenn committed Dec 14, 2024
1 parent c4630c4 commit 91d61aa
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions dGame/dUtilities/SlashCommandHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1057,9 +1057,9 @@ void SlashCommandHandler::Startup() {
RegisterCommand(InstanceInfoCommand);

Command ServerUptimeCommand{
.help = "Display the time the current server has been active",
.info = "Display the time the current server has been active",
.aliases = { "serveruptime", "uptime" },
.help = "Display the time the current world server has been active",
.info = "Display the time the current world server has been active",
.aliases = { "uptime" },
.handle = GMZeroCommands::ServerUptime,
.requiredLevel = eGameMasterLevel::CIVILIAN
};
Expand Down
5 changes: 3 additions & 2 deletions dScripts/02_server/Map/AG/NpcAgCourseStarter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ void NpcAgCourseStarter::OnUse(Entity* self, Entity* user) {
if (!scriptedActivityComponent) return;

const auto selfId = self->GetObjectID();
const auto userId = user->GetObjectID();
const auto userSysAddr = user->GetSystemAddress();

if (scriptedActivityComponent->GetActivityPlayerData(user->GetObjectID()) != nullptr) {
if (scriptedActivityComponent->GetActivityPlayerData(userId) != nullptr) {
GameMessages::SendNotifyClientObject(selfId, u"exit", 0, 0, LWOOBJID_EMPTY, "", userSysAddr);
} else {
GameMessages::SendNotifyClientObject(selfId, u"start", 0, 0, LWOOBJID_EMPTY, "", userSysAddr);
Expand All @@ -44,7 +45,7 @@ void NpcAgCourseStarter::OnMessageBoxResponse(Entity* self, Entity* sender, int3
GameMessages::SendNotifyClientObject(selfId, u"start_timer", 0, 0, LWOOBJID_EMPTY, "", senderSysAddr);
GameMessages::SendActivityStart(selfId, senderSysAddr);

auto* const data = scriptedActivityComponent->AddActivityPlayerData(selfId);
auto* const data = scriptedActivityComponent->AddActivityPlayerData(senderId);
if (data->values[1] != 0) return;

const auto raceStartTime = Game::server->GetUptime() + std::chrono::seconds(4); // Offset for starting timer
Expand Down
1 change: 1 addition & 0 deletions docs/Commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
|setannmsg|`/setannmsg <title>`|Sets the message of an announcement.|8|
|setanntitle|`/setanntitle <title>`|Sets the title of an announcement.|8|
|shutdownuniverse|`/shutdownuniverse`|Sends a shutdown message to the master server. This will send an announcement to all players that the universe will shut down in 10 minutes.|9|
|uptime|`/uptime`|Displays the time the current world server has been active.|10|

## Development Commands

Expand Down

0 comments on commit 91d61aa

Please sign in to comment.