Gamestudio Links
Zorro Links
Newest Posts
Z9 getting Error 058
by jcl. 06/16/26 09:51
How to select between IB accounts by script?
by AndrewAMD. 06/13/26 15:44
Zorro tutorial ideas?
by AndrewAMD. 06/13/26 15:01
Zorro 3.01 recoded MMI function issue
by 11honza11. 06/13/26 11:40
Stooq now requires an API key
by AndrewAMD. 06/11/26 17:55
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
0 registered members (), 3,467 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Student_64151, Koti, curry, DeepxKalsi, Samed
19219 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
working enet example #183477
02/12/08 12:15
02/12/08 12:15
Joined: Jul 2005
Posts: 1,930
Austria
Dark_samurai Offline OP
Serious User
Dark_samurai  Offline OP
Serious User

Joined: Jul 2005
Posts: 1,930
Austria
Hi everybody!
Has anyone seen an small enet example, or a good tutorial about it? I tried to make a small console app (based on the code snippets from the enet page), which connects a client with a server. But I faild, because I don't get a connection. The only example I got was from NFS42, but it seems after compiling it, it doesn't work anymore (no connection). Although the exe I got from him works without any problems.
I searched more than 2 hours on the net and couldn't find any tutorials or other examples about enet! Maybe you know any tutorials or examples?

Thanks for your help!

Dark_Samurai


ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)!
get free version
Re: working enet example [Re: Dark_samurai] #183478
02/12/08 20:09
02/12/08 20:09
Joined: Jun 2001
Posts: 1,004
Dossenbach
N
nfs42 Offline
Serious User
nfs42  Offline
Serious User
N

Joined: Jun 2001
Posts: 1,004
Dossenbach
Hi Dark,

there was a typo in one line, sorry for this
change
Code:
        // connect to server:
enet_address_set_host (&address, argv[2]);


to
Code:
        // connect to server:
enet_address_set_host (&address, argv[3]);



download zip


Andreas
GSTools - Home of
GSTScript 0.9.8: lua scripting for A6/7/8
GSTNet 0.7.9.20: network plugin for A6/7/8
GSTsqlite 1.3.7: sql database plugin for A6/7/8
3DGS Codebase: 57 snippets || 3DGS Downloads: 248 files
Re: working enet example [Re: nfs42] #183479
02/13/08 13:37
02/13/08 13:37
Joined: Jul 2005
Posts: 1,930
Austria
Dark_samurai Offline OP
Serious User
Dark_samurai  Offline OP
Serious User

Joined: Jul 2005
Posts: 1,930
Austria
Thanks for your help, now it works!

I have another small problem:
Client1 wants to send something only to Client2. So he needs the peer of Client2, but how can I get this? I thought about sending it, but it looks like I can't send structs, or am I wrong?

Thanks for your help!

Dark_Samurai


ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)!
get free version
Re: working enet example [Re: Dark_samurai] #183480
02/13/08 19:57
02/13/08 19:57
Joined: Jun 2001
Posts: 1,004
Dossenbach
N
nfs42 Offline
Serious User
nfs42  Offline
Serious User
N

Joined: Jun 2001
Posts: 1,004
Dossenbach
for peer to peer connections you need a sender (enet client) AND a listener (enet server) in every game client app.


Andreas
GSTools - Home of
GSTScript 0.9.8: lua scripting for A6/7/8
GSTNet 0.7.9.20: network plugin for A6/7/8
GSTsqlite 1.3.7: sql database plugin for A6/7/8
3DGS Codebase: 57 snippets || 3DGS Downloads: 248 files
Re: working enet example [Re: nfs42] #183481
02/14/08 10:51
02/14/08 10:51
Joined: Jul 2005
Posts: 1,930
Austria
Dark_samurai Offline OP
Serious User
Dark_samurai  Offline OP
Serious User

Joined: Jul 2005
Posts: 1,930
Austria
So you mean that the Client always sends his message to the server, and the server sends it to the other Client(s)?

Dark_Samurai


ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)!
get free version
Re: working enet example [Re: Dark_samurai] #183482
02/14/08 12:15
02/14/08 12:15
Joined: Jun 2001
Posts: 1,004
Dossenbach
N
nfs42 Offline
Serious User
nfs42  Offline
Serious User
N

Joined: Jun 2001
Posts: 1,004
Dossenbach
no, that's a true client/server model

for peer to peer every client must accept requested connections from any other client. so every game client works as a non-dedicated server running also as client.

GSTNet is client/server, so there is no possibilty for a client to connect to another client. all transfer is managed by the server.

http://de.wikipedia.org/wiki/Peer_to_peer


Andreas
GSTools - Home of
GSTScript 0.9.8: lua scripting for A6/7/8
GSTNet 0.7.9.20: network plugin for A6/7/8
GSTsqlite 1.3.7: sql database plugin for A6/7/8
3DGS Codebase: 57 snippets || 3DGS Downloads: 248 files
Re: working enet example [Re: nfs42] #183483
02/14/08 14:39
02/14/08 14:39
Joined: Jul 2005
Posts: 1,930
Austria
Dark_samurai Offline OP
Serious User
Dark_samurai  Offline OP
Serious User

Joined: Jul 2005
Posts: 1,930
Austria
But why do you use a real client/server model for GSTNet?
Wouldn't it need less data transfer if you can send something directly to a Client instead of sending it to the server and then to the other Clients?

Dark_Samurai


ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)!
get free version
Re: working enet example [Re: Dark_samurai] #183484
02/20/08 08:46
02/20/08 08:46
Joined: Apr 2006
Posts: 136
San Francisco
T
Tor Offline
Member
Tor  Offline
Member
T

Joined: Apr 2006
Posts: 136
San Francisco
Oi, there's a whole issue with peer-to-peer and server/client.

Mostly, with peer-to-peer it's impossible to stop the clients from just sending whatever packets they want (this is what made it so hard to stop the hacks in Diablo2).

In a pure client/server architecture, the client checks and OKs everything. There is much less probability for cheating.

Also, in a peer-to-peer, if a player enters with a shitty connection, he will be sending out late packets to everyone and generally getting away with murder. He can shoot at everyone and hit them on his screen, send out the packet, the client would then have to determine if he was at xyz location at t time etc etc.

big nightmare.

Much better to just have:

clientA sendshotpacket @locxyz;
server recieves packet
server checks if clientB gets hit;
server returns yes/no packet;


"Towlie, you're the worst character ever." I know...
Re: working enet example [Re: Tor] #183485
02/20/08 16:22
02/20/08 16:22
Joined: Jul 2005
Posts: 1,930
Austria
Dark_samurai Offline OP
Serious User
Dark_samurai  Offline OP
Serious User

Joined: Jul 2005
Posts: 1,930
Austria
Ok, thanks for answering!

Dark_Samurai


ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)!
get free version
Re: working enet example [Re: Dark_samurai] #183486
02/21/08 02:41
02/21/08 02:41
Joined: Apr 2006
Posts: 136
San Francisco
T
Tor Offline
Member
Tor  Offline
Member
T

Joined: Apr 2006
Posts: 136
San Francisco
Also, peer to peer scales exponentially, which client/server doesn't.

(peer to peer has to send data to everyone connected...which means individual clients must have HUGE internet pipes...instead of just one central server with a huge pipe.)


"Towlie, you're the worst character ever." I know...

Moderated by  TWO 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1