Browse Source

优化AI获取初始牌型接口V1.ll0接口定义

johnclot69 3 tháng trước cách đây
mục cha
commit
d9d97fe4a4

+ 4 - 9
incubator-common/src/main/java/com/incubator/common/util/PropertiesUtil.java

@@ -3,7 +3,6 @@ package com.incubator.common.util;
 import com.incubator.common.log4j.Log;
 
 import java.io.File;
-import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.Reader;
@@ -34,13 +33,11 @@ public final class PropertiesUtil extends Properties {
 	}
 
 	public PropertiesUtil(String name) throws IOException {
-		load(new FileInputStream(Paths.get(name).toFile()));
-//		load(Files.newInputStream(Paths.get(name)));
+		load(Files.newInputStream(Paths.get(name).toFile().toPath()));
 	}
 
 	public PropertiesUtil(File file) throws IOException {
-		load(new FileInputStream(file.toPath().toFile()));
-//		load(Files.newInputStream(file.toPath()));
+		load(Files.newInputStream(file.toPath().toFile().toPath()));
 	}
 
 	public PropertiesUtil(InputStream inStream) throws IOException {
@@ -52,13 +49,11 @@ public final class PropertiesUtil extends Properties {
 	}
 
 	public void load(String name) throws IOException {
-		load(new FileInputStream(Paths.get(name).toFile()));
-//		load(Files.newInputStream(Paths.get(name)));
+		load(Files.newInputStream(Paths.get(name).toFile().toPath()));
 	}
 
 	public void load(File file) throws IOException {
-		load(new FileInputStream(file.toPath().toFile()));
-//		load(Files.newInputStream(file.toPath()));
+		load(Files.newInputStream(file.toPath().toFile().toPath()));
 	}
 
 	@Override

+ 18 - 1
incubator-game/src/main/java/com/incubator/game/handler/http/GetCardInfoHandler.java

@@ -1,5 +1,6 @@
 package com.incubator.game.handler.http;
 
+import com.alibaba.fastjson2.JSONObject;
 import com.incubator.common.MessageHandler;
 import com.incubator.common.log4j.Log;
 import com.incubator.core.net.http.HttpRequest;
@@ -10,7 +11,7 @@ import com.incubator.message.proto.CommonProto;
 import java.util.Map;
 
 /**
- * 获取房间玩家手牌信息
+ * AI获取初始牌型接口V1.ll0接口定义
  *
  * @author johnc
  */
@@ -29,6 +30,22 @@ public class GetCardInfoHandler extends HttpHandler {
 			response.setMessage("参数错误");
 		}
 
+		// 房间是否存在
+
+
+		JSONObject data = new JSONObject();
+		data.put("roomId", roomId);
+		data.put("player1", new int[]{0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e,
+				0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x22});
+		data.put("player2", new int[]{0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e,
+				0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x22});
+		data.put("player3", new int[]{0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e,
+				0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x22});
+		data.put("player4", new int[]{0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e,
+				0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x22});
+		response.setCode(CommonProto.Code.OK_VALUE);
+		response.setData(data.toJSONString());
+
 		return response;
 	}
 }