Skip to content

Commit ac269e3

Browse files
author
Roman
authored
Update README.md
1 parent a353215 commit ac269e3

File tree

1 file changed

+57
-4
lines changed

1 file changed

+57
-4
lines changed

README.md

Lines changed: 57 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ C language bindings to the BWAPI library
77

88
# BWAPI again? Why?
99

10-
The original `BWAPId.lib` is written in C++. Due to mangling etc... you can't link against `BWAPId.lib` with other compilers but only with `cl.exe` and `link.exe`. The goal of this library is to provide a minimalistic C API which can be used to create bindings for high-level languages.
10+
The original `BWAPI.dll` is written in C++. Due to mangling etc... you can't link against `BWAPI.dll` with other compilers but only with `cl.exe` and `link.exe`. The goal of this library is to provide a minimalistic C API which can be used to create bindings for high-level languages.
1111

1212
# Build on Linux
1313

@@ -20,11 +20,13 @@ bwapi-c/build $ make
2020
`BWAPI_PATH` must point to directory with BWAPI release.
2121

2222
# Usage on Linux
23-
You should get `BWAPIC.lib` and `BWAPIC.dll` that was build on Windows with MSVC. See [Releases](https://github.com/RnDome/bwapi-c/releases).
23+
You should get `BWAPIC.lib`, `BWAPIC.dll` and `BWAPI.dll` that was build on Windows with MSVC. See [Releases](https://github.com/RnDome/bwapi-c/releases).
24+
25+
### Module
2426

2527
```
2628
~/bwapi-c/example $ ls
27-
BWAPIC.lib Dll.c
29+
BWAPIC.lib Dll.c
2830
~/bwapi-c/example $ i686-w64-mingw32-gcc -mabi=ms -shared -o Dll.dll Dll.c -I../include -L. -lBWAPIC
2931
~/bwapi-c/example $ ls
3032
BWAPIC.lib Dll.cpp Dll.dll
@@ -33,5 +35,56 @@ BWAPIC.lib Dll.cpp Dll.dll
3335
Put `BWAPIC.dll` inside `StarCraft` directory and `Dll.dll` inside `StarCraft/bwapi-data`.
3436
Set up `bwapi.ini` (`ai=bwapi-data/Dll.dll`) and run:
3537
```
36-
wine bwheadless.exe -e StarCraft.exe -l bwapi-data/BWAPI.dll --headful
38+
$ wine bwheadless.exe -e StarCraft.exe -l bwapi-data/BWAPI.dll --headful
39+
```
40+
41+
### Client
42+
```
43+
~/bwapi-c/example $ ls
44+
BWAPIC.lib Client.c
45+
~/bwapi-c/example $ i686-w64-mingw32-gcc -mabi=ms -o Client.exe Client.c -I../include -L. -lBWAPIC
46+
~/bwapi-c/example $ ls
47+
BWAPIC.lib Client.c Client.exe
48+
```
49+
50+
Put `Client.exe` into a directory with `BWAPIC.dll` and `BWAPI.dll`. Run in the first terminal:
51+
```
52+
~/bwapi-c/example $ ls
53+
Client.exe BWAPIC.dll BWAPI.dll
54+
~/bwapi-c/example $ wine Client.exe
55+
fixme:module:load_library unsupported flag(s) used (flags: 0x00000800)
56+
...
57+
fixme:ntdll:EtwEventRegister ({5eec90ab-c022-44b2-a5dd-fd716a222a15}, 0x2a27f0, 0x2b0030, 0x2b0048) stub.
58+
fixme:ntdll:EtwEventSetInformation (deadbeef, 2, 0x2a2560, 43) stub
59+
Reconnecting...
60+
Game table mapping not found.
61+
...
62+
```
63+
64+
Set up `bwapi.ini` (comment out `ai=...` and `ai_dbg=...`) and run in the second terminal:
65+
```
66+
$ wine bwheadless.exe -e StarCraft.exe -l bwapi-data/BWAPI.dll --headful
67+
```
68+
69+
Switch to the first terminal, you shall see:
70+
```
71+
...
72+
Game table mapping not found.
73+
0 | 62 | 0 | 36406654
74+
1 | 0 | 0 | 0
75+
2 | 0 | 0 | 0
76+
3 | 0 | 0 | 0
77+
4 | 0 | 0 | 0
78+
5 | 0 | 0 | 0
79+
6 | 0 | 0 | 0
80+
7 | 0 | 0 | 0
81+
Connected
82+
Connection successful
83+
```
84+
85+
Open Starcraft gui window, start a game or replay, the client in the first terminal will report you:
86+
```
87+
Connected
88+
Connection successful
89+
Starting match
3790
```

0 commit comments

Comments
 (0)