GithubHelp home page GithubHelp logo

alternatelife / ragemp.net Goto Github PK

View Code? Open in Web Editor NEW
23.0 11.0 14.0 573 KB

RAGE Multiplayer .NET Core Wrapper

Home Page: https://ragemp.alternate-life.de

License: MIT License

C# 97.08% CMake 0.26% C++ 2.35% Dockerfile 0.31%
ragemp gta5 multiplayer

ragemp.net's Introduction

AlternateLife.RageMP.Net

Development Build status (Windows, Linux) NuGet Docker Pulls

AlternateLife.RageMP.Net is an alternative server-side .NET Core 2.2 implementation for RAGE Multiplayer. This library targets more advanced developers which are more familiar with the RAGE Multiplayer server API and its features. It offers a mostly asynchronous API to interact with, so a thread-safe access to the native API is always guaranteed.

Download & Installation

NuGet

PM> Install-Package AlternateLife.RageMP.Net

All releases are available for download in our Releases page. You can also find all instructions on how to get started in our installation guide.

Documentation

You can find the latest AlternateLife.RageMP.Net documentation here.

Example

This is a sneak peek on how to create the Main-class, so the server can find your entry point where to start from.

using System.Threading.Tasks;
using AlternateLife.RageMP.Net.Enums;
using AlternateLife.RageMP.Net.Interfaces;
using AlternateLife.RageMP.Net.Scripting;

namespace AlternateLife.RageMP.Net.Example
{
    public class Main : IResource
    {
        public Main()
        {
            MP.Events.PlayerJoin += OnPlayerJoin;
            MP.Events.PlayerQuit += OnPlayerQuit;

            MP.Events.Add("PLAYER_INTERACT", OnPlayerInteract);
        }

        public Task OnStartAsync()
        {
            return Task.CompletedTask;
        }

        public Task OnStopAsync()
        {
            return Task.CompletedTask;
        }

        private Task OnPlayerJoin(IPlayer player)
        {
            MP.Logger.Info($"Player {player.SocialClubName} ({player.Ip}) joined");

            return Task.CompletedTask;
        }

        private void OnPlayerQuit(IPlayer player, DisconnectReason type, string reason)
        {
            MP.Logger.Info($"Player {player.SocialClubName} ({player.Ip}) left the server: {type.ToString()} ({reason})");
        }

        private Task OnPlayerInteract(IPlayer player, string eventname, object[] arguments)
        {
            var health = player.Health;

            health += 5;
            if (health > 100)
            {
                health = 100;
            }

            player.Health = health;

            return Task.CompletedTask;
        }
    }
}

Docker

On DockerHub is an image containing the RAGE Multiplayer Linux server with AlternateLife.RageMP.Net already preinstalled. You can find more documentation there.

See also

MIT License

Copyright (c) 2018 Alternate-Life

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

ragemp.net's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ragemp.net's Issues

MP.TextLabels.New causes segfault

when using MP.TextLabels.New the server crashes with a segfault afterwards

        [Command("test")]
        public async Task test(IPlayer player)
        {
            MP.TextLabels.New(player.GetPosition(), "test", 0, Color.White);
        }

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.