Final Change


The final, very, very last piece of code we are going to change will allow us to remain in the program after we exit a game. Previously, when we exited a game using the Escape key, the program quit. This final change tidies that up for us. Open the file C:\koob\control\ client\misc\presetkeys.cs and locate the function DoExitGame() and change it to match the following:

 function DoExitGame() {    if ( $Server::ServerType $= "SinglePlayer" )       MessageBoxYesNo( "Exit Mission", "Exit?", "disconnect();", "");    else       MessageBoxYesNo( "Disconnect", "Disconnect?", "disconnect();", ""); } 

This function now checks to see if we are in single- or multiplayer mode. It does this to provide a customized exit prompt depending on which mode it is. In any event, the disconnect function is called to break the connection with the game server.




3D Game Programming All in One
3D Game Programming All in One (Course Technology PTR Game Development Series)
ISBN: 159200136X
EAN: 2147483647
Year: 2006
Pages: 197

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net