|
@@ -39,8 +39,7 @@ func matchRoom(matchInfo *msg.MatchLudo, userId string, user_agent gate.Agent) {
|
|
if err_info == nil {
|
|
if err_info == nil {
|
|
if isFullPlayer {
|
|
if isFullPlayer {
|
|
fmt.Printf("匹配成功开始游戏!")
|
|
fmt.Printf("匹配成功开始游戏!")
|
|
- startGame(roomList[0])
|
|
|
|
- NotifyRoomPlayerMatch(roomList[0])
|
|
|
|
|
|
+ NotifyRoomPlayerMatch(startGame(roomList[0]))
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
sendMatchErrorMsg(user_agent, 101, "not find player")
|
|
sendMatchErrorMsg(user_agent, 101, "not find player")
|
|
@@ -49,13 +48,13 @@ func matchRoom(matchInfo *msg.MatchLudo, userId string, user_agent gate.Agent) {
|
|
}
|
|
}
|
|
|
|
|
|
// 通知房间玩家匹配成功
|
|
// 通知房间玩家匹配成功
|
|
-func NotifyRoomPlayerMatch(room_info *msg.RoomInfo) {
|
|
|
|
|
|
+func NotifyRoomPlayerMatch(room_info *RoomInfoWrapper) {
|
|
for i := range room_info.Colors {
|
|
for i := range room_info.Colors {
|
|
user_id := room_info.Colors[i].MId
|
|
user_id := room_info.Colors[i].MId
|
|
user_agent := getAgentByUserId(user_id)
|
|
user_agent := getAgentByUserId(user_id)
|
|
if user_agent != nil {
|
|
if user_agent != nil {
|
|
user_agent.WriteMsg(&msg.ResMatchLudo{
|
|
user_agent.WriteMsg(&msg.ResMatchLudo{
|
|
- Room: room_info,
|
|
|
|
|
|
+ Room: room_info.RoomInfo,
|
|
Success: true,
|
|
Success: true,
|
|
ErrMsg: nil,
|
|
ErrMsg: nil,
|
|
})
|
|
})
|