Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I use pointers in a MMORPG emulator?

I have a MMORPG emulator, this means it will be handling packets quite a bit. Currently, I am using pointers for this, as I think when used correctly, they can speed up my server, however I've got two friends, one is telling me to use pointers, he thinks I can use them without running into trouble, my other friends says I should not use pointers, as they could make my server crash, they are unsafe, and they aren't easy to manage.

I use structs for my packet structures, so e.g. I could get its type using the following line: Ptr->Type;

What do you think?

like image 856
Basser Avatar asked Dec 03 '22 11:12

Basser


1 Answers

I think you should probably test the performance with and without pointers, and then see for yourself if the gains in performance, if any, are worth the extra complexity of using pointers.

Chances are you'll find most of the your porgram's time is spent sitting there twiddling its thumbs doing nothing while waiting on network traffic.

like image 123
Mhmmd Avatar answered Dec 19 '22 17:12

Mhmmd