View Single Post
Old 09-11-2011, 01:38 AM   #217
-=*Raz0r*=-
Rookie
 
-=*Raz0r*=-'s Avatar
 
Join Date: Oct 2006
Location: Australia
Posts: 243
There is a bug in jamp.exe where connecting to an invalid hostname or IP whilst ingame will shove you out to a black screen, unable to do anything (including open your console). A very ugly situation.

The function in question is CL_Connect_f (0x41D990)
The code in question is:
Code:
	//Taken from q3
	if (!NET_StringToAdr( cls.servername, &clc.serverAddress) ) {
		Com_Printf ("Bad server address\n");
		cls.state = CA_DISCONNECTED;
		return;
	}
At the very least, it should be setting your connection state to CA_CONNECTING

Ideally, you would rewrite this function to have a different code path if you attempt to connect to a bad hostname or IP whilst ingame.
Another solution, is to patch the opcode setting cls.state to CA_DISCONNECTED

You will have to unlock the code page with VirtualProtect or mprotect
I suggest writing a wrapper.

Code:
UnlockMemory( 0x41DACB, 1 );
*(unsigned char *)0x41DACB = (unsigned char)0x03;
LockMemory( 0x41DACB, 1 );
At the moment this fix is only for Windows, but it is possible to fix on Mac with the right addresses.

With this fix, you will be sent to the "Connecting to someinvalidhostname...1" screen and things will carry on as normal. Not ideal, but it works.

-=*Raz0r*=- is offline   you may: quote & reply,