|
@@ -133,35 +133,35 @@ namespace ET.Server
|
|
|
else
|
|
|
{
|
|
|
// 强制操作
|
|
|
- if (self.Time >= 15)
|
|
|
- {
|
|
|
- if (self.DrawCardPlayer.Id == self.CurrentPlayer.Id)
|
|
|
- {
|
|
|
- if (self.OperableList.Count > 0)
|
|
|
- {
|
|
|
- self.Guo(room, self.CurrentPlayer);
|
|
|
- }
|
|
|
- self.DisCard(room, self.CurrentPlayer, 0, true);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- if (self.OperableList.Count > 0)
|
|
|
- {
|
|
|
- self.Guo(room, self.CurrentPlayer);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- self.Time = 15;
|
|
|
-
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- // todo 自动托管逻辑
|
|
|
- if (self.CurrentPlayer != null && self.CurrentPlayer.State != 3 && self.CurrentPlayer.IsAuto)
|
|
|
- {
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
+ // if (self.Time >= 30)
|
|
|
+ // {
|
|
|
+ // if (self.DrawCardPlayer.Id == self.CurrentPlayer.Id)
|
|
|
+ // {
|
|
|
+ // if (self.OperableList.Count > 0)
|
|
|
+ // {
|
|
|
+ // self.Guo(room, self.CurrentPlayer);
|
|
|
+ // }
|
|
|
+ // self.DisCard(room, self.CurrentPlayer, 0, true);
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // if (self.OperableList.Count > 0)
|
|
|
+ // {
|
|
|
+ // self.Guo(room, self.CurrentPlayer);
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ //
|
|
|
+ // self.Time = 30;
|
|
|
+ //
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // // todo 自动托管逻辑
|
|
|
+ // if (self.CurrentPlayer != null && self.CurrentPlayer.State != 3 && self.CurrentPlayer.IsAuto)
|
|
|
+ // {
|
|
|
+ //
|
|
|
+ // }
|
|
|
+ // }
|
|
|
}
|
|
|
break;
|
|
|
case 3:
|
|
@@ -254,9 +254,9 @@ namespace ET.Server
|
|
|
{
|
|
|
player.State = 2;
|
|
|
|
|
|
- MessageHelper.SendToClient(player, new G2C_HGHHStartPush(){info = ProtoHelper.RoomToProto(room, player, null)});
|
|
|
+ MessageHelper.SendToClient(player, new G2C_HGHHStartPush(){info = ProtoHelper.RoomToProto(room, player, self.CurrentPlayer)});
|
|
|
|
|
|
- Log.Info($"游戏开局, 房间id={room.RoomId}, 玩家id={player.Id}, 玩家={player.Name}, 手牌信息={player.RemainCards}");
|
|
|
+ Log.Info($"游戏开局, 房间id={room.RoomId}, 玩家id={player.Id}, 玩家={player.Name}, 手牌信息={string.Join(", ", player.RemainCards)}");
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -322,12 +322,16 @@ namespace ET.Server
|
|
|
{
|
|
|
drawCardPlayer.Act[4] = 0;
|
|
|
}
|
|
|
+
|
|
|
+ // 设置当前操作玩家
|
|
|
+ self.CurrentPlayer = drawCardPlayer;
|
|
|
+
|
|
|
+ Log.Info($"摸牌... 玩家ID:{drawCardPlayer.Id}, 位置:{drawCardPlayer.Pos}, 手牌大小:{drawCardPlayer.RemainCards.Length}, 手牌信息:{string.Join(", ", drawCardPlayer.RemainCards)}, 摸的牌:{card}");
|
|
|
+
|
|
|
// 推送摸牌广播
|
|
|
foreach (Player player in room.GetAllPlayers().Values.Where(player => player != null))
|
|
|
{
|
|
|
MessageHelper.SendToClient(player, new G2C_HGHHDrawCardPush(){info = ProtoHelper.RoomToProto(room, player, drawCardPlayer)});
|
|
|
-
|
|
|
- Log.Info($"摸牌... 玩家ID:{player.Id}, 位置:{player.Pos}, 摸牌玩家:{player.Id == drawCardPlayer.Id}, 手牌大小:{player.RemainCards.Length}, 手牌信息:{string.Join(", ", player.RemainCards)}, 摸的牌:{card}");
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -385,8 +389,8 @@ namespace ET.Server
|
|
|
self.DisCardPlayer = player;
|
|
|
self.PengPlayer = null;
|
|
|
|
|
|
- // 给出牌人广播
|
|
|
- MessageHelper.SendToClient(player, new G2C_HGHHDisCardPush(){info = ProtoHelper.RoomToProto(room, player, player)});
|
|
|
+ // // 给出牌人广播
|
|
|
+ // MessageHelper.SendToClient(player, new G2C_HGHHDisCardPush(){info = ProtoHelper.RoomToProto(room, player, player)});
|
|
|
|
|
|
self.CanHuIds.Clear();
|
|
|
self.ClickHuIds.Clear();
|
|
@@ -447,18 +451,30 @@ namespace ET.Server
|
|
|
{
|
|
|
hasAct = true;
|
|
|
act[2] = 1;
|
|
|
+ foreach (Struct.Kezi kezi in gangs.Where(kezi => kezi is { Card: >= 0 }))
|
|
|
+ {
|
|
|
+ otherPlayer.ActInfo.Add(new Struct.Kezi(kezi.Type, kezi.Card, kezi.PlayerId));
|
|
|
+ }
|
|
|
}
|
|
|
// 是否碰
|
|
|
if (pengs.Count > 0)
|
|
|
{
|
|
|
hasAct = true;
|
|
|
act[1] = 1;
|
|
|
+ foreach (Struct.Kezi kezi in pengs.Where(kezi => kezi is { Card: >= 0 }))
|
|
|
+ {
|
|
|
+ otherPlayer.ActInfo.Add(new Struct.Kezi(kezi.Type, kezi.Card, kezi.PlayerId));
|
|
|
+ }
|
|
|
}
|
|
|
// 是否吃
|
|
|
if (chis.Count > 0)
|
|
|
{
|
|
|
hasAct = true;
|
|
|
act[0] = 1;
|
|
|
+ foreach (Struct.Kezi kezi in chis.Where(kezi => kezi is { Card: >= 0 }))
|
|
|
+ {
|
|
|
+ otherPlayer.ActInfo.Add(new Struct.Kezi(kezi.Type, kezi.Card, kezi.PlayerId));
|
|
|
+ }
|
|
|
}
|
|
|
// 是否过
|
|
|
if (hasAct) {
|
|
@@ -478,8 +494,8 @@ namespace ET.Server
|
|
|
otherPlayer.Act = act;
|
|
|
}
|
|
|
|
|
|
- // 广播其它三家
|
|
|
- MessageHelper.SendToClient(otherPlayer, new G2C_HGHHDisCardPush(){info = ProtoHelper.RoomToProto(room, otherPlayer, player)});
|
|
|
+ // // 广播其它三家
|
|
|
+ // MessageHelper.SendToClient(otherPlayer, new G2C_HGHHDisCardPush(){info = ProtoHelper.RoomToProto(room, otherPlayer, player)});
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -537,6 +553,19 @@ namespace ET.Server
|
|
|
self.CurrentPlayer = self.Players[tmpPlayer.Pos];
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ // 给出牌人广播
|
|
|
+ MessageHelper.SendToClient(player, new G2C_HGHHDisCardPush(){info = ProtoHelper.RoomToProto(room, player, self.CurrentPlayer)});
|
|
|
+ // 给其他三家广播
|
|
|
+ foreach (int index in nextPos)
|
|
|
+ {
|
|
|
+ Player otherPlayer = self.Players[index];
|
|
|
+ if (otherPlayer != null)
|
|
|
+ {
|
|
|
+ // 广播其它三家
|
|
|
+ MessageHelper.SendToClient(otherPlayer, new G2C_HGHHDisCardPush(){info = ProtoHelper.RoomToProto(room, otherPlayer, self.CurrentPlayer)});
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -625,7 +654,7 @@ namespace ET.Server
|
|
|
self.OperableList.Clear();
|
|
|
|
|
|
// 重置时间和流程标记
|
|
|
- self.Time = 15;
|
|
|
+ self.Time = 30;
|
|
|
self.Flag = false;
|
|
|
|
|
|
Log.Info($"玩家吃牌... 玩家ID:{player.Id}, 位置:{player.Pos}, 手牌大小:{player.RemainCards.Length}, 手牌信息:{string.Join(", ", player.RemainCards)}, 吃的牌:{card}");
|