Ok, I'm starting to feel the pangs of intense frustration setting in. I've successully been testing my game using Gnet by connecting to 127.0.0.1 but when I attempt to connect to someone else on the internet I don't get any kind of connection. I've also tried connecting to myself using my non-local ip address which doesn't work.
I'm using mark's gnetchat.bmx as a base to attempt this but everything I do leads me to the inexorable conclusion that it doesn't work.
I've tried shutting off my windows firewall - doesn't work
I've tried opening a port in the firewall - doesn't work
I've tried allowing firewall exception access to the gnetchat.debug.exe file - doesn't work
I've tried opening the port on my router - doesn't work
I've tried setting my router to DMZ - doesn't work
Am I missing something? Has anyone got this working successully? Is it my setup? Am I protecting my pc so much that I might make it impossible to handle multiplayer games?
* run the chat and listen
* run another chat and connect to the remote IP it states.
* no connection
Any help would be greatly appreciated.
See below for Mark's code:
Matt
I'm using mark's gnetchat.bmx as a base to attempt this but everything I do leads me to the inexorable conclusion that it doesn't work.
I've tried shutting off my windows firewall - doesn't work
I've tried opening a port in the firewall - doesn't work
I've tried allowing firewall exception access to the gnetchat.debug.exe file - doesn't work
I've tried opening the port on my router - doesn't work
I've tried setting my router to DMZ - doesn't work
Am I missing something? Has anyone got this working successully? Is it my setup? Am I protecting my pc so much that I might make it impossible to handle multiplayer games?
* run the chat and listen
* run another chat and connect to the remote IP it states.
* no connection
Any help would be greatly appreciated.
See below for Mark's code:
Matt
Strict AppTitle="GNet Test2" Local host:TGNetHost=CreateGNetHost() Local me:TGNetObject Local chat$,info$ Graphics 520,200,0,15 Local ip$=GetIP() Repeat Local c=GetChar() Select c Case 8 If chat chat=chat[..chat.length-1] Case 27 'If Confirm( "Quit?" ) CloseGNetHost host End 'EndIf Case 13 If chat.find("/")=0 chat=chat[1..] Local cmd$=chat Local arg$ Local i=chat.find(" ") If i<>-1 cmd=chat[..i] arg=chat[i+1..] EndIf Select cmd Case "create" If me info="Already created" Else me=CreateGNetObject( host ) SetGNetString me,0,arg SetGNetString me,1,"Ready" EndIf Case "close" If me CloseGNetObject me me=Null Else info="Not created" EndIf Case "quit","exit" CloseGNetHost host End Case "nick" If arg If me SetGNetString me,0,arg info="Nick changed to "+arg Else info="Expecting arg" EndIf Case "listen" Local port=17263 If arg port=Int(arg) If GNetListen( host,port ) info="Listening on port "+port+" / "+ip Else info="Listen failed" EndIf Case "connect" If arg Local addr$=arg Local port=17263 Local i=arg.find(":") If i<>-1 addr=arg[..i] port=Int(arg[i+1..]) EndIf If GNetConnect( host,addr,port ) info="Connected to "+addr+":"+port Else info="Failed to connect to "+addr+":"+port EndIf Else info="Expecting arg" EndIf Default info="Unrecognized command '"+cmd+"'" End Select Else If me SetGNetString me,1,chat EndIf chat="" Default If c>31 And c<127 chat:+Chr(c) End Select GNetSync host Cls Local y,h=GraphicsHeight() For Local obj:TGNetObject=EachIn GNetObjects( host,GNET_ALL ) If obj.state()=GNET_CLOSED Continue If obj=me SetColor 255,255,255 Else SetColor 0,128,255 EndIf DrawText GetGNetString( obj,0 )+":"+GetGNetString( obj,1 ),0,y y:+16 Next SetColor 255,0,0 ' Local cons:TList=GNetPeers( host ) SetColor 255,255,0 DrawText info,0,h-32 SetColor 0,255,0 DrawText ">"+chat,0,h-16 DrawRect TextWidth(">"+chat),h-16,8,16 DrawText "/create nick /listen /connect host /quit /nick newnick",0,h-48 Flip Forever Function getIP$() Local ip$="" 'get internet ip address '*** you will need to specify your own URl here & change the text search below *** Local ipStream:TStream = ReadStream("http::www.whatismyip.com/automation/n09230945.asp") If ipStream ip$ =ReadLine(ipStream) EndIf CloseStream ipStream Return ip End Function