|
@@ -21,12 +21,12 @@ 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) {
|
|
- fmt.Printf("matchRoom")
|
|
|
|
|
|
+ fmt.Printf("matchRoom\n")
|
|
roomList := GetRoomsByLevel(matchInfo, msg.RoomStatus_AWAIT)
|
|
roomList := GetRoomsByLevel(matchInfo, msg.RoomStatus_AWAIT)
|
|
|
|
|
|
if len(roomList) == 0 {
|
|
if len(roomList) == 0 {
|
|
// Create new room if none available
|
|
// Create new room if none available
|
|
- log.Error("没找到房间匹配一个!")
|
|
|
|
|
|
+ fmt.Printf("没找到房间匹配一个!\n")
|
|
room_info := CreateRoom(matchInfo, userId)
|
|
room_info := CreateRoom(matchInfo, userId)
|
|
if room_info == nil {
|
|
if room_info == nil {
|
|
sendMatchErrorMsg(user_agent, 101, "not find player")
|
|
sendMatchErrorMsg(user_agent, 101, "not find player")
|
|
@@ -38,7 +38,7 @@ func matchRoom(matchInfo *msg.MatchLudo, userId string, user_agent gate.Agent) {
|
|
isFullPlayer, err_info := JoinRoom(roomList[0], matchInfo, userId)
|
|
isFullPlayer, err_info := JoinRoom(roomList[0], matchInfo, userId)
|
|
if err_info != nil {
|
|
if err_info != nil {
|
|
if isFullPlayer {
|
|
if isFullPlayer {
|
|
- print("匹配成功开始游戏!")
|
|
|
|
|
|
+ fmt.Printf("匹配成功开始游戏!")
|
|
startGame(roomList[0])
|
|
startGame(roomList[0])
|
|
NotifyRoomPlayerMatch(roomList[0])
|
|
NotifyRoomPlayerMatch(roomList[0])
|
|
}
|
|
}
|