|
@@ -1,9 +1,12 @@
|
|
|
package com.incubator.game.handler;
|
|
|
|
|
|
+import com.incubator.core.Cmd;
|
|
|
import com.incubator.core.message.MessageHandler;
|
|
|
import com.incubator.core.protocol.Message;
|
|
|
import io.netty.channel.Channel;
|
|
|
|
|
|
+import java.util.*;
|
|
|
+
|
|
|
/**
|
|
|
* 登录请求
|
|
|
*/
|
|
@@ -16,8 +19,48 @@ public class LoginHandler extends MessageHandler {
|
|
|
@Override
|
|
|
public void handle(Channel session, Message message) {
|
|
|
String username = message.getDataValue("username", String.class, "");
|
|
|
- String password = message.getDataValue("password", String.class, "");
|
|
|
|
|
|
- session.writeAndFlush(new Message());
|
|
|
+ Map<String, Object> playerInfo = new HashMap<>();
|
|
|
+ playerInfo.put("id", UUID.randomUUID().toString());
|
|
|
+ playerInfo.put("name", username);
|
|
|
+ playerInfo.put("avatar", "https://img95.699pic.com/element/40112/2503.png_300.png");
|
|
|
+ playerInfo.put("sex", 0);
|
|
|
+ playerInfo.put("exp", 0L);
|
|
|
+ playerInfo.put("maxExp", 0);
|
|
|
+ playerInfo.put("vipLevel", 0);
|
|
|
+ playerInfo.put("masterScore", 0L);
|
|
|
+ playerInfo.put("masterScoreLevel", 0);
|
|
|
+ playerInfo.put("gold", 10000L);
|
|
|
+ playerInfo.put("diamond", 20000L);
|
|
|
+ playerInfo.put("startTimeVip", "");
|
|
|
+ playerInfo.put("endTimeVip", "");
|
|
|
+ playerInfo.put("gps", "");
|
|
|
+ playerInfo.put("gpsAddr", "");
|
|
|
+ playerInfo.put("foca", 0L);
|
|
|
+ playerInfo.put("ranking", 0);
|
|
|
+ playerInfo.put("figureId", 0);
|
|
|
+ playerInfo.put("realName", "李晓强");
|
|
|
+ playerInfo.put("phoneNum", "13800000001");
|
|
|
+ playerInfo.put("idCard", "42100119000101000X");
|
|
|
+ playerInfo.put("friendMasterNum", 0);
|
|
|
+ playerInfo.put("friendMasterRate", 0);
|
|
|
+ playerInfo.put("tradPoints", 0);
|
|
|
+ playerInfo.put("tradPointsRate", 0);
|
|
|
+ playerInfo.put("tradMatchNum", 0);
|
|
|
+ playerInfo.put("tradMatchRate", 0);
|
|
|
+ playerInfo.put("noReshNum", 0);
|
|
|
+ playerInfo.put("noReshRate", 0);
|
|
|
+
|
|
|
+ Map<String, Object> data = new HashMap<>();
|
|
|
+ data.put("playerInfo", playerInfo);
|
|
|
+ // 玩家绑定的房间号
|
|
|
+ data.put("roomId", 0L);
|
|
|
+ // 玩家绑定的官方比赛id
|
|
|
+ data.put("contestId", 0L);
|
|
|
+ // 官方比赛信息列表
|
|
|
+ data.put("contestInfo", new ArrayList<>());
|
|
|
+ data.put("eventList", "");
|
|
|
+
|
|
|
+ session.writeAndFlush(new Message(Cmd.LoginRes, data));
|
|
|
}
|
|
|
}
|