-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More flexible checking #8
Open
DerFlash
wants to merge
5
commits into
MCBans:master
Choose a base branch
from
Cube-Nation:Update
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
50fd20d
provide pom.xml for maven project import
DerFlash 5c39bf5
more flexible checking:
DerFlash a2f6a0e
make login/ban checks async, so the whole server won't get stalled wh…
DerFlash e71b887
add a snapshot build for the latest BungeeCord changes (needed recomp…
DerFlash 82371b7
Finally switch dependencies to the BungeeCord API
DerFlash File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>com.mcbans.syamn.bungee</groupId> | ||
<artifactId>MCBansProxy</artifactId> | ||
<version>1.3-SNAPSHOT</version> | ||
<name>MCBansProxy</name> | ||
<build> | ||
<sourceDirectory>src</sourceDirectory> | ||
<resources> | ||
<resource> | ||
<directory>src</directory> | ||
<excludes> | ||
<exclude>**/*.java</exclude> | ||
</excludes> | ||
</resource> | ||
</resources> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>3.0</version> | ||
<configuration> | ||
<source>1.7</source> | ||
<target>1.7</target> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
<repositories> | ||
<repository> | ||
<id>sonatype-oss-public</id> | ||
<url>https://oss.sonatype.org/content/groups/public/</url> | ||
<releases> | ||
<enabled>true</enabled> | ||
</releases> | ||
<snapshots> | ||
<enabled>true</enabled> | ||
</snapshots> | ||
</repository> | ||
</repositories> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>net.md-5</groupId> | ||
<artifactId>bungeecord-proxy</artifactId> | ||
<version>1.5-SNAPSHOT</version> | ||
</dependency> | ||
</dependencies> | ||
</project> |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.mcbans.syamn.bungee; | ||
|
||
import net.md_5.bungee.api.ProxyServer; | ||
import net.md_5.bungee.api.connection.ProxiedPlayer; | ||
|
||
public class MCBansChecker extends Thread { | ||
|
||
private String checkPlayerName; | ||
private String checkHostName; | ||
|
||
MCBansChecker(String checkPlayerName, String checkHostName) { | ||
this.checkPlayerName = checkPlayerName; | ||
this.checkHostName = checkHostName; | ||
} | ||
|
||
@Override | ||
public void run() { | ||
if (checkPlayerName == null || checkHostName == null) { | ||
System.out.println("MCBansChecker needs to be innitialized with a playername and hostname"); | ||
return; | ||
} | ||
|
||
String cancelReason = MCBansProxy.checkMCBansForPlayer(checkPlayerName, checkPlayerName); | ||
System.out.println("ServerConnectEvent - cancelreason: " + cancelReason); | ||
if (cancelReason != null) { | ||
ProxiedPlayer player = ProxyServer.getInstance().getPlayer(checkPlayerName); | ||
if (player != null) { | ||
player.disconnect(cancelReason); | ||
} | ||
|
||
} | ||
|
||
} | ||
|
||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it correct version?
https://oss.sonatype.org/content/groups/public/net/md-5/bungeecord-proxy/
I couldn't find this in their repository :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, right. Seems like I've mixed this with my local repo. Furthermore they've did some more changes lately so you only need the API dependency. I'll check if we can now use that one finally at version 1.5-SNAPSHOT