Code Monkey home page Code Monkey logo

antivpn's Introduction

AntiVPN

Get the best; save money on overpriced plugins and block VPN users!

Installation

Single / Personal servers

Simply drop the jar into your "plugins" folder. The auto-generated config should default to reasonable values for you, but you may modify it if you wish.

Multiple servers / Large networks

Drop the jar into the plugins folder and configure the "sql" section to use MySQL instead of SQLite. RabbitMQ and/or Redis are optional but highly recommended if you have multiple servers.

Configs

Bukkit: https://github.com/egg82/AntiVPN/blob/master/Bukkit/src/main/resources/config.yml

Bungee: https://github.com/egg82/AntiVPN/blob/master/Bungee/src/main/resources/config.yml

Commands

/avpnreload - Reloads the plugin configuration. This will disconnect and reconnect (if appropriate) any services configured in the config.yml file.

/avpntest - Test an IP through the various (enabled) services. Note that this forces a check so will use credits every time it's run.

/avpncheck - Check an IP using the default system. This will return exactly the same value as any other API call.

/avpnscore - Scores a particular source based on a pre-made list of known good and bad IPs. Note that this forces a check so will use credits every time it's run.

Permissions

avpn.admin - allows access to the /avpnreload, /avpntest, /avpncheck, and /avpnscore commands

avpn.bypass - players with this node bypass the filter entirely

Legal

According to the GDPR, you must specify that you are storing IP information to your players in a privacy policy when using this plugin (actually you need that if you're running a vanilla server without this plugin because of server logs). Depending on how data provided from this API is used, you may be required to manually remove some data from the databases.

Disclaimer: I am a plugin developer, not a lawyer. This information is provided as a "best guess" and is not legal advice.

API / Developer Usage

Maven

<repository>
    <id>egg82-ninja</id>
    <url>https://www.myget.org/F/egg82-java/maven/</url>
</repository>

Latest Repo

https://www.myget.org/feed/egg82-java/package/maven/ninja.egg82.plugins/AntiVPN

API usage

VPNAPI.getInstance();
...
long getCurrentSQLTime();
boolean cascade(String ip, [boolean expensive]);
ImmutableMap<String, Optional<Boolean>> testAllSources(String ip); // WARNING: Does not cache results
double consensus(String ip, [boolean expensive]);
Optional<Boolean> getSourceResult(String ip, String sourceName); // WARNING: Does not cache results

Example - Detect if a player is using a VPN (cascade)

VPNAPI api = VPNAPI.getInstance();
if (api.cascade(playerIp)) {
    // Do something
}

Example - Detect if a player is using a VPN (consensus)

VPNAPI api = VPNAPI.getInstance();
if (api.consensus(playerIp) >= threshold) { // Anywhere from 0.0 to 1.0
    // Do something
}

Example - See which services detect a given IP as a VPN

VPNAPI api = VPNAPI.getInstance();
ImmutableMap<String, Optional<Boolean>> response = api.testAllSources(ip);
for (Entry<String, Optional<Boolean>> kvp : response) {
    // Do something
}

Example - Get the most updated result from a specified provider

VPNAPI api = VPNAPI.getInstance();
Optional<Boolean> result = api.getSourceResult(playerIp);
if (!result.isPresent()) {
    // Error- ran out of credits, too many attempts, etc etc
    return;
}
if (result.get()) {
    // Do something
} else {
    // Do something else
}

antivpn's People

Contributors

egg82 avatar jascotty2 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.