2022-10-29 20:02:09 +00:00
|
|
|
/*
|
|
|
|
* 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
|
|
|
|
*/
|
|
|
|
|
2022-07-16 12:50:09 +00:00
|
|
|
package com.imaginarycode.minecraft.redisbungee.api;
|
2022-04-13 13:14:08 +00:00
|
|
|
|
2022-07-27 13:43:51 +00:00
|
|
|
import com.imaginarycode.minecraft.redisbungee.AbstractRedisBungeeAPI;
|
2023-10-01 10:31:49 +00:00
|
|
|
import com.imaginarycode.minecraft.redisbungee.api.config.LangConfiguration;
|
2022-07-22 08:29:39 +00:00
|
|
|
import com.imaginarycode.minecraft.redisbungee.api.config.RedisBungeeConfiguration;
|
2022-07-30 18:36:29 +00:00
|
|
|
import com.imaginarycode.minecraft.redisbungee.api.events.EventsPlatform;
|
2022-07-16 12:50:09 +00:00
|
|
|
import com.imaginarycode.minecraft.redisbungee.api.summoners.Summoner;
|
|
|
|
import com.imaginarycode.minecraft.redisbungee.api.util.uuid.UUIDTranslator;
|
2023-09-10 14:15:01 +00:00
|
|
|
import net.kyori.adventure.text.Component;
|
2022-04-13 13:14:08 +00:00
|
|
|
|
|
|
|
import java.net.InetAddress;
|
2024-04-12 18:37:02 +00:00
|
|
|
import java.util.UUID;
|
2022-04-13 13:14:08 +00:00
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
2022-04-14 10:12:47 +00:00
|
|
|
|
|
|
|
/**
|
2022-07-30 18:36:29 +00:00
|
|
|
* This Class has all internal methods needed by every redis bungee plugin, and it can be used to implement another platforms than bungeecord or another forks of RedisBungee
|
2023-04-25 07:09:45 +00:00
|
|
|
* <p>
|
|
|
|
* Reason this is interface because some proxies implementations require the user to extend class for plugins for example bungeecord.
|
2022-04-14 10:12:47 +00:00
|
|
|
*
|
|
|
|
* @author Ham1255
|
|
|
|
* @since 0.7.0
|
|
|
|
*/
|
2022-07-30 18:36:29 +00:00
|
|
|
public interface RedisBungeePlugin<P> extends EventsPlatform {
|
2022-04-13 13:14:08 +00:00
|
|
|
|
2022-07-07 23:23:44 +00:00
|
|
|
default void initialize() {
|
2022-04-13 13:14:08 +00:00
|
|
|
|
2022-04-13 18:17:38 +00:00
|
|
|
}
|
|
|
|
|
2022-07-06 19:04:09 +00:00
|
|
|
default void stop() {
|
2022-04-13 18:17:38 +00:00
|
|
|
|
|
|
|
}
|
2022-04-13 13:14:08 +00:00
|
|
|
|
2024-04-12 18:37:02 +00:00
|
|
|
void logInfo(String msg);
|
2022-04-13 13:14:08 +00:00
|
|
|
|
2024-04-12 18:37:02 +00:00
|
|
|
void logInfo(String format, Object... object);
|
2022-04-13 13:14:08 +00:00
|
|
|
|
2024-04-12 18:37:02 +00:00
|
|
|
void logWarn(String msg);
|
2022-04-13 13:14:08 +00:00
|
|
|
|
2024-04-12 18:37:02 +00:00
|
|
|
void logWarn(String format, Object... object);
|
2022-04-13 13:14:08 +00:00
|
|
|
|
2024-04-12 18:37:02 +00:00
|
|
|
void logFatal(String msg);
|
2022-04-13 13:14:08 +00:00
|
|
|
|
2024-04-12 18:37:02 +00:00
|
|
|
void logFatal(String format, Throwable throwable);
|
2022-04-13 18:17:38 +00:00
|
|
|
|
2024-04-12 18:37:02 +00:00
|
|
|
RedisBungeeConfiguration configuration();
|
2022-04-13 13:14:08 +00:00
|
|
|
|
2023-10-01 10:31:49 +00:00
|
|
|
LangConfiguration langConfiguration();
|
|
|
|
|
2024-04-12 18:37:02 +00:00
|
|
|
Summoner<?> getSummoner();
|
2022-04-13 13:14:08 +00:00
|
|
|
|
2024-04-12 18:37:02 +00:00
|
|
|
RedisBungeeMode getRedisBungeeMode();
|
2022-04-13 13:14:08 +00:00
|
|
|
|
2024-04-12 18:37:02 +00:00
|
|
|
AbstractRedisBungeeAPI getAbstractRedisBungeeApi();
|
2022-04-13 13:14:08 +00:00
|
|
|
|
2024-04-12 18:37:02 +00:00
|
|
|
ProxyDataManager proxyDataManager();
|
2022-04-13 13:14:08 +00:00
|
|
|
|
2024-04-12 18:37:02 +00:00
|
|
|
PlayerDataManager<P, ?, ?, ?, ?, ?, ?> playerDataManager();
|
2022-04-13 13:14:08 +00:00
|
|
|
|
2024-04-12 18:37:02 +00:00
|
|
|
UUIDTranslator getUuidTranslator();
|
2022-04-13 13:14:08 +00:00
|
|
|
|
2024-04-12 18:37:02 +00:00
|
|
|
boolean isOnlineMode();
|
2022-04-13 13:14:08 +00:00
|
|
|
|
2023-09-12 12:06:36 +00:00
|
|
|
P getPlayer(UUID uuid);
|
2022-04-13 13:14:08 +00:00
|
|
|
|
2023-09-12 12:06:36 +00:00
|
|
|
P getPlayer(String name);
|
2022-04-13 13:14:08 +00:00
|
|
|
|
2023-09-12 12:06:36 +00:00
|
|
|
UUID getPlayerUUID(String player);
|
2022-04-13 13:14:08 +00:00
|
|
|
|
|
|
|
|
2023-09-12 12:06:36 +00:00
|
|
|
String getPlayerName(UUID player);
|
2022-04-13 13:14:08 +00:00
|
|
|
|
2023-09-10 14:15:01 +00:00
|
|
|
boolean handlePlatformKick(UUID uuid, Component message);
|
2022-04-13 13:14:08 +00:00
|
|
|
|
2023-09-12 12:06:36 +00:00
|
|
|
String getPlayerServerName(P player);
|
2022-04-13 13:14:08 +00:00
|
|
|
|
2023-09-12 12:06:36 +00:00
|
|
|
boolean isPlayerOnAServer(P player);
|
2022-04-13 18:17:38 +00:00
|
|
|
|
2023-09-12 12:06:36 +00:00
|
|
|
InetAddress getPlayerIp(P player);
|
2022-07-19 11:30:45 +00:00
|
|
|
|
2024-04-12 18:37:02 +00:00
|
|
|
void executeAsync(Runnable runnable);
|
2022-07-19 11:30:45 +00:00
|
|
|
|
2024-04-12 18:37:02 +00:00
|
|
|
void executeAsyncAfter(Runnable runnable, TimeUnit timeUnit, int time);
|
2022-07-16 05:18:33 +00:00
|
|
|
|
2022-07-20 09:21:24 +00:00
|
|
|
|
2022-04-13 13:14:08 +00:00
|
|
|
}
|