SFML community forums

Help => Network => Topic started by: tgm on June 16, 2008, 10:37:15 pm

Title: Packet.SetReadPos()
Post by: tgm on June 16, 2008, 10:37:15 pm
would you mind adding something like
Packet.SetReadPos()
Packet.GetReadPos()

That would certainly make some things easier ... (and it doesnt require more than 5 lines of code.)
thx in advance
Title: Packet.SetReadPos()
Post by: Laurent on June 17, 2008, 03:15:34 am
Yep, I can add them.

What would you use them for ?
Title: Packet.SetReadPos()
Post by: tgm on June 17, 2008, 03:40:17 pm
Well, I'm implementing some encryption layer protkol mixup...
got some problems, when I need to read the first 4 bytes multiple times...
drove me crazy yesterday.. (may it be, GetData() returns the pointer to data+myReadPos??)
I guess its my fault, since it did work... some time the day before yesterday -_-
not sure.. anyway.. stumbled over this nice thingy, and there certainly are some situations when you gonna need this one.
I would code that myself (won't take longer but 5mins) but honestly I already did change a bunch of things, and applying all this changes over and over again, every time you change something about one of the files is quite annoying ;)
greetz
Title: Packet.SetReadPos()
Post by: Laurent on June 17, 2008, 05:03:15 pm
Well, you don't need to modify SFML for such simple changes. Just use external non-member functions.

Anyway, maybe I'll add these functions soon ;)
Title: Packet.SetReadPos()
Post by: tgm on June 17, 2008, 06:57:14 pm
I'd love to but myReadPois ist private ;)