Update of /cvsroot/netrek/client/netrekxp
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5894

Modified Files:
	NetrekXP to do list.C build.cmd compile.txt 
Added Files:
	rsa.txt 
Removed Files:
	buildexe.cmd 
Log Message:
Major features in this patch are:
Merge of Stas' latest source into client.
 - Lots of double buffering code
 - Cleanup of protoyping functions and proper variable initialization
 - Addition of working RSA key generator mkkey.exe (this necessitates another DLL in the source)
 - Updated compile instructions, and a new document on how to make a RSA key
 - Working version of winkey with BCC compiler
 - Bug fixes as per listed in his change log
Cleanup of changes list to remove bug fix/stuff only coders need to know.
Removal of buildexe script - Stas rewrote build to make this obsolete
Addition of HR bitmap set (including a few placeholder bitmaps until art is done)
Metablock patch accepted (not working proper yet though due to retrieving login issue)
Probably a few other things I forgot about!

Index: NetrekXP to do list.C
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- NetrekXP to do list.C	6 May 2006 06:25:14 -0000	1.16
+++ NetrekXP to do list.C	7 May 2006 16:59:26 -0000	1.17
@@ -11,10 +11,9 @@
 Things not gonna happen, or server problems:
 1) Player list messaging doesn't work if you can't see player (cloaked, too far
 away, etc).  Don't think this is fixable.
-2) Get mkkey working.
 3) torp_other and plasma_other not working right due to lack of torp fuse info
 4) cloaking/shields at warp 0 doesn't update someone else's tactical on what you did -
-server not sending right info.
+server not sending right info - short packets!
 4a) observer sound messes up when someone flips shields at warp 0, again a server problem
 4b) Locking onto iggy caues the observer sound to mess up for shields up/down (this is
 server side problem, both for the not being able to lock back onto your team, and
@@ -23,6 +22,7 @@
 any state at all (head to default which is error message).
 
 Things to do:
+0) Eventually add the SDL dll files to the source.
 1) Add warning hull.
 2) resizeable message windows.  Perhaps memory of window positions if you choose
 to save settings.  Text in windows should adjust to new window size.
@@ -39,17 +39,11 @@
 closeable by shift right click.
 6) With new scaling function, implement Defcom's new bitmaps
 6a) Issue with flickering.
-6b) Issue with 0 degree messing up bitmap.
-
-Might be done:
-1) mouse scroll in message windows gets the up/down coord wrong when main title
-bar is turned on.
-2) CRASH BUG! Resize main window and try to do mouse scroll, it will crash client.
-3) Disable window move stuff still broken.
-4) save_options keymap: not saving right
-5) if waiting on queue and get in, quit clock missing
-6) right click on all_review window, get message "obsolete!"
-7) winkey working with BCC
+6b) Border issue
+6c) The new smooth turning only working on self, not obs or others - short packets!
+6d) Not working with BCC
+7) right click on all_review window, get message "obsolete!"
+8) login not read in before metaserver info (for metablocking purposes)
 
 Stas's list:
 - color coded playerlist.

--- buildexe.cmd DELETED ---

--- NEW FILE: rsa.txt ---
This client incorporates RES-RSA code that uniquely identifies client binary on server side.

If you are willing to build the client without RSA support you will have to figure out how
to do that by yourself. It is a matter of altering project files and removing RSA definitions.

In order to create RSA key you should use mkkey.exe utility located under tools directory
in source distribution.

To create key you will have to provide mkkey.exe with following information:

key_name - general name for the key file
client_type - actual client name that will be shown by server after verification
architecture - Win32 in our case
creator - your mail address for bugs/suggestions
comment - free text

After running mkkey.exe with parameters you will have following files created:

key_name - public key part
key_name.secret - private key part
rsa_box*.c - obfuscated C code containing key identification sequence

The key file is composed of options and their values. Options separated by columns.
Here's how typical key file looks:

NetrekXP-Mod-RSA-Key-Win32:ct=NetrekXP Mod:cr=keyos at keyos.org:\
   :cd=January 2003:ar=Win32\
   :cm=NetrekXP Modification for Windows 9x/NT/2000/XP:\
   :gk=b160145c4205bba8815db0a908fcac9b99a0303ee44c204469374109e09bb782:\
   :pk=8b0f3d3f1b1b8528d86545d3be9d8900f2e3130cb52248df9a5ec63ff9a15e11:

In order for the key file to work with netrek servers you'll have to add another option
called 'client compatibility'. For example NetrekXP Mod is standard2 and inl compatible, so
its key contains 'cl=inl,standard2' option in addition to others.

Here's how public file for NetrekXP Mod looks like:

NetrekXP-Mod-RSA-Key-Win32:ct=NetrekXP Mod:cr=keyos at keyos.org:\
   :cd=January 2003:ar=Win32:cl=inl,standard2:\
   :cm=NetrekXP Modification for Windows 9x/NT/2000/XP:\
   :gk=b160145c4205bba8815db0a908fcac9b99a0303ee44c204469374109e09bb782:\
   :pk=8b0f3d3f1b1b8528d86545d3be9d8900f2e3130cb52248df9a5ec63ff9a15e11:


At the moment you have rsa_box*.c files created you can use them to compile your client.
However having the client compiled with RSA doesn't mean that you will be able to play
on any server that requires RSA verification.

After adding client compatibility option to both key_name and key_name.secret files you
can distribute the public key file to server admins or central key repository that is stored
on clientkeys.netrek.org (port 3530)
In order to add key to central repository you should contact clientkeys at clientkeys.netrek.org
In order to add key to specific server you should talk to server admin
When the key is added to central repository it is still required that keys update utility will be run
on each server.

That's all.

Stas Pirogov (keyos at keyos.org)
Index: compile.txt
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/compile.txt,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- compile.txt	30 Apr 2006 15:59:39 -0000	1.7
+++ compile.txt	7 May 2006 16:59:26 -0000	1.8
@@ -1,22 +1,48 @@
 This source tree was tested with MS Visual C++ 6.0 and Borland C Builder 5.5
 
-- Edit build.cmd to set following variables:
+I'd like however to discourage you from using Borland's compiler unless you know how
+to debug its binaries. The output is also slower even though speed optimizations
+are used.
+
+Step 1:
+--------
+Edit build.cmd to set following variables:
 
 RSAKey = path to your RSA-KEY.secret file
-Compiler = VCC or BCC (default BCC)
+Compiler = VCC or BCC (default VCC)
 InstCWD = path to folder to copy files to (default \netrek_files)
+HelpCompiler = path to hhc.exe from Microsoft's HTML Help Workshop (available from microsoft.com)
 
-- Edit clientr.dsp and change \netrek_files to be same as InstCWD (only if using VCC)
+Step 2:
+--------
+If you're building with MS Visual C++:
+
+- Edit clientr.dsp and change \netrek_files to be same as InstCWD
 - Edit src\cursors\curslib.dsp and change \netrek_files to be same as InstCWD
-  (again only necessary if using VCC)
-- Get SDL.dll and SDL_mixer.dll from the SDL website (you will need these to
-  run the client, they must be in the installer package)
-After compilation under BCC, there will be one folder under InstCWD - netrek.
-Netrek contains the ready to distribute netrek client tree.
-After compilation under VCC, there will be an additional directory called 
-tmp which can be deleted.
+- Edit src\winkey\winkey.dsp and change \netrek_files to be same as InstCWD
 
+If you're building with Borland C Builder:
+
+Make sure you have configuration set correctly for the builder itself.
+Follow setup instructions from builder readme file to create proper configuration
+files. Otherwise the compiler and linker won't find the correct paths.
+
+Step 3:
+--------
+Open command prompt in the source tree directory and run build.cmd
+
+If everything is correct and working then after a couple of minutes you will have compiled
+a working client under InstCWD\netrek.
+If you were compiling with Visual C++ you will also have a InstCWD\tmp folder containing
+lots of objects.  Just delete it.
+
+Step 4:
+-------
+Get SDL.dll and SDL_mixer.dll from the SDL website (you will need these to run the client,
+they must be in the installer package)
 
+Other Notes:
+------------
 Additional instructions for compiling with Microsoft Visual C++ 2005 Express Edition,
 aka Microsoft Visual Studio 2005
 
@@ -27,7 +53,8 @@
 that used cscript to compile the source since that command doesn't work with Visual
 Studio.
 
+That's pretty much all.
 
 Stas Pirogov (keyos at keyos.org)
 
-Instructions modified by Bill Balcerski 
+Instructions modified by Bill Balcerski 
\ No newline at end of file

Index: build.cmd
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/build.cmd,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- build.cmd	6 May 2006 05:39:59 -0000	1.12
+++ build.cmd	7 May 2006 16:59:26 -0000	1.13
@@ -1,16 +1,22 @@
-SET RSAKey=\netrek_files\rsa\NetrekXP-Mod-RSA-Key-Win32.secret
-Set Compiler=BCC
-Set InstCWD=\netrek_files
-rem Set Compiler=VCC
+set RSAKey="\netrek_files\rsa\NetrekXP-2006-RSA-Key-Win32.secret"
+set InstCWD="\netrek_files"
+set HelpCompiler="C:\Program Files\HTML Help Workshop\hhc.exe"
+rem set Compiler=VCC
+set Compiler=BCC
 
 @echo off
 Set MyCWD=%cd%
 if /I "%1" == "clean" goto :clean
+if /I "%1" == "cleanrsa" goto :cleanrsa
 if /I "%1" == "dist" goto :dist
+if /I "%1" == "build" goto :build
+if /I "%1" == "pics" goto :pics
 
 mkdir %InstCWD%
 mkdir %InstCWD%\netrek
 
+:pics
+
 pushd resources\ships\color\fed
 echo Making resources\ships\color\fed...
 %MyCWD%\tools\imagemagick\montage -mode concatenate -tile 1x32 fed_as01.bmp fed_as02.bmp fed_as03.bmp fed_as04.bmp fed_as05.bmp fed_as06.bmp fed_as07.bmp fed_as08.bmp fed_as09.bmp fed_as10.bmp fed_as11.bmp fed_as12.bmp fed_as13.bmp fed_as14.bmp fed_as15.bmp fed_as16.bmp fed_as17.bmp fed_as18.bmp fed_as19.bmp fed_as20.bmp fed_as21.bmp fed_as22.bmp fed_as23.bmp fed_as24.bmp fed_as25.bmp fed_as26.bmp fed_as27.bmp fed_as28.bmp fed_as29.bmp fed_as30.bmp fed_as31.bmp fed_as32.bmp fed_as.bmp
@@ -341,6 +347,20 @@
 %MyCWD%\tools\imagemagick\montage -colors 256 -mode concatenate -tile 1x5 shexpl0.bmp shexpl1.bmp shexpl2.bmp shexpl3.bmp shexpl4.bmp shexpl.bmp
 popd
 
+if /I "%1" == "pics" goto :end
+
+:build
+
+pushd resources
+pushd htmlhelp
+%HelpCompiler% netrek.hhp
+popd
+popd
+
+pushd src
+%MyCWD%\tools\mkkey -k %RSAKEY%
+popd
+
 if /I "%Compiler%" == "BCC" goto :CompilerBCC
 if /I "%Compiler%" == "VCC" goto :CompilerVCC
 
@@ -348,23 +368,20 @@
 goto :end
 
 :CompilerVCC
-pushd src
-%MyCWD%\tools\mkkey -nt -k %RSAKEY%
+pushd src\cursors
+cscript %MyCWD%\tools\vcmake.vbs curslib.dsw "Win32 Release"
 popd
 
-rem pushd src\cursors
-rem cscript %MyCWD%\tools\vcmake.vbs curslib.dsw "Win32 Release"
-rem popd
-
-rem pushd src\winkey
-rem cscript %MyCWD%\tools\vcmake.vbs winkey.dsw "Win32 Release"
-rem popd
+pushd src\winkey
+cscript %MyCWD%\tools\vcmake.vbs winkey.dsw "Win32 Release"
+popd
 
-rem cscript %MyCWD%\tools\vcmake.vbs clientr.dsw "Win32 Release"
+cscript %MyCWD%\tools\vcmake.vbs clientr.dsw "Win32 Release"
 
 pushd %InstCWD%\netrek
 %MyCWD%\tools\stampver -v%MyCWD%\src\stampver.inf netrek.exe
 popd
+
 goto :dist
 
 :CompilerBCC
@@ -372,6 +389,9 @@
 pushd cursors
 make
 popd
+pushd winkey
+make
+popd
 make
 %MyCWD%\tools\stampver -v%MyCWD%\src\stampver.inf netrek.exe
 popd
@@ -380,6 +400,8 @@
 
 :dist
 
+copy resources\htmlhelp\netrek.chm %InstCWD%\netrek
+
 mkdir %InstCWD%\netrek\bitmaps\shiplib
 copy resources\ships\color\fed\fedship.bmp %InstCWD%\netrek\bitmaps\shiplib
 copy resources\ships\color\ind\indship.bmp %InstCWD%\netrek\bitmaps\shiplib
@@ -459,12 +481,15 @@
 mkdir %InstCWD%\netrek\sounds
 copy resources\sounds\*.wav %InstCWD%\netrek\sounds
 
-if /I "%Compiler%" == "BCC" copy src\netrek.exe %InstCWD%\netrek
 if /I "%Compiler%" == "BCC" copy src\cursors\curslib.dll %InstCWD%\netrek\bitmaps
+if /I "%Compiler%" == "BCC" copy src\winkey\winkey.dll %InstCWD%\netrek\bitmaps
+if /I "%Compiler%" == "BCC" copy src\netrek.exe %InstCWD%\netrek
 
 goto end
 
 :clean
+del resources\htmlhelp\netrek.chm
+
 del resources\ships\color\fed\fedship.bmp resources\ships\color\fed\fed_??.bmp
 del resources\ships\color\ind\indship.bmp resources\ships\color\ind\ind_??.bmp
 del resources\ships\color\kli\kliship.bmp resources\ships\color\kli\kli_??.bmp
@@ -510,12 +535,13 @@
 
 if /I "%Compiler%" == "BCC" goto :CleanBCC
 if /I "%Compiler%" == "VCC" goto :CleanVCC
+
 echo You must set which compiler you have at the top of this batch file.
+
 goto :end
 
 :CleanVCC
 pushd src
-del rsa*.c
 pushd cursors
 del *.ncb
 del *.opt
@@ -532,13 +558,22 @@
 
 :CleanBCC
 pushd src
-del *.obj *.res netrek.exe netrek.tds netrek.map
+make clean
 pushd cursors
-del curslib.ilf curslib.ilc curslib.ild curslib.ils curslib.tds curslib.dll
+make clean
 popd
 pushd winkey
-del winkey.ilf winkey.ilc winkey.ild winkey.ils winkey.tds winkey.dll
+make clean
 popd
 popd
 
+goto :end
+
+:cleanrsa
+pushd src
+del rsa*.c
+popd
+
+goto :end
+
 :end