Odd behaviour with NAT/Router 
Author Message
 Odd behaviour with NAT/Router


I'm about to finish my game which is using DirectPlay8. The game works
perfectly over LAN. But over the internet it doesn't work at all.
Npow, I have read many NAT/router topics over the internet, but none
of the solution I have read works. my game uses port 6000 for
gameplay, and 9000 for the masterserver. (DirectPlay8, Visual Basic6
SP5, Windows 2000 SP2 + All patches)

I'm using the Freesco 2.7 (LINUX) router, which is using DHCP, for
it's internet connection (to the provider). my PC is connected to this
router with a local LAN IP (, hence the "NAT".

I'm connecting with the following code:
Public Sub ConnectMasterserver(strServerIP As String)

    Dim PlayerInfo As DPN_PLAYER_INFO
    Dim UserString As String
    Dim Caps As DPN_CAPS

    On Error Resume Next
    Set objDPMasterClient = Nothing
    Set objDPMasterClientAddress = Nothing
    Set objDPMasterServerAddress = Nothing

    On Error GoTo errorhandler

    AppDesc.guidApplication = MasterServerAppGuid
    AppDesc.SessionName = "none"

    '//Create DP8 client object
    Set objDPMasterClient = objDX.DirectPlayClientCreate

    '//Create DP address
    Set objDPMasterClientAddress = objDX.DirectPlayAddressCreate

    '//Create Server DP address
    Set objDPMasterServerAddress = objDX.DirectPlayAddressCreate

    '//Register Server message handler
    objDPMasterClient.RegisterMessageHandler frmAbout

'    Caps = objDPMasterClient.GetCaps
'    Caps.lTimeoutUntilKeepAlive = 60000
'    objDPMasterClient.SetCaps Caps, 0

    '//Configure Client address for TCP/IP
    objDPMasterClientAddress.SetSP DP8SP_TCPIP

    '//Configure Server address for TCP/IP
    objDPMasterServerAddress.SetSP DP8SP_TCPIP

    UserString = ServerAppDesc.SessionName
    PlayerInfo.Name = UserString
    PlayerInfo.lInfoFlags = DPNINFO_NAME
    objDPMasterClient.SetClientInfo PlayerInfo, DPNOP_SYNC

    objDPMasterServerAddress.AddComponentString DPN_KEY_HOSTNAME,
    objDPMasterServerAddress.AddComponentLong DPN_KEY_PORT,

    objDPMasterClient.connect AppDesc, objDPMasterServerAddress,
objDPMasterClientAddress, 0, UserString, Len(UserString)

Exit Sub
    Dim obj As D3DX8
    Set obj = New D3DX8
    Debug.Print "Error: " & obj.GetErrorString(Err.number)
End Sub

The code looks perfect to me, and it works over the LAN perfectly.

Now, I read on multiple sites to open certain ports, what I have done
(my router always allows outside traffic, incoming needs to be

(Ranges, like 2300-2400)

And some specific ports:

UDP >                      
UDP >                      
UDP >                      
TCP >                      
TCP >                      
TCP >                      
TCP >  

Now other clients on the internet simply can't connect to my
masterserver. And I think this newsgroup is one of my last options.

Does any one have alternative solutions to make the masterserver (or
gameserver for that matter) work behind my NAT? It's not essential,
but this way I can run the masterserver myself...

Thanks in advance,

Tue, 28 Dec 2004 01:31:22 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Visible property causes odd Insert behaviour

2. Odd behaviour of 'selection.find'

3. odd cint() behaviour

4. Very odd behaviour

5. Odd behaviour of Imagelist vs Picture box on Nt4

6. Odd behaviour in derived form...

7. Odd Modem behaviour on replicated database

8. Odd behaviour in enum declaration

9. Odd database behaviour

10. Cortona and VB -> odd behaviour

11. Odd behaviour of Msgbox in Form_Load

12. Very odd behaviour - is this a bug?


Powered by phpBB® Forum Software