Coder Social home page Coder Social logo

canadianbaconboi / gmoddotnet Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gmodnet/gmoddotnet

0.0 1.0 0.0 3 MB

Cross-platform .NET Module/Plugin platform for Garry's Mod powered by .NET Core.

License: MIT License

C# 74.36% C++ 12.25% CMake 0.85% C 10.65% Lua 0.01% CSS 1.88%

gmoddotnet's Introduction

Nuget Downloads Discord Server CI

Gmod.NET

Current Runtime Current API

Cross-platform .NET Module/Plugin platform for Garry's Mod powered by .NET Core.

About

Gmod.NET is Garry's Mod Module/Plugin loader for C# and other .NET languages which runs across all platforms (Windows, Linux, Mac Os). Gmod.NET allows you to develop cross-platform Garry's Mod extensions without need to close or reload your game or server.

Similar projects

Check out gmod_csModuleLoader by Bailey Drahoss.

Current features

GmodNET provides functionality to write Garry's Mod modules in C# or any other CIL-compiled language as .NET Core 3.1 class libraries. For more information on modules and API check out project's wiki. Only x86_64 version of Garry's Mod is currently supported.

Need help?

Check out our wiki or join our discord server.

Building and contributing

Build instructions

To build GmodDotNet you need to have following software installed and registered with your PATH environment variable:

  1. Latest version of git

  2. Latest version of CMake

  3. Latest version of dotnet SDK

  4. (On Windows) Latest version of Visual Studio 2019 with C++ package

  5. (On macOS) Latest version of Xcode

  6. (On Linux) Latest versions of make and gcc (or clang)

Build steps:

  1. Clone this git repository (building outside of git repository is not supported)

  2. In the root of the cloned repository run dotnet build runtime.csproj -c Debug or dotnet build runtime.csproj -c Release instruction in your command prompt.

NOTE: runtime.csproj is not a real C# project file but a kind of build script. To work with the managed part of GmodDotNet open gm_dotnet_managed/gm_dotnet_managed.sln solution file in your IDE instead.

runtime.csproj build script will produce following folders in the root of repository:

  1. build folder contains the full build of GmodDotNet runtime (both native and managed). The content of this folder should be copied to garrysmod/lua/bin.

  2. Modules folder contains tests suit. To run tests this folder should be copied to garrysmod/lua/bin.

  3. nupkgs folder contains GmodNET.API NuGet package.

You may also want to copy the content of lua folder to the corresponding destinations in garrysmod/lua.

Folder structure

Gmod.NET is subdivided into three subprojects.

Garry's Mod binary native module and helper libraries are contained in gm_dotnet_native folder and organized as CMake project.

Managed part is contained in gm_dotnet_managed folder and organized with .NET soultion file gm_dotnet_managed.sln.

Bootstrap Lua scripts are contained in lua folder.

Nightly builds

You can find latest nightly builds GmodDotNet runtime at http://nightly.gmodnet.xyz/. To use nightly NuGet packages connect to our nightly NuGet feed.

Installation and usage

  1. Download latest build from the project's releases page.

  2. Unpack archive for your OS to the %GARRYS_MOD_ROOT_FOLDER%garrysmod/lua/bin/ folder.

  3. Create a Modules folder inside garrysmod/lua/bin/.

  4. Download and copy gm_dotnet_server.lua to garrysmod/lua/autorun/server folder.

  5. Download and copy gm_dotnet_client.lua to garrysmod/lua/autorun/client folder.

  6. Place your .NET module, ...deps.json file, and all dependencies in Modules/%exact_name_of_the_module_without_dll/ folder.

  7. If you signed your module with GmodNetModuleSigner, copy [name_of_your_module].modulekey and [name_of_your_module].modulesign to the same folder as above (Modules/%exact_name_of_the_module_without_dll/).

  8. If you want your module to be serverside (clientside) only then add file TYPE to Modules/%exact_name_of_the_module_without_dll/ with content server (client).

  9. Use gmod_net_load_all (gmod_net_load_all_cl for client-side) console command to load all managed modules and gmod_net_unload_all (gmod_net_unload_all_cl) to unload them. Modules can be hot-reloaded, so one doesn't need to quit game to see changes.

License

Whole project is licensed under MIT License.

Dependencies and code usage

Gmod.NET is making use of or borrows code from the following projects:

  1. CoreCLR, CoreFX, and core-setup by .NET Foundation (MIT License)

  2. pure_lua_SHA by Egor Skriptunoff (MIT License)

  3. NSec by Klaus Hartke (MIT License)

  4. Libsodium by Frank Denis (ISC License)

See other copyright notices in the NOTICE file.

gmoddotnet's People

Contributors

aaronjthompson avatar glebchili avatar luttje avatar stat1cv01d avatar supinepandora43 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.