GithubHelp home page GithubHelp logo

vik1395 / bungeeauth-minecraft Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 14.0 8.85 MB

[Minecraft] A Player Authentication plugin for Bungee Servers

Home Page: https://www.spigotmc.org/resources/bungeeauth.493/

License: Other

PHP 2.43% Java 97.57%

bungeeauth-minecraft's People

Contributors

franciscoquintana avatar games647 avatar vik1395 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

bungeeauth-minecraft's Issues

Task Error

I have this problem when i connect to my Proxy (HexaCord) sometimes

15:24:54 [INFO] [CleusGamer201] <-> ServerConnector [Lobby] has connected
15:24:56 [GRAVE] Task BungeeTask(sched=net.md_5.bungee.scheduler.BungeeScheduler
@27adc16e, id=2, owner=me.vik1395.BungeeAuth.Main@2ea6e30c, task=me.vik1395.Bung
eeAuth.Main$2@388526fb, delay=0, period=10000, running=true) encountered an exce
ption
java.lang.NullPointerException
    at me.vik1395.BungeeAuth.Main$2.run(Main.java:205)
    at net.md_5.bungee.scheduler.BungeeTask.run(BungeeTask.java:63)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
15:25:42 [INFO] C:\Users\XXXX\XXXX\XXXX\XXXX\HexaCord\plugin
s\BungeeAuth/SQLite.db

BungeeAuth messages.yml

The problem is that i can't use color codes in the plugin messages... Pls how i can finish this problem? Sorry for my english.

Wrror while making SQLite database

My config

BungeeAuth Config File

Use SQLite: true

Set this to true if you want to use a file based database (SQLite) rather than MySQL

#Host: 127.0.0.1

Please enter the Host of your MySQL database here.

#Port: 3306

Please enter the port where your MySQL database is hosted.

#Username: root

The Username which should be used to login to the MySQL database.

#Password: 'pass'

The Password which should be used to login to the MySQL database. If you don't have a password, please leave two single quotation marks (') in this field.

#DBName: Bungee
#The name of the MySQL database where BungeeAuth's Tables shall be created.

Lobby: lobby

The name of the lobby server.

Fallback Lobby: Lobby2

The name of the fallback lobby server in case the main lobby is down.

AuthLobby: lobby

The name of the lobby where players are pushed before they authenticate. leave it same as normal lobby if you don't have an auth lobby.

Fallback AuthLobby: AuthLobby2

The name of the fallback AuthLobby server in case the main AuthLobby is down.

Ask Email: false

Set this to True if you want the plugin to prompt users to register their email when they login to the server for the first time.

Session Length: 5

How long (in minutes) does the user's session remains running after a player quits. This allows the user to log back in within the time frame without

having to type their password again. If user logs in from a different IP, they will be asked to type their password again for security reasons.

Guest Session Length: 60

How long (in seconds) the user has before they have to register or login. Set this to 0 to disable guest session time limits.

Legal Usernames Characters: "[a-zA-Z0-9_]*"

Allowed Characters in Usernames (). Enclose in quotation marks.

Users per IP: 5

Number of users that can register (not login) from the same IP.

Password Tries: 5

Number of times a player can input a wrong password before getting their account locked. Set this to 0 to disable this feature.

Wrong Password Timeout: 5

Timeout (in minutes) for players who spam commands. The timeout occurs if a player tries to use a BungeeAuth command more than 10 times. Set this to 0 to disable this feature.

Guest Server Failsafe Check: true

A failsafe method that runs every 10 seconds to check if a guest player is in AuthLobby, and if not, moves them to AuthLobby.

#---------------------------- PHP API AREA ----------------------------#

Enable PHP API: false

Enabling this will make the plugin listen to API requests from a port.

PHP API Port: 1395

The port that the plugin will be listening for API requests on.

API Password: 'pZe8qNCC6s5NKvYj'

The password required in the API requests for a response. If you don't have a password, please leave two single quotation marks (') in this field.

API Error Limit: 5

Set the maximum number of wrong api password attempts used by a php script before it's ip gets blocked. IP will be blocked until removed from apiblacklist.txt


My Error

05:26:05 [INFO] Enabled plugin AdvancedBan version 2.3.0 by Leoko
05:26:05 [INFO] /home/opc/BungeeCord/plugins/BungeeAuth/SQLite.db

05:26:05 [INFO] [BungeeAuth] Error while creating SQLite Database

05:26:05 [SEVERE] java.sql.SQLException: Error opening connection


Suggestion: kick on wrong password

I would suggest to add kick from the bungee when fail to type password, it will prevent brute force attack with login command spam.

config.yml
Kick on Wrong Password: true

messages.yml
wrongpass_kick: "Wrong password!"

Very big lag when someone joins

I'm using Waterfall and 3 PaperSpigot backends:

  • auth
  • lobby
  • survival

When someone joins he's joining at first 'auth' for authentication and then 'lobby' or 'survival'. At this moment it generates a very big lag. In /timings report I can see that BungeeAuth causes lag. (ConnectionHandler)

[API] Add isLoggedIn()

I'm still missing a isLoggedIn method. I'm currently using Main.plonline, but I think it's better to have this in the API too in the case you change something there (i.e. renaming this variable).

API for ForceAction

Since you are back, we could also submit feature right?

It would be a lot easier for my project FastLogin if you add an API for force actions like forceLogin(ProxiedPlayer), forceRegister(ProxiedPlayer) and isRegistered(playerName). I'm currently using reflection, but this leads to a really bad coding style and could be error-prone (especially if a security manager is activated).

Current hook of mine: https://github.com/games647/FastLogin/blob/master/bungee/src/main/java/com/github/games647/fastlogin/bungee/hooks/BungeeAuthHook.java

I didn't necessary mean that you need to hook into FastLogin. I just mean to add an API that maybe other plugins could also use.

Session issues

  1. Sometimes user is not teleported to the lobby when he return
  2. When other user with different ip log into the session time, it will be teleported to lobby (lucky he can't do anything) and asking him to login, teleport should be cancelled
  3. Feature request: allow session to be disabled, puting 0 or -1 do nothing for now

Player teleported back

Hi,

I have problem with login. I am using FastLogin to log-in player atomatically.

Whe I join, I am redirected to lobby server - Fastlogin logs me...but after few secodns, I am warped back to auth server.

Can you help me with that? Thanks

messages.yaml possible to configurate other languages and color text

I cant change text of messages in messages.yml that make abrakadabra in game.
I tried chage " " = ' ' but not work.

Can ure pls make possible to enter another languge text in messages.yml?

I found translate version of that but to old (1.3.1) where was realized what i want...
link to download it for exaple and fast realize https://yadi.sk/d/Uo2giJqhvaWyb

message for exaple:

illegal_name: "§cВ Вашем нике есть недопустимые символы, смените никнейм и играйте!"

and can ure pls add allias commands /r /l to register and login?

Thanks)

LagMonitor hint

Hey,

LagMonitor gives me a hint for your plugin:
[Server thread/WARN]: [LagMonitor] Plugin BungeeAuth is performing a blocking action on the main thread. This could be a performance hit Socket: socket://localhost:3306. Such actions should be handled async from the main thread. Report it to the plugin author [Server thread/WARN]: [LagMonitor] The following exception is not an error. It's a hint for the plugin developer to find the source of the threading action. LagMonitor doesn't prevent this action. It just warns you java.lang.IllegalAccessException: null at com.github.games647.lagmonitor.threading.BlockingActionManager.logCurrentStack(BlockingActionManager.java:55) [LagMonitor.jar:?] at com.github.games647.lagmonitor.threading.BlockingActionManager.checkBlockingAction(BlockingActionManager.java:42) [LagMonitor.jar:?] at com.github.games647.lagmonitor.listeners.BlockingConnectionSelector.select(BlockingConnectionSelector.java:27) [LagMonitor.jar:?] at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:384) [?:1.8.0_144] at java.net.Socket.connect(Socket.java:589) [?:1.8.0_144] at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:211) [spigot-1.12.2.jar:git-Spigot-5695bca-53fccdf] at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:300) [spigot-1.12.2.jar:git-Spigot-5695bca-53fccdf] at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2189) [spigot-1.12.2.jar:git-Spigot-5695bca-53fccdf] at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2222) [spigot-1.12.2.jar:git-Spigot-5695bca-53fccdf] at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2017) [spigot-1.12.2.jar:git-Spigot-5695bca-53fccdf] at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:779) [spigot-1.12.2.jar:git-Spigot-5695bca-53fccdf] at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47) [spigot-1.12.2.jar:git-Spigot-5695bca-53fccdf] at sun.reflect.GeneratedConstructorAccessor141.newInstance(Unknown Source) [?:1.8.0_144] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [?:1.8.0_144] at java.lang.reflect.Constructor.newInstance(Constructor.java:423) [?:1.8.0_144] at com.mysql.jdbc.Util.handleNewInstance(Util.java:425) [spigot-1.12.2.jar:git-Spigot-5695bca-53fccdf] at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:389) [spigot-1.12.2.jar:git-Spigot-5695bca-53fccdf] at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:330) [spigot-1.12.2.jar:git-Spigot-5695bca-53fccdf] at java.sql.DriverManager.getConnection(DriverManager.java:664) [?:1.8.0_144] at java.sql.DriverManager.getConnection(DriverManager.java:247) [?:1.8.0_144] at MySQL.openConnection(MySQL.java:34) [BungeeAuthValidator.jar:?] at Tables.checkPlayerEntry(Tables.java:13) [BungeeAuthValidator.jar:?] at Main.onjoin(Main.java:81) [BungeeAuthValidator.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_144] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_144] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_144] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_144] at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:302) [spigot-1.12.2.jar:git-Spigot-5695bca-53fccdf] at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) [spigot-1.12.2.jar:git-Spigot-5695bca-53fccdf] at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:499) [spigot-1.12.2.jar:git-Spigot-5695bca-53fccdf] at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:484) [spigot-1.12.2.jar:git-Spigot-5695bca-53fccdf] at net.minecraft.server.v1_12_R1.PlayerList.onPlayerJoin(PlayerList.java:346) [spigot-1.12.2.jar:git-Spigot-5695bca-53fccdf] at net.minecraft.server.v1_12_R1.PlayerList.a(PlayerList.java:166) [spigot-1.12.2.jar:git-Spigot-5695bca-53fccdf] at net.minecraft.server.v1_12_R1.LoginListener.b(LoginListener.java:159) [spigot-1.12.2.jar:git-Spigot-5695bca-53fccdf] at net.minecraft.server.v1_12_R1.LoginListener.e(LoginListener.java:57) [spigot-1.12.2.jar:git-Spigot-5695bca-53fccdf] at net.minecraft.server.v1_12_R1.NetworkManager.a(NetworkManager.java:233) [spigot-1.12.2.jar:git-Spigot-5695bca-53fccdf] at net.minecraft.server.v1_12_R1.ServerConnection.c(ServerConnection.java:140) [spigot-1.12.2.jar:git-Spigot-5695bca-53fccdf] at net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:845) [spigot-1.12.2.jar:git-Spigot-5695bca-53fccdf] at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:406) [spigot-1.12.2.jar:git-Spigot-5695bca-53fccdf] at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:679) [spigot-1.12.2.jar:git-Spigot-5695bca-53fccdf] at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:577) [spigot-1.12.2.jar:git-Spigot-5695bca-53fccdf] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_144]

Maven repository

I've seen that you are back. Do you have any plans on providing a maven repository for this project? I want to use this project as dependency.

BTW: I have a lot users you actually liked this project and asked for continuation.

Bugs 1.4

  1. When player register a new account he dont receive any message
  2. session still work also if i put 0
  3. bungeeauth will cause lag if a massive amount of people will enter -around 100 (not sure if is the cause but i think) http://hastebin.com/ixuyixiwad.hs
    I suggest to use caching method like authme, it dont cause any error but host was partially unreachable (online but really hard to login/enter)

[Feature] Setting for disable mixing hash

A config that you can disable random passowlrd hash type and keep the favourite password hash would be great. The reason for this feature is for help user to switch from/to another auth plugin easly without lose all user database

Config example:

Encrpytion:
        #Should Bungeeauth use a defined hash instead be random selected?
        Definedhash: true
        #If the above setting is true, specific the hash to use. (Supported hash MD5, SHA1, SHA256, SHA512... i dont remember other ones)
        HashtoUse: true

Typo error

these two strings reset_noreg and reset_success in messages %player% string will be alway the player that typed the command /reset instead the target player

Problem with FastLogin

Hey, soo i tried adding fastlogin and it doesnt autologin (people still have to use /login) and also i dont have 2 servers for lobby (auth one and main lobby) so i have to use the same server

Security problem in /login force

As I was looking into some issues with the plugin, I noticed that you can force a small valid login session to have enough time to execute an admin command on a server
Here are the steps that I took to execute this command:

  • First I logged in with my Tlauncher in one of my admins account, that happens to be an unoriginal account.
  • Then when logging into my server, I did /login force <HisAccountName>

After that, I noticed that bungeeauth won't kick me if I stay more than 5 minutes unauthenticated, so in theory, I was authenticated and I was also able to execute any bungeecord command, like /server, /ip and /end, so I could already stop the bungeecord server and leak other players ip addresses, but there's one more problem into it. Here are the steps:

  • After exploiting the force login, do /server
  • Execute any command in 10 seconds

Because of the failsafe mechanic of bungeeauth, you actually have limited time to execute a command on a specific server other than the authentication server, but even after the failsafe mechanism is activated and you go back to the auth server, you are still logged in and can still execute commands inside the server and in bungeecord

My recommendation to fix that bug is to block the "force" argument when user is not logged in, so the solution would be something like

// Just an example code to explain the idea
if (!user.loggedIn()) { 
    if (args[0].equals("force")) {
        // Send a message to him
        return true; // or false, I never looked into bungeeauth's code...
    }
}

And that's it, hope you're able to fix it

Error Installing

I Have this error trying to install the plugin:

Error enabling plugin BungeeAuth java.lang.NoClassDefFoundError: org/bukkit/event/Listener at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.access$100(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at net.md_5.bungee.api.plugin.PluginClassloader.loadClass0(PluginClassloader.java:34) at net.md_5.bungee.api.plugin.PluginClassloader.loadClass(PluginClassloader.java:27) at java.lang.ClassLoader.loadClass(Unknown Source) at net.md_5.bungee.api.plugin.PluginManager.enablePlugin(PluginManager.java:304) at net.md_5.bungee.api.plugin.PluginManager.loadPlugins(PluginManager.java:212) at net.md_5.bungee.BungeeCord.start(BungeeCord.java:257) at net.md_5.bungee.BungeeCordLauncher.main(BungeeCordLauncher.java:56) at net.md_5.bungee.Bootstrap.main(Bootstrap.java:15) Caused by: java.lang.ClassNotFoundException: org.bukkit.event.Listener at net.md_5.bungee.api.plugin.PluginClassloader.loadClass0(PluginClassloader.java:53) at net.md_5.bungee.api.plugin.PluginClassloader.loadClass(PluginClassloader.java:27) at java.lang.ClassLoader.loadClass(Unknown Source) ... 18 more

Cant connect to MySQL

18:32:09 [SEVERE] [BungeeAuth] Could not connect to MySQL database! Because: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
18:32:09 [WARNING] Exception encountered when loading plugin: BungeeAuth
java.lang.NullPointerException
at me.vik1395.BungeeAuth.Tables.Create(Tables.java:53)
at me.vik1395.BungeeAuth.Main.onEnable(Main.java:59)
at net.md_5.bungee.api.plugin.PluginManager.enablePlugins(PluginManager.java:227)
at net.md_5.bungee.BungeeCord.start(BungeeCord.java:273)
at net.md_5.bungee.BungeeCordLauncher.main(BungeeCordLauncher.java:55)
at net.md_5.bungee.Bootstrap.main(Bootstrap.java:15)

Fallbacks servers are broken

Fallback Lobby and Fallback AuthLobby never worked for me and do nothing (if lobby is down it must teleport the user at fallback lobby right?)

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.