I really need help... GNet Establishing a Connecti

BlitzMax Forums/BlitzMax Programming/I really need help... GNet Establishing a Connecti

Apollonius(Posted 2007) [#1]
Well I've been messing around ALOT. And I just can't figure it out. (on the side note can GNet support 200 players on a dedicated server?)

How can I establish a Server & Client Connection? There's no example, tutorial of any kind. And I can't seem to figure it out, so could you please help me?

Server
AppTitle$="VF Server"
Graphics 640,480,0

VFHost=CreateGNetHost()

Repeat

If GNetListen(VFHost, 1024) Then
	DrawText("Connection!!!",10,10)
EndIf

Cls; Flip
Until KeyHit(KEY_ESCAPE)

CloseGNetHost(VFHost)
End


Client
AppTitle$="VF Client"
Graphics 640,480,0

VFHost=CreateGNetHost()

Repeat

If KeyHit(KEY_SPACE) Then
	GNetConnect(VFHost,"127.0.0.1",1024,10000)
EndIf

Until KeyHit(KEY_ESCAPE)
End



Ghost Dancer(Posted 2007) [#2]
I posted some gnet code a while back. have a look here:

http://www.blitzmax.com/codearcs/codearcs.php?code=1908

Hopefully that is of use to you?