parent
b534752f29
commit
979ca55dfb
98
pom.xml
98
pom.xml
|
@ -1,73 +1,26 @@
|
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>pw.yumc</groupId>
|
||||
|
||||
<artifactId>MiaoLobby</artifactId>
|
||||
<version>2.0</version>
|
||||
|
||||
<parent>
|
||||
<groupId>pw.yumc</groupId>
|
||||
<artifactId>minecraft-plugin-parent</artifactId>
|
||||
<version>1.0</version>
|
||||
<relativePath/>
|
||||
</parent>
|
||||
|
||||
<build>
|
||||
<finalName>${project.name}</finalName>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<filtering>true</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>2.4.3</version>
|
||||
<configuration>
|
||||
<createDependencyReducedPom>false</createDependencyReducedPom>
|
||||
<minimizeJar>true</minimizeJar>
|
||||
<artifactSet>
|
||||
<includes>
|
||||
<include>pw.yumc:YumCore</include>
|
||||
</includes>
|
||||
</artifactSet>
|
||||
<relocations>
|
||||
<relocation>
|
||||
<pattern>pw.yumc.YumCore</pattern>
|
||||
<shadedPattern>${project.groupId}.${project.artifactId}</shadedPattern>
|
||||
</relocation>
|
||||
</relocations>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>com.github.wvengen</groupId>
|
||||
<artifactId>proguard-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>proguard</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<options>
|
||||
<option>-repackageclasses \ʼ.ʽ.ʾ.${project.artifactId}</option>
|
||||
<option>-keep class ${project.groupId}.${project.artifactId}.${project.artifactId}</option>
|
||||
</options>
|
||||
<libs>
|
||||
<lib>${java.home}/lib/rt.jar</lib>
|
||||
</libs>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<ciManagement>
|
||||
<system>Jenkins</system>
|
||||
<url>http://ci.yumc.pw/job/${project.artifactId}/</url>
|
||||
</ciManagement>
|
||||
|
||||
<properties>
|
||||
<update.description>§a正式版本 §bv${project.version}</update.description>
|
||||
<update.changes>
|
||||
|
@ -78,40 +31,19 @@
|
|||
<update.changelog>
|
||||
</update.changelog>
|
||||
<env.GIT_COMMIT>DEV</env.GIT_COMMIT>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
</properties>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>yumc-repo</id>
|
||||
<url>http://repo.yumc.pw/content/groups/public/</url>
|
||||
<url>https://repo.yumc.pw/repository/maven-public/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>jtb</id>
|
||||
<name>YUMC</name>
|
||||
<url>http://repo.yumc.pw/content/repositories/yumcenter/</url>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>pw.yumc</groupId>
|
||||
<artifactId>YumCore</artifactId>
|
||||
<type>jar</type>
|
||||
<version>[1.7,)</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.citycraft</groupId>
|
||||
<artifactId>AuthMe</artifactId>
|
||||
<type>jar</type>
|
||||
<version>6.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.citycraft</groupId>
|
||||
<artifactId>VBossAuth</artifactId>
|
||||
<version>1.5.2</version>
|
||||
<groupId>fr.xephi</groupId>
|
||||
<artifactId>authme</artifactId>
|
||||
<version>5.6.0-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -8,11 +8,9 @@ import org.bukkit.event.EventHandler;
|
|||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import pw.yumc.MiaoLobby.config.Config;
|
||||
import pw.yumc.MiaoLobby.hook.AuthMeHook;
|
||||
import pw.yumc.MiaoLobby.hook.LoginHook;
|
||||
import pw.yumc.MiaoLobby.hook.VBossAuthHook;
|
||||
import pw.yumc.YumCore.bukkit.Log;
|
||||
import pw.yumc.YumCore.commands.CommandSub;
|
||||
import pw.yumc.YumCore.commands.annotation.Cmd;
|
||||
|
@ -54,10 +52,6 @@ public class MiaoLobby extends JavaPlugin implements Executor, Listener {
|
|||
new AuthMeHook();
|
||||
Log.i("已配置为AuthMe登录传送模式!");
|
||||
}
|
||||
if (Bukkit.getPluginManager().isPluginEnabled("VBossAuth")) {
|
||||
new VBossAuthHook();
|
||||
Log.i("已配置为VBossAuth登录传送模式!");
|
||||
}
|
||||
}
|
||||
new Statistics();
|
||||
new SubscribeTask(true, SubscribeTask.UpdateType.MAVEN);
|
||||
|
|
|
@ -1,24 +1,22 @@
|
|||
package pw.yumc.MiaoLobby;
|
||||
|
||||
import com.google.common.io.ByteArrayDataOutput;
|
||||
import com.google.common.io.ByteStreams;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
import org.bukkit.scheduler.BukkitTask;
|
||||
import pw.yumc.MiaoLobby.config.Config;
|
||||
import pw.yumc.MiaoLobby.event.PreLobbyTpEvent;
|
||||
import pw.yumc.YumCore.bukkit.P;
|
||||
import pw.yumc.YumCore.bukkit.compatible.C;
|
||||
|
||||
import java.security.SecureRandom;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
import org.bukkit.scheduler.BukkitTask;
|
||||
|
||||
import com.google.common.io.ByteArrayDataOutput;
|
||||
import com.google.common.io.ByteStreams;
|
||||
|
||||
import pw.yumc.MiaoLobby.config.Config;
|
||||
import pw.yumc.MiaoLobby.event.PreLobbyTpEvent;
|
||||
import pw.yumc.YumCore.bukkit.P;
|
||||
import pw.yumc.YumCore.bukkit.compatible.C;
|
||||
|
||||
/**
|
||||
* @author 喵♂呜
|
||||
* @since 2016/12/25 0025
|
||||
|
@ -77,7 +75,7 @@ public class Util {
|
|||
|
||||
public static void random(final Player player) {
|
||||
new BukkitRunnable() {
|
||||
List<String> servers = new ArrayList<>(config.Servers);
|
||||
final List<String> servers = new ArrayList<>(config.Servers);
|
||||
int i = 0;
|
||||
|
||||
@Override
|
||||
|
@ -90,9 +88,9 @@ public class Util {
|
|||
C.ActionBar.send(player, config.Unavailable);
|
||||
player.sendMessage(config.Unavailable);
|
||||
} else if (player.isOnline()) {
|
||||
final String sname = servers.remove(random.nextInt(servers.size()));
|
||||
C.ActionBar.send(player, String.format(i > 0 ? config.TimeOut : config.Message, sname));
|
||||
connect(player, sname);
|
||||
final String serverName = servers.remove(random.nextInt(servers.size()));
|
||||
C.ActionBar.send(player, String.format(i > 0 ? config.TimeOut : config.Message, serverName));
|
||||
connect(player, serverName);
|
||||
i++;
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
package pw.yumc.MiaoLobby.hook;
|
||||
|
||||
import org.bukkit.event.EventHandler;
|
||||
|
||||
import cn.citycraft.VBossAuth.event.LoginEvent;
|
||||
import cn.citycraft.VBossAuth.event.RegisterEvent;
|
||||
import pw.yumc.MiaoLobby.Util;
|
||||
|
||||
public class VBossAuthHook extends Hook {
|
||||
@EventHandler
|
||||
public void onLogin(LoginEvent e) {
|
||||
if (e.isLogin()) {
|
||||
Util.delayTpTargetEvent(e.getPlayer());
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onRegister(RegisterEvent e) {
|
||||
Util.delayTpTargetEvent(e.getPlayer());
|
||||
}
|
||||
}
|
|
@ -1,22 +1,22 @@
|
|||
#配置文件版本 请勿修改
|
||||
Version: 1.4
|
||||
|
||||
#服务器列表
|
||||
Servers:
|
||||
- lobby1
|
||||
- lobby2
|
||||
#传送超时时间(单位: Tick)
|
||||
WaitTime: 35
|
||||
#自带传送(如果开启 则Login自动传送失效)
|
||||
AutoTP: false
|
||||
#登录自动传送(暂时支持AuthMe和VBossAuth)
|
||||
LoginAutoTP: true
|
||||
#传送延时(单位: 秒)
|
||||
AutoTPDelay: 10
|
||||
#尝试完毕后是否继续重试
|
||||
ReTry: true
|
||||
#传送提示
|
||||
Message: '&a请稍候 正在传送至服务器 %s ...'
|
||||
TimeOut: '&c传送超时 正在切换到服务器 %s ...'
|
||||
TPDelay: '&a登陆成功 正在为您匹配服务器 剩余 %s 秒...'
|
||||
#配置文件版本 请勿修改
|
||||
Version: 1.5
|
||||
|
||||
#服务器列表
|
||||
Servers:
|
||||
- lobby1
|
||||
- lobby2
|
||||
#传送超时时间(单位: Tick)
|
||||
WaitTime: 35
|
||||
#自带传送(如果开启 则Login自动传送失效)
|
||||
AutoTP: false
|
||||
#登录自动传送(暂时支持AuthMe)
|
||||
LoginAutoTP: true
|
||||
#传送延时(单位: 秒)
|
||||
AutoTPDelay: 10
|
||||
#尝试完毕后是否继续重试
|
||||
ReTry: true
|
||||
#传送提示
|
||||
Message: '&a请稍候 正在传送至服务器 %s ...'
|
||||
TimeOut: '&c传送超时 正在切换到服务器 %s ...'
|
||||
TPDelay: '&a登陆成功 正在为您匹配服务器 剩余 %s 秒...'
|
||||
Unavailable: '&4已尝试所有可用服务器 传送失败!'
|
Loading…
Reference in New Issue