mirror of
https://github.com/proxiodev/RedisBungee.git
synced 2026-05-03 11:40:29 +00:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5c4de82714 | |||
| 9e48e472a6 | |||
| b04e13136b | |||
| 8821d3995c | |||
| 9218e6ad42 | |||
| fa6bcf7cb8 | |||
| 830b930394 | |||
| 450b0ee396 | |||
| dd4cc2a5bb | |||
| fd3aa51288 | |||
|
|
99941c733f |
52
.github/ISSUE_TEMPLATE/bug.yml
vendored
Normal file
52
.github/ISSUE_TEMPLATE/bug.yml
vendored
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
# used https://github.com/PaperMC/Paper/blob/master/.github/ISSUE_TEMPLATE/behavior-bug-or-plugin-incompatibility.yml as template
|
||||||
|
name: Bug or incompatibility
|
||||||
|
description: report issues within RedisBungee
|
||||||
|
labels: [ "waiting" ]
|
||||||
|
body:
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: intended behavior
|
||||||
|
description: what you expected to happen.
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: what the behavior you actually saw
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Steps to reproduce
|
||||||
|
description: either a video, or way you want to present it.
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Velocity or Bungeecord Versions
|
||||||
|
description: |
|
||||||
|
Please provide Proxy version for either Bungeecord or Velocity
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: RedisBungee Version & Redis Version
|
||||||
|
description: |
|
||||||
|
RedisBungee version is Different from Redis Version!
|
||||||
|
good example:
|
||||||
|
|
||||||
|
Redis Version: 7.2
|
||||||
|
RedisBungee Version: 0.12.0
|
||||||
|
|
||||||
|
in-case you used development branch you can use git commit hash Instead of the version
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Other
|
||||||
|
description: |
|
||||||
|
extra information that we might need to know?
|
||||||
|
validations:
|
||||||
|
required: false
|
||||||
32
.github/ISSUE_TEMPLATE/bug_report.md
vendored
32
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -1,32 +0,0 @@
|
|||||||
---
|
|
||||||
name: Bug report
|
|
||||||
about: if you find a bug please report it here...
|
|
||||||
title: ''
|
|
||||||
labels: waiting
|
|
||||||
assignees: ham1255
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
**Describe the bug**
|
|
||||||
|
|
||||||
|
|
||||||
**To Reproduce**
|
|
||||||
Steps to reproduce the behavior:
|
|
||||||
1. Go to '...'
|
|
||||||
2. Click on '....'
|
|
||||||
3. Scroll down to '....'
|
|
||||||
4. See error
|
|
||||||
|
|
||||||
**Expected behavior**
|
|
||||||
A clear and concise description of what you expected to happen.
|
|
||||||
|
|
||||||
**Screenshots**
|
|
||||||
If applicable, add screenshots to help explain your problem.
|
|
||||||
|
|
||||||
**Redis version? it should be at least 6 and above.**
|
|
||||||
|
|
||||||
**Bungeecord version or (the bungee fork name eg: waterfall) and your plugins**
|
|
||||||
|
|
||||||
|
|
||||||
**console logs?**
|
|
||||||
please provide any errors if there any.
|
|
||||||
10
.github/ISSUE_TEMPLATE/question.md
vendored
10
.github/ISSUE_TEMPLATE/question.md
vendored
@@ -1,10 +0,0 @@
|
|||||||
---
|
|
||||||
name: Question
|
|
||||||
about: ask your questions here
|
|
||||||
title: ''
|
|
||||||
labels: question
|
|
||||||
assignees: GovindasOM, ham1255
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## What is your question?
|
|
||||||
10
.github/ISSUE_TEMPLATE/question.yml
vendored
Normal file
10
.github/ISSUE_TEMPLATE/question.yml
vendored
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# used https://github.com/PaperMC/Paper/blob/master/.github/ISSUE_TEMPLATE/behavior-bug-or-plugin-incompatibility.yml as template
|
||||||
|
name: Ask Question
|
||||||
|
description: Ask any questions to the developers
|
||||||
|
labels: [ "question"]
|
||||||
|
body:
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Your question?
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
@@ -16,10 +16,10 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Set up JDK 11
|
- name: Set up JDK 17
|
||||||
uses: actions/setup-java@v2
|
uses: actions/setup-java@v2
|
||||||
with:
|
with:
|
||||||
java-version: '11'
|
java-version: '17'
|
||||||
distribution: 'adopt'
|
distribution: 'adopt'
|
||||||
- name: Build with gradle
|
- name: Build with gradle
|
||||||
run: ./gradlew shadowJar
|
run: ./gradlew shadowJar
|
||||||
@@ -176,9 +176,7 @@ If you are using static legacy method `RedisBungee#getPool()` it might fail in:
|
|||||||
|
|
||||||
## Support
|
## Support
|
||||||
|
|
||||||
You can join our matrix room [here](https://matrix.to/#/!zhedzmRNSZXfuOPZUB:govindas.net?via=govindas.net&via=matrix.org)
|
open an issue with question button
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ repositories {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
val jedisVersion = "4.3.2"
|
val jedisVersion = "5.1.2"
|
||||||
val configurateVersion = "3.7.3"
|
val configurateVersion = "3.7.3"
|
||||||
val guavaVersion = "31.1-jre"
|
val guavaVersion = "31.1-jre"
|
||||||
|
|
||||||
|
|||||||
@@ -11,50 +11,49 @@
|
|||||||
package com.imaginarycode.minecraft.redisbungee.api.util.uuid;
|
package com.imaginarycode.minecraft.redisbungee.api.util.uuid;
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.gson.JsonObject;
|
||||||
import com.squareup.okhttp.OkHttpClient;
|
import com.squareup.okhttp.OkHttpClient;
|
||||||
import com.squareup.okhttp.Request;
|
import com.squareup.okhttp.Request;
|
||||||
import com.squareup.okhttp.ResponseBody;
|
import com.squareup.okhttp.ResponseBody;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.lang.reflect.Type;
|
import java.util.Collections;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public class NameFetcher {
|
public class NameFetcher {
|
||||||
private static OkHttpClient httpClient;
|
private static OkHttpClient httpClient;
|
||||||
private static final Gson gson = new Gson();
|
private static final Gson gson = new Gson();
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public static void setHttpClient(OkHttpClient httpClient) {
|
public static void setHttpClient(OkHttpClient httpClient) {
|
||||||
throw new UnsupportedOperationException("Due mojang disabled the Names API NameFetcher no longer functions and has been disabled");
|
NameFetcher.httpClient = httpClient;
|
||||||
// NameFetcher.httpClient = httpClient;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public static List<String> nameHistoryFromUuid(UUID uuid) throws IOException {
|
public static List<String> nameHistoryFromUuid(UUID uuid) throws IOException {
|
||||||
throw new UnsupportedOperationException("Due mojang disabled the Names API NameFetcher no longer functions and has been disabled");
|
String name = getName(uuid);
|
||||||
// String url = "https://api.mojang.com/user/profiles/" + uuid.toString().replace("-", "") + "/names";
|
if (name == null) return Collections.emptyList();
|
||||||
// Request request = new Request.Builder().url(url).get().build();
|
return Collections.singletonList(name);
|
||||||
// ResponseBody body = httpClient.newCall(request).execute().body();
|
|
||||||
// String response = body.string();
|
|
||||||
// body.close();
|
|
||||||
//
|
|
||||||
// Type listType = new TypeToken<List<Name>>() {
|
|
||||||
// }.getType();
|
|
||||||
// List<Name> names = gson.fromJson(response, listType);
|
|
||||||
//
|
|
||||||
// List<String> humanNames = new ArrayList<>();
|
|
||||||
// for (Name name : names) {
|
|
||||||
// humanNames.add(name.name);
|
|
||||||
// }
|
|
||||||
// return humanNames;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated
|
public static String getName(UUID uuid) throws IOException {
|
||||||
public static class Name {
|
String url = "https://playerdb.co/api/player/minecraft/" + uuid.toString();
|
||||||
private String name;
|
Request request = new Request.Builder()
|
||||||
private long changedToAt;
|
.addHeader("User-Agent", "RedisBungee-ProxioDev")
|
||||||
|
.url(url)
|
||||||
|
.get()
|
||||||
|
.build();
|
||||||
|
ResponseBody body = httpClient.newCall(request).execute().body();
|
||||||
|
String response = body.string();
|
||||||
|
body.close();
|
||||||
|
|
||||||
|
JsonObject json = gson.fromJson(response, JsonObject.class);
|
||||||
|
if (!json.has("success") || !json.get("success").getAsBoolean()) return null;
|
||||||
|
if (!json.has("data")) return null;
|
||||||
|
JsonObject data = json.getAsJsonObject("data");
|
||||||
|
if (!data.has("player")) return null;
|
||||||
|
JsonObject player = data.getAsJsonObject("player");
|
||||||
|
if (!player.has("username")) return null;
|
||||||
|
|
||||||
|
return player.get("username").getAsString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -12,7 +12,6 @@ package com.imaginarycode.minecraft.redisbungee.api.util.uuid;
|
|||||||
|
|
||||||
import com.google.common.base.Charsets;
|
import com.google.common.base.Charsets;
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
import com.google.common.collect.Iterables;
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.imaginarycode.minecraft.redisbungee.api.RedisBungeePlugin;
|
import com.imaginarycode.minecraft.redisbungee.api.RedisBungeePlugin;
|
||||||
|
|
||||||
@@ -169,17 +168,12 @@ public final class UUIDTranslator {
|
|||||||
if (!expensiveLookups || !plugin.isOnlineMode())
|
if (!expensiveLookups || !plugin.isOnlineMode())
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
// That didn't work. Let's ask Mojang. This call may fail, because Mojang is insane.
|
// That didn't work. Let's ask PlayerDB.
|
||||||
//
|
|
||||||
// UPDATE: Mojang has removed the API somewhere in september/2022 due privacy issues
|
|
||||||
// this is expected to fail now, so we will keep logging it until we figure out something or remove name fetching completely
|
|
||||||
// Name fetching class was deprecated as result
|
|
||||||
String name;
|
String name;
|
||||||
try {
|
try {
|
||||||
plugin.logFatal("Due Mojang removing the naming API, we were unable to fetch player names.");
|
name = NameFetcher.getName(player);
|
||||||
name = Iterables.getLast(NameFetcher.nameHistoryFromUuid(player));
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
plugin.logFatal("Unable to fetch name from Mojang for " + player);
|
plugin.logFatal("Unable to fetch name from PlayerDB for " + player);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -223,7 +223,7 @@ public class RedisBungee extends Plugin implements RedisBungeePlugin<ProxiedPlay
|
|||||||
httpClient = new OkHttpClient();
|
httpClient = new OkHttpClient();
|
||||||
Dispatcher dispatcher = new Dispatcher(getExecutorService());
|
Dispatcher dispatcher = new Dispatcher(getExecutorService());
|
||||||
httpClient.setDispatcher(dispatcher);
|
httpClient.setDispatcher(dispatcher);
|
||||||
//NameFetcher.setHttpClient(httpClient);
|
NameFetcher.setHttpClient(httpClient);
|
||||||
UUIDFetcher.setHttpClient(httpClient);
|
UUIDFetcher.setHttpClient(httpClient);
|
||||||
InitialUtils.checkRedisVersion(this);
|
InitialUtils.checkRedisVersion(this);
|
||||||
// check if this proxy is recovering from a crash and start heart the beat.
|
// check if this proxy is recovering from a crash and start heart the beat.
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ dependencies {
|
|||||||
exclude("com.google.code.gson", "gson")
|
exclude("com.google.code.gson", "gson")
|
||||||
exclude("org.spongepowered", "configurate-yaml")
|
exclude("org.spongepowered", "configurate-yaml")
|
||||||
}
|
}
|
||||||
compileOnly("com.velocitypowered:velocity-api:3.2.0-SNAPSHOT")
|
compileOnly("com.velocitypowered:velocity-api:3.3.0-SNAPSHOT")
|
||||||
annotationProcessor("com.velocitypowered:velocity-api:3.2.0-SNAPSHOT")
|
annotationProcessor("com.velocitypowered:velocity-api:3.3.0-SNAPSHOT")
|
||||||
}
|
}
|
||||||
|
|
||||||
description = "RedisBungee Velocity implementation"
|
description = "RedisBungee Velocity implementation"
|
||||||
@@ -42,11 +42,11 @@ tasks {
|
|||||||
options.linksOffline("https://ci.limework.net/RedisBungee/RedisBungee-API/build/docs/javadoc", apiDocs.path)
|
options.linksOffline("https://ci.limework.net/RedisBungee/RedisBungee-API/build/docs/javadoc", apiDocs.path)
|
||||||
}
|
}
|
||||||
runVelocity {
|
runVelocity {
|
||||||
velocityVersion("3.2.0-SNAPSHOT")
|
velocityVersion("3.3.0-SNAPSHOT")
|
||||||
}
|
}
|
||||||
compileJava {
|
compileJava {
|
||||||
options.encoding = Charsets.UTF_8.name()
|
options.encoding = Charsets.UTF_8.name()
|
||||||
options.release.set(11)
|
options.release.set(17)
|
||||||
}
|
}
|
||||||
javadoc {
|
javadoc {
|
||||||
options.encoding = Charsets.UTF_8.name()
|
options.encoding = Charsets.UTF_8.name()
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ public class RedisBungeeVelocityPlugin implements RedisBungeePlugin<Player>, Con
|
|||||||
this.httpClient = new OkHttpClient();
|
this.httpClient = new OkHttpClient();
|
||||||
Dispatcher dispatcher = new Dispatcher(Executors.newFixedThreadPool(6));
|
Dispatcher dispatcher = new Dispatcher(Executors.newFixedThreadPool(6));
|
||||||
this.httpClient.setDispatcher(dispatcher);
|
this.httpClient.setDispatcher(dispatcher);
|
||||||
//NameFetcher.setHttpClient(httpClient);
|
NameFetcher.setHttpClient(httpClient);
|
||||||
UUIDFetcher.setHttpClient(httpClient);
|
UUIDFetcher.setHttpClient(httpClient);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
group = com.imaginarycode.minecraft
|
group = com.imaginarycode.minecraft
|
||||||
version = 0.11.2-SNAPSHOT
|
version = 0.11.4-SNAPSHOT
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
jdk:
|
jdk:
|
||||||
- openjdk11
|
- openjdk17
|
||||||
|
|||||||
Reference in New Issue
Block a user