• Advertisement


This topic is now archived and is closed to further replies.

Multiplayer using HawkNL

This topic is 5742 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

Hi, I want to create a VERY basic RPG game (please no comments or long stories saying give up and dont try). Nothing fancy just a 2D OpenGL engine (which Im almost done) and a client server interface using HawkNL, I havent coded anything for the internet before so I was wondering if there are any simple articles for server creation, possibly using HawkNL (some ones basic source code). I have a basic understanding of the client-server layout but would like to see some psuedo code for the server or atleast basic code with many comments for a server. Thanks in advance for anyone willing to point me in a direction.

Share this post

Link to post
Share on other sites
I have come to this issue too and had the similar problem - how do i do it?

I have discovered http://code.jakobbieling.de/
CNetworking v2

for class CNetworking concentrate on these methods
Listens at a specified port.

Stops the listen process.

Returns the first accepted connection.

returns the number of pending connections


class CConnection - concentrate on these methods
Connect to a specified IP and port.

Close the connection.

Send data over the current connection.

Receive pending data.


there are more methods than that, but i used them to create a multi-user server-client chat program. piece of cake. as easy as using java almost.

in summary. All communication controlled by the CConnection class. The clients have 1 each to send and receive data to the server. you connect to the server using the ''Connect(int port)'' method.

specifically the server
The server however start by setting up a CNetworking class. You use the method ''Listen(port)'' to start this. Then during each loop you see if there are any connection attempts from a client (using the method ''HasAccepted()'' ) if there are pending connections start making new CConnection objects with CNetworking''s GetAccepted method. that''ll return a pointer to a connection object.

now happily, u have a connection object on the client side and one of the server side. then u can get talking.

Share this post

Link to post
Share on other sites
hey, i am in exactly the same situation! right now i''m looking at CNetworking v2.0, but it seems to be windows only (winsock only)... that''s why i prefer to learn HawkNL better, all i need is some article desribing the whole process in general.

my project

Share this post

Link to post
Share on other sites

  • Advertisement