jefe0226
parent
c20bb4ec0c
commit
a3b46394c4
|
|
@ -45,6 +45,6 @@ public class Config {
|
|||
public static final String DEFAULT_PID = "10";
|
||||
|
||||
/** 默认群组ID */
|
||||
public static final String DEFAULT_GROUP_ID = "762479";
|
||||
public static final String DEFAULT_GROUP_ID = "426149";
|
||||
|
||||
}
|
||||
|
|
@ -746,7 +746,7 @@ public class RobotConnectionManager {
|
|||
public void connectGame(RobotUser robotUser){
|
||||
if(robotUser.isLogin){
|
||||
if(robotUser.getClient()==null){
|
||||
TaurusClient client = new TaurusClient(robotUser.getGameHost()+":"+robotUser.getGamePort(), "game", TaurusClient.ConnectionProtocol.Tcp);
|
||||
TaurusClient client = new TaurusClient(robotUser.getGameHost()+":"+robotUser.getGamePort(), "cm"+robotUser.getRobotId(), TaurusClient.ConnectionProtocol.Tcp);
|
||||
client.setSession(robotUser.getLoginsession());
|
||||
client.connect();
|
||||
setupEventListeners(client, robotUser.getCurrentRoomId()+"_"+robotUser.getRobotId());
|
||||
|
|
@ -765,7 +765,7 @@ public class RobotConnectionManager {
|
|||
robotUser.setIsconnect(true);
|
||||
}else{
|
||||
System.out.println("reconnect"+robotUser.getClient().getGameID());
|
||||
TaurusClient client = new TaurusClient(robotUser.getGameHost()+":"+robotUser.getGamePort(), "game", TaurusClient.ConnectionProtocol.Tcp);
|
||||
TaurusClient client = new TaurusClient(robotUser.getGameHost()+":"+robotUser.getGamePort(), "cm"+robotUser.getRobotId(), TaurusClient.ConnectionProtocol.Tcp);
|
||||
client.setSession(robotUser.getLoginsession());
|
||||
client.connect();
|
||||
robotUser.setIsconnect(client.isConnected());
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import taurus.client.TaurusClient;
|
|||
import taurus.util.*;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
|
@ -872,11 +873,20 @@ public class HuNanChangSha {
|
|||
System.out.println("打过后的手牌 +++ " + changShaCardInhand);
|
||||
params.putString("session", session + "," + token);
|
||||
|
||||
int ot = new Random().nextInt(5);
|
||||
Thread.sleep(ot*1000);
|
||||
client.send("611", params, response -> {
|
||||
CompletableFuture.runAsync(() -> {
|
||||
try {
|
||||
int ot = new Random().nextInt(4);
|
||||
Thread.sleep(ot*1000);
|
||||
client.send("611", params, response -> {
|
||||
|
||||
});
|
||||
} catch (Exception e) {
|
||||
System.out.println("Thread error");
|
||||
//Thread.currentThread().interrupt();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}catch (Exception e){
|
||||
|
||||
}
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -1,10 +1,8 @@
|
|||
taurus\util\TinHuChi.class
|
||||
taurus\util\TinHuGang.class
|
||||
robot\mj\Config.class
|
||||
taurus\util\PlayerState.class
|
||||
robot\mj\handler\HuNanChangSha$7.class
|
||||
robot\mj\RobotConnectionManager$3.class
|
||||
taurus\util\TinHuPeng.class
|
||||
robot\mj\business\AccountBusiness.class
|
||||
robot\mj\RobotConnectionManager.class
|
||||
robot\mj\RoomCreator$RoomInfo.class
|
||||
|
|
@ -15,8 +13,6 @@ robot\mj\EXPlayer.class
|
|||
robot\mj\handler\HuNanChangSha$3.class
|
||||
robot\mj\EXGameController.class
|
||||
robot\mj\handler\HuNanChangSha.class
|
||||
taurus\util\TinHuChi$TingResult.class
|
||||
taurus\util\TinHuPeng$HandAnalysis.class
|
||||
taurus\util\ROBOTEventType.class
|
||||
robot\mj\EXRoom.class
|
||||
taurus\util\Paixing.class
|
||||
|
|
@ -30,8 +26,6 @@ robot\mj\RoomCreator.class
|
|||
taurus\util\ai$DiscardResult.class
|
||||
robot\mj\info\RobotUser.class
|
||||
robot\mj\RobotConnectionManager$2.class
|
||||
taurus\util\TinHuChi$TingChiOption.class
|
||||
robot\mj\network\TaurusTcpListener.class
|
||||
taurus\util\WinCardType.class
|
||||
robot\mj\handler\HuNanChangSha$5.class
|
||||
robot\mj\RobotConnectionManager$1.class
|
||||
|
|
@ -40,4 +34,3 @@ taurus\util\HandAnalysis.class
|
|||
taurus\util\ChangShaSuanFaTest.class
|
||||
robot\mj\handler\HuNanChangSha$2.class
|
||||
taurus\util\TingPaiChecker$TingCardInfo.class
|
||||
robot\mj\EXActionEvent.class
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -316,7 +316,7 @@ public class EXGameController extends GameController {
|
|||
System.err.println("重启后已进入房间准备成功: " + "room:" + robotUser.getCurrentRoomId() + "robot:" + robotUser.getRobotId());
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
// throw new RuntimeException(e);
|
||||
} finally {
|
||||
jedis0.close();
|
||||
jedis2.close();
|
||||
|
|
@ -394,7 +394,7 @@ public class EXGameController extends GameController {
|
|||
robotUser.setIntoRoomTime(robotConnectionManager.getTime());
|
||||
System.err.println("已进入房间准备成功: " + robotUser.getConnecId());
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
// throw new RuntimeException(e);
|
||||
} finally {
|
||||
jedis0.close();
|
||||
jedis2.close();
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import taurus.util.HongZhongSuanFaTest;
|
|||
import taurus.util.Util;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
public class HuNanHongZhong {
|
||||
|
||||
|
|
@ -404,13 +405,22 @@ public class HuNanHongZhong {
|
|||
System.out.println("目前机器人剩余手牌:" + hongZhongCardInhand.toString());
|
||||
params.putString("session", session + "," + token);
|
||||
|
||||
//缩短出牌延时
|
||||
int ot = new Random().nextInt(3);
|
||||
Thread.sleep(ot * 1000);
|
||||
CompletableFuture.runAsync(() -> {
|
||||
try {
|
||||
//缩短出牌延时
|
||||
int ot = new Random().nextInt(2);
|
||||
Thread.sleep(ot * 1000+1000);
|
||||
|
||||
client.send("611", params, response -> {
|
||||
System.out.println("出牌成功: " + response.returnCode);
|
||||
client.send("611", params, response -> {
|
||||
System.out.println("出牌成功: " + response.returnCode);
|
||||
});
|
||||
} catch (Exception e) {
|
||||
System.out.println("Thread error");
|
||||
//Thread.currentThread().interrupt();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
}
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -20,7 +20,6 @@ robot\mj\RoomCreator.class
|
|||
robot\mj\handler\HuNanHongZhong$2.class
|
||||
taurus\util\HongZhongSuanFaTest$SpecialPattern.class
|
||||
robot\mj\info\RobotUser.class
|
||||
taurus\util\HongZhongSuanFaTest$WinResult.class
|
||||
robot\mj\RobotConnectionManager$2.class
|
||||
robot\mj\RobotConnectionManager$1.class
|
||||
robot\mj\handler\HuNanHongZhong.class
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Reference in New Issue