Build the client with MSVC 2003

From OpenUru
Revision as of 02:28, 30 March 2011 by Mac Fife (talk | contribs) (Add categories)
Jump to: navigation, search

Items needed to compile

Instructions to obtain the Microsoft Platform SDK February 2003 edition

The old MS Platform SDK is no longer available as a single package from Microsoft. You will have to either order it for $10 from MS, or download the parts and build the install yourself. To build it yourself, download the files from the below links into the same directory.

Run the batch file that is in the directory, and it will build the install. After doing this, you can either install the SDK directly, or burn it onto a CD so you will have it for later and install from there (I recommend burning to a CD, as this multi-part thing is a hassle).

Note on versions: I am using this older stuff because it is closest to what Cyan builds with. You can try to update everything, but be prepared for the need to make a lot of modifications.

Build steps

  1. Obtain CWE sources from the repository.
  2. Install MS Platform SDK. You only need the "Core SDK" and the "Internet Development SDK". You do not need to use the setup.exe in the root of the SDK installer directory - this is merely a splash page and requires IE. Instead, go to the "setup" directory and run "CoreSDK-x86.msi" and then run "IESDK-x86.msi". Note that the "-ia64" installers are for Itanium 64 bit machines, and will not run in x64. If you are compiling on a 64 bit machine, you will need to install the SDK on a 32 bit machine and copy the files from there.
  3. Copy the include and lib directories from the SDK to "\CWE\MOULOpenSourceClientPlugin\StaticSDKs\Win32\PlatformSDK".
    Directory structure will look like this:
  4. Build libogg and libvorbis using MSVC 2003.
    1. Create a directory and then create two subdirectories under it called "ogg" and "vorbis".
    2. Unpack the sources into their respective directories. Make sure it does not do ogg\ogg-1.2.0, or some such thing. Vorbis depends on ogg, and it looks for the ogg stuff in ..\ogg.
    3. Fire up MSVC 2003.
    4. Do File -> Open -> Project, and select the ogg\win32\VS6\ogg_static.vcproj file. It will prompt to convert and open the project - click "Yes".
    5. On the drop down box on the top of the window, change it from "debug" to "release".
    6. Right-click on the "ogg_static" project and select build. Accept the "save file as" defaults in the box that pops up and just click "save".
    7. ogg build is done. Under win32\VS6\Static_Release, there will be a ogg_static.lib file.
    8. File -> Close Solution
    9. Do File -> Open -> Project and select the vorbis\win32\vorbis_static.dsp file. It will prompt to convert and open the project - click "Yes".
    10. On the drop down box on the top of the window, change it from "debug" to "release".
    11. Right-click on the "vorbis_static" project and select build. Accept the "save file as" defaults in the box that pops up and just click "save".
    12. vorbis build is done - under win32\Vorbis_Static_Release, there will be a vorbis_static.lib file.
    13. File -> Close Solution
    14. Start at step (i), and repeat the steps, choosing "vorbisfile_static.dsp" instead. You will have under vorbis\win32\VorbisFile_Static_Release a vorbisfile.static.lib file when done.

    Note: Warnings in the build process are ogg/vorbis problems, and fixing an old release of ogg/vorbis is outside the scope of this document. Also, we are using the VC6 projects instead of the MSVC 2003 ones so that the file names and such will match what Cyan has in their projects. You can build the MSVC 2003 projects if you wish, but you will have to either change the output file names to match the VC6 ones, or change Cyan's projects to use the names the MSVC 2003 projects use. Building the VC6 ones required the less changing of the projects.

  5. Copy the contents of your ogg directory and then vorbis directory into "CWE\MOULOpenSourceClientPlugin\StaticSDKs\Win32\oggvorbis". It is okay to let it overwrite. Once that is done, copy the lib files you created above into "CWE\MOULOpenSourceClientPlugin\StaticSDKs\Win32\oggvorbis\lib"
    Directory will look like this:
  6. Install the OpenAL SDK and copy it to "\CWE\MOULOpenSourceClientPlugin\StaticSDKs\Win32\OpenAL 1.1 with EFX SDK"
    Directory structure will look like this:
          OpenAL 1.1 with EFX SDK
  7. Install the DirectX 9.0c SDK and copy it to "\CWE\MOULOpenSourceClientPlugin\StaticSDKs\Win32\DX9.0c"
    Directory structure will look like this:
            Developer Runtime
  8. Install "PhysX 2.6.4 SDK Core" (or, if you have or can obtain it, 2.6.0) and copy it to "\CWE\MOULOpenSourceClientPlugin\StaticSDKs\Win32\PhysX". You must use a 2.6.x version, because the mesh cooking format was changed in 2.7.x. You will copy subdirectories from "C:\Program Files\AGEIA Technologies\AGEIA PhysX SDK\v2.6.4\SDKs" and C:\Program Files (x86)\AGEIA Technologies\AGEIA PhysX SDK\v2.6.4\Bin"
    Directory structure will look like this:
  9. Compile and install OpenSSL. It is best to compile it yourself, because we need to make sure it is dynamically linked (this is important for licensing purposes).
    Note: This will cause the Uru client to require the OpenSSL DLLs to be present in the client directory or in the system path.

    Copy the installed stuff to "\CWE\MOULOpenSourceClientPlugin\StaticSDKs\Win32\OpenSSL" (created by "make install" - you do not want your development tree here).
    Directory structure will look like this:
  10. Open up "Visual Studio .NET 2003 Command Prompt" and change to the "\CWE\MOULOpenSourceClientPlugin\StaticSDKs\XPlatform\jpeg-8c-rgba directory." Copy to makefile.nmake, and to jconfig.h and then run nmake nodebug=1 -f makefile.nmake. This will build the library in non-debug mode. If you use a debug library, the linker will complain when we link the client executable.
  11. Once you have completed all the setup steps, open a "Visual Studio .NET 2003 Command Prompt" again, and change directory to the root of the CWE source. Run "build-allclient-solution.bat" and wait. If all is well, you will have a plClient.exe and UruLauncher.exe, along with the matching PhysX DLLs, in "CWE\MOULOpenSourceClientPlugin\Plasma20\test". Rename plClient.exe to UruExplorer.exe, and copy the executables and DLLs to your "Uru Live" directory. You do not need to copy in the *.pdb. *.map, or sp.dll files for a live external build. Those are only used by the internal builds.

Additional notes

  • This is built as a PLASMA_EXTERNAL_RELEASE, BUILD_TYPE_LIVE build.
  • Only the "Win32|Release" target will build with the changes I loaded to the repository. I did not modify any other build types, so if you wish to build those, you will have to fix them up first.
  • Crypto keys are located in "CWE\MOULOpenSourceClientPlugin\Plasma20\Sources\Plasma\NucleusLib\pnNetBase". Edit the *.hpp files with a text editor to replace the Cyan keys with your own server's keys. A future action item is to move the keys to an external INI and add a dialog which will allow the user to select the keys for the server they are connecting to.

Important: Make sure to run "clean-allclient-solution.bat" and rebuild when you change crypto keys, to make sure they are updated.

  • Server hostnames are located in the following files:

The status URL:
"CWE\MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plClient/winmain.cpp" "CWE\MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plUruLauncher/Main.cpp"

The auth/gatekeeper address

IMPORTANT: You *must* make sure your client is using the same versions of the PhysX DLLs that you built with. They are not compatible from version to version.