Go to file
David Anderson e5ddbd9886 Introduce a pbproxy library to solve macOS linker issues.
On SDKs which use protobufs, the engine has objects compiled against a specific
version of protobuf. Normally this is fine, we take care on Linux to use the
same C++ ABI. On macOS however, we use libc++ to enable C++11 functionality,
whereas the protobuf library has been compiled with libstc++. These ABIs are
not compatible.

To address the problem, we introduce PbHandle. PbHandle is a wrapper around
protobuf::Message with two added pieces of state: whether or not the handle
"owns" the message (and can free it in its destructor), and whether or not
the handle was created by the engine (private) or created by SourceMod
(local).

Whenever we transfer a protobuf::Message pointer to SourceMod, we must take
care to convert it to a Local version first. Whenever we transfer a protobuf
pointer to the engine, we must convert it to a Private handle.

For platforms with no ABI differences (almost all of them), the handle is a
no-op. The private and local localities are compatible and no translation
takes place.

On macOS, CS:GO does require translation. SourceMod loads a tiny shim
library that contains a copy of the protobuf sources compiled against the
game's ABI. It then provides serialization and deserialization methods.
SourceMod must not interact with the game's protobuf objects without first
going through this proxy library.

Note that PbHandle is not quite like unique_ptr. It can be converted into a
PbHandle that does not destroy the underlying object. This is mainly because
UserMessages.cpp has rather complex state, so it is useful to track locality
without destroying an object. An unowned PbHandle must not outlive the
owning PbHandle.
2020-05-30 22:13:07 -07:00
.github Create FUNDING.yml 2019-05-27 17:15:04 +01:00
bridge/include Rename ke::Lambda to ke::Function. 2020-05-17 12:33:52 -07:00
configs Allow setting multiple chat trigger characters (PR #449, bug 4341, bug 5668) 2016-10-04 16:34:42 +01:00
core Introduce a pbproxy library to solve macOS linker issues. 2020-05-30 22:13:07 -07:00
editor Added AMXX Pawn geshi generation script. 2010-08-23 13:53:44 -04:00
extensions Fix mac build, part 2. 2020-05-20 23:17:15 -07:00
gamedata Fix GetDataDescMap not work on Day Of Infamy (#1263) 2020-05-07 12:20:29 +01:00
licenses Fix quote mismatch (#1092) 2019-09-30 22:43:18 -07:00
loader Revert "Remove arch loops from build scripts. (#889)" 2018-10-04 17:59:40 +00:00
plugins Add an array operations to CDataPack (#1219) 2020-05-08 15:23:48 -07:00
public Fix startup crash. 2020-05-30 19:10:23 -07:00
sourcepawn@71016c40cf Fix startup crash. 2020-05-30 19:10:23 -07:00
tools Change bootstrap.pl and startbuild.pl to also take CXX. (#1280) 2020-05-27 21:18:49 -04:00
translations Standardize some spacing in translation phrases (#1254) 2020-05-08 14:55:05 -07:00
versionlib 64-bit support for CSGO on Linux and macOS (#705) 2017-12-20 01:56:23 -06:00
.arcconfig Add a .arcconfig file so that arc works 2013-10-15 22:57:59 +01:00
.gitattributes NPOTB: Correct GitHub's Linguist inaccuracies (#1096) 2019-10-07 19:14:09 +01:00
.gitignore Update to the latest SourcePawn revision. 2015-08-18 09:51:24 -07:00
.gitmodules Use upstream SourcePawn as a submodule. 2015-03-15 16:38:38 -07:00
.travis.yml Build csgo-x64 on travis. 2020-05-30 22:13:07 -07:00
AMBuildScript Introduce a pbproxy library to solve macOS linker issues. 2020-05-30 22:13:07 -07:00
changelog.txt Triggering a build. 2011-04-13 19:05:41 -05:00
configure.py Add an option to build against no SDKs (#1201) 2020-03-04 21:52:07 +00:00
product.version Bump version to 1.11. 2019-10-18 21:07:36 -07:00
pushbuild.txt Trigger build for hl2sdk-csgo update. 2019-03-28 20:00:20 -04:00
README.md Incorperate Licensing Into Project Tree (#961) 2019-04-12 12:10:13 -07:00

SourceMod

General

Development

Contact

  • Connect with us on GameSurge IRC in #sourcemod
  • Alternatively feel free to join our Discord server

License

SourceMod is licensed under the GNU General Public License version 3. Special exceptions are outlined in the LICENSE.txt file inside of the licenses folder.