Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into fix/protocol
Browse files Browse the repository at this point in the history
Signed-off-by: Joshua Castle <[email protected]>
  • Loading branch information
Kas-tle committed Apr 17, 2024
2 parents f200df3 + 5151c25 commit 9fe3207
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ dependencies {
}

repositories {
// mavenLocal()
maven("https://repo.opencollab.dev/maven-releases/")
maven("https://repo.opencollab.dev/maven-snapshots/")
maven("https://jitpack.io")
Expand Down
4 changes: 4 additions & 0 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ plugins {
}

dependencies {
constraints {
implementation(libs.raknet) // Ensure protocol does not override the RakNet version
}

api(projects.common)
api(projects.api)

Expand Down
3 changes: 3 additions & 0 deletions core/src/main/java/org/geysermc/geyser/dump/DumpInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public class DumpInfo {
private final GeyserConfiguration config;
private final Floodgate floodgate;
private final Object2IntMap<DeviceOs> userPlatforms;
private final int connectionAttempts;
private final HashInfo hashInfo;
private final RamInfo ramInfo;
private LogsInfo logsInfo;
Expand Down Expand Up @@ -129,6 +130,8 @@ public DumpInfo(boolean addLog) {
userPlatforms.put(device, userPlatforms.getOrDefault(device, 0) + 1);
}

this.connectionAttempts = GeyserImpl.getInstance().getGeyserServer().getConnectionAttempts();

this.bootstrapInfo = GeyserImpl.getInstance().getBootstrap().getDumpInfo();

this.flagsInfo = new FlagsInfo();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ public final class GeyserServer {

private ChannelFuture[] bootstrapFutures;

// Keep track of connection attempts for dump info
@Getter
private int connectionAttempts = 0;

/**
* The port to broadcast in the pong. This can be different from the port the server is bound to, e.g. due to port forwarding.
*/
Expand Down Expand Up @@ -226,6 +230,7 @@ private ServerBootstrap createBootstrap() {
.option(RakChannelOption.RAK_MAX_MTU, this.geyser.getConfig().getMtu())
.option(RakChannelOption.RAK_PACKET_LIMIT, rakPacketLimit)
.option(RakChannelOption.RAK_GLOBAL_PACKET_LIMIT, rakGlobalPacketLimit)
.option(RakChannelOption.RAK_SEND_COOKIE, true)
.childHandler(serverInitializer);
}

Expand All @@ -241,6 +246,7 @@ public boolean onConnectionRequest(InetSocketAddress inetSocketAddress) {
}

if (!isWhitelistedIP) {
connectionAttempts++;
return false;
}
}
Expand All @@ -263,10 +269,12 @@ public boolean onConnectionRequest(InetSocketAddress inetSocketAddress) {
geyser.eventBus().fire(requestEvent);
if (requestEvent.isCancelled()) {
geyser.getLogger().debug("Connection request from " + ip + " was cancelled using the API!");
connectionAttempts++;
return false;
}

geyser.getLogger().info(GeyserLocale.getLocaleStringLog("geyser.network.attempt_connect", ip));
geyser.getLogger().debug(GeyserLocale.getLocaleStringLog("geyser.network.attempt_connect", ip));
connectionAttempts++;
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ gson = "2.3.1" # Provided by Spigot 1.8.8
websocket = "1.5.1"
protocol = "3.0.0.Beta1-20240411.165033-129"
protocol-connection = "3.0.0.Beta1-20240411.165033-128"
raknet = "1.0.0.CR1-20240330.103819-16"
raknet = "1.0.0.CR3-20240416.144209-1"
blockstateupdater="1.20.80-20240411.142413-1"
mcauthlib = "d9d773e"
mcprotocollib = "1.20.4-2-20240116.220521-7"
Expand Down
3 changes: 2 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")

dependencyResolutionManagement {
repositories {
// mavenLocal()

// Floodgate, Cumulus etc.
maven("https://repo.opencollab.dev/main")

Expand All @@ -30,7 +32,6 @@ dependencyResolutionManagement {
mavenContent { releasesOnly() }
}

mavenLocal()
mavenCentral()

// ViaVersion
Expand Down

0 comments on commit 9fe3207

Please sign in to comment.