xy 1 week ago
parent
commit
9cd3228ebb
2 changed files with 3 additions and 4 deletions
  1. 3 2
      src/server/game/ludo/match.go
  2. 0 2
      src/server/game/ludo/room.go

+ 3 - 2
src/server/game/ludo/match.go

@@ -38,8 +38,9 @@ func matchRoom(matchInfo *msg.MatchLudo, userId string, user_agent gate.Agent) {
 		isFullPlayer, err_info := JoinRoom(roomList[0], matchInfo, userId)
 		if err_info == nil {
 			if isFullPlayer {
-				fmt.Printf("匹配成功开始游戏!")
-				NotifyRoomPlayerMatch(startGame(roomList[0]))
+				start_room := startGame(roomList[0])
+				fmt.Printf("%v:匹配成功开始游戏!", start_room)
+				NotifyRoomPlayerMatch(start_room)
 			}
 		} else {
 			sendMatchErrorMsg(user_agent, 101, "not find player")

+ 0 - 2
src/server/game/ludo/room.go

@@ -103,8 +103,6 @@ func CreateRoom(matchInfo *msg.MatchLudo, userId string) *msg.RoomInfo {
 }
 
 func JoinRoom(room *msg.RoomInfo, matchInfo *msg.MatchLudo, userId string) (bool, error) {
-	gameConfig.mu.Lock()
-	defer gameConfig.mu.Unlock()
 	userInfo, err_info := redismgr.GetUserInfoFromRedis(userId)
 	if err_info != nil {
 		return false, errors.New("not find user at JoinRoom time ")