From 861c06a558e4616ba19bcda2dc713ecce57494bd Mon Sep 17 00:00:00 2001 From: Adam Heinermann Date: Wed, 28 Aug 2013 14:38:41 +0000 Subject: [PATCH] Failed attempt to remove the multi-instance patch. Shorten the readme. Prep for 4.0.1 release. git-svn-id: https://bwapi.googlecode.com/svn/trunk@4453 273ecf2c-f24b-0410-b6a7-e9298bb4873f --- Installer/Installer.iss | 10 ++--- Release_Binary/ChangeLog.txt | 20 ++++++++++ Release_Binary/README | 38 ++++++------------- Release_Binary/Starcraft/bwapi-data/bwapi.ini | 1 + bwapi/BWAPI/Source/CodePatch.cpp | 1 + bwapi/BWAPI/Source/Config.cpp | 2 +- bwapi/BWAPI/Source/Detours.cpp | 13 +++++++ bwapi/BWAPI/Source/Detours.h | 2 + 8 files changed, 55 insertions(+), 32 deletions(-) diff --git a/Installer/Installer.iss b/Installer/Installer.iss index 729190376..cbc669902 100644 --- a/Installer/Installer.iss +++ b/Installer/Installer.iss @@ -57,16 +57,16 @@ SolidCompression=True Compression=lzma2/ultra InternalCompressLevel=ultra DisableProgramGroupPage=yes -AppVersion=4.0.0 +AppVersion=4.0.1 ShowLanguageDialog=no AlwaysShowComponentsList=False ShowComponentSizes=False PrivilegesRequired=poweruser LanguageDetectionMethod=locale -VersionInfoVersion=4.0.0 -VersionInfoTextVersion=4.0.0 -VersionInfoProductVersion=4.0.0 -VersionInfoProductTextVersion=4.0.0 +VersionInfoVersion=4.0.1 +VersionInfoTextVersion=4.0.1 +VersionInfoProductVersion=4.0.1 +VersionInfoProductTextVersion=4.0.1 OutputBaseFilename=BWAPI_Setup [Components] diff --git a/Release_Binary/ChangeLog.txt b/Release_Binary/ChangeLog.txt index 115585f55..aef9b51da 100644 --- a/Release_Binary/ChangeLog.txt +++ b/Release_Binary/ChangeLog.txt @@ -1,3 +1,23 @@ +================================================= +Changes from BWAPI 4.0.0 Beta to BWAPI 4.0.1 Beta +================================================= +Changes: + * All interface pointers are now hidden. Instead of Unit* you will now just use Unit. This will require a "Replace in Files" operation to convert existing sources. + * The installer now prompts the user to locate the Starcraft installation directory if it is not found. + * Game::setTextSize now takes a BWAPI::Text::Size::Enum parameter instead of an integer. + * All instances of IsUnpowered were renamed to IsPowered. + * The AI module in the configuration now accepts absolute paths (Ex: C:/stuff). + +Bug Fixes: + * Fixed a regression that prevented auto-menu from functioning. + * Fixed an issue that caused Type::getType to be case sensitive. + * Fixed a regression where addons and the engineering bay returned incorrect tile sizes. + * Fixed a regression that prevented the construction of structures on the right and bottom edges of the map. + * Fixed a regression that prevented the example projects from building out-of-the-box. + * Fixed a bug where auto_menu caused a second multi-instance client to redownload a map that already existed. + * Fixed a bug where auto_menu attempted to start a game before map downloads could be processed. + * Fixed a regression that prevented the client/server setup from communicating. + ============================================ Changes from BWAPI 3.7.4 to BWAPI 4.0.0 Beta ============================================ diff --git a/Release_Binary/README b/Release_Binary/README index 443dba0ec..8526ed2b1 100644 --- a/Release_Binary/README +++ b/Release_Binary/README @@ -1,5 +1,5 @@ -------------------- -| BWAPI 4.0.0 Beta | +| BWAPI 4.0.1 Beta | -------------------- The BWAPI web site http://code.google.com/p/bwapi/ @@ -19,7 +19,7 @@ IRC Channel Freenode #BWAPI the doors for custom AIs with new micro and macro algorithms. The installer contains all the necessary include files, libs, and dlls - required to compile and run an AI module and also comes with three projects + required to compile and run an AI module and also comes with four projects to help get you started in AI development with BWAPI: - Example AI Module - This project shows how to build an AI module DLL which @@ -51,27 +51,24 @@ IRC Channel Freenode #BWAPI Build Instructions: 1. Run the installer and go to the installation directory. - 2. Open ExampleProjects.sln in Visual C++ 2010 and build the solution. + 2. Open ExampleProjects.sln in Visual C++ 2010 Express and build the solution. All projects should now be built and can be found in the solution directory's Release or - Debug subdirectories. + Debug subdirectories. Make sure to run the corresponding version of BWAPI and set the + proper settings for Release and Debug binaries. To run the Example AI Module: - 1. Copy Release/ExampleAIModule.dll to - /bwapi-data/AI/ExampleAIModule.dll - - 2. Open /bwapi-data/bwapi.ini and set ai to - bwapi-data/AI/ExampleAIModule.dll if it isn't already. + 1. Open /bwapi-data/bwapi.ini and set ai to + the path to your newly built ExampleAIModule.dll. - 3. Run Chaoslauncher with BWAPI Injector checked. You can also check W-MODE - to have Broodwar run in a window rather than full-screen (if not using BWAPI's windowed mode). + 2. Run Chaoslauncher with BWAPI Injector checked. - 4. Start Starcraft: Broodwar and create a match. + 3. Start Starcraft: Broodwar and create a match. + Note: With BWAPI you can switch to windowed mode using the shortcut ALT+ENTER. To run the Example AI Client: - 1. Open /bwapi-data/bwapi.ini and set ai to NULL (or some - other file name that doesn't exist). + 1. Open /bwapi-data/bwapi.ini and comment out the ai field with a semicolon. 2. Run Release/ExampleAIClient.exe @@ -79,16 +76,7 @@ IRC Channel Freenode #BWAPI 4. Start Starcraft: Broodwar and create a match. -2. Basic AI Module ------------------- - The Example AI Module mainly just shows how to set everything up to make an -AI module for BWAPI. Once you understand how the Example AI Module works, you -may be interested the Basic AI Module from the BWSAL project, which aims to -develop several robust components which execute basic tasks, such as -constructing buildings, training units, gathering resources, and build-order -management. For more information, visit: http://code.google.com/p/bwsal/ - -3. Bug Reports +2. Bug Reports -------------- BWAPI is not perfect. As you write custom AI modules using BWAPI you may run into bugs or other problems. We cannot find all the bugs on our own so your @@ -99,5 +87,3 @@ find a bug, please contact us on the IRC or file an issue at Additionally, if the program experienced an exception, then a log will be created in /Errors/ which may be useful. - -Thank you for using BWAPI. diff --git a/Release_Binary/Starcraft/bwapi-data/bwapi.ini b/Release_Binary/Starcraft/bwapi-data/bwapi.ini index 6b1fd3faa..afb6846d2 100644 --- a/Release_Binary/Starcraft/bwapi-data/bwapi.ini +++ b/Release_Binary/Starcraft/bwapi-data/bwapi.ini @@ -4,6 +4,7 @@ ; - If there are more instances than the amount of ; DLLs specified, then the last entry is used. ; - Example: SomeAI.dll, SecondInstance.dll, ThirdInstance.dll +; - Absolute paths are acceptable. ai = bwapi-data/AI/ExampleAIModule.dll ai_dbg = bwapi-data/AI/ExampleAIModuled.dll diff --git a/bwapi/BWAPI/Source/CodePatch.cpp b/bwapi/BWAPI/Source/CodePatch.cpp index 0be2eb84d..3fe965414 100644 --- a/bwapi/BWAPI/Source/CodePatch.cpp +++ b/bwapi/BWAPI/Source/CodePatch.cpp @@ -100,6 +100,7 @@ void ApplyCodePatches() _FindFirstFileOld = HackUtil::PatchImport("kernel32.dll", "FindFirstFileA", &_FindFirstFile); _SleepOld = HackUtil::PatchImport("kernel32.dll", "Sleep", &_Sleep); _CreateThreadOld = HackUtil::PatchImport("kernel32.dll", "CreateThread", &_CreateThread); + _CreateEventOld = HackUtil::PatchImport("kernel32.dll", "CreateEvent", &_CreateEvent); } //----------------------------------------- NET-MODE RETURN MENU --------------------------------------------- diff --git a/bwapi/BWAPI/Source/Config.cpp b/bwapi/BWAPI/Source/Config.cpp index 399733c31..6725092df 100644 --- a/bwapi/BWAPI/Source/Config.cpp +++ b/bwapi/BWAPI/Source/Config.cpp @@ -86,7 +86,7 @@ void InitPrimaryConfig() } */ // Get process count - gdwProcNum = getProcessCount("StarCraft_MultiInstance.exe"); + gdwProcNum = getProcessCount("StarCraft_MultiInstance.exe"); // + getProcessCount("StarCraft.exe") - 1; // ------------------------- WMODE CONFIG OPTIONS ---------------------------------- // Load windowed mode position and fullscreen setting diff --git a/bwapi/BWAPI/Source/Detours.cpp b/bwapi/BWAPI/Source/Detours.cpp index b28d2d17d..8ac0be583 100644 --- a/bwapi/BWAPI/Source/Detours.cpp +++ b/bwapi/BWAPI/Source/Detours.cpp @@ -46,6 +46,7 @@ DECL_OLDFXN(CreateFile); DECL_OLDFXN(CreateWindowEx); DECL_OLDFXN(Sleep); DECL_OLDFXN(CreateThread); +DECL_OLDFXN(CreateEvent); //------------------------------------------------ RANDOM RACE -------------------------------------------------- u8 savedRace[PLAYABLE_PLAYER_COUNT]; @@ -118,6 +119,18 @@ bool __fastcall TriggerActionReplacement(BW::Triggers::Action *pAction) return rval; } +//--------------------------------------------- CREATE EVENT ------------------------------------------------- +HANDLE WINAPI _CreateEvent(LPSECURITY_ATTRIBUTES lpEventAttributes, BOOL bManualReset, BOOL bInitialState, LPCTSTR lpName) +{ + if ( std::string(lpName) == "Starcraft Check For Other Instances" ) + { + SetLastError(ERROR_SUCCESS); + return 0; + } + auto CreateEventProc = _CreateEventOld ? _CreateEventOld : &CreateEvent; + return CreateEventProc(lpEventAttributes, bManualReset, bInitialState, lpName); +} + //--------------------------------------------- CREATE THREAD ------------------------------------------------ HANDLE WINAPI _CreateThread(LPSECURITY_ATTRIBUTES lpThreadAttributes, SIZE_T dwStackSize,LPTHREAD_START_ROUTINE lpStartAddress, LPVOID lpParameter, DWORD dwCreationFlags, LPDWORD lpThreadId) { diff --git a/bwapi/BWAPI/Source/Detours.h b/bwapi/BWAPI/Source/Detours.h index f6cb80619..37c3ec01d 100644 --- a/bwapi/BWAPI/Source/Detours.h +++ b/bwapi/BWAPI/Source/Detours.h @@ -32,6 +32,7 @@ HANDLE WINAPI _CreateFile(LPCTSTR lpFileName, DWORD dwDesiredAccess, DWORD dwSha HWND WINAPI _CreateWindowEx(DWORD dwExStyle, LPCSTR lpClassName, LPCSTR lpWindowName, DWORD dwStyle, int x, int y, int nWidth, int nHeight, HWND hWndParent, HMENU hMenu, HINSTANCE hInstance, LPVOID lpParam); VOID WINAPI _Sleep(DWORD dwMilliseconds); HANDLE WINAPI _CreateThread(LPSECURITY_ATTRIBUTES lpThreadAttributes, SIZE_T dwStackSize,LPTHREAD_START_ROUTINE lpStartAddress, LPVOID lpParameter, DWORD dwCreationFlags, LPDWORD lpThreadId); +HANDLE WINAPI _CreateEvent(LPSECURITY_ATTRIBUTES lpEventAttributes, BOOL bManualReset, BOOL bInitialState, LPCTSTR lpName); extern bool hideHUD; extern DWORD lastTurnTime; @@ -57,6 +58,7 @@ extern DECL_OLDFXN(CreateFile); extern DECL_OLDFXN(CreateWindowEx); extern DECL_OLDFXN(Sleep); extern DECL_OLDFXN(CreateThread); +extern DECL_OLDFXN(CreateEvent); bool __fastcall TriggerActionReplacement(BW::Triggers::Action *pAction); extern bool (__fastcall *BWTriggerActionFxnTable[60])(BW::Triggers::Action*);