Skip to content

Commit

Permalink
updated ghost.cfg
Browse files Browse the repository at this point in the history
updated the readme
updated the exe

git-svn-id: http://ghostplusplus.googlecode.com/svn/trunk@81 a7494f72-a4b0-11dd-a887-7ffe1a420f8d
  • Loading branch information
hogantp committed Mar 20, 2009
1 parent b40485b commit 550d845
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 20 deletions.
16 changes: 14 additions & 2 deletions ghost.cfg
Expand Up @@ -192,14 +192,26 @@ admingame_password =
# DATABASE CONFIGURATION #
##########################

### database type (this config value is ignored for now since we only support one type of database)
### database type
### use "sqlite3" for a local SQLite database
### use "mysql" for any MySQL database

db_type = sqlite3

### sqlite3 database file
### sqlite3 database configuration
### this is only used if your database type is SQLite

db_sqlite3_file = ghost.dbs

### mysql database configuration
### this is only used if your database type is MySQL

db_mysql_server = localhost
db_mysql_database = ghost
db_mysql_user = YOUR_USERNAME
db_mysql_password = YOUR_PASSWORD
db_mysql_port = 0

############################
# BATTLE.NET CONFIGURATION #
############################
Expand Down
Binary file modified ghost.exe
Binary file not shown.
100 changes: 82 additions & 18 deletions readme.txt
@@ -1,5 +1,5 @@
====================
GHost++ Version 11.5
GHost++ Version 12.0
====================

GHost++ is a port of the original GHost project to C++ (ported by Trevor Hogan).
Expand All @@ -11,7 +11,7 @@ Since it is written in native code you do not need to install the .NET framework
Configuration
=============

GHost++ is configured via the three configuration files ghost.cfg, map.cfg, and language.cfg.
GHost++ is configured via the two configuration files ghost.cfg and language.cfg.
The program itself runs in console mode and does not take any console input (it outputs messages to the console for information purposes only).

***You need to edit ghost.cfg before running GHost++***
Expand Down Expand Up @@ -279,11 +279,12 @@ Since Version 7.0 GHost++ can automatically calculate some of the map config val
a.) map_size (the size of the map).
b.) map_info (the CRC32 of the map).
c.) map_crc (this is generated by a custom algorithm - note that due to a naming mixup this is NOT actually the CRC).
d.) map_width (the playable width of the map).
e.) map_height (the playable height of the map).
f.) map_numplayers (the number of players - used with melee maps only).
g.) map_numteams (the number of teams - used with melee maps only).
h.) map_slot<x> (the slot structure).
d.) map_sha1 (the SHA1 hash of a subset of the map data).
e.) map_width (the playable width of the map).
f.) map_height (the playable height of the map).
g.) map_numplayers (the number of players - used with melee maps only).
h.) map_numteams (the number of teams - used with melee maps only).
i.) map_slot<x> (the slot structure).

Credit goes to Strilanc for figuring out the algorithm for calculating map_crc.
GHost++ performs the following actions at startup:
Expand All @@ -293,16 +294,16 @@ GHost++ performs the following actions at startup:

Note that it is NOT an error if the above process fails.
e.g. if you already have a copy of common.j and blizzard.j in your bot_mapcfgpath then this is not a problem.
e.g. if you don't care about GHost++ automatically calculating map_crc then this is not a problem.
e.g. if you don't care about GHost++ automatically calculating map_crc/sha1 then this is not a problem.
GHost++ performs the following actions when loading a map:

1.) The bot tries to open the specified map config file.
2.) The bot tries to open the actual map file as specified by [bot_mappath + map_localpath].
3.) If successful it automatically calculates map_size and map_info.
4.) The bot tries to open "common.j" in the directory specified by bot_mapcfgpath. If it fails it stops trying to calculate map_crc.
5.) The bot tries to open "blizzard.j" in the directory specified by bot_mapcfgpath. If it fails it stops trying to calculate map_crc.
4.) The bot tries to open "common.j" in the directory specified by bot_mapcfgpath. If it fails it stops trying to calculate map_crc/sha1.
5.) The bot tries to open "blizzard.j" in the directory specified by bot_mapcfgpath. If it fails it stops trying to calculate map_crc/sha1.
6.) The bot tries to open the actual map file as an MPQ archive.
7.) If successful it automatically calculates map_crc. If it fails it stops trying to calculate map_crc.
7.) If successful it automatically calculates map_crc/sha1. If it fails it stops trying to calculate map_crc/sha1.
8.) If the bot is able to open the MPQ archive it tries to extract "war3map.w3i" (it keeps this file in memory and does not make a disk copy).
9.) If successful it automatically calculates map_width, map_height, map_slot<x>, map_numplayers, and map_numteams.
10.) If any map values were specified in the map config file the bot uses those values INSTEAD of the automatically calculated ones.
Expand All @@ -320,7 +321,7 @@ If you want players to be able to download maps:
If you want GHost++ to automatically calculate map_size and map_info:
- make sure you have a copy of the actual map file on the server and that [bot_mappath + map_localpath] is set to the correct location.

If you want GHost++ to automatically calculate map_crc:
If you want GHost++ to automatically calculate map_crc/sha1:
- make sure you have a copy of common.j and blizzard.j as extracted from War3Patch.mpq in bot_mapcfgpath.
- make sure you have a copy of the actual map file on the server and that [bot_mappath + map_localpath] is set to the correct location.

Expand All @@ -332,6 +333,25 @@ If you want GHost++ to automatically extract common.j and blizzard.j from War3Pa

Note that some map files are "protected" in such a way that StormLib is unable to read them. In this case the bot might calculate incorrect values.

===========
Using MySQL
===========

Since Version 12.0 GHost++ supports MySQL databases for storing admins/ban/stats/etc...
To configure GHost++ to connect to a MySQL database you just need to specify the following config values in ghost.cfg:

db_type = mysql
db_mysql_server = localhost
db_mysql_database = YOUR_DB
db_mysql_user = YOUR_USERNAME
db_mysql_password = YOUR_PASSWORD
db_mysql_port = 0

You can use a remote MySQL server if you wish, just specify the server and port above (the default MySQL port is 3306).
Create a new database on your MySQL server then run the "mysql_create_tables.sql" file on it.
GHost++ won't create or modify your MySQL database schema like it does with SQLite so you are responsible for making sure your database schema is accurate.
Note that with MySQL you can configure multiple bots to use the same database although support for this is not 100% complete or configurable.

========
Commands
========
Expand All @@ -351,6 +371,7 @@ In battle.net (via local chat or whisper at any time):
!closeall close all open slots
!countadmins display the total number of admins for this realm
!countbans display the total number of bans for this realm
!dbstatus show database status information
!deladmin <name> remove an admin from the database for this realm
!delban <name> remove a ban from the database for all realms
!disable disable creation of new games
Expand Down Expand Up @@ -497,6 +518,10 @@ Compiling GHost++ on Windows
============================

1. Download Visual C++ 2008 Express Edition at http://www.microsoft.com/express/
2. Download Boost 1.38.0 and configure Visual C++ to use the Boost headers.
a. Go to http://www.boost.org/ and download and extract Boost 1.38.0.
b. Open Visual C++ and click Tools -> Options -> Projects and Solutions -> VC++ Directories -> Show directories for: Include files.
c. Select the path to wherever you downloaded Boost (e.g. for me it's "D:\boost_1_38_0").
2. Open ghost.sln
3. Choose a Debug or Release version
4. Build
Expand All @@ -512,10 +537,6 @@ GHost++ requires StormLib but I have included a prebuilt StormLibRAS.lib so you
StormLib can be found here: http://www.zezula.net/en/mpq/stormlib.html
The included StormLibRAS.lib is a Static Release version built with my own copy of Visual C++ 2008 Express Edition.
I made some modifications to StormLib to make it compile on Linux. The modified project can be found in the included StormLib directory if you want to compile it yourself.
When you build bncsutil the compiler will ouput some warnings about Wp64 deprecation and unsafe functions but you can ignore these.
When you build a Debug version of bncsutil the linker will output a lot of warnings about missing debug information due to gmp.lib being a Release version but you can ignore these.
When you build GHost++ the compiler will output a lot of warnings when compiling sqlite3.c but you can ignore these.
When you build a Debug version of GHost++ the linker will out a warning about conflicting default libs due to StormLibRAS.lib being a Release version but you can ignore this.

==========================
Compiling GHost++ on Linux
Expand All @@ -538,10 +559,28 @@ StormLib requires libbz2 and zlib (try running "yum install bzip2-devel" and/or
4. cd ~/ghost/StormLib/stormlib/
5. make

You'll need the MySQL development libraries to build GHost++. You can probably use whatever version your package manager has available as they are usually kept up to date.

6. yum install mysql-devel

You'll need Boost version 1.38.0 (or potentially any newer versions). If your package manager has this version avilable please use it instead of installing it manually.
To install Boost manually:

7. Download and extract Boost 1.38.0 from http://www.boost.org/
8. su to root.
9. ./configure --prefix=/usr --with-libraries=date_time,thread
10. make install

Once it's built you can continue:

6. cd ~/ghost/ghost/
7. make
11. cd ~/ghost/ghost/
12. make

Notes:

I specifically link against the gcc-compiled versions of boost in the Makefile.
If your system produces different libraries you may need to edit the Makefile and specify the correct libraries.
The manual install of Boost also put the headers in a "boost_1_38/boost" directory in /usr/include so I was forced to move the boost subdirectory into /usr/include and delete the (now empty) boost_1_38 directory.

========================
Running GHost++ on Linux
Expand All @@ -556,6 +595,31 @@ GHost++ searches for "storm.dll" in all lowercase not "Storm.dll" so you may nee
CHANGELOG
=========

Version 12.0
- updated ip-to-country.csv to the latest version from February 26, 2009
- added support for MySQL databases
- added precompiled boost libraries for Visual C++
- added precompiled mysql libraries for Visual C++
- added mysql headers for Visual C++
- refresh messages are no longer permanently disabled and can be configured on or off once again
- games are now refreshed every 3 seconds instead of 2 seconds (to reduce the risk of flooding out)
- when a game refresh fails the bot will stop trying to refresh the game until it is rehosted (to reduce the risk of flooding out)
- fixed the "duplicate game" bug when rehosting a game
- fixed an error in the Makefile
- added support for Warcraft III patch 1.23
- bnet*_custom_war3version now defaults to 23
- updated the game protocol to match the 1.23 game protocol
- updated the LAN protocol to match the 1.23 LAN protocol
- updated the replay header to match the 1.23 replay header
- added a public domain SHA1 hashing algorithm
- added a new map config value map_sha1
- added support for spoof checking via friend whisper
- added error codes to unknown socket errors
- fixed a minor bug with the !statsdota command not responding correctly to whispers
- fixed a bug where changes to the system clock could cause GHost++ to drop players (thanks lucasn)
- minor optimizations
- modified language.cfg

Version 11.5
- updated ip-to-country.csv to the latest version from January 23, 2009
- updated StormLib
Expand Down

0 comments on commit 550d845

Please sign in to comment.