|
|
@ -20,8 +20,25 @@ void WorldstateFunctions::SetHour(unsigned short pid, double hour) noexcept
|
|
|
|
writeWorldstate.guid = player->guid;
|
|
|
|
writeWorldstate.guid = player->guid;
|
|
|
|
|
|
|
|
|
|
|
|
writeWorldstate.hour = hour;
|
|
|
|
writeWorldstate.hour = hour;
|
|
|
|
writeWorldstate.month = -1;
|
|
|
|
|
|
|
|
writeWorldstate.day = -1;
|
|
|
|
writeWorldstate.day = -1;
|
|
|
|
|
|
|
|
writeWorldstate.month = -1;
|
|
|
|
|
|
|
|
writeWorldstate.timeScale = -1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mwmp::Networking::get().getWorldstatePacketController()->GetPacket(ID_WORLD_TIME)->setWorldstate(&writeWorldstate);
|
|
|
|
|
|
|
|
mwmp::Networking::get().getWorldstatePacketController()->GetPacket(ID_WORLD_TIME)->Send(false);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void WorldstateFunctions::SetDay(unsigned short pid, int day) noexcept
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Player *player;
|
|
|
|
|
|
|
|
GET_PLAYER(pid, player, );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
writeWorldstate.guid = player->guid;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
writeWorldstate.hour = -1;
|
|
|
|
|
|
|
|
writeWorldstate.day = day;
|
|
|
|
|
|
|
|
writeWorldstate.month = -1;
|
|
|
|
|
|
|
|
writeWorldstate.timeScale = -1;
|
|
|
|
|
|
|
|
|
|
|
|
mwmp::Networking::get().getWorldstatePacketController()->GetPacket(ID_WORLD_TIME)->setWorldstate(&writeWorldstate);
|
|
|
|
mwmp::Networking::get().getWorldstatePacketController()->GetPacket(ID_WORLD_TIME)->setWorldstate(&writeWorldstate);
|
|
|
|
mwmp::Networking::get().getWorldstatePacketController()->GetPacket(ID_WORLD_TIME)->Send(false);
|
|
|
|
mwmp::Networking::get().getWorldstatePacketController()->GetPacket(ID_WORLD_TIME)->Send(false);
|
|
|
@ -35,15 +52,15 @@ void WorldstateFunctions::SetMonth(unsigned short pid, int month) noexcept
|
|
|
|
writeWorldstate.guid = player->guid;
|
|
|
|
writeWorldstate.guid = player->guid;
|
|
|
|
|
|
|
|
|
|
|
|
writeWorldstate.hour = -1;
|
|
|
|
writeWorldstate.hour = -1;
|
|
|
|
writeWorldstate.month = month;
|
|
|
|
|
|
|
|
writeWorldstate.day = -1;
|
|
|
|
writeWorldstate.day = -1;
|
|
|
|
|
|
|
|
writeWorldstate.month = month;
|
|
|
|
|
|
|
|
writeWorldstate.timeScale = -1;
|
|
|
|
|
|
|
|
|
|
|
|
mwmp::Networking::get().getWorldstatePacketController()->GetPacket(ID_WORLD_TIME)->setWorldstate(&writeWorldstate);
|
|
|
|
mwmp::Networking::get().getWorldstatePacketController()->GetPacket(ID_WORLD_TIME)->setWorldstate(&writeWorldstate);
|
|
|
|
mwmp::Networking::get().getWorldstatePacketController()->GetPacket(ID_WORLD_TIME)->Send(false);
|
|
|
|
mwmp::Networking::get().getWorldstatePacketController()->GetPacket(ID_WORLD_TIME)->Send(false);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WorldstateFunctions::SetDay(unsigned short pid, int day) noexcept
|
|
|
|
void WorldstateFunctions::SetTimeScale(unsigned short pid, double timeScale) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Player *player;
|
|
|
|
Player *player;
|
|
|
|
GET_PLAYER(pid, player, );
|
|
|
|
GET_PLAYER(pid, player, );
|
|
|
@ -51,8 +68,9 @@ void WorldstateFunctions::SetDay(unsigned short pid, int day) noexcept
|
|
|
|
writeWorldstate.guid = player->guid;
|
|
|
|
writeWorldstate.guid = player->guid;
|
|
|
|
|
|
|
|
|
|
|
|
writeWorldstate.hour = -1;
|
|
|
|
writeWorldstate.hour = -1;
|
|
|
|
|
|
|
|
writeWorldstate.day = -1;
|
|
|
|
writeWorldstate.month = -1;
|
|
|
|
writeWorldstate.month = -1;
|
|
|
|
writeWorldstate.day = day;
|
|
|
|
writeWorldstate.timeScale = timeScale;
|
|
|
|
|
|
|
|
|
|
|
|
mwmp::Networking::get().getWorldstatePacketController()->GetPacket(ID_WORLD_TIME)->setWorldstate(&writeWorldstate);
|
|
|
|
mwmp::Networking::get().getWorldstatePacketController()->GetPacket(ID_WORLD_TIME)->setWorldstate(&writeWorldstate);
|
|
|
|
mwmp::Networking::get().getWorldstatePacketController()->GetPacket(ID_WORLD_TIME)->Send(false);
|
|
|
|
mwmp::Networking::get().getWorldstatePacketController()->GetPacket(ID_WORLD_TIME)->Send(false);
|
|
|
|