[DiscordArchive] But I am a bit confused by the structure of the packet...
[DiscordArchive] But I am a bit confused by the structure of the packet...
Archived author: Vel • Posted: 2025-09-09T13:36:48.496000+00:00
Original source
But I am a bit confused by the structure of the packet...
```c++
class LoginSetTimeSpeed final : public ServerPacket
{
public:
explicit LoginSetTimeSpeed() : ServerPacket(SMSG_LOGIN_SET_TIME_SPEED, 20) { }
WorldPacket const* Write() override;
float NewSpeed = 0.0f;
int32 ServerTimeHolidayOffset = 0;
WowTime GameTime;
WowTime ServerTime;
int32 GameTimeHolidayOffset = 0;
};
```
Should the packet be constructed in this order or some other?
Archived author: Tea • Posted: 2025-09-09T13:37:47.178000+00:00
Original source
its just a regular c++ struct, it doesnt matter what order you assign the fields
Archived author: Vel • Posted: 2025-09-09T13:38:13.989000+00:00
Original source
Well uh, I try to construct it in LUA.
Archived author: Fabian • Posted: 2025-09-09T13:40:18.872000+00:00
Original source
if you want the order in the buffer you gotta look at the Write function in the cpp for that packet
Archived author: Tea • Posted: 2025-09-09T13:40:35.315000+00:00
Original source
well, no, you should just construct it in the c function exposed to lua
Archived author: Vel • Posted: 2025-09-09T13:42:57.510000+00:00
Original source
OOOH!
Archived author: Vel • Posted: 2025-09-09T13:43:07.283000+00:00
Original source
Thank you. This explains a LOT now!
```c++
WorldPacket const* LoginSetTimeSpeed::Write()
{
_worldPacket << ServerTime;
_worldPacket << GameTime;
_worldPacket << float(NewSpeed);
_worldPacket << uint32(ServerTimeHolidayOffset);
_worldPacket << uint32(GameTimeHolidayOffset);
return &_worldPacket;
}
```
Archived author: Tea • Posted: 2025-09-09T13:43:57.369000+00:00
Original source
keep in mind that GameTime/ServerTime are WowTime type
Archived author: Tea • Posted: 2025-09-09T13:44:11.940000+00:00
Original source
meaning they do that silly bit shifting packing stuff
Archived author: Vel • Posted: 2025-09-09T13:44:48.208000+00:00
Original source
Does it work like the unix but from the 2000 or something like that if I recal correctly?