2
0
mirror of https://github.com/proxiodev/RedisBungee.git synced 2026-05-03 03:30:26 +00:00

25 Commits

Author SHA1 Message Date
mohammed jasem alaajel
8df8d96ced add random ids! 2021-05-17 22:42:57 +04:00
mohammed jasem alaajel
4c1ffa2b01 changed this to warn instead of severe 2021-05-17 04:11:09 +04:00
mohammed jasem alaajel
02caf2da5e Removed Limework maven server 2021-05-17 00:53:42 +04:00
mohammed jasem alaajel
a005b46467 Update README.md 2021-05-16 21:59:04 +04:00
mohammed jasem alaajel
65abb29558 Update README.md 2021-05-16 21:56:55 +04:00
mohammed jasem alaajel
5169d873a8 Update maven.yml 2021-05-16 21:54:14 +04:00
mohammed jasem alaajel
f0fbaab0b1 Changed default config redirection 2021-05-14 15:55:33 +04:00
mohammed jasem alaajel
4091da2ed8 Update README.md 2021-05-14 15:15:45 +04:00
mohammed jasem alaajel
86bef752de Update README.md 2021-05-14 15:12:07 +04:00
Govindas
17e203d7be small mistake 2021-05-14 10:53:00 +00:00
Govindas
ab8db5570c Update README.md 2021-05-14 10:52:12 +00:00
Govindas
571a318969 Update README.md 2021-05-14 10:51:41 +00:00
mohammed jasem alaajel
f07eed220d Update README.md 2021-05-13 23:12:40 +04:00
mohammed jasem alaajel
76721cd5fd fix to spamming seconds behind (#2)
* fix to spamming seconds behind

* changes the message

* bumped version
2021-05-13 22:41:53 +04:00
mohammed jasem alaajel
f8ed847857 Last commit on the action workflow sorry :/ 2021-05-13 22:16:38 +04:00
mohammed jasem alaajel
bfdbe69b97 Update maven.yml 2021-05-13 22:14:20 +04:00
mohammed jasem alaajel
536686e92f Update maven.yml 2021-05-13 22:10:29 +04:00
mohammed jasem alaajel
78ee62a98a Create maven.yml 2021-04-27 19:52:17 +04:00
Govindas
01f63f0f58 Update bungeecord api to working one 2021-03-28 17:53:23 +03:00
mohammed jasem alaajel
28640ab859 changed version to without snapshot due bug in nexus i think 2021-02-06 16:50:02 +04:00
mohammed jasem alaajel
e72126a15b Update README.md 2021-01-10 23:38:14 +04:00
mohammed jasem alaajel
386b02ed30 Update example_config.yml 2021-01-10 23:23:30 +04:00
mohammed jasem alaajel
40e8831ab8 Update README.md 2021-01-10 22:22:57 +04:00
mohammed jasem alaajel
aca5203962 Update README.md 2021-01-08 00:20:37 +04:00
mohammed jasem alaajel
3512895ad8 fixed some typos in readme! and java docs added 2021-01-08 00:09:43 +04:00
6 changed files with 80 additions and 23 deletions

32
.github/workflows/maven.yml vendored Normal file
View File

@@ -0,0 +1,32 @@
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: RedisBungee Build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Download a Build Artifact
uses: actions/upload-artifact@v2.2.3
with:
# Artifact name
name: Redis_JAR
# Destination path
path: target/RedisBungee*

View File

@@ -1,38 +1,40 @@
# Limework fork of RedisBungee # Limework fork of RedisBungee
this fork was made due maintainer of redisBungee became unactive so we took the place to develop it! [![RedisBungee Build](https://github.com/Limework/RedisBungee/actions/workflows/maven.yml/badge.svg)](https://github.com/Limework/RedisBungee/actions/workflows/maven.yml)
RedisBungee bridges [Redis](http://redis.io) and BungeeCord together. Spigot link: [click](https://www.spigotmc.org/resources/redisbungee.87700/)
RedisBungee was used on thechunk server which we think was shutdown due website not loading... The maintainer of RedisBungee has became inactive, so we have taken the development of the plugin.
this will be deployed soon on [Govindas limework!](https://Limework.net) RedisBungee bridges [Redis](https://redis.io) and [BungeeCord](https://github.com/SpigotMC/BungeeCord) together.
~~This is the solution deployed on [The Chunk](http://thechunk.net) to make sure our multi-Bungee setup flows smoothly together.~~
This is currently deployed on [Govindas Limework!](https://Limework.net)
## Compiling ## Compiling
Now you can use maven without installing it using Maven wrapper https://github.com/takari/maven-wrapper :) Now you can use maven without installing it using Maven wrapper [github?](https://github.com/takari/maven-wrapper) :)
RedisBungee is distributed as a [maven](http://maven.apache.org) project. To compile it and install it in your local Maven repository: RedisBungee is distributed as a [maven](https://maven.apache.org) project. To compile it and install it in your local Maven repository:
git clone https://github.com/Limework/RedisBungee.git git clone https://github.com/Limework/RedisBungee.git
cd RedisBungee cd RedisBungee
mvnw clean install mvnw clean install
## Javadocs ## Javadocs
Hosted on limework website. Version 0.6.0 (note: any version 0.6.* will not have API changes.)
will be availale soon! https://limework.net/JavaDocs/RedisBungee/
## Configuration ## Configuration
**REDISBUNGEE REQUIRES A REDIS SERVER**, preferably with reasonably low latency. The default [config](https://github.com/minecrafter/RedisBungee/blob/master/src/main/resources/example_config.yml) is saved when the plugin first starts. **REDISBUNGEE REQUIRES A REDIS SERVER**, preferably with reasonably low latency. The default [config](https://github.com/limework/RedisBungee/blob/master/src/main/resources/example_config.yml) is saved when the plugin first starts.
## License! ## License!
this project is distruped using Eclipse Public License 1.0 This project is distributed under Eclipse Public License 1.0
which you can find it [here](https://github.com/Limework/RedisBungee/blob/master/LICENSE) You can find it [here](https://github.com/Limework/RedisBungee/blob/master/LICENSE)
you can find the orginal redisBungee by minecrafter [here](https://github.com/minecrafter/RedisBungee) or spigot page [here](https://www.spigotmc.org/resources/redisbungee.13494/) You can find the original RedisBungee by minecrafter [here](https://github.com/minecrafter/RedisBungee) or spigot page [here](https://www.spigotmc.org/resources/redisbungee.13494/)

View File

@@ -6,7 +6,7 @@
<groupId>com.imaginarycode.minecraft</groupId> <groupId>com.imaginarycode.minecraft</groupId>
<artifactId>RedisBungee</artifactId> <artifactId>RedisBungee</artifactId>
<version>0.6-SNAPSHOT</version> <version>0.6.2</version>
<repositories> <repositories>
<repository> <repository>
@@ -80,6 +80,9 @@
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId> <artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version> <version>2.9.1</version>
<configuration>
<source>8</source>
</configuration>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
@@ -100,7 +103,7 @@
<dependency> <dependency>
<groupId>net.md-5</groupId> <groupId>net.md-5</groupId>
<artifactId>bungeecord-api</artifactId> <artifactId>bungeecord-api</artifactId>
<version>1.16-R0.4-SNAPSHOT</version> <version>1.16-R0.5-SNAPSHOT</version>
<type>jar</type> <type>jar</type>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>

View File

@@ -104,7 +104,8 @@ public final class RedisBungee extends Plugin {
if (lagged ? time >= stamp + 30 : time <= stamp + 30) if (lagged ? time >= stamp + 30 : time <= stamp + 30)
servers.add(entry.getKey()); servers.add(entry.getKey());
else if (nag && nagTime <= 0) { else if (nag && nagTime <= 0) {
getLogger().severe(entry.getKey() + " is " + (time - stamp) + " seconds behind! (Time not synchronized or server down?)"); getLogger().warning(entry.getKey() + " is " + (time - stamp) + " seconds behind! (Time not synchronized or server down?) and was removed from heartbeat.");
jedis.hdel("heartbeats", entry.getKey());
} }
} catch (NumberFormatException ignored) { } catch (NumberFormatException ignored) {
} }
@@ -414,7 +415,13 @@ public final class RedisBungee extends Plugin {
final int redisPort = configuration.getInt("redis-port", 6379); final int redisPort = configuration.getInt("redis-port", 6379);
final boolean useSSL = configuration.getBoolean("useSSL"); final boolean useSSL = configuration.getBoolean("useSSL");
String redisPassword = configuration.getString("redis-password"); String redisPassword = configuration.getString("redis-password");
String serverId = configuration.getString("server-id"); String serverId;
final String randomUUID = UUID.randomUUID().toString();
if (configuration.getBoolean("use-random-id-string", false)) {
serverId = configuration.getString("server-id") + "-" + randomUUID;
} else {
serverId = configuration.getString("server-id");
}
if (redisPassword != null && (redisPassword.isEmpty() || redisPassword.equals("none"))) { if (redisPassword != null && (redisPassword.isEmpty() || redisPassword.equals("none"))) {
redisPassword = null; redisPassword = null;
@@ -474,7 +481,7 @@ public final class RedisBungee extends Plugin {
httpClient.setDispatcher(dispatcher); httpClient.setDispatcher(dispatcher);
NameFetcher.setHttpClient(httpClient); NameFetcher.setHttpClient(httpClient);
UUIDFetcher.setHttpClient(httpClient); UUIDFetcher.setHttpClient(httpClient);
RedisBungee.configuration = new RedisBungeeConfiguration(RedisBungee.this.getPool(), configuration); RedisBungee.configuration = new RedisBungeeConfiguration(RedisBungee.this.getPool(), configuration, randomUUID);
return null; return null;
} }
}); });

View File

@@ -8,6 +8,7 @@ import redis.clients.jedis.JedisPool;
import java.net.InetAddress; import java.net.InetAddress;
import java.util.List; import java.util.List;
import java.util.UUID;
public class RedisBungeeConfiguration { public class RedisBungeeConfiguration {
@Getter @Getter
@@ -19,9 +20,15 @@ public class RedisBungeeConfiguration {
@Getter @Getter
private final List<InetAddress> exemptAddresses; private final List<InetAddress> exemptAddresses;
public RedisBungeeConfiguration(JedisPool pool, Configuration configuration) {
public RedisBungeeConfiguration(JedisPool pool, Configuration configuration, String randomUUID) {
this.pool = pool; this.pool = pool;
this.serverId = configuration.getString("server-id"); if (configuration.getBoolean("use-random-id-string", false)) {
this.serverId = configuration.getString("server-id") + "-" + randomUUID;
} else {
this.serverId = configuration.getString("server-id");
}
this.registerBungeeCommands = configuration.getBoolean("register-bungee-commands", true); this.registerBungeeCommands = configuration.getBoolean("register-bungee-commands", true);
List<String> stringified = configuration.getStringList("exempt-ip-addresses"); List<String> stringified = configuration.getStringList("exempt-ip-addresses");
@@ -33,4 +40,5 @@ public class RedisBungeeConfiguration {
this.exemptAddresses = addressBuilder.build(); this.exemptAddresses = addressBuilder.build();
} }
} }

View File

@@ -1,5 +1,5 @@
# RedisBungee configuration file. # RedisBungee configuration file.
# PLEASE READ THE WIKI: https://github.com/minecrafter/RedisBungee/wiki # PLEASE READ THE WIKI: https://github.com/Limework/RedisBungee/wiki
# The Redis server you use. # The Redis server you use.
# Get Redis from http://redis.io/ # Get Redis from http://redis.io/
@@ -12,11 +12,16 @@ redis-password: ""
# inefficient plugins or a lot of players. # inefficient plugins or a lot of players.
max-redis-connections: 8 max-redis-connections: 8
# since redis can support ssl by version 6 you can use ssl in redis bungee too! ( # since redis can support ssl by version 6 you can use ssl in redis bungee too!
# you must disable this if redis version is under 6 you must disable this or connection wont work!!!
useSSL: false useSSL: false
# An identifier for this BungeeCord instance. # An identifier for this BungeeCord instance.
server-id: test1 server-id: test1
# Should use random string? if enabled proxy id will be like this "test1-66cd2aeb-91f3-43a7-a106-e0307b098652"
# this great for servers who run replicas in Kubernetes or any auto deploying replica service
use-random-id-string: false
# Whether or not RedisBungee should install its version of regular BungeeCord commands. # Whether or not RedisBungee should install its version of regular BungeeCord commands.
# Often, the RedisBungee commands are desired, but in some cases someone may wish to # Often, the RedisBungee commands are desired, but in some cases someone may wish to