Advertisement

Jim Adams Server/Client

Started by September 16, 2005 04:49 PM
8 comments, last by Nashoc3 19 years, 5 months ago
Hey everyone, I recently built Jim Adams client/server code (Chapter 19) from his book Roleplaying RPG's w/ DirectX. When I run the server, I get an error saying Unable to Host Network Server. The thing is, about 3 days ago, the server that came right off the cd (pre-updateds) worked perfectly.. I've tried turning off all firewall settings but I'm still getting this error. Any ideas? Thanks!
Ok, so far I've figured out what I think is wrong, just don't know how to fix it...

if(m_Server.Host(m_guidAdapter, 9123, "RPGGAME", NULL, MAX_PLAYERS) == FALSE)
return FALSE;



This function is returning false so the server isn't being hosted.. how do I find out why it's returning false?
Advertisement
Look at the source for whatever kind of object m_Server is.

Edit: Sorry this is too short. More precisely look at the Host(...) function in whatever kind of object m_Server is. That's where your false is being returned from.
Winterdyne Solutions Ltd is recruiting - this thread for details!
Have you forwarded the ports?

ace
Forward through the router? That I haven't tried. I have opened port 9123 in windows firewall though.

I'll go give it a shot.
Well I just forwarded the port through my Linksys config and it still doesn't work..


This is mind boggling because the server worked literally 4 days ago. Anyone else have any ideas?
Advertisement
This is the part inside the HOST function that is returning FALSE. Notice the 7 arguments?


BOOL cNetworkServer::Host(GUID *guidAdapter, long Port, char *SessionName, char *Password, long MaxPlayers)
{
DPN_APPLICATION_DESC dpad;
IDirectPlay8Address *pDPAddress;
....
....


if(FAILED(m_pDPServer->Host(&dpad, &pDPAddress, 1, NULL, NULL, NULL, 0))) {
pDPAddress->Release();
return FALSE;
}

....
....
}


The function should only be taking 5 yet it is given 7. Am I starting to see things or am I correct =P.

LOL, I ran the server on my bro's computer (at his house) and it works perfectly, which means its a setting on my computer. Besides Firewall/Router config, what else would prevent a server from hosting?
Check all the arguments to the call to Host() internally. You may be using some stale pointer or bum data in your parameter blocks.

Also, make sure you have the appropriate version of DirectPlay installed (that is, DirectX version). Also verify that the Windows XP SP2 Firewall isn't getting in your way.
enum Bool { True, False, FileNotFound };
Yay,

I noticed that under the Network tab of DXDIAG, There was an error. After googling the error, I found that UPnP needed to be disabled for my specific Linksys router. Everything works perfect, thanks GameDev.net =P

This topic is closed to new replies.

Advertisement