Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit 0877d02

Browse files
authored
Merge pull request #14 from yogstation13/bee
1561 Test
2 parents d544aec + 1e21375 commit 0877d02

File tree

10 files changed

+50
-440
lines changed

10 files changed

+50
-440
lines changed

.appveyor.yml

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,12 @@ branches:
55
only:
66
- master
77
shallow_clone: true
8-
image:
9-
- Visual Studio 2017
10-
- Ubuntu
8+
image: Visual Studio 2017
119
build_script:
1210
- mkdir build
1311
- cd build
1412
- cmake ../byond-extools
15-
- cmd: cmake --build . --config RelWithDebInfo
16-
- sh: sudo apt-get install -y gcc-multilib g++-multilib
17-
- sh: make
18-
19-
for:
20-
- matrix:
21-
only:
22-
- image: Visual Studio 2017
13+
- cmake --build . --config RelWithDebInfo
2314
artifacts:
2415
- path: build/RelWithDebInfo/byond-extools.dll
2516
- path: build/RelWithDebInfo/byond-extools.pdb
26-
27-
- matrix:
28-
only:
29-
- image: Ubuntu
30-
artifacts:
31-
- path: build/libbyond-extools.so

.vscode/settings.json

Lines changed: 0 additions & 82 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
# BYOND extools
22
External tools for BYOND. Used to fiddle with the game engine's internals.
33

4-
# This project is archived
5-
Extools will no longer be receiving updates. I recommend switching to Rust-based [Auxtools](https://github.com/willox/auxtools), which I contribute to as well.
6-
<br/><br/><br/><br/>
7-
84
<table>
9-
<tr><td align="right" valign="middle">Find an action run with an artifact and download it</td></tr>
5+
<tr><td align="right" valign="middle"><a href="https://ci.appveyor.com/project/yogstation13/extools"><img src="https://ci.appveyor.com/api/projects/status/github/MCHSL/extools?svg=true" alt="Appveyor status" /></a></td><td>Windows build (with <a href="https://ci.appveyor.com/project/yogstation13/extools/build/artifacts">binaries</a>)</td></tr>
106
</table>
117

128
## Isn't there a project just like this already?
@@ -18,28 +14,12 @@ Here are the modules currently available (not counting the core). Scroll to the
1814
#### Proc hooking
1915
Not exactly a module, but still useful. Hooking allows you to reimplement procs in C++, which usually run much faster, especially if the hooked proc is, for example, just math operations.
2016

21-
#### Debug server
22-
Interfaces with debugger frontends, providing various information and managing breakpoints.
23-
[SpacemanDMM](https://github.com/SpaceManiac/SpacemanDMM) by SpaceManiac enables line-by-line debugging and live viewing of variables. More to come.
24-
Steamport's [Somnium](https://github.com/steamp0rt/somnium) is currently non-functional, but will allow debugging of low-level bytecode.
25-
2617
#### TFFI
2718
Threaded FFI for BYOND. Automagically threads off all DLL calls and prevents them from locking up the game until they return. You may use a Promise datum, pass a callback (global or an object) or simply sleep until the call returns.
2819

2920
#### Optimizer
3021
Currently a proof of concept. The only optimization available is inlining - the optimizer will go through all procs and attempt to inline global proc calls to eliminate call overhead. At the time of writing optimizing takes an incredibly long time to finish, which makes it infeasible to use.
3122

32-
#### Memory Profiler
33-
34-
Counts all soft-code objects currently instantiated in the game world and dumps
35-
these numbers into a JSON file of your choosing for later inspection. The code
36-
also attempts to approximate the number of bytes that each object type takes
37-
up, though the accuracy is not guaranteed.
38-
39-
To use, simply invoke `dump_memory_usage("myfile.json")` with the appropriate
40-
`call()()` syntax and away you go. This will halt the server for a moment as the
41-
counting is done.
42-
4323
#### Maptick
4424
Hooks an internal BYOND function which sends map updates to players, and measures time taken to execute it. The result is written to a global variable called `internal_tick_usage`. SS13 servers can use this information to adjust how much of a tick running subsystems can take, which reduces lag spikes perceived by players.
4525

@@ -59,6 +39,7 @@ These modules are planned to be included in the future.
5939
- Proxy objects: Forward variable reads and writes to C++.
6040
- Websockets: Send and receive data using the websocket protocol.
6141
- Lua: Allows writing lua scripts that replace builtin procs. Mostly for messing about.
42+
- ~~Optimizer: Optimizes bytecode and inlines procs into each other to avoid call overhead.~~
6243

6344
## I want to use this!
6445
Download the DLL and .dm file from [Releases](https://github.com/MCHSL/extools/releases). Place the DLL next to your DMB and plop the .dm somewhere where you can easily tick it. Afterwards, add `extools_initialize()` to `world/New()` or equivalent. To load modules, call `<module>_initialize()`, for example `tffi_initialize()`. Module initialization functions must be called after `extools_initialize()`!

byond-extools/src/core/byond_structures.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -361,24 +361,24 @@ ManagedValue::~ManagedValue()
361361

362362
Params MiscEntry::as_params()
363363
{
364-
return Params {
365-
parameters2.count(),
366-
parameters2.params,
367-
};
368-
}
364+
return Params {
365+
parameters2.count(),
366+
parameters2.params,
367+
};
368+
}
369369

370370
LocalVars MiscEntry::as_locals()
371371
{
372-
return LocalVars {
373-
local_vars2.count,
374-
local_vars2.var_name_indices,
375-
};
376-
}
372+
return LocalVars {
373+
local_vars2.count,
374+
local_vars2.var_name_indices,
375+
};
376+
}
377377

378378
ProcBytecode MiscEntry::as_bytecode()
379379
{
380-
return ProcBytecode {
381-
bytecode2.bytecode_length,
382-
&bytecode2.bytecode,
383-
};
384-
}
380+
return ProcBytecode {
381+
bytecode2.bytecode_length,
382+
&bytecode2.bytecode,
383+
};
384+
}

byond-extools/src/core/core.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ void Core::Alert(int what)
111111
}
112112

113113
unsigned int Core::GetStringId(std::string str, bool increment_refcount) {
114-
if (ByondVersion > 513) {
114+
if (ByondVersion == 514) {
115115
return GetStringTableIndexUTF8(str.c_str(), 0xFFFFFFFF, 0, 1);
116116
}
117117
return 0;

0 commit comments

Comments
 (0)