This commit is contained in:
2026-07-17 17:50:31 +08:00
parent efce942e52
commit 287ece9dc8
14 changed files with 229 additions and 86 deletions
@@ -1720,20 +1720,24 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
// 三射 = 3 发,否则 = 1 发
int count = isSanShe ? 3 : 1;
// 新版 FireCannon 不需要 timestamp 和 sign
// ⭐ 客户端生成 bulletIds(GUID),与服务端 RoomFireNotice 新签名对齐
// 本地玩家也通过服务器广播回来创建子弹,bulletIds 必须提前生成
List<string> bulletIds = new List<string>(count);
for (int i = 0; i < count; i++)
{
bulletIds.Add(System.Guid.NewGuid().ToString("N"));
}
// 新版 FireCannon:roomId, userId, gold, count, bulletIds, extra, isBot
WebSocketSendList.FireCannon(
roomdata.roomId,
user.id,
currSitData.consumeGoldNum,
count,
bulletIds,
sgd,
"63215f0afa3f5b25"
false
);
// WebSocketSendList.FireCannon(roomdata.roomId, user.id,currSitData.consumeGoldNum,1,BeijingTimeManager.Instance.CurrentTimestamp, "63215f0afa3f5b25", sgd);
}
@@ -1833,8 +1837,10 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
float angle = botLastAngle.TryGetValue(sync.userId, out float a) ? a : sit.currentAngle;
if (sync.bulletIds == null || sync.bulletIds.Count == 0) return;
// bot 从 botLastFireData 还原完整技能参数;真人玩家用默认参数
if (sit.isBot && botLastFireData.TryGetValue(sync.userId, out var fireData))
// ⭐ 优先用服务器广播的 sync.isBot 标记判断是否机器人
// bot 从 botLastFireData 还原完整技能参数;真人玩家用默认参数
bool isBot = sync.isBot || sit.isBot;
if (isBot && botLastFireData.TryGetValue(sync.userId, out var fireData))
{
FireBullet(sit, angle, fireData.isSanShe, fireData.twoRTruuect,
fireData.isSuoDing, sync.bulletIds, fireData.monsterIDs);