Hi !
Ok I'm trying to understand how does GNet work.
I try to make a little server/client (separated) program that juste print on each client the name of each client (inclued himself) connected, I'm currently testing on local but It doesn't work cuz I don't realy know how to do this... that's why I beg your help :)
server.bmx
client.bmx
any help would be appreciated
Ok I'm trying to understand how does GNet work.
I try to make a little server/client (separated) program that juste print on each client the name of each client (inclued himself) connected, I'm currently testing on local but It doesn't work cuz I don't realy know how to do this... that's why I beg your help :)
server.bmx
Local host:TGNetHost=CreateGNetHost() While Not KeyHit(KEY_ESCAPE) GNetListen(host,9000) GNetSync(host) GNetAccept(host) Wend
client.bmx
Local host:TGNetHost=CreateGNetHost() Local localclient:TGNetObject=CreateGNetObject(host) Local nick:String=Input() Const slot_name = 0 SetGNetString localclient,slot_name,nick GNetConnect(host,"127.0.0.1",9000) While Not KeyHit( KEY_ESCAPE ) GNetSync(host) RefreshName() Wend Function RefreshName() For Local obj:TGNetObject=EachIn GNetObjects(host) Print GetGNetString(obj,0) Next EndFunction
any help would be appreciated