Sign in to follow this  

Factories in RakNet

This topic is 3742 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

This question is for a RakNet expert =) Originally I had an ugly structures implementation(non-raknet) and a huge case statement on the server opcode. It was ugly. TCP Now I have message factories where the appropriate message class is referenced for its size(of message-can be variable if message has strings) is pulled from class and when the entire message is received(gotta luv TCP) it passes that to a Deserialize function that pulls the data out to the class and then call Invoke. I include the same files into client and server and use #ifdef to make sure that only the correct one processes code in invoke. If i make a new message, i copy my template file and search and replace __NAME__ and boom i got a new message. i love this. it is still TCP and has some flaws and is somewhat dependant on Windows. It could be fairly easily ported i believe, however. There are a lot of changes going on in my game and if a rebuild comes out of this, moving to RakNet with a reliable UDP would be good. Will i be able to get the same ease of networking out of RakNet? Like I said, its practically copy paste message right now. There are some hang ups but its kinda nice. I'm reading RakNet documentation right now. I want a really high level interface to networking, non-OO was a nightmare in networking. Edit: RakNetworkFactory.h is an implementation of the factory design pattern, used to get a pointer to RakPeer, RakServer, and RakClient I think this is going down my alley... we will see.

Share this post


Link to post
Share on other sites

This topic is 3742 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this