-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
95 changed files
with
388 additions
and
70 deletions.
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 |
---|---|---|
|
@@ -29,14 +29,14 @@ jobs: | |
# Artifact name | ||
name: RedisBungee-Bungee | ||
# Destination path | ||
path: RedisBungee-Bungee/build/libs/* | ||
path: Bungee/build/libs/* | ||
- name: Upload Velocity | ||
uses: actions/[email protected] | ||
with: | ||
name: RedisBungee-Velocity | ||
path: RedisBungee-Velocity/build/libs/* | ||
path: Velocity/build/libs/* | ||
- name: Upload API | ||
uses: actions/[email protected] | ||
with: | ||
name: RedisBungee-API | ||
path: RedisBungee-API/build/libs/* | ||
path: API/build/libs/* |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,51 @@ | ||
plugins { | ||
`java-library` | ||
`maven-publish` | ||
} | ||
|
||
dependencies { | ||
api(project(":RedisBungee-API")) | ||
compileOnly(libs.platform.bungeecord) { | ||
exclude("com.google.guava", "guava") | ||
exclude("com.google.code.gson", "gson") | ||
exclude("net.kyori","adventure-api") | ||
} | ||
} | ||
|
||
description = "RedisBungee Bungeecord API" | ||
|
||
java { | ||
withJavadocJar() | ||
withSourcesJar() | ||
} | ||
|
||
|
||
tasks { | ||
withType<Javadoc> { | ||
dependsOn(project(":RedisBungee-API").getTasksByName("javadoc", false)) | ||
val path = project(":RedisBungee-API").path | ||
val options = options as StandardJavadocDocletOptions | ||
options.use() | ||
options.isDocFilesSubDirs = true | ||
options.links( | ||
"https://ci.md-5.net/job/BungeeCord/ws/api/target/apidocs/", // bungeecord api | ||
) | ||
val apiDocs = File(rootProject.projectDir, "$path/build/docs/javadoc") | ||
options.linksOffline("https://ci.limework.net/ValioBungee/api/build/docs/javadoc", apiDocs.path) | ||
} | ||
compileJava { | ||
options.encoding = Charsets.UTF_8.name() | ||
options.release.set(17) | ||
} | ||
javadoc { | ||
options.encoding = Charsets.UTF_8.name() | ||
} | ||
} | ||
|
||
publishing { | ||
publications { | ||
create<MavenPublication>("maven") { | ||
from(components["java"]) | ||
} | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
63 changes: 63 additions & 0 deletions
63
proxies/bungeecord/src/main/java/com/imaginarycode/minecraft/redisbungee/RedisBungeeAPI.java
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,63 @@ | ||
/* | ||
* Copyright (c) 2013-present RedisBungee contributors | ||
* | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
*/ | ||
|
||
package com.imaginarycode.minecraft.redisbungee; | ||
|
||
import com.imaginarycode.minecraft.redisbungee.api.RedisBungeePlugin; | ||
import net.md_5.bungee.api.config.ServerInfo; | ||
import net.md_5.bungee.api.plugin.Plugin; | ||
import org.checkerframework.checker.nullness.qual.NonNull; | ||
import org.checkerframework.checker.nullness.qual.Nullable; | ||
|
||
import java.util.UUID; | ||
|
||
/** | ||
* This platform class exposes some internal RedisBungee functions. You obtain an instance of this object by invoking {@link RedisBungeeAPI#getRedisBungeeApi()} | ||
* or somehow you got the Plugin instance by you can call the api using {@link RedisBungeePlugin#getAbstractRedisBungeeApi()}. | ||
* | ||
* @author tuxed | ||
* @since 0.2.3 | updated 0.8.0 | ||
*/ | ||
public class RedisBungeeAPI extends AbstractRedisBungeeAPI { | ||
|
||
private static RedisBungeeAPI redisBungeeApi; | ||
|
||
public RedisBungeeAPI(RedisBungeePlugin<?> plugin) { | ||
super(plugin); | ||
if (redisBungeeApi == null) { | ||
redisBungeeApi = this; | ||
} | ||
} | ||
|
||
/** | ||
* Get the server where the specified player is playing. This function also deals with the case of local players | ||
* as well, and will return local information on them. | ||
* | ||
* @param player a player uuid | ||
* @return {@link ServerInfo} Can be null if proxy can't find it. | ||
* @see #getServerNameFor(UUID) | ||
*/ | ||
@Nullable | ||
public final ServerInfo getServerFor(@NonNull UUID player) { | ||
String serverName = this.getServerNameFor(player); | ||
if (serverName == null) return null; | ||
return ((Plugin) this.plugin).getProxy().getServerInfo(serverName); | ||
} | ||
|
||
/** | ||
* Api instance | ||
* | ||
* @return the API instance. | ||
* @since 0.6.5 | ||
*/ | ||
public static RedisBungeeAPI getRedisBungeeApi() { | ||
return redisBungeeApi; | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
52 changes: 52 additions & 0 deletions
52
.../java/com/imaginarycode/minecraft/redisbungee/events/PlayerChangedServerNetworkEvent.java
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,52 @@ | ||
/* | ||
* Copyright (c) 2013-present RedisBungee contributors | ||
* | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
*/ | ||
|
||
package com.imaginarycode.minecraft.redisbungee.events; | ||
|
||
import com.imaginarycode.minecraft.redisbungee.api.events.IPlayerChangedServerNetworkEvent; | ||
import net.md_5.bungee.api.plugin.Event; | ||
|
||
import java.util.UUID; | ||
|
||
/** | ||
* This event is sent when a player connects to a new server. RedisBungee sends the event only when | ||
* the proxy the player has been connected to is different than the local proxy. | ||
* <p> | ||
* This event corresponds to {@link net.md_5.bungee.api.event.ServerConnectedEvent}, and is fired | ||
* asynchronously. | ||
* | ||
* @since 0.3.4 | ||
*/ | ||
public class PlayerChangedServerNetworkEvent extends Event implements IPlayerChangedServerNetworkEvent { | ||
private final UUID uuid; | ||
private final String previousServer; | ||
private final String server; | ||
|
||
public PlayerChangedServerNetworkEvent(UUID uuid, String previousServer, String server) { | ||
this.uuid = uuid; | ||
this.previousServer = previousServer; | ||
this.server = server; | ||
} | ||
|
||
@Override | ||
public UUID getUuid() { | ||
return uuid; | ||
} | ||
|
||
@Override | ||
public String getServer() { | ||
return server; | ||
} | ||
|
||
@Override | ||
public String getPreviousServer() { | ||
return previousServer; | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
...rc/main/java/com/imaginarycode/minecraft/redisbungee/events/PlayerJoinedNetworkEvent.java
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,38 @@ | ||
/* | ||
* Copyright (c) 2013-present RedisBungee contributors | ||
* | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
*/ | ||
|
||
package com.imaginarycode.minecraft.redisbungee.events; | ||
|
||
import com.imaginarycode.minecraft.redisbungee.api.events.IPlayerJoinedNetworkEvent; | ||
import net.md_5.bungee.api.plugin.Event; | ||
|
||
import java.util.UUID; | ||
|
||
/** | ||
* This event is sent when a player joins the network. RedisBungee sends the event only when | ||
* the proxy the player has been connected to is different than the local proxy. | ||
* <p> | ||
* This event corresponds to {@link net.md_5.bungee.api.event.PostLoginEvent}, and is fired | ||
* asynchronously. | ||
* | ||
* @since 0.3.4 | ||
*/ | ||
public class PlayerJoinedNetworkEvent extends Event implements IPlayerJoinedNetworkEvent { | ||
private final UUID uuid; | ||
|
||
public PlayerJoinedNetworkEvent(UUID uuid) { | ||
this.uuid = uuid; | ||
} | ||
|
||
@Override | ||
public UUID getUuid() { | ||
return uuid; | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
.../src/main/java/com/imaginarycode/minecraft/redisbungee/events/PlayerLeftNetworkEvent.java
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,38 @@ | ||
/* | ||
* Copyright (c) 2013-present RedisBungee contributors | ||
* | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
*/ | ||
|
||
package com.imaginarycode.minecraft.redisbungee.events; | ||
|
||
import com.imaginarycode.minecraft.redisbungee.api.events.IPlayerLeftNetworkEvent; | ||
import net.md_5.bungee.api.plugin.Event; | ||
|
||
import java.util.UUID; | ||
|
||
/** | ||
* This event is sent when a player disconnects. RedisBungee sends the event only when | ||
* the proxy the player has been connected to is different than the local proxy. | ||
* <p> | ||
* This event corresponds to {@link net.md_5.bungee.api.event.PlayerDisconnectEvent}, and is fired | ||
* asynchronously. | ||
* | ||
* @since 0.3.4 | ||
*/ | ||
public class PlayerLeftNetworkEvent extends Event implements IPlayerLeftNetworkEvent { | ||
private final UUID uuid; | ||
|
||
public PlayerLeftNetworkEvent(UUID uuid) { | ||
this.uuid = uuid; | ||
} | ||
|
||
@Override | ||
public UUID getUuid() { | ||
return uuid; | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
...cord/src/main/java/com/imaginarycode/minecraft/redisbungee/events/PubSubMessageEvent.java
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,42 @@ | ||
/* | ||
* Copyright (c) 2013-present RedisBungee contributors | ||
* | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
*/ | ||
|
||
package com.imaginarycode.minecraft.redisbungee.events; | ||
|
||
import com.imaginarycode.minecraft.redisbungee.api.events.IPubSubMessageEvent; | ||
import net.md_5.bungee.api.plugin.Event; | ||
|
||
/** | ||
* This event is posted when a PubSub message is received. | ||
* <p> | ||
* <strong>Warning</strong>: This event is fired in a separate thread! | ||
* | ||
* @since 0.2.6 | ||
*/ | ||
|
||
public class PubSubMessageEvent extends Event implements IPubSubMessageEvent { | ||
private final String channel; | ||
private final String message; | ||
|
||
public PubSubMessageEvent(String channel, String message) { | ||
this.channel = channel; | ||
this.message = message; | ||
} | ||
|
||
@Override | ||
public String getChannel() { | ||
return channel; | ||
} | ||
|
||
@Override | ||
public String getMessage() { | ||
return message; | ||
} | ||
} |
File renamed without changes.
Oops, something went wrong.