mirror of
https://github.com/tiennm99/caro.git
synced 2026-08-07 08:23:52 +00:00
Merge branch 'dev-1.1.0' of https://github.com/ainilili/ratel into dev-1.1.0
# Conflicts: # landlords-common/src/main/java/org/nico/ratel/landlords/helper/PokerHelper.java
This commit is contained in:
@@ -50,9 +50,11 @@ public class SimpleClient {
|
||||
for(int i = 0; i < serverAddressList.size(); i++) {
|
||||
SimplePrinter.printNotice((i+1) + ". " + serverAddressList.get(i));
|
||||
}
|
||||
int serverPick = Integer.parseInt(SimpleWriter.write("option"));
|
||||
int serverPick = 0;
|
||||
while(serverPick<1 || serverPick>serverAddressList.size()){
|
||||
SimplePrinter.printNotice("Invalid Option");
|
||||
try {
|
||||
serverPick = Integer.parseInt(SimpleWriter.write("option"));
|
||||
}catch(NumberFormatException e){}
|
||||
}
|
||||
serverAddress = serverAddressList.get(serverPick-1);
|
||||
String[] elements = serverAddress.split(":");
|
||||
|
||||
-1
@@ -5,7 +5,6 @@ import java.util.Map;
|
||||
|
||||
import org.nico.noson.Noson;
|
||||
import org.nico.noson.entity.NoType;
|
||||
import org.nico.ratel.landlords.client.SimpleClient;
|
||||
import org.nico.ratel.landlords.entity.Poker;
|
||||
import org.nico.ratel.landlords.enums.ServerEventCode;
|
||||
import org.nico.ratel.landlords.helper.MapHelper;
|
||||
|
||||
+2
-11
@@ -13,20 +13,11 @@ public class ClientEventListener_CODE_SHOW_OPTIONS_SETTING extends ClientEventLi
|
||||
@Override
|
||||
public void call(Channel channel, String data) {
|
||||
SimplePrinter.printNotice("Setting: ");
|
||||
/*
|
||||
case 0:
|
||||
return buildHandStringSharp(pokers);
|
||||
case 1:
|
||||
return buildHandStringRounded(pokers);
|
||||
case 2:
|
||||
return textOnly(pokers);
|
||||
case 3:
|
||||
return textOnlyNoType(pokers);
|
||||
*/
|
||||
SimplePrinter.printNotice("1. Card with shape edges (Default)");
|
||||
SimplePrinter.printNotice("2. Card with rounded edges");
|
||||
SimplePrinter.printNotice("3. Text Only with types");
|
||||
SimplePrinter.printNotice("4. Text Only without types");
|
||||
SimplePrinter.printNotice("5. Unicode Cards");
|
||||
|
||||
SimplePrinter.printNotice("Please enter the number of setting (enter [BACK] return options list)");
|
||||
String line = SimpleWriter.write("setting");
|
||||
@@ -40,7 +31,7 @@ public class ClientEventListener_CODE_SHOW_OPTIONS_SETTING extends ClientEventLi
|
||||
}
|
||||
|
||||
int choose = Integer.valueOf(line);
|
||||
if(choose > 0 && choose <= 4){
|
||||
if(choose >=1 && choose <= PokerHelper.totalPrinters){
|
||||
PokerHelper.pokerPrinterType = choose - 1;
|
||||
get(ClientEventCode.CODE_SHOW_OPTIONS).call(channel, data);
|
||||
} else {
|
||||
|
||||
-3
@@ -2,12 +2,9 @@ package org.nico.ratel.landlords.client.event;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.concurrent.ConcurrentSkipListMap;
|
||||
|
||||
import org.nico.noson.Noson;
|
||||
import org.nico.noson.entity.NoType;
|
||||
import org.nico.ratel.landlords.entity.Room;
|
||||
import org.nico.ratel.landlords.enums.ClientEventCode;
|
||||
import org.nico.ratel.landlords.print.SimplePrinter;
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package org.nico.ratel.landlords.enums;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public enum SellType {
|
||||
|
||||
ILLEGAL("非合法"),
|
||||
|
||||
+6
-1
@@ -1,5 +1,6 @@
|
||||
package org.nico.ratel.landlords.server.event;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -22,7 +23,11 @@ public interface ServerEventListener {
|
||||
}else{
|
||||
String eventListener = LISTENER_PREFIX + code.name();
|
||||
Class<ServerEventListener> listenerClass = (Class<ServerEventListener>) Class.forName(eventListener);
|
||||
listener = listenerClass.newInstance();
|
||||
try {
|
||||
listener = listenerClass.getDeclaredConstructor().newInstance();
|
||||
} catch (InvocationTargetException | NoSuchMethodException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
ServerEventListener.LISTENER_MAP.put(code, listener);
|
||||
}
|
||||
return listener;
|
||||
|
||||
-4
@@ -1,8 +1,5 @@
|
||||
package org.nico.ratel.landlords.server.event;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.nico.ratel.landlords.channel.ChannelUtils;
|
||||
import org.nico.ratel.landlords.entity.ClientSide;
|
||||
@@ -10,7 +7,6 @@ import org.nico.ratel.landlords.entity.Room;
|
||||
import org.nico.ratel.landlords.enums.ClientEventCode;
|
||||
import org.nico.ratel.landlords.enums.ClientRole;
|
||||
import org.nico.ratel.landlords.enums.ClientType;
|
||||
import org.nico.ratel.landlords.enums.RoomType;
|
||||
import org.nico.ratel.landlords.enums.ServerEventCode;
|
||||
import org.nico.ratel.landlords.helper.MapHelper;
|
||||
import org.nico.ratel.landlords.helper.PokerHelper;
|
||||
|
||||
-1
@@ -9,7 +9,6 @@ import org.nico.ratel.landlords.entity.ClientSide;
|
||||
import org.nico.ratel.landlords.entity.Room;
|
||||
import org.nico.ratel.landlords.enums.ClientEventCode;
|
||||
import org.nico.ratel.landlords.helper.MapHelper;
|
||||
import org.nico.ratel.landlords.helper.PokerHelper;
|
||||
import org.nico.ratel.landlords.server.ServerContains;
|
||||
|
||||
public class ServerEventListener_CODE_GAME_POKER_PLAY_REDIRECT implements ServerEventListener{
|
||||
|
||||
-1
@@ -11,7 +11,6 @@ import org.nico.ratel.landlords.enums.ClientEventCode;
|
||||
import org.nico.ratel.landlords.enums.ClientRole;
|
||||
import org.nico.ratel.landlords.enums.ClientType;
|
||||
import org.nico.ratel.landlords.enums.RoomStatus;
|
||||
import org.nico.ratel.landlords.enums.RoomType;
|
||||
import org.nico.ratel.landlords.helper.MapHelper;
|
||||
import org.nico.ratel.landlords.helper.PokerHelper;
|
||||
import org.nico.ratel.landlords.server.ServerContains;
|
||||
|
||||
-1
@@ -3,7 +3,6 @@ package org.nico.ratel.landlords.server.event;
|
||||
import java.util.LinkedList;
|
||||
import java.util.concurrent.ConcurrentSkipListMap;
|
||||
|
||||
import org.nico.noson.Noson;
|
||||
import org.nico.ratel.landlords.channel.ChannelUtils;
|
||||
import org.nico.ratel.landlords.entity.ClientSide;
|
||||
import org.nico.ratel.landlords.entity.Room;
|
||||
|
||||
+7
-2
@@ -1,5 +1,6 @@
|
||||
package org.nico.ratel.landlords.server.robot;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -13,7 +14,7 @@ public interface RobotEventListener {
|
||||
public final static Map<ClientEventCode, RobotEventListener> LISTENER_MAP = new HashMap<>();
|
||||
|
||||
public void call(ClientSide robot, String data);
|
||||
|
||||
|
||||
public static RobotEventListener get(ClientEventCode code) {
|
||||
RobotEventListener listener = null;
|
||||
try {
|
||||
@@ -22,7 +23,11 @@ public interface RobotEventListener {
|
||||
}else{
|
||||
String eventListener = LISTENER_PREFIX + code.name();
|
||||
Class<RobotEventListener> listenerClass = (Class<RobotEventListener>) Class.forName(eventListener);
|
||||
listener = listenerClass.newInstance();
|
||||
try {
|
||||
listener = listenerClass.getDeclaredConstructor().newInstance();
|
||||
} catch (NoSuchMethodException | InvocationTargetException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
RobotEventListener.LISTENER_MAP.put(code, listener);
|
||||
}
|
||||
return listener;
|
||||
|
||||
Reference in New Issue
Block a user