Greetings.
I have been using Darknet for some LAN application with great success. I've been having trouble locating a proper tutorial for internet connections, particularly those using Darknet. I'm primarily looking to work on movement and event information for right now, but I'd rather have the code properly developed in an internet environment.
I tried entering my ip as given from whatsmyip.com and the connection didn't happen.
Using Darknet syntax, my Server Startup code is:
InitializeServer:
LocalPort = 6789
LocalIP$ = ""
MaxClients = 10
UDPMode = 1
NoThreads = 0
NoInstances = 1
SendPacket = mn create packet()
RecvPacket = mn create packet()
mn set memory size SendPacket, 1024
mn start NoInstances, NoThreads
profile = mn Create Instance Profile()
mn Set Profile Local profile, LocalIP$, LocalPort, localIP$, LocalPort
mn Set Profile Mode UDP profile, UDPMode
Result = mn Start Server(0, MaxClients, profile)
if Result = 0
print "Server Started Successfully"
else
print "Server Failed to Start"
endif
Return
and my Client Startup Code is
InitializeClient:
Velocity = 5
TurnSpeed = 5
MaximumClients as integer
ConnectPort = 6789
Timeout = 4000
NoThreads = 0
NoInstances = 1
SendPacket = mn create packet()
RecvPacket = mn create packet()
mn set memory size SendPacket, 1024
mn start NoInstances, NoThreads
ConnectIP$ as string
Input "Enter the IP that you would like to connect to:", ConnectIP$
profile = mn Create Instance Profile()
Connect = mn connect(0, ConnectIP$, ConnectPort, ConnectIP$, ConnectPort, Timeout, 1, profile)
cls
Select Connect
case 1:
print "Connected Successfully!"
MaximumClients = mn Get Max Clients(0)
print "Press Spacebar to exit"
endcase
case 0:
print "Connection Timed Out"
print "Press Spacebar to exit"
endcase
case -1:
print "Connection failed due to an unknown error!"
print "Press Spacebar to exit"
endcase
case -2:
print "Server Full"
print "Press SpaceBar to exit"
endcase
endselect
return
Any info on what I might need to do differently to allow for internet connections would be greatly appreciated. I know I can comb through the Darknet syntax lists but I'm hoping some of you might have already been through the process and can guide me.
Thanks in advance
Ask not for whom the bell tolls;
It tolls for ye!