-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|611|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
SoCoder -> Blogs Home -> Blogs


 
Afr0
Created : 08 September 2009
Edited : 08 September 2009
System : Mac

How to handle packets

How to handle packets dynamically



As you can see from this screenshot, I've registered an SWG (Star Wars Galaxies) packethandler in the code for the UDP socket here.
This is done through a single event which has a very simple interface, so it can easily be replaced with other games like Everquest.
If you wanted to, you could also start up another Server instance listening to another UDP and TCP port, and with some small modifications to the code you'd then be able to listen to two incoming protocols at once.

The call to hook the event looks like this:



And the packethandler implementation is as simple as:


 

Comments