|
@@ -1,6 +1,7 @@
|
|
package ludo
|
|
package ludo
|
|
|
|
|
|
import (
|
|
import (
|
|
|
|
+ "fmt"
|
|
"server/msg"
|
|
"server/msg"
|
|
|
|
|
|
"github.com/name5566/leaf/gate"
|
|
"github.com/name5566/leaf/gate"
|
|
@@ -20,7 +21,7 @@ func RecvMatchLudo(args []interface{}) {
|
|
//根据玩家要匹配的对局,给玩家寻找和的房间
|
|
//根据玩家要匹配的对局,给玩家寻找和的房间
|
|
|
|
|
|
func matchRoom(matchInfo *msg.MatchLudo, userId string, user_agent gate.Agent) {
|
|
func matchRoom(matchInfo *msg.MatchLudo, userId string, user_agent gate.Agent) {
|
|
- print("matchRoom")
|
|
|
|
|
|
+ fmt.Printf("matchRoom")
|
|
roomList := GetRoomsByLevel(matchInfo, msg.RoomStatus_AWAIT)
|
|
roomList := GetRoomsByLevel(matchInfo, msg.RoomStatus_AWAIT)
|
|
|
|
|
|
if len(roomList) == 0 {
|
|
if len(roomList) == 0 {
|
|
@@ -31,7 +32,7 @@ func matchRoom(matchInfo *msg.MatchLudo, userId string, user_agent gate.Agent) {
|
|
sendMatchErrorMsg(user_agent, 101, "not find player")
|
|
sendMatchErrorMsg(user_agent, 101, "not find player")
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- print(roomList)
|
|
|
|
|
|
+ fmt.Printf("roomList: %+v\n", roomList)
|
|
log.Error("匹配到%d个房间", len(roomList))
|
|
log.Error("匹配到%d个房间", len(roomList))
|
|
// 如果房间具备开始的条件
|
|
// 如果房间具备开始的条件
|
|
isFullPlayer, err_info := JoinRoom(roomList[0], matchInfo, userId)
|
|
isFullPlayer, err_info := JoinRoom(roomList[0], matchInfo, userId)
|