In Memoriam: Tai'lahr

OpenUru.org, along with the rest of the Mystonline community, is mourning the loss of Tai'lahr on October 16th, 2019.

Rest in Peace, friend.

Build the client with MSVC 2003

From OpenUru
Jump to navigation Jump to search

Introduction

This document provides steps to build the CWE client with minimal changes from the initial Cyan source release. It is assumed that you have the initial Cyan source commit, the four commits made by a'moaca (add jpeg-8c library, remove EAX, replace IJL with IJG, and remove Bink), and the one made by cjkelly1 (modify the MsDevProjects and add batch files) in your source tree. Be aware that subsequent commits by other developers may invalidate these instructions.

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.

PSDK-FULL.1.cab
PSDK-FULL.2.cab
PSDK-FULL.3.cab
PSDK-FULL.4.cab
PSDK-FULL.5.cab
PSDK-FULL.6.cab
PSDK-FULL.7.cab
PSDK-FULL.8.cab
PSDK-FULL.9.cab
PSDK-FULL.10.cab
PSDK-FULL.11.cab
PSDK-FULL.12.cab
PSDK-FULL.13.cab
PSDK-FULL.bat
Extract.exe

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. These instructions have only been tested with these specific versions. If you use other versions of the SDKs and such, you will have to adjust for the changes. If you do use different versions, it would be greatly appreciated if you would add to this document what you had to do, so everyone can benefit from your work.

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. Note: Do not copy the .msi files somewhere else and run them. They need to be run in the same directory as all the *.cab files.
  3. Copy the include and lib directories from the SDK to "\CWE\MOULOpenSourceClientPlugin\StaticSDKs\Win32\PlatformSDK". Note:The directory where the SDK resides will be the one specified in the "Select An Installation Location" dialog when you ran the .msi files. This location will vary by platform.

    Directory structure in the CWE tree will look like this:
    StaticSDKs
      Win32
        PlatformSDK
          include
          lib
  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 structure in the CWE tree will look like this:
      StaticSDKs
        win32
          oggvorbis
            doc
            examples
            include
            lib
            ....
  6. Install the OpenAL SDK and copy it to "\CWE\MOULOpenSourceClientPlugin\StaticSDKs\Win32\OpenAL 1.1 with EFX SDK"

    Directory structure in the CWE tree will look like this:
      StaticSDKs
        win32
          OpenAL 1.1 with EFX SDK
            docs
            include
            libs
            ....
  7. Install the DirectX 9.0c SDK and copy it to "\CWE\MOULOpenSourceClientPlugin\StaticSDKs\Win32\DX9.0c"

    Directory structure in the CWE tree will look like this:
      StaticSDKs
        Win32
          DX9.0c
            Developer Runtime
            Documentation
            include
            Lib
            .....
  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 in the CWE tree will look like this:
      StaticSDKs
        Win32
          PhysX
            Bin
            Cooking
            Docs
            Foundation
            Framework
            lib
            .....
  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 in the CWE tree will look like this:
      StaticSDKs
         Win32
           OpenSSL
             bin
             include
               openssl
             lib
  10. Open up "Visual Studio .NET 2003 Command Prompt" and change to the "\CWE\MOULOpenSourceClientPlugin\StaticSDKs\XPlatform\jpeg-8c-rgba directory." Copy makefile.vc to makefile.nmake, and jconfig.vc 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
"CWE\MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/NucleusLib/pnNetBase/Private/pnNbSrvs.cpp"


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.