|
@@ -5,6 +5,8 @@ import (
|
|
|
"server/game"
|
|
|
"server/game/room"
|
|
|
"server/msg"
|
|
|
+ "server/user"
|
|
|
+ "strconv"
|
|
|
"time"
|
|
|
|
|
|
"github.com/name5566/leaf/log"
|
|
@@ -28,38 +30,150 @@ func seen(room *room.Room, sitPos int32) {
|
|
|
PlayerOpt: &msg.PlayerOpt{OptType: msg.PlayerOptType_OPT_SEEN, SeenCards: convertToMsgCardList(seenCards)},
|
|
|
UserId: room.GetPlayerBySitPos(sitPos).GetUserId(),
|
|
|
})
|
|
|
+ log.Debug("玩家看破sitPos", sitPos)
|
|
|
+ log.Debug("玩家看破", seenCards)
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
|
func packed(room *room.Room, sitPos int32) {
|
|
|
player := room.GetPlayerBySitPos(sitPos)
|
|
|
player.IsPacked = true
|
|
|
+ SendRoundMsgToAll(room, &msg.ReqRound{
|
|
|
+ Round: int32(room.Round),
|
|
|
+ RoundSitPos: int32(sitPos),
|
|
|
+ PlayerOpt: &msg.PlayerOpt{OptType: msg.PlayerOptType_OPT_PACKED},
|
|
|
+ UserId: room.GetPlayerBySitPos(sitPos).GetUserId(),
|
|
|
+ })
|
|
|
if isOnlyOne, sp := room.IsOnlyOneNotPacked(); isOnlyOne {
|
|
|
+
|
|
|
|
|
|
room.PlayerWin(sp)
|
|
|
+
|
|
|
+ winPlayer := room.GetPlayerBySitPos(sp)
|
|
|
+
|
|
|
+ if winPlayer.IsRobot {
|
|
|
+
|
|
|
+ } else {
|
|
|
+ user.AddUserPoint(room.GameRound.TotalBet, winPlayer.Id)
|
|
|
+ UserInfo := user.GetUserInfoById(winPlayer.Id)
|
|
|
+
|
|
|
+ SendUserInfoMsg(room, &msg.ReqUserInfo{
|
|
|
+ UserId: winPlayer.Id,
|
|
|
+ Points: int32(UserInfo.Points),
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
sendResult(room, sp)
|
|
|
+
|
|
|
+ time.Sleep(5 * time.Second)
|
|
|
+ log.Debug("弃牌的位置startNextRound: %d")
|
|
|
+ startNextRound(room)
|
|
|
+ } else {
|
|
|
+ log.Debug("弃牌的位置: %d", room.RoundSitPos)
|
|
|
+ room.SetNextRound()
|
|
|
+ checkRoomStatus(room)
|
|
|
}
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+func chaal(room *room.Room, sitPos int32, betAmount int32) {
|
|
|
+
|
|
|
+
|
|
|
+ if betAmount > room.GameRound.ResBet.MaxCheelBet || betAmount < room.GameRound.ResBet.MinCheelBet {
|
|
|
+ log.Debug("Bet amount %d is out of valid range. Min: %d, Max: %d", betAmount, room.GameRound.ResBet.MinCheelBet, room.GameRound.ResBet.MaxCheelBet)
|
|
|
+ betAmount = room.GameRound.ResBet.MaxCheelBet
|
|
|
+ }
|
|
|
+ UserId := room.GetPlayerBySitPos(sitPos).GetUserId()
|
|
|
+ if room.GetPlayerBySitPos(sitPos).IsRobot {
|
|
|
+
|
|
|
+ } else {
|
|
|
+
|
|
|
+
|
|
|
+ UserInfo := user.GetUserInfoById(UserId)
|
|
|
+ if UserInfo.Points < betAmount {
|
|
|
+ log.Debug("chaal User %s has insufficient points. Current points: %d", UserId, UserInfo.Points)
|
|
|
+
|
|
|
+ room.GetPlayerBySitPos(sitPos).Agent.WriteMsg(&msg.ReqInsufficientPoints{
|
|
|
+ UserId: UserInfo.Id,
|
|
|
+ RequiredAmount: int32(betAmount),
|
|
|
+ AvailableAmount: UserInfo.Points,
|
|
|
+ GameId: "teen_patti",
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ user.DecreaseUserPoint(betAmount, UserId)
|
|
|
+
|
|
|
+ SendUserInfoMsg(room, &msg.ReqUserInfo{
|
|
|
+ UserId: UserId,
|
|
|
+ Points: int32(UserInfo.Points),
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
room.SetNextRound()
|
|
|
- log.Debug("弃牌的位置: %d", room.RoundSitPos)
|
|
|
+ room.AddBet(betAmount)
|
|
|
+
|
|
|
+
|
|
|
+ room.UpdateResBet(betAmount, getRoomChaalLimmit(room.ConfId))
|
|
|
+
|
|
|
SendRoundMsgToAll(room, &msg.ReqRound{
|
|
|
Round: int32(room.Round),
|
|
|
RoundSitPos: int32(sitPos),
|
|
|
- PlayerOpt: &msg.PlayerOpt{OptType: msg.PlayerOptType_OPT_PACKED},
|
|
|
- UserId: room.GetPlayerBySitPos(sitPos).GetUserId(),
|
|
|
+ PlayerOpt: &msg.PlayerOpt{OptType: msg.PlayerOptType_OPT_CHAAL},
|
|
|
+ UserId: UserId,
|
|
|
})
|
|
|
+
|
|
|
checkRoomStatus(room)
|
|
|
+ game.Module.Skeleton.AfterFunc(time.Microsecond*500, func() {
|
|
|
+ sendRoomBet(room)
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-func chaal(room *room.Room, sitPos int32, betAmount int32) {
|
|
|
+
|
|
|
+func blind(room *room.Room, sitPos int32, betAmount int32) {
|
|
|
+
|
|
|
+ if betAmount > room.GameRound.ResBet.MaxBlindBet || betAmount < room.GameRound.ResBet.MinBlindBet {
|
|
|
+ log.Debug("Bet amount %d is out of valid range. MinBlindBet: %d, MaxBlindBet: %d", betAmount, room.GameRound.ResBet.MinBlindBet, room.GameRound.ResBet.MaxBlindBet)
|
|
|
+
|
|
|
+
|
|
|
+ betAmount = room.GameRound.ResBet.MaxBlindBet
|
|
|
+ }
|
|
|
+ UserId := room.GetPlayerBySitPos(sitPos).GetUserId()
|
|
|
+ UserInfo := user.GetUserInfoById(UserId)
|
|
|
room.SetNextRound()
|
|
|
room.AddBet(betAmount)
|
|
|
+
|
|
|
+
|
|
|
+ room.UpdateResBet(betAmount, getRoomChaalLimmit(room.ConfId))
|
|
|
+
|
|
|
SendRoundMsgToAll(room, &msg.ReqRound{
|
|
|
Round: int32(room.Round),
|
|
|
RoundSitPos: int32(sitPos),
|
|
|
- PlayerOpt: &msg.PlayerOpt{OptType: msg.PlayerOptType_OPT_CHAAL},
|
|
|
- UserId: room.GetPlayerBySitPos(sitPos).GetUserId(),
|
|
|
+ PlayerOpt: &msg.PlayerOpt{OptType: msg.PlayerOptType_OPT_BLIND},
|
|
|
+ UserId: UserId,
|
|
|
})
|
|
|
+ if room.GetPlayerBySitPos(sitPos).IsRobot {
|
|
|
+
|
|
|
+ } else {
|
|
|
+ if UserInfo.Points < betAmount {
|
|
|
+ log.Debug("blind User %s has insufficient points. Current points: %d", UserId, UserInfo.Points)
|
|
|
+
|
|
|
+ room.GetPlayerBySitPos(sitPos).Agent.WriteMsg(&msg.ReqInsufficientPoints{
|
|
|
+ UserId: UserInfo.Id,
|
|
|
+ RequiredAmount: int32(betAmount),
|
|
|
+ AvailableAmount: UserInfo.Points,
|
|
|
+ GameId: "teen_patti",
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ user.DecreaseUserPoint(betAmount, UserId)
|
|
|
+
|
|
|
+ SendUserInfoMsg(room, &msg.ReqUserInfo{
|
|
|
+ UserId: UserId,
|
|
|
+ Points: int32(UserInfo.Points),
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
checkRoomStatus(room)
|
|
|
game.Module.Skeleton.AfterFunc(time.Microsecond*500, func() {
|
|
|
sendRoomBet(room)
|
|
@@ -69,24 +183,296 @@ func chaal(room *room.Room, sitPos int32, betAmount int32) {
|
|
|
|
|
|
func ante(room *room.Room, sitPos int32, betAmount int32) {
|
|
|
room.AddBet(betAmount)
|
|
|
+ UserId := room.GetPlayerBySitPos(sitPos).GetUserId()
|
|
|
SendRoundMsgToAll(room, &msg.ReqRound{
|
|
|
Round: int32(room.Round),
|
|
|
RoundSitPos: int32(sitPos),
|
|
|
PlayerOpt: &msg.PlayerOpt{OptType: msg.PlayerOptType_OPT_ANTE},
|
|
|
- UserId: room.GetPlayerBySitPos(sitPos).GetUserId(),
|
|
|
+ UserId: UserId,
|
|
|
})
|
|
|
+ if room.GetPlayerBySitPos(sitPos).IsRobot {
|
|
|
+
|
|
|
+ } else {
|
|
|
+
|
|
|
+ user.DecreaseUserPoint(betAmount, UserId)
|
|
|
+
|
|
|
+ UserInfo := user.GetUserInfoById(UserId)
|
|
|
+ SendUserInfoMsg(room, &msg.ReqUserInfo{
|
|
|
+ UserId: UserId,
|
|
|
+ Points: int32(UserInfo.Points),
|
|
|
+ })
|
|
|
+ }
|
|
|
game.Module.Skeleton.AfterFunc(time.Microsecond*500, func() {
|
|
|
sendRoomBet(room)
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+func checkSiteShow(r *room.Room, sitPos int32) bool {
|
|
|
+
|
|
|
+ currentPlayer := r.GetPlayerBySitPos(sitPos)
|
|
|
+ log.Debug("现在的座位号1", sitPos)
|
|
|
+ if currentPlayer == nil {
|
|
|
+ log.Debug("currentPlayer Player with SitPos %d not found.", sitPos)
|
|
|
+ return false
|
|
|
+ }
|
|
|
+
|
|
|
+ if currentPlayer.IsPacked {
|
|
|
+ log.Debug("Player %s has packed, cannot show cards.", currentPlayer.Id)
|
|
|
+ return false
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ activePlayers := 0
|
|
|
+ for _, player := range r.Players {
|
|
|
+ if player != nil && !player.IsPacked {
|
|
|
+ activePlayers++
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if activePlayers < 3 {
|
|
|
+ log.Debug("Not enough active players (less than 3). Cannot show cards.")
|
|
|
+ return false
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ previousSitPos := getRoomSitPos(r, sitPos, -1)
|
|
|
+ log.Debug("上一位玩家的座位号checkSiteShow", previousSitPos)
|
|
|
+
|
|
|
+ previousPlayer := r.GetPlayerBySitPos(previousSitPos)
|
|
|
+ if previousPlayer == nil {
|
|
|
+ log.Debug("previousPlayer1 Player with SitPos %d not found.", previousSitPos)
|
|
|
+ return false
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if !previousPlayer.IsSeen || !currentPlayer.IsSeen {
|
|
|
+ log.Debug("Either player %s or previous player %s has not seen their cards.", currentPlayer.Id, previousPlayer.Id)
|
|
|
+ return false
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ log.Debug("Player ture %s can show cards.", currentPlayer.Id)
|
|
|
+ return true
|
|
|
+}
|
|
|
+func site_show(r *room.Room, sitPos int32, betAmount int32) {
|
|
|
+
|
|
|
+ if !checkSiteShow(r, sitPos) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ ante(r, sitPos, betAmount)
|
|
|
+
|
|
|
+ UserId := r.GetPlayerBySitPos(sitPos).GetUserId()
|
|
|
+ if r.GetPlayerBySitPos(sitPos).IsRobot {
|
|
|
+ updateRobotPoints(UserId, betAmount, false)
|
|
|
+
|
|
|
+ } else {
|
|
|
+
|
|
|
+ user.DecreaseUserPoint(betAmount, UserId)
|
|
|
+
|
|
|
+ UserInfo := user.GetUserInfoById(UserId)
|
|
|
+ SendUserInfoMsg(r, &msg.ReqUserInfo{
|
|
|
+ UserId: UserId,
|
|
|
+ Points: int32(UserInfo.Points),
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ UserInfo := user.GetUserInfoById(UserId)
|
|
|
+
|
|
|
+ SendUserInfoMsg(r, &msg.ReqUserInfo{
|
|
|
+ UserId: UserId,
|
|
|
+ Points: int32(UserInfo.Points),
|
|
|
+ RoomId: r.Id,
|
|
|
+ })
|
|
|
+
|
|
|
+ previousSitPos := getRoomSitPos(r, sitPos, -1)
|
|
|
+
|
|
|
+ log.Debug("发起比牌的玩家座位号", sitPos)
|
|
|
+ log.Debug("接受比牌选项玩家的座位号", previousSitPos)
|
|
|
+
|
|
|
+ SendRoundMsgToAll(r, &msg.ReqRound{
|
|
|
+ Round: int32(r.Round),
|
|
|
+ RoundSitPos: int32(sitPos),
|
|
|
+ PlayerOpt: &msg.PlayerOpt{OptType: msg.PlayerOptType_OPT_SITESHOW},
|
|
|
+ UserId: r.GetPlayerBySitPos(sitPos).Id,
|
|
|
+ })
|
|
|
+
|
|
|
+ notifyPlayerAction(r, int32(previousSitPos), msg.PlayerOptType_OPT_SELECTSITESHOW)
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+func RefuseSiteShow(r *room.Room, sitPos int32) {
|
|
|
+
|
|
|
+
|
|
|
+ SendRoundMsgToAll(r, &msg.ReqRound{
|
|
|
+ Round: int32(r.Round),
|
|
|
+ RoundSitPos: int32(sitPos),
|
|
|
+ PlayerOpt: &msg.PlayerOpt{OptType: msg.PlayerOptType_OPT_REFUSESITESHOW},
|
|
|
+ UserId: r.GetPlayerBySitPos(sitPos).GetUserId(),
|
|
|
+ })
|
|
|
+ r.SetNextRound()
|
|
|
+ checkRoomStatus(r)
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+func AgreeSiteShow(r *room.Room, sitPos int32) {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ currentPlayer := r.GetPlayerBySitPos(sitPos)
|
|
|
+ if currentPlayer == nil {
|
|
|
+ log.Debug("Player with SitPos %d not found.", sitPos)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ previousSitPos := getRoomSitPos(r, sitPos, 1)
|
|
|
+ previousPlayer := r.GetPlayerBySitPos(previousSitPos)
|
|
|
+ if previousPlayer == nil {
|
|
|
+ log.Debug("Next player with SitPos %d not found.", previousPlayer)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ players := []*room.Player{currentPlayer, previousPlayer}
|
|
|
+ winPlayer := compareCards(players)
|
|
|
+
|
|
|
+ if winPlayer != nil {
|
|
|
+
|
|
|
+
|
|
|
+ var loserPlayer *room.Player
|
|
|
+ if winPlayer == currentPlayer {
|
|
|
+ loserPlayer = previousPlayer
|
|
|
+ } else {
|
|
|
+ loserPlayer = currentPlayer
|
|
|
+ }
|
|
|
+
|
|
|
+ loserPlayer.IsPacked = true
|
|
|
+ log.Debug("Player %s has packed, they lose the showdown.", loserPlayer.Id)
|
|
|
+
|
|
|
+ SendRoundMsgToAll(r, &msg.ReqRound{
|
|
|
+ Round: int32(r.Round),
|
|
|
+ RoundSitPos: int32(currentPlayer.SitPos),
|
|
|
+ PlayerOpt: &msg.PlayerOpt{OptType: msg.PlayerOptType_OPT_AGREESITESHOW},
|
|
|
+ UserId: currentPlayer.Id,
|
|
|
+ })
|
|
|
+
|
|
|
+ for _, player := range []*room.Player{currentPlayer, previousPlayer} {
|
|
|
+ if player.Agent == nil {
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ var seenCards []*msg.ReqCard
|
|
|
+ var opponent *room.Player
|
|
|
+
|
|
|
+ if player.Id == currentPlayer.Id {
|
|
|
+ opponent = previousPlayer
|
|
|
+ seenCards = convertToMsgCardList(previousPlayer.HandCards)
|
|
|
+ } else {
|
|
|
+ opponent = currentPlayer
|
|
|
+ seenCards = convertToMsgCardList(currentPlayer.HandCards)
|
|
|
+ }
|
|
|
+ log.Debug("AgreeSiteShow seenCards", seenCards)
|
|
|
+
|
|
|
+ player.Agent.WriteMsg(&msg.SiteShowResult{
|
|
|
+ Round: int32(r.Round),
|
|
|
+ RoundSitPos: int32(opponent.SitPos),
|
|
|
+ SeenCards: seenCards,
|
|
|
+ UserId: opponent.Id,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ packed(r, loserPlayer.SitPos)
|
|
|
+
|
|
|
+ } else {
|
|
|
+ log.Error("到这就错误了SiteShowResult")
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+func checkShow(r *room.Room, sitPos int32) bool {
|
|
|
+
|
|
|
+ currentPlayer := r.GetPlayerBySitPos(sitPos)
|
|
|
+ if currentPlayer == nil {
|
|
|
+ log.Debug("Player with SitPos %d not found.", sitPos)
|
|
|
+ return false
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if currentPlayer.IsPacked {
|
|
|
+ log.Debug("Player %s has packed, cannot show cards.", currentPlayer.Id)
|
|
|
+ return false
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ activePlayers := 0
|
|
|
+ for _, player := range r.Players {
|
|
|
+ if player != nil && !player.IsPacked {
|
|
|
+ activePlayers++
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if activePlayers == 2 {
|
|
|
+ log.Debug("There are two players left, showing cards is allowed.")
|
|
|
+ return true
|
|
|
+ }
|
|
|
+
|
|
|
+ log.Debug("There are not two players left, cannot show cards.")
|
|
|
+ return false
|
|
|
+}
|
|
|
+
|
|
|
|
|
|
-func show(r *room.Room) {
|
|
|
+func show(r *room.Room, sitPos int32) {
|
|
|
+
|
|
|
+
|
|
|
+ betAmount := r.GameRound.ResBet.MinCheelBet
|
|
|
+ ante(r, sitPos, betAmount)
|
|
|
+
|
|
|
+ if !checkShow(r, sitPos) {
|
|
|
+ log.Debug("Player %d cannot show cards, conditions not met.", sitPos)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ UserId := r.GetPlayerBySitPos(sitPos).GetUserId()
|
|
|
+ UserInfo := user.GetUserInfoById(UserId)
|
|
|
+ if r.GetPlayerBySitPos(sitPos).IsRobot {
|
|
|
+ updateRobotPoints(UserId, betAmount, false)
|
|
|
+
|
|
|
+ } else {
|
|
|
+ if UserInfo.Points < betAmount && UserInfo.Points > 0 {
|
|
|
+ betAmount = UserInfo.Points
|
|
|
+ }
|
|
|
+
|
|
|
+ user.DecreaseUserPoint(betAmount, UserId)
|
|
|
+
|
|
|
+ SendUserInfoMsg(r, &msg.ReqUserInfo{
|
|
|
+ UserId: UserId,
|
|
|
+ Points: int32(UserInfo.Points),
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ SendUserInfoMsg(r, &msg.ReqUserInfo{
|
|
|
+ UserId: UserId,
|
|
|
+ Points: int32(UserInfo.Points),
|
|
|
+ })
|
|
|
+
|
|
|
players := r.Players
|
|
|
temp := make([]*room.Player, 0)
|
|
|
+
|
|
|
+
|
|
|
for _, player := range players {
|
|
|
if !player.IsPacked {
|
|
|
temp = append(temp, player)
|
|
|
+
|
|
|
SendRoundMsgToAll(r, &msg.ReqRound{
|
|
|
Round: int32(r.Round),
|
|
|
RoundSitPos: int32(player.SitPos),
|
|
@@ -96,17 +482,37 @@ func show(r *room.Room) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
winPlayer := compareCards(temp)
|
|
|
if winPlayer != nil {
|
|
|
r.PlayerWin(winPlayer.SitPos)
|
|
|
sendResult(r, winPlayer.SitPos)
|
|
|
+
|
|
|
+
|
|
|
+ log.Debug("SHOWUserId", UserId)
|
|
|
+
|
|
|
+ if winPlayer.IsRobot {
|
|
|
+
|
|
|
+ } else {
|
|
|
+ user.AddUserPoint(r.GameRound.TotalBet, winPlayer.Id)
|
|
|
+
|
|
|
+ UserInfo := user.GetUserInfoById(winPlayer.Id)
|
|
|
+
|
|
|
+ SendUserInfoMsg(r, &msg.ReqUserInfo{
|
|
|
+ UserId: winPlayer.Id,
|
|
|
+ Points: int32(UserInfo.Points),
|
|
|
+ })
|
|
|
+ }
|
|
|
} else {
|
|
|
log.Error("所有玩家都弃牌了")
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ time.Sleep(5 * time.Second)
|
|
|
+ startNextRound(r)
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
func cancelOptTimeout(player *room.Player, sitPos int32) {
|
|
|
eventID := fmt.Sprintf("player_%s_opt_%s", player.Id, sitPos)
|
|
|
timerMgr.RemoveEvent(eventID)
|
|
@@ -123,3 +529,16 @@ func checkRoomStatus(r *room.Room) {
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+func getRoomChaalLimmit(ConfId string) int32 {
|
|
|
+ for _, betInfo := range GameConfig.RoomList {
|
|
|
+ if betInfo.ConfId == ConfId {
|
|
|
+
|
|
|
+ chaalLimmit, err := strconv.Atoi(betInfo.ChaalLimmit)
|
|
|
+ if err != nil {
|
|
|
+ log.Error("Invalid chaalLimmit value: %v", chaalLimmit)
|
|
|
+ }
|
|
|
+ return int32(chaalLimmit)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0
|
|
|
+}
|