Merge branch 'develop' into sdk
This commit is contained in:
commit
6d2729ebd0
@ -610,6 +610,7 @@ func ReqGmCommand_(player *Player, Command string) error {
|
||||
player.ClearData()
|
||||
case "resetCode":
|
||||
BaseMod := player.PlayMod.getBaseMod()
|
||||
BaseMod.Uid = player.GetPlayerBaseMod().Data.DwUin
|
||||
BaseMod.AddCode = fmt.Sprintf("MMM-%s-%s", BaseMod.CountryCode, GoUtil.UniqueStringFromInt(int(BaseMod.Uid)))
|
||||
player.BackUserInfo()
|
||||
case "debug":
|
||||
|
||||
@ -327,28 +327,31 @@ func (p *Player) handle(m *msg.Msg) error {
|
||||
return nil
|
||||
}
|
||||
var bankruptcy bool
|
||||
if gameId == playroom.GAME_TYPE_HOOK || gameId == playroom.GAME_TYPE_HIDE {
|
||||
PlayroomMod.AddChip(m.From, m.SendT, emoji)
|
||||
p.AddLog(m.From, friend.LOG_TYPE_PLAYROOM_CAT_WIN, fmt.Sprintf("%d_%d_%d", m.Item[0].Id, m.Item[0].Num, emoji), m.SendT)
|
||||
} else {
|
||||
p.AddLog(m.From, friend.LOG_TYPE_PLAYROOM_VISIT, fmt.Sprintf("%d_%d_%d", m.Item[0].Id, m.Item[0].Num, emoji), m.SendT)
|
||||
}
|
||||
PlayroomMod.AddMood(playroom.MOOD_TYPE_FOOD, -50)
|
||||
PlayroomMod.AddMood(playroom.MOOD_TYPE_CLEAN, -50)
|
||||
PlayroomMod.AddVisitor(m.From, m.SendT)
|
||||
|
||||
if m.Item[0].Id == item.ITEM_STAR_ID {
|
||||
BaseMod := p.PlayMod.getBaseMod()
|
||||
starNum := BaseMod.GetStar()
|
||||
m.Item[0].Num = min(m.Item[0].Num, starNum)
|
||||
if m.Item[0].Num >= starNum && gameId == playroom.GAME_TYPE_FILP {
|
||||
bankruptcy = true
|
||||
p.AddLog(m.From, friend.LOG_TYPE_PLAYROOM_BANKRUPTCY, fmt.Sprintf("%d", m.Item[0].Num), m.SendT)
|
||||
if m.Item[0].Num > 0 {
|
||||
p.AddLog(m.From, friend.LOG_TYPE_PLAYROOM_BANKRUPTCY, fmt.Sprintf("%d", m.Item[0].Num), m.SendT)
|
||||
}
|
||||
}
|
||||
p.HandleLoseItem(m.Item, "HANDLE_TYPE_PLAYROOM_LOSE")
|
||||
} else {
|
||||
PlayroomMod.Lose(m.Item)
|
||||
}
|
||||
if gameId == playroom.GAME_TYPE_HOOK || gameId == playroom.GAME_TYPE_HIDE {
|
||||
PlayroomMod.AddChip(m.From, m.SendT, emoji)
|
||||
p.AddLog(m.From, friend.LOG_TYPE_PLAYROOM_CAT_WIN, fmt.Sprintf("%d_%d_%d", m.Item[0].Id, m.Item[0].Num, emoji), m.SendT)
|
||||
} else {
|
||||
if !bankruptcy {
|
||||
p.AddLog(m.From, friend.LOG_TYPE_PLAYROOM_VISIT, fmt.Sprintf("%d_%d_%d", m.Item[0].Id, m.Item[0].Num, emoji), m.SendT)
|
||||
}
|
||||
}
|
||||
PlayroomMod.AddMood(playroom.MOOD_TYPE_FOOD, -50)
|
||||
PlayroomMod.AddMood(playroom.MOOD_TYPE_CLEAN, -50)
|
||||
PlayroomMod.AddVisitor(m.From, m.SendT)
|
||||
if bankruptcy {
|
||||
playerSimpleData := G_GameLogicPtr.GetResSimplePlayerByUid(m.From)
|
||||
p.PushClientRes(&proto.NotifyPlayroomBroken{
|
||||
|
||||
@ -448,7 +448,7 @@ func (p *PlayroomMod) AddChip(uid int, time int64, emoji int) {
|
||||
|
||||
func (p *PlayroomMod) SetTarget(target int) {
|
||||
p.Target = target
|
||||
p.Status = 1
|
||||
p.Status = STATUS_VISIT
|
||||
p.HasVisit[target] = GoUtil.Now()
|
||||
}
|
||||
|
||||
@ -858,6 +858,9 @@ func (p *PlayroomMod) FlipCard(pos int) (int, error) {
|
||||
}
|
||||
|
||||
func (p *PlayroomMod) GetFlipReward() ([]*item.Item, int, int, error) {
|
||||
if p.Status != STATUS_VISIT {
|
||||
return nil, 0, 0, fmt.Errorf("GetFlipReward Status is not STATUS_VISIT")
|
||||
}
|
||||
check := make(map[int]int)
|
||||
var items []*item.Item
|
||||
target := p.Target
|
||||
|
||||
Loading…
Reference in New Issue
Block a user