1
0
mirror of https://e.coding.net/circlecloud/CTZLoginServer.git synced 2024-12-12 05:28:48 +00:00

modify annotation...

Signed-off-by: j502647092 <jtb1@163.com>
This commit is contained in:
j502647092 2015-08-14 16:39:04 +08:00
parent 41998638d7
commit af41dcd7b9
3 changed files with 22 additions and 15 deletions

View File

@ -6,7 +6,9 @@ package cn.citycraft.CTZLoginServer;
import java.util.HashMap; import java.util.HashMap;
/** /**
* @author 蒋天蓓 2015年7月28日下午9:08:23 TODO * 玩家登录队列类
*
* @author 蒋天蓓 2015年7月28日下午9:08:23
*/ */
public class CTZLoginQueue { public class CTZLoginQueue {
protected static boolean checkIP = true;; protected static boolean checkIP = true;;
@ -26,8 +28,7 @@ public class CTZLoginQueue {
} }
public static boolean canLogin(String player, String IP) { public static boolean canLogin(String player, String IP) {
return list.containsKey(player.toLowerCase()) return list.containsKey(player.toLowerCase()) && list.get(player.toLowerCase()).equalsIgnoreCase(IP);
&& list.get(player.toLowerCase()).equalsIgnoreCase(IP);
} }
public static boolean isCheckIP() { public static boolean isCheckIP() {
@ -39,8 +40,7 @@ public class CTZLoginQueue {
} }
public static boolean Login(String player, String IP) { public static boolean Login(String player, String IP) {
if (list.containsKey(player.toLowerCase()) if (list.containsKey(player.toLowerCase()) && list.get(player.toLowerCase()).equalsIgnoreCase(IP)) {
&& list.get(player.toLowerCase()).equalsIgnoreCase(IP)) {
list.remove(player.toLowerCase()); list.remove(player.toLowerCase());
return true; return true;
} }

View File

@ -45,7 +45,9 @@ class CTZServer {
} }
/** /**
* @author 蒋天蓓 2015年8月8日下午2:50:02 TODO * Json服务器信息序列化类
*
* @author 蒋天蓓 2015年8月8日下午2:50:02
*/ */
public class CTZServers { public class CTZServers {
@ -106,18 +108,22 @@ public class CTZServers {
*/ */
public boolean isChinese(char c) { public boolean isChinese(char c) {
Character.UnicodeBlock ub = Character.UnicodeBlock.of(c); Character.UnicodeBlock ub = Character.UnicodeBlock.of(c);
if (ub == Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS if (ub == Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS || ub == Character.UnicodeBlock.CJK_COMPATIBILITY_IDEOGRAPHS
|| ub == Character.UnicodeBlock.CJK_COMPATIBILITY_IDEOGRAPHS || ub == Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A || ub == Character.UnicodeBlock.GENERAL_PUNCTUATION
|| ub == Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A || ub == Character.UnicodeBlock.CJK_SYMBOLS_AND_PUNCTUATION || ub == Character.UnicodeBlock.HALFWIDTH_AND_FULLWIDTH_FORMS)
|| ub == Character.UnicodeBlock.GENERAL_PUNCTUATION
|| ub == Character.UnicodeBlock.CJK_SYMBOLS_AND_PUNCTUATION
|| ub == Character.UnicodeBlock.HALFWIDTH_AND_FULLWIDTH_FORMS)
return true; return true;
return false; return false;
} }
} }
/**
* 服务器数据序列化类
*
* @author 蒋天蓓
* 2015年8月14日下午4:36:12
*
*/
class Server { class Server {
public String name; public String name;

View File

@ -18,7 +18,9 @@ import cn.citycraft.CTZLoginServer.config.Config;
import fr.xephi.authme.api.API; import fr.xephi.authme.api.API;
/** /**
* @author 蒋天蓓 2015年7月28日下午9:05:20 TODO * 玩家登录监听类
*
* @author 蒋天蓓 2015年7月28日下午9:05:20
*/ */
public class PlayerListen implements Listener { public class PlayerListen implements Listener {
protected HashMap<String, Long> lastquittime = new HashMap<String, Long>(); protected HashMap<String, Long> lastquittime = new HashMap<String, Long>();
@ -49,8 +51,7 @@ public class PlayerListen implements Listener {
e.setResult(Result.KICK_WHITELIST); e.setResult(Result.KICK_WHITELIST);
} }
@EventHandler( @EventHandler(priority = EventPriority.LOWEST)
priority = EventPriority.LOWEST)
public void PlayerJoin(PlayerJoinEvent e) { public void PlayerJoin(PlayerJoinEvent e) {
String name = e.getPlayer().getName().toLowerCase(); String name = e.getPlayer().getName().toLowerCase();
if (lastquittime.containsKey(name)) { if (lastquittime.containsKey(name)) {