Forums WoW Modding Support Archives TrinityCore Discord Archives [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...

[DiscordArchive] But I am a bit confused by the structure of the packet...

Pages (2): 1 2 Next
rektbyfaith
Administrator
0
09-09-2025, 01:36 PM
#1
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?
rektbyfaith
09-09-2025, 01:36 PM #1

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?

rektbyfaith
Administrator
0
09-09-2025, 01:37 PM
#2
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
rektbyfaith
09-09-2025, 01:37 PM #2

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

rektbyfaith
Administrator
0
09-09-2025, 01:38 PM
#3
Archived author: Vel • Posted: 2025-09-09T13:38:13.989000+00:00
Original source

Well uh, I try to construct it in LUA.
rektbyfaith
09-09-2025, 01:38 PM #3

Archived author: Vel • Posted: 2025-09-09T13:38:13.989000+00:00
Original source

Well uh, I try to construct it in LUA.

rektbyfaith
Administrator
0
09-09-2025, 01:40 PM
#4
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
rektbyfaith
09-09-2025, 01:40 PM #4

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

rektbyfaith
Administrator
0
09-09-2025, 01:40 PM
#5
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
rektbyfaith
09-09-2025, 01:40 PM #5

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

rektbyfaith
Administrator
0
09-09-2025, 01:42 PM
#6
Archived author: Vel • Posted: 2025-09-09T13:42:57.510000+00:00
Original source

OOOH!
rektbyfaith
09-09-2025, 01:42 PM #6

Archived author: Vel • Posted: 2025-09-09T13:42:57.510000+00:00
Original source

OOOH!

rektbyfaith
Administrator
0
09-09-2025, 01:43 PM
#7
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;
}
```
rektbyfaith
09-09-2025, 01:43 PM #7

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;
}
```

rektbyfaith
Administrator
0
09-09-2025, 01:43 PM
#8
Archived author: Tea • Posted: 2025-09-09T13:43:57.369000+00:00
Original source

keep in mind that GameTime/ServerTime are WowTime type
rektbyfaith
09-09-2025, 01:43 PM #8

Archived author: Tea • Posted: 2025-09-09T13:43:57.369000+00:00
Original source

keep in mind that GameTime/ServerTime are WowTime type

rektbyfaith
Administrator
0
09-09-2025, 01:44 PM
#9
Archived author: Tea • Posted: 2025-09-09T13:44:11.940000+00:00
Original source

meaning they do that silly bit shifting packing stuff
rektbyfaith
09-09-2025, 01:44 PM #9

Archived author: Tea • Posted: 2025-09-09T13:44:11.940000+00:00
Original source

meaning they do that silly bit shifting packing stuff

rektbyfaith
Administrator
0
09-09-2025, 01:44 PM
#10
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?
rektbyfaith
09-09-2025, 01:44 PM #10

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?

Pages (2): 1 2 Next
Recently Browsing
 1 Guest(s)
Recently Browsing
 1 Guest(s)