|
@@ -128,24 +128,15 @@ func JoinRoom(room *msg.RoomInfo, matchInfo *msg.MatchLudo, userId string) (bool
|
|
if err_info != nil {
|
|
if err_info != nil {
|
|
return false, errors.New("not find user at JoinRoom time ")
|
|
return false, errors.New("not find user at JoinRoom time ")
|
|
}
|
|
}
|
|
- user_agent := getAgentByUserId(userId)
|
|
|
|
- if user_agent == nil {
|
|
|
|
- return false, errors.New("not find user ")
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- room.Colors = append(room.Colors, &msg.ColorData{
|
|
|
|
- MId: userId,
|
|
|
|
- MColor: matchInfo.SelectColor, //所属阵营
|
|
|
|
- IsKick: false, //是否被踢
|
|
|
|
- IsFinish: false, //是否完成了比赛
|
|
|
|
- TimeOutNum: 0, //超时次数
|
|
|
|
- MName: userInfo.Name, //玩家名字
|
|
|
|
- MHead: userInfo.MHead, //头像
|
|
|
|
- RankNum: 0, //本局游戏的名次
|
|
|
|
- MCoin: userInfo.MCoin, //玩家拥有的金币
|
|
|
|
- })
|
|
|
|
|
|
|
|
if !isRobot {
|
|
if !isRobot {
|
|
|
|
+
|
|
|
|
+ user_agent := getAgentByUserId(userId)
|
|
|
|
+
|
|
|
|
+ if user_agent == nil {
|
|
|
|
+ return false, errors.New("not find user ")
|
|
|
|
+ }
|
|
|
|
+
|
|
ud := &msg.UserInfo{
|
|
ud := &msg.UserInfo{
|
|
UserId: userInfo.UserId,
|
|
UserId: userInfo.UserId,
|
|
Name: userInfo.Name,
|
|
Name: userInfo.Name,
|
|
@@ -159,6 +150,18 @@ func JoinRoom(room *msg.RoomInfo, matchInfo *msg.MatchLudo, userId string) (bool
|
|
user_agent.SetUserData(ud)
|
|
user_agent.SetUserData(ud)
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ room.Colors = append(room.Colors, &msg.ColorData{
|
|
|
|
+ MId: userId,
|
|
|
|
+ MColor: matchInfo.SelectColor, //所属阵营
|
|
|
|
+ IsKick: false, //是否被踢
|
|
|
|
+ IsFinish: false, //是否完成了比赛
|
|
|
|
+ TimeOutNum: 0, //超时次数
|
|
|
|
+ MName: userInfo.Name, //玩家名字
|
|
|
|
+ MHead: userInfo.MHead, //头像
|
|
|
|
+ RankNum: 0, //本局游戏的名次
|
|
|
|
+ MCoin: userInfo.MCoin, //玩家拥有的金币
|
|
|
|
+ })
|
|
|
|
+
|
|
isFullPlayer := false
|
|
isFullPlayer := false
|
|
|
|
|
|
if room.RoomType == msg.RoomType_SHUANG_REN { //说明是两人的房间
|
|
if room.RoomType == msg.RoomType_SHUANG_REN { //说明是两人的房间
|