TradeWars II MODIFIED BY Dan Wright For WWIV 4.0 4-21-1988 Ported to the C language 2009 This is the first version of my Tradewars that is built with the Open Doors package. This allows the game to run under Synchronet. While the game is multiuser, there is no locking going on the database so it should be run as single user... Even though I do close the database every time I'm done with it, the program is not reloading the player & sector data so there is room for LOTS of errors. It should be used with one user at a time for now. Because of the nature of OpenDoors & it's reliance on a toolbar you will require Visual C++ 6.0 or higher to compile & run this. I have tested this with Visual C++ 2008 and it 'runs' but I haven't done any extensive testing. INSTALLATION ============ There is no setup program. The door will have to be setup manually. I've tried to make this as easy as possible, but I'm sure there will always be snags... In this example I've setup my BBS to use the T: drive for my door. First make a directory for your door. t: md twc cd twc Then copy the contents of the 'distro' folder into t:\twc Then run: unpack This will unzip the gfiles.zip file with the included unzip.exe (assuming your OS has a msvcrt.dll ... they all should by now!!!). Ok now with that out of the way, the next thing to do is to setup the database. It's an export from the pascal TradeWars II, as it was distributed... Everything is in twdata.txt if you want to mess with it. To compile the data file just run: condat If everything goes well, it'll spit out the number 471, which is how many records there are in the db. If you have ANY issues with the game, this is the quickest way to sort things out.... redo the database. SETTING UP SBBS =============== This should be somewhat straight forward. Run the "Synchronet configuration" utility and go to External Programs. Next select Online Programs (Doors), and then pick a section.. Games works fine. Next look at the available online games, move to an empty slot and hit the insert key. From there this is what I have: Name TradewarsC Internal Code TWC Start-up Directory t:\twc Command Line tradewars.exe Clean-up Command Line Execution Cost None Access Requirements Execution Requirements Multiple Concurrent Users No Intercept Standard I/O No Native (32-bit) Executable Yes Use Shell to Execute No Modify User Data No Execute on Event No Pause After Execution No BBS Drop File Type Mystic Door32.sys Place Drop File In Start-Up Directory Time Options... Now there should be a 'timed' even to run once a day.. Call it TWC1DAY Internal Code TWC1DAY Start-up Directory t:\twc Command Line tradewars maint Enabled YES Execution Node 1 Execution Months ANY Execution Days of the Month Any Execution Days of the Week Any Execution Frequency 1 times a day Force Users Off-line for Event No Native (32-bit) Executable Yes Use Shell to Execute No Background Execution No Always Run After Init/Re-init No It is HIGHLY HIGHLY recommended you run the timed event ONCE before someone logs on. The original Database is FULL of old users... And they ought to be removed to make room for new ones. Unless you like the sitting ducks.. RUNNING AS LOCAL USER ===================== You can run the program locally by using the doorinfo1.def file in the directory to 'fool' the door to giving you a local window. Make sure there is no existing door32.sys (The door currently doesn't delete old ones) and copy this into the "t:\twc" (or where ever you've installed it) to, and you should be good to go. COMPILING ========= Compiling should be pretty straight forward.. I've been using the CLI stuff as it's just easier for me, and without makefiles because it's A) Small, and B) I keep changing build stuff too frequently to settle on something. You will require Visual C++ 6.0 or higher to build the Win32 stuff. Opendoors uses a GUI toolbar, and it will not compile with VC 1,2,4. I've thought about hacking the source enough to remove that barrier but I've decided against that for the moment. Now that Opendoors is LGPL I've included it in this source package. The only 'complaint' I've had is that it cannot print floating point numbers. Other then that it made porting a simple C program a breeze! First extract the 'source' directory wherever you want it. Then make sure you are running a window with the VC environment variables so you can compile... === condat C:\temp\bbs\twc\source>cl condat.c -I TW4 /W0 Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for 80x86 Copyright (C) Microsoft Corp 1984-1998. All rights reserved. condat.c Microsoft (R) Incremental Linker Version 6.00.8168 Copyright (C) Microsoft Corp 1992-1998. All rights reserved. /out:condat.exe condat.obj === mailman C:\temp\bbs\twc\source>cl MAILMAN.C /W0 Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for 80x86 Copyright (C) Microsoft Corp 1984-1998. All rights reserved. MAILMAN.C Microsoft (R) Incremental Linker Version 6.00.8168 Copyright (C) Microsoft Corp 1992-1998. All rights reserved. /out:MAILMAN.exe MAILMAN.obj === tradewars C:\temp\bbs\twc\source>cl /W0 tw4\*.c -o tradewars.exe tw4\ODoorW.lib Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for 80x86 Copyright (C) Microsoft Corp 1984-1998. All rights reserved. COMBAT.C COMPTR.C Compiling for Win32 DLL version of OpenDoors PLANET.C Compiling for Win32 DLL version of OpenDoors port.c Compiling for Win32 DLL version of OpenDoors TW4.C Compiling for Win32 DLL version of OpenDoors Generating Code... Microsoft (R) Incremental Linker Version 6.00.8168 Copyright (C) Microsoft Corp 1992-1998. All rights reserved. /out:COMBAT.exe /out:tradewars.exe COMBAT.obj COMPTR.obj PLANET.obj port.obj TW4.obj tw4\ODoorW.lib