Code Monkey home page Code Monkey logo

anti_combat_logout's Introduction

Anti Combat Logout

Players entering in combat will need to wait a configurable amount of seconds beforing exiting from the game, if the player exit during this time all their inventory will be dropped and cleaned.

Configuration

  • PlayersFolder: location of players folders, this is necessary because when player disconnect in combat we need to clean their inventory
  • LevelName: we use this to locate the player inventory by the level to not clean other levels if exist
  • CombatTickrateDuration: the tickrate amount to player exit from combat, this is based on ServerTickrate for example, on a server with 60 frames per second and you want 15 seconds of combat make the calculation: 60 x 15 = 900
  • ServerTickrate: used only for calculations, make sure this is the same as MaxFrames from Rocket.config
  • InventoryMaxPage: larger numbers of this will make the server lag on cleaning inventory, my recomendation is 10 if you have mods that increase the page amount consider changing this.
  • InventoryMaxX/InventoryMaxY: the biggest storage size on the server.

Library

This mods also works like a library, if you create a reference into your project you can use the AntiCombatLogoutTools with this class you can access events and variables to manipulate the combat players

/// Contains all players in combat mode
readonly public static Dictionary<string, bool> CombatPlayersId = new();
/// Called every time a player enter in combat
public static event Action<string>? PlayerEnterInCombat;
/// Called every time a player exit from combat
public static event Action<string>? PlayerExitFromCombat;
/// Called when a player disconnect in combat
public static event Action<string>? PlayerCombatLogout;

There is others functions like: PlayerEnteringInCombat PlayerExitingFromCombat PlayerLogoutInCombat this functions exists only for invoking this events and updating the CombatPlayersId

Building

Windows: The project uses dotnet 4.8, consider installing into your machine, you need visual studio, simple open the solution file open the Build section and hit the build button (ctrl + shift + b) or you can do into powershell the command dotnet build -c Debug if you have installed dotnet 4.8.

Linux: Install dotnet-sdk from your distro package manager, open the root folder of this project and type dotnet build -c Debug.

FTM License.

anti_combat_logout's People

Contributors

leandrothedev avatar

Stargazers

 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.