I would like some advices

Started by
2 comments, last by shocobenn 10 years, 5 months ago

Hi ! Like a lot of people here i'm working on a game and I would like to add it a multiplayer part smile.png.

I looked the populars C++ libraries (Raknet, Ice, POCO) and the only one who is attracting me is eNet, because the 3 others have a lot of features that I don't want to use / I don't understand.

But I think that i'm going to make my own winsock server, so i'm going to ask some questions to see if I won't have to reinvent the wheel by doing this.

  1. What kinds of things should I add to a basic winsock server to have a minimum of security / efficiency?
  2. Is it really usefull to have such complete libraries like Ice, POCO and raknet for a game ?
  3. Is eNet already effective for a game or will I have to add security / packet management things ?

Thanks for your help.

Advertisement

What kinds of things should I add to a basic winsock server to have a minimum of security / efficiency?


Security:
- Protection against protocol errors (avoid buffer overflows etc.)
- Proper authentication.
- Proper authorization.

Efficiency:
- Proper use of OS-level primitives, like I/O completion ports, or kpoll/epoll/whatever.

Is it really usefull to have such complete libraries like Ice, POCO and raknet for a game ?


Yes, in the same way it's useful to have a sound playback/effects engine instead of building your own sound system, and a graphics/rendering engine, instead of building your own rendering system.

Is eNet already effective for a game or will I have to add security / packet management things ?


eNet manages packets and does not, in itself, have buffer overflow vulnerabilities.

You will have to add authentication and authorization yourself, and you will have to make sure that your use of eNet does not introduce security vulnerabilities in your higher-level code.
enum Bool { True, False, FileNotFound };

Thank you :) Then, I think i'll use Boost.asio because I can easily find tutorials for this one.

Ice looks weird with its string commands...

And POCO slides are not really helpfull to start... If someone know which slide will teach me how to setup a stream / datagram connection, please say which one, I only see HTTP requests.

Hi ! After a little work with Boost.asio here is what I can say about starting with it :

If you want to learn and practice low level networking :

You should use boost, which allow you to do basic networking stuff without care about the threads stuff. The tutorials and samples are really good to start and you'll be able to understand faster other libraries.

If you don't want to learn low level networking (You need to decode the header... the body...) and want to quickly setup your network :

Use raknet. You can find it on github here, and if you're an indie and your budget is less than 100K, raknet will stay free for you. You will be able to quickly make a chat with the RPC functions (that's magical !).

This topic is closed to new replies.

Advertisement