Multiplayer using HawkNL
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.
MSN Messenger: Thomas_Szafran@hotmail.com
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
Listen
Listens at a specified port.
StopListen
Stops the listen process.
GetAccepted
Returns the first accepted connection.
HasAccepted
returns the number of pending connections
----------------
class CConnection - concentrate on these methods
Connect
Connect to a specified IP and port.
Disconnect
Close the connection.
Send
Send data over the current connection.
Receive
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.
client+server
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.
I have discovered http://code.jakobbieling.de/
CNetworking v2
---------------
for class CNetworking concentrate on these methods
Listen
Listens at a specified port.
StopListen
Stops the listen process.
GetAccepted
Returns the first accepted connection.
HasAccepted
returns the number of pending connections
----------------
class CConnection - concentrate on these methods
Connect
Connect to a specified IP and port.
Disconnect
Close the connection.
Send
Send data over the current connection.
Receive
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.
client+server
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.
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.
---
shurcool
my project
---
shurcool
my project
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement