Skip to content

Medo42/Faucet-Networking-Extension

Repository files navigation

This is Faucet Networking, a Game Maker extension by Simeon Maxein (MedO) for easy
integration of networking into Game Maker games. It is distributed under the ISC license,
which is short and simple enough that I don't have to explain it, just read the LICENSE
file.

I have worked many weeks to create this library and support its users. If you want to
support me in return, you can use flattr:
https://flattr.com/thing/350329/The-Faucet-Networking-extension

You can find the source code for this project at Github:
https://github.com/Medo42/Faucet-Networking-Extension/


Usage

See help.pdf

Creating the extension from source

To create the .gex extension file, you need the following steps:
- Compile a .dll from the source code in the faucet directory
- Create the .gex from the .dll


Compiling the .dll

For building the .dll I recommend using MinGW, because that's what I use myself
(version 4.8.1). The compiler needs decent C++11 support.

This project requires some libraries from Boost, available from http://www.boost.org

The Code::Blocks project has a post-build step that requires UPX (http://upx.sourceforge.net/)

A project file for Code::Blocks is provided. You should only need to change the Compiler
and linker search paths in order to build the project. Alternatively, here are the
rules needed to build Faucet Net from scratch:
- all .cpp files in the faucet directory and subdirectories should be compiled
  and then linked as a dll.
- As include directories, you need to set up the Boost include dir as well as the project
  directory itself (i.e. the directory containing the "faucet" source directory)
- Link statically with the mswsock, ws2_32 and iphlpapi libraries, as well as the boost system
  library and Boost threads. Use the multithreaded static (mt-s) variants for both. Also,
  statically link with the multithreading-safe standard library.
- For compiling with mingw, make sure to add the -mthreads switch to both the compiler and
  the linker. Link as -static to avoid depending on external runtime dlls. Use -std=gnu++11
  in the compiler (note that boost also needs to be built with that switch to avoid
  compatibility issues).
  
Please let me know if it worked, I set this up more or less by trial and error myself :P


Creating the .gex

For this task you need the GM Extension Maker. It used to be available for download from Yoyo
games at http://www.yoyogames.com/make/extensions, but unfortunately they no longer have it on
their website. You can still download it from the Internet Archive though:
https://web.archive.org/web/20111209035249/http://sandbox.yoyogames.com/downloads/extensions/extmaker.zip

Open the extension description file (faucetnet.ged)
in the main project directory. You'll have to adapt it to work for you, so click on the 
faucetNetworking.dll file and switch to the "Misc" tab. Change the "Original Name" to
the pathname where your own .dll is located.

Now you should be able to build the extension (File->Build Package...)

There is also an additional .ged now, called fct_faucetnet.ged. This contains the same functions,
but prefixed with fct_. This way, we can avoid name collisions that happen in GM_Studio,
which also defines buffer and networking functions.