This commit is contained in:
2026-08-09 17:57:46 +08:00
parent 316a83a6ac
commit 983192ba29
323 changed files with 32641 additions and 14505 deletions
+56
View File
@@ -394,5 +394,61 @@ Debug.Log("url----" + url + "--" + "Json-" + json + "res--" + JsonConvert.Serial
//这里之后补弹窗
UIManager.Instance.ShowBoardError(message);
}
// ============================ AdminApi(临时/调试出鱼) ============================
// GET /adminapi/Admin/TempSpawnFish
// 参数: roomId, fishNumber, count, seconds, routeId
// 无鉴权,直接调用。服务端收到后在指定房间强制出指定鱼。
/// <summary>
/// 调用服务端 AdminApi 强制出鱼(临时/调试)。GET 请求,无鉴权。
/// </summary>
/// <param name="roomId">房间ID(如 room1)</param>
/// <param name="fishNumber">鱼编号(须存在于该房间等级出鱼配置中,如 1001)</param>
/// <param name="count">出鱼数量(Boss类强制1,普通鱼默认1,上限2000)</param>
/// <param name="seconds">存活秒数(默认30)</param>
/// <param name="routeId">路径编号(空则按配置路径随机)</param>
/// <param name="callback">请求完成回调,true=成功</param>
public static void TempSpawnFish(string roomId, string fishNumber, int count = 1, int seconds = 30, int routeId = 0, Action<bool> callback = null)
{
if (string.IsNullOrEmpty(roomId) || string.IsNullOrEmpty(fishNumber))
{
Debug.LogWarning("[AdminApi] TempSpawnFish 参数为空: roomId=" + roomId + " fishNumber=" + fishNumber);
callback?.Invoke(false);
return;
}
string url = baseURL + "/adminapi/Admin/TempSpawnFish";
url += "?roomId=" + UnityWebRequest.EscapeURL(roomId);
url += "&fishNumber=" + UnityWebRequest.EscapeURL(fishNumber);
url += "&count=" + count;
url += "&seconds=" + seconds;
if (routeId > 0)
url += "&routeId=" + routeId;
UIManager.Instance.StartCoroutine(IETempSpawnFish(url, callback));
}
/// <summary>TempSpawnFish 协程</summary>
static IEnumerator IETempSpawnFish(string url, Action<bool> callback)
{
Debug.Log("[AdminApi] TempSpawnFish 请求: " + url);
using (UnityWebRequest req = UnityWebRequest.Get(url))
{
req.SetRequestHeader("Content-Type", "application/json");
yield return req.SendWebRequest();
if (req.result == UnityWebRequest.Result.Success)
{
Debug.Log("[AdminApi] TempSpawnFish 成功: " + req.downloadHandler.text);
callback?.Invoke(true);
}
else
{
Debug.LogError("[AdminApi] TempSpawnFish 失败: " + req.error);
callback?.Invoke(false);
}
}
}
}
}
@@ -13,24 +13,14 @@ namespace Assets.MyGame.Scripts.Net.APIRequest.Objs
/// </summary>
public string mobile;
/// <summary>
/// 验证码
/// </summary>
public string code;
/// <summary>
/// 用户密码
/// </summary>
public string passWord;
/// <summary>
/// 邀请码(可选)
/// </summary>
public string inviteCode;
/// <summary>
///真实名字
///</summary>
public string realName;
public string iDCard;
public string account;
public string nickName;
}
}
@@ -1,4 +1,4 @@
using System;
using System;
namespace Assets.MyGame.Scripts.Net.API.GameConfig_SubClass
{
@@ -31,7 +31,7 @@ namespace Assets.MyGame.Scripts.Net.API.GameConfig_SubClass
/// <summary>
/// 经销商价格
/// </summary>
public int dealerPrice;
public long dealerPrice;
/// <summary>
/// 是否启用
@@ -25,7 +25,7 @@ namespace Assets.MyGame.Scripts.Net.API.GameConfig_SubClass
public class BattleOrderLevelConfig
{
public int level;
public int exp;
public long exp;
public List<GiftConfig> normalGiftList;
public List<GiftConfig> luxuryGiftList;
public List<GiftConfig> supremeGiftList;
@@ -0,0 +1,588 @@
using System.Collections.Generic;
using System.Linq;
// ============================================================
// 文件:BossConfig.cs
// 职责:Boss 各种死亡爆奖配置(幸运轮盘/小丑扑克/幸运飞碟/破坏球/烈焰风暴/星际巡航/神龙转盘 等)
// - 服务端下发配置,客户端解析后用 GetResponse() 取随机结果
// - 已将服务端依赖(GlobalRandom/RandomBossOption/BsonIgnoreExtraElements)
// 替换为 Unity 客户端兼容实现
// ============================================================
namespace Assets.MyGame.Scripts.Net.APIResponses.GameConfig_SubClass
{
/// <summary>
/// Boss设定配置信息
/// </summary>
public class BossConfig
{
/// <summary>幸运轮盘配置信息</summary>
public List<LuckWheelConfig> LuckWheel { get; set; } = new List<LuckWheelConfig>();
/// <summary>小丑扑克</summary>
public LuckPokerConfig LuckPoker { get; set; } = new LuckPokerConfig();
/// <summary>幸运飞碟</summary>
public List<LuckFlyDiskConfig> LuckFlyDisk { get; set; } = new List<LuckFlyDiskConfig>();
/// <summary>全屏秒怪</summary>
public BaseBossConfig FullScreen { get; set; } = new BaseBossConfig();
/// <summary>范围秒怪</summary>
public BaseBossConfig Range { get; set; } = new BaseBossConfig();
/// <summary>弹药箱配置</summary>
public AmmunitionBoxConfig AmmunitionBox { get; set; } = new AmmunitionBoxConfig();
/// <summary>星际巡航配置</summary>
public InterstellarCruiseConfig InterstellarCruise { get; set; } = new InterstellarCruiseConfig();
/// <summary>烈焰风暴-死亡配置</summary>
public BossFlameStormConfig FlameStorm { get; set; } = new BossFlameStormConfig();
/// <summary>破坏球-死亡配置</summary>
public BossBombConfig Bomb { get; set; } = new BossBombConfig();
/// <summary>概率击杀</summary>
public List<BossProbabilityConfig> Probability { get; set; } = new List<BossProbabilityConfig>();
/// <summary>神龙转盘</summary>
public List<LuckDragonConfig> LuckDragon { get; set; } = new List<LuckDragonConfig>();
/// <summary>
/// 根据权重随机获取一个 Boss 选项
/// </summary>
public static int GetBossProbabilityConfigResponse(List<BossProbabilityConfigParam> configParams)
{
if (configParams == null || configParams.Count == 0) return 0;
int totalWeight = configParams.Sum(p => p.TriggerRate);
if (totalWeight <= 0) return 0;
int randomValue = GlobalRandom.Next(0, totalWeight);
int currentWeightSum = 0;
foreach (var param in configParams)
{
currentWeightSum += param.TriggerRate;
if (randomValue < currentWeightSum)
{
return GlobalRandom.NextInclusive(param.Min, param.Max);
}
}
return 0;
}
/// <summary>
/// 根据权重随机获取一个死亡次数配置
/// </summary>
public static CruiseConfigCount GetRandomCountConfigOption(List<CruiseConfigCount> options)
{
if (options == null || !options.Any()) return null;
long totalWeight = options.Sum(o => (long)o.TriggerRate);
if (totalWeight <= 0) return null;
long randomValue = GlobalRandom.NextInt64(0, totalWeight);
long currentWeightSum = 0;
foreach (var option in options)
{
currentWeightSum += option.TriggerRate;
if (randomValue < currentWeightSum)
{
return option;
}
}
return options.FirstOrDefault(o => o.TriggerRate > 0);
}
/// <summary>死亡次数配置参数</summary>
public class CruiseConfigCount
{
/// <summary>死亡次数</summary>
public int Count { get; set; }
/// <summary>触发权重</summary>
public int TriggerRate { get; set; } = 0;
/// <summary>击杀权重</summary>
public int KillRate { get; set; } = 0;
}
/// <summary>神龙转盘</summary>
public class LuckDragonConfig : BaseBossConfig
{
/// <summary>外圈配置 下一个配置为-1</summary>
public List<BossProbabilityConfigParam> OuterConfig { get; set; } = new List<BossProbabilityConfigParam>();
/// <summary>中圈配置 下一个配置为-1</summary>
public List<BossProbabilityConfigParam> MiddleConfig { get; set; } = new List<BossProbabilityConfigParam>();
/// <summary>内圈配置 下一个配置为-1</summary>
public List<BossProbabilityConfigParam> InnerConfig { get; set; } = new List<BossProbabilityConfigParam>();
/// <summary>获取结果</summary>
public (List<int> option, int beizhu) GetResponse()
{
int beishu = 1;
var result = new List<int>();
int outerResult = GetBossProbabilityConfigResponse(OuterConfig);
result.Add(outerResult);
if (outerResult == -1)
{
int middleResult = GetBossProbabilityConfigResponse(MiddleConfig);
result.Add(middleResult);
if (outerResult == -1)
{
int innerResult = GetBossProbabilityConfigResponse(InnerConfig);
result.Add(innerResult);
beishu = innerResult;
}
else
{
beishu = middleResult;
}
}
else
{
beishu = outerResult;
}
UnityEngine.Debug.Log($"[BossConfig] LuckDragon.GetResponse 选项=[{string.Join(",", result)}] 倍数={beishu}");
return (result, beishu);
}
}
/// <summary>破坏球配置参数</summary>
public class BossBombConfig : BaseBossConfig
{
/// <summary>死亡次数配置</summary>
public List<CruiseConfigCount> CountConfig { get; set; } = new List<CruiseConfigCount>();
/// <summary>第一次死亡配置</summary>
public List<BossProbabilityConfigParam> OneDeathConfig { get; set; } = new List<BossProbabilityConfigParam>();
/// <summary>第二次死亡配置</summary>
public List<BossProbabilityConfigParam> TwoDeathConfig { get; set; } = new List<BossProbabilityConfigParam>();
/// <summary>获取破坏球配置响应信息</summary>
public (int beishu, int type) GetResponse(string fishId)
{
int beishu = 0;
var countConfig = GetRandomCountConfigOption(CountConfig);
if (countConfig == null)
{
UnityEngine.Debug.Log("[BossConfig] Bomb.GetResponse countConfig为null 返回 (1,1)");
return (1, 1);
}
if (countConfig.Count == 1)
{
beishu = GetBossProbabilityConfigResponse(OneDeathConfig);
UnityEngine.Debug.Log($"[BossConfig] Bomb.GetResponse 死亡次数={countConfig.Count} 倍数={beishu} type=1 fishId={fishId}");
return (beishu, 1);
}
else
{
beishu = GetBossProbabilityConfigResponse(TwoDeathConfig);
UnityEngine.Debug.Log($"[BossConfig] Bomb.GetResponse 死亡次数={countConfig.Count} 倍数={beishu} type=2 fishId={fishId}");
return (beishu, 2);
}
}
}
/// <summary>烈焰风暴配置</summary>
public class BossFlameStormConfig : BaseBossConfig
{
/// <summary>死亡次数配置</summary>
public List<CruiseConfigCount> CountConfig { get; set; } = new List<CruiseConfigCount>();
/// <summary>第一次死亡配置</summary>
public List<BossProbabilityConfigParam> OneDeathConfig { get; set; } = new List<BossProbabilityConfigParam>();
/// <summary>第二次死亡配置</summary>
public List<BossProbabilityConfigParam> TwoDeathConfig { get; set; } = new List<BossProbabilityConfigParam>();
/// <summary>获取烈焰风暴配置响应信息</summary>
public (bool isKill, int beishu, string fishId) GetResponse(string fishId)
{
bool isKill = false;
int beishu = 0;
int count = 1;
int sumcount = 1;
if (!fishId.Contains("-")) // 首次击杀
{
var countConfig = GetRandomCountConfigOption(CountConfig);
if (countConfig == null)
{
UnityEngine.Debug.Log($"[BossConfig] FlameStorm.GetResponse 首击 countConfig为null 返回 (true,1,{fishId})");
return (true, 1, fishId);
}
count = countConfig.Count;
beishu = GetBossProbabilityConfigResponse(OneDeathConfig);
if (count == 1)
{
isKill = true;
UnityEngine.Debug.Log($"[BossConfig] FlameStorm.GetResponse 首击一次死 isKill=true 倍数={beishu} fishId={fishId}-{count}-{sumcount}");
return (isKill, beishu, $"{fishId}-{count}-{sumcount}");
}
else
{
sumcount = countConfig.Count;
}
}
else
{
var parts = fishId.Split('-');
count = int.Parse(parts[1]);
sumcount = int.Parse(parts[2]);
}
if (count == 1)
{
beishu = GetBossProbabilityConfigResponse(TwoDeathConfig);
if (sumcount == 2 && count == 1)
{
UnityEngine.Debug.Log($"[BossConfig] FlameStorm.GetResponse 二击致死 isKill=true 倍数={beishu} fishId={fishId}-{count + 1}-{sumcount}");
return (true, beishu, $"{fishId}-{count + 1}-{sumcount}");
}
else
{
UnityEngine.Debug.Log($"[BossConfig] FlameStorm.GetResponse 二击未死 isKill=false 倍数={beishu} fishId={fishId}-{count + 1}-{sumcount}");
return (false, beishu, $"{fishId}-{count + 1}-{sumcount}");
}
}
UnityEngine.Debug.Log($"[BossConfig] FlameStorm.GetResponse 三击致死 isKill=true 倍数={beishu} fishId={fishId}-{count + 1}-{sumcount}");
return (true, beishu, $"{fishId}-{count + 1}-{sumcount}");
}
}
/// <summary>星际巡航配置</summary>
public class InterstellarCruiseConfig : BaseBossConfig
{
/// <summary>死亡次数配置</summary>
public List<CruiseConfigCount> CountConfig { get; set; } = new List<CruiseConfigCount>();
/// <summary>第一次死亡配置</summary>
public List<BossProbabilityConfigParam> OneDeathConfig { get; set; } = new List<BossProbabilityConfigParam>();
/// <summary>第二次死亡配置</summary>
public List<BossProbabilityConfigParam> TwoDeathConfig { get; set; } = new List<BossProbabilityConfigParam>();
/// <summary>第三次死亡配置</summary>
public List<BossProbabilityConfigParam> ThreeDeathConfig { get; set; } = new List<BossProbabilityConfigParam>();
/// <summary>获取星际巡航配置响应信息</summary>
public (bool isKill, int beishu, string fishId) GetResponse(string fishId)
{
bool isKill = false;
int beishu = 0;
int count = 1;
int sumcount = 1;
if (!fishId.Contains("-")) // 首次击杀
{
var countConfig = GetRandomCountConfigOption(CountConfig);
if (countConfig == null)
{
UnityEngine.Debug.Log($"[BossConfig] Cruise.GetResponse 首击 countConfig为null 返回 (true,1,{fishId})");
return (true, 1, fishId);
}
count = countConfig.Count;
beishu = GetBossProbabilityConfigResponse(OneDeathConfig);
if (count == 1)
{
isKill = true;
UnityEngine.Debug.Log($"[BossConfig] Cruise.GetResponse 首击一次死 isKill=true 倍数={beishu} fishId={fishId}-{count}-{sumcount}");
return (isKill, beishu, $"{fishId}-{count}-{sumcount}");
}
else
{
sumcount = countConfig.Count;
}
}
else
{
var parts = fishId.Split('-');
count = int.Parse(parts[1]);
sumcount = int.Parse(parts[2]);
}
if (count == 1)
{
beishu = GetBossProbabilityConfigResponse(TwoDeathConfig);
if (sumcount == 2 && count == 1)
{
UnityEngine.Debug.Log($"[BossConfig] Cruise.GetResponse 二击致死 isKill=true 倍数={beishu} fishId={fishId}-{count + 1}-{sumcount}");
return (true, beishu, $"{fishId}-{count + 1}-{sumcount}");
}
else
{
UnityEngine.Debug.Log($"[BossConfig] Cruise.GetResponse 二击未死 isKill=false 倍数={beishu} fishId={fishId}-{count + 1}-{sumcount}");
return (false, beishu, $"{fishId}-{count + 1}-{sumcount}");
}
}
beishu = GetBossProbabilityConfigResponse(ThreeDeathConfig);
UnityEngine.Debug.Log($"[BossConfig] Cruise.GetResponse 三击致死 isKill=true 倍数={beishu} fishId={fishId}-{count + 1}-{sumcount}");
return (true, beishu, $"{fishId}-{count + 1}-{sumcount}");
}
}
/// <summary>概率击杀</summary>
public class BossProbabilityConfig : BaseBossConfig
{
public List<BossProbabilityConfigParam> configParams { get; set; } = new List<BossProbabilityConfigParam>();
public int GetResponse()
{
int beishu = GetBossProbabilityConfigResponse(configParams);
UnityEngine.Debug.Log($"[BossConfig] Probability.GetResponse 倍数={beishu}");
return beishu;
}
}
/// <summary>弹药箱配置</summary>
public class AmmunitionBoxConfig : BaseBossConfig
{
/// <summary>3个一样的</summary>
public List<BossOptionBaseParam> OptionList { get; set; } = new List<BossOptionBaseParam>();
/// <summary>获取随机结果</summary>
public List<BossOptionBaseParam> GetResponse()
{
var opt = RandomBossOption.GetRandomBossOption(OptionList);
if (opt == null)
{
UnityEngine.Debug.LogWarning("[BossConfig] AmmunitionBox.GetResponse 选中为null");
return null;
}
UnityEngine.Debug.Log($"[BossConfig] AmmunitionBox.GetResponse 选项Id={opt.OptionId} 倍数/分值={opt.Score}");
return new List<BossOptionBaseParam>() { opt };
}
}
/// <summary>幸运飞碟配置信息</summary>
public class LuckFlyDiskConfig : BaseBossConfig
{
/// <summary>内层配置选项列表</summary>
public List<BossOptionBaseParam> InnerOptionList { get; set; } = new List<BossOptionBaseParam>();
/// <summary>外层配置选项列表</summary>
public List<BossOptionBaseParam> OuterOptionList { get; set; } = new List<BossOptionBaseParam>();
/// <summary>获取随机结果</summary>
public List<BossOptionBaseParam> GetResponse()
{
List<BossOptionBaseParam> result = new List<BossOptionBaseParam>();
var opt = RandomBossOption.GetRandomBossOption(InnerOptionList);
result.Add(opt);
var opt1 = RandomBossOption.GetRandomBossOption(OuterOptionList);
result.Add(opt1);
UnityEngine.Debug.Log($"[BossConfig] FlyDisk.GetResponse 内层={(opt?.OptionId.ToString() ?? "null")} 外层={(opt1?.OptionId.ToString() ?? "null")}");
return result;
}
}
/// <summary>小丑扑克</summary>
public class LuckPokerConfig : BaseBossConfig
{
/// <summary>配置选项列表</summary>
public List<BossOptionBaseParam> OptionList { get; set; } = new List<BossOptionBaseParam>();
/// <summary>获取随机结果</summary>
public List<BossOptionBaseParam> GetResponse()
{
var opt = RandomBossOption.GetRandomBossOption(OptionList);
if (opt == null)
{
UnityEngine.Debug.LogWarning("[BossConfig] Poker.GetResponse 选中为null");
return null;
}
UnityEngine.Debug.Log($"[BossConfig] Poker.GetResponse 选项Id={opt.OptionId} 倍数/分值={opt.Score}");
return new List<BossOptionBaseParam>() { opt };
}
}
/// <summary>幸运轮盘配置信息</summary>
public class LuckWheelConfig : BaseBossConfig
{
/// <summary>配置选项列表</summary>
public List<BossOptionBaseParam> OptionList { get; set; } = new List<BossOptionBaseParam>();
/// <summary>配置项数量配置列表</summary>
public List<BossOptionBaseParam> CountList { get; set; } = new List<BossOptionBaseParam>();
/// <summary>获取随机结果</summary>
public List<BossOptionBaseParam> GetResponse()
{
List<double> count = new List<double>();
List<BossOptionBaseParam> option = new List<BossOptionBaseParam>();
foreach (var item in CountList)
{
if (item.TriggerRate >= 100)
{
count.Add(item.OptionId);
continue;
}
if (GlobalRandom.Next(100) < item.TriggerRate)
{
count.Add(item.OptionId);
continue;
}
break;
}
foreach (var item in count)
{
var opt = RandomBossOption.GetRandomBossOption(OptionList);
if (opt == null) continue;
option.Add(opt);
}
UnityEngine.Debug.Log($"[BossConfig] Wheel.GetResponse 触发次数={count.Count} 选项Ids=[{string.Join(",", option.Select(o => o.OptionId))}]");
return option;
}
}
/// <summary>Boss配置基类</summary>
public class BaseBossConfig
{
/// <summary>鱼编号</summary>
public List<string> FishNumber { get; set; } = new List<string>();
}
/// <summary>boss 概率配置参数</summary>
public class BossProbabilityConfigParam
{
public BossProbabilityConfigParam() { }
public BossProbabilityConfigParam(int min, int max, int triggerRate)
{
Min = min;
Max = max;
TriggerRate = triggerRate;
}
/// <summary>最小值</summary>
public int Min { get; set; }
/// <summary>最大值</summary>
public int Max { get; set; }
/// <summary>触发权重</summary>
public int TriggerRate { get; set; } = 0;
}
}
/// <summary>Boss道具掉落配置项</summary>
public class BossDropItemConfig
{
/// <summary>道具编号</summary>
public string PropNumber { get; set; } = string.Empty;
/// <summary>道具名称</summary>
public string PropName { get; set; } = string.Empty;
/// <summary>掉落数量</summary>
public int Count { get; set; } = 1;
/// <summary>掉落权重(概率 = Weight / 10000)</summary>
public int Weight { get; set; } = 0;
}
/// <summary>Boss道具掉落配置</summary>
public class BossDropConfig
{
/// <summary>不掉落权重(概率 = NoDropWeight / 总权重和)</summary>
public int NoDropWeight { get; set; } = 5000;
/// <summary>掉落道具列表</summary>
public List<BossDropItemConfig> DropItems { get; set; } = new List<BossDropItemConfig>();
}
/// <summary>公共选项配置</summary>
public class BossOptionBaseParam
{
public BossOptionBaseParam() { }
public BossOptionBaseParam(double optionId, int triggerRate, double score = 0)
{
OptionId = optionId;
TriggerRate = triggerRate;
Score = score;
}
/// <summary>选项编号</summary>
public double OptionId { get; set; }
/// <summary>触发权重</summary>
public int TriggerRate { get; set; } = 0;
/// <summary>分值</summary>
public double Score { get; set; } = 0;
}
// ============================================================
// 服务端依赖的 Unity 客户端兼容实现
// ============================================================
/// <summary>
/// 线程安全的随机数工具(替代服务端的 GlobalRandom)。
/// 全部走 UnityEngine.Random,保证客户端单线程主逻辑使用。
/// </summary>
public static class GlobalRandom
{
/// <summary>[min, max) 的随机整数</summary>
public static int Next(int min, int max)
{
return UnityEngine.Random.Range(min, max);
}
/// <summary>[0, max) 的随机整数</summary>
public static int Next(int max)
{
return UnityEngine.Random.Range(0, max);
}
/// <summary>[min, max] 闭区间的随机整数(含两端)</summary>
public static int NextInclusive(int min, int max)
{
// Range 的整数重载是 [min, max) 上界开,这里补 1 实现闭区间
if (min > max) return min;
return UnityEngine.Random.Range(min, max + 1);
}
/// <summary>[min, max) 的随机 long</summary>
public static long NextInt64(long min, long max)
{
if (min >= max) return min;
// UnityEngine.Random 无 long 重载,用 double 映射
double t = UnityEngine.Random.value;
return (long)(min + (max - min) * t);
}
}
/// <summary>
/// Boss 选项权重随机工具(替代服务端的 RandomBossOption)。
/// </summary>
public static class RandomBossOption
{
/// <summary>
/// 按权重随机选中一个 Boss 选项。
/// </summary>
public static BossOptionBaseParam GetRandomBossOption(List<BossOptionBaseParam> options)
{
if (options == null || options.Count == 0) return null;
long totalWeight = options.Sum(o => (long)o.TriggerRate);
if (totalWeight <= 0) return null;
long randomValue = GlobalRandom.NextInt64(0, totalWeight);
long currentWeightSum = 0;
foreach (var option in options)
{
currentWeightSum += option.TriggerRate;
if (randomValue < currentWeightSum)
{
return option;
}
}
return options.FirstOrDefault(o => o.TriggerRate > 0);
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 69ace07c67208384189ccb057cbecba5
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -32,7 +32,7 @@ namespace Assets.MyGame.Scripts.Net.API.GameConfig_SubClass
/// <summary>
/// 基础分数
/// </summary>
public int fishScore;
public long fishScore;
/// <summary>
/// 击杀权重
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
namespace Assets.MyGame.Scripts.Net.API.GameConfig_SubClass
@@ -27,7 +27,7 @@ namespace Assets.MyGame.Scripts.Net.API.GameConfig_SubClass
/// <summary>
/// 金币价格
/// </summary>
public int gold;
public long gold;
/// <summary>
/// 现金价格
@@ -18,7 +18,7 @@ namespace Assets.MyGame.Scripts.Net.API.GameConfig_SubClass
/// <summary>
/// 注册初始钻石
/// </summary>
public int initDiamond;
public long initDiamond;
/// <summary>
/// 注册初始道具列表
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
namespace Assets.MyGame.Scripts.Net.API.GameConfig_SubClass
@@ -42,7 +42,7 @@ namespace Assets.MyGame.Scripts.Net.API.GameConfig_SubClass
/// <summary>
/// 进房金币限制
/// </summary>
public int roomGoldLimit;
public long roomGoldLimit;
/// <summary>
/// 炮倍列表
@@ -1,4 +1,4 @@
using System;
using System;
namespace Assets.MyGame.Scripts.Net.API.GameConfig_SubClass
{
@@ -16,7 +16,7 @@ namespace Assets.MyGame.Scripts.Net.API.GameConfig_SubClass
/// <summary>
/// 金币
/// </summary>
public int gold;
public long gold;
/// <summary>
/// 名称
@@ -1,4 +1,4 @@
using Assets.MyGame.Scripts.Net.API.UserData_SubClass;
using Assets.MyGame.Scripts.Net.API.UserData_SubClass;
using System;
using System.Collections.Generic;
@@ -28,12 +28,12 @@ namespace Assets.MyGame.Scripts.Net.API.GameConfig_SubClass
/// <summary>
/// 奖励金币
/// </summary>
public int gold;
public long gold;
/// <summary>
/// 奖励钻石
/// </summary>
public int diamond;
public long diamond;
/// <summary>
/// 奖励道具列表
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
namespace Assets.MyGame.Scripts.Net.API.GameConfig_SubClass
@@ -17,12 +17,12 @@ namespace Assets.MyGame.Scripts.Net.API.GameConfig_SubClass
/// <summary>
/// 经验上限
/// </summary>
public int expMax;
public long expMax;
/// <summary>
/// 经验下限
/// </summary>
public int expMin;
public long expMin;
/// <summary>
/// 签到加成
@@ -31,7 +31,7 @@ namespace Assets.MyGame.Scripts.Net.APIResponses
[Serializable]
public class GetReliefResponse
{
public int reliefAmount; // 领取的救济金数量
public long reliefAmount; // 领取的救济金数量(改用long防溢出)
public int leftTimes; // 剩余可领取次数
public string message; // 提示信息
}
@@ -71,7 +71,7 @@ namespace Assets.MyGame.Scripts.Net.APIResponses
{
public int userId; // 用户ID
public long gold; // 当前金币
public int addGold; // 本次增加金币
public long addGold; // 本次增加金币(改用long防溢出)
}
/// <summary>
@@ -93,8 +93,8 @@ namespace Assets.MyGame.Scripts.Net.APIResponses
{
public int day; // 第几天签到
public bool isToday; // 今日是否已签到
public int rewardGold; // 奖励金币
public int rewardDiamond;// 奖励钻石
public long rewardGold; // 奖励金币(改用long防溢出)
public long rewardDiamond;// 奖励钻石(改用long防溢出)
}
/// <summary>
@@ -229,7 +229,7 @@ namespace Assets.MyGame.Scripts.Net.APIResponses
{
public string userId;
public int level;
public int exp;
public long exp;
public bool isLuxury;
public bool isSupreme;
public List<int> receivedLevels;
@@ -251,7 +251,7 @@ namespace Assets.MyGame.Scripts.Net.APIResponses
public class BattleOrderLevelInfo
{
public int level;
public int exp;
public long exp;
public List<GiftConfig> normalGiftList;
public List<GiftConfig> luxuryGiftList;
public List<GiftConfig> supremeGiftList;
@@ -302,7 +302,7 @@ namespace Assets.MyGame.Scripts.Net.APIResponses
public int taskAddTime;
public long taskEndTime;
public long taskFinishTime;
public int exp; // 奖励经验
public long exp; // 奖励经验
}
/// <summary>
@@ -16,7 +16,7 @@ namespace Assets.MyGame.Scripts.Net.APIResponses.HomeMain_User
public long readTime;
public bool isRead;
public bool isReward;
public int rewardDiamond;
public long rewardDiamond;
public long rewardGold;
public long expireTime;
public List<RewardItem> rewardItems;
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -16,8 +16,8 @@ namespace Assets.MyGame.Scripts.Net.API.UserData_SubClass
public int diamond;
public long gold;
public int level;
public int exp;
public int vipExp; // VIP经验值
public long exp; // 经验值(可能超过int上限,改用long)
public long vipExp; // VIP经验值(同上)
public double vipSignInAdd;
public int vipLevel;
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -13,9 +13,9 @@ namespace Assets.MyGame.Scripts.Net.API.UserData_SubClass
public class SafeBoxInfo
{
/// <summary>
/// 保险箱金额
/// 保险箱金额(可能超过int上限,改用long)
/// </summary>
public int amount;
public long amount;
/// <summary>
/// 保险箱密码
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -19,8 +19,8 @@ namespace Assets.MyGame.Scripts.Net.API.UserData_SubClass
public long gameTime;
public string roomNumber;
public double totalRecharge;
public int totalConsumeGold;
public int totalConsumeDiamond;
public long totalConsumeGold;
public long totalConsumeDiamond;
public int reliefGoldCount;
}
@@ -52,7 +52,7 @@ namespace Assets.MyGame.Scripts.Net.WebResponses
/// <summary>
/// 玩家钻石
/// </summary>
public int diamond;
public long diamond;
/// <summary>
/// 玩家在房间中的位置(1~4)
@@ -24,7 +24,7 @@ namespace Assets.MyGame.Scripts.Net.WebResponses
/// <summary>
/// 获得金币
/// </summary>
public int gold;
public long gold;
public int beishu;
/// <summary>
@@ -34,9 +34,18 @@ namespace Assets.MyGame.Scripts.Net.WebResponses
public long timespan;
public int killtime;
public string msg;
public int skillsGold;
public int fishScore;
public object param;
public long skillsGold;
public long fishScore;
/// <summary>
/// Boss 爆奖结果(服务端按 Boss 类型下发不同结构)。
/// 调用方按鱼类型用 ToObject&lt;T&gt;() 解析为具体结构:
/// - LuckDragon: 取 option(int 数组)、beishu
/// - Bomb: 取 beishu、type
/// - FlameStorm/Cruise: 取 isKill、beishu、fishId
/// - 选项类(Wheel/Poker/FlyDisk/AmmunitionBox): List&lt;BossOptionBaseParam&gt;
/// </summary>
public JToken param;
/// <summary>
/// 掉落道具(击杀 Boss 鱼时可能掉落,与 gold 一样仅占位,掉落道具弹窗逻辑暂未实现)
@@ -176,7 +176,7 @@ namespace Assets.MyGame.Scripts.Net.WebResponses
/// <summary>最终倍数</summary>
public int beishu;
/// <summary>最终得分(金币)</summary>
public int score;
public long score;
}
// ================================================================
@@ -1004,9 +1004,7 @@ namespace Assets.MyGame.Scripts.Net
}
// 加入会话房间,之后才能收发消息
//WebSocketSendList.Customer_JoinConversation(result.conversation.id);
// TODO: 通知客服 UI 显示会话(替换为你的实际 Panel 调用)
UIManager.Instance.Get<UIHomeMain>(UIPanel.HomeMainPanel).subUIManager.Get<UIHome_BY_ServicePanel>(UIPanel.ServicePanel)?.OnConversationStarted(result);
GetActiveServicePanel()?.OnConversationStarted(result);
}
/// <summary>
@@ -1014,12 +1012,31 @@ namespace Assets.MyGame.Scripts.Net
/// </summary>
public static void Customer_OnMessageReceived(CustomerMessageReceived msg)
{
// TODO: 通知客服 UI 追加消息(替换为你的实际 Panel 调用)
UIManager.Instance.Get<UIHomeMain>(UIPanel.HomeMainPanel).subUIManager.Get<UIHome_BY_ServicePanel>(UIPanel.ServicePanel)?.OnMessageReceived(msg);
GetActiveServicePanel()?.OnMessageReceived(msg);
Debug.Log($"[Customer] 收到消息 from {msg.senderName}({msg.senderType}): {msg.content}");
}
/// <summary>
/// 获取当前活动的客服面板(主界面或登录界面打开的)
/// </summary>
private static UIHome_BY_ServicePanel GetActiveServicePanel()
{
// 先尝试主界面
var home = UIManager.Instance.Get<UIHomeMain>(UIPanel.HomeMainPanel);
if (home != null && home.subUIManager != null)
{
var panel = home.subUIManager.Get<UIHome_BY_ServicePanel>(UIPanel.ServicePanel);
if (panel != null) return panel;
}
// 再尝试登录界面(游客模式)
var login = UIManager.Instance.Get<UILoginPanel>(UIPanel.LoginPanel);
if (login != null && login.uIManager != null)
{
return login.uIManager.Get<UIHome_BY_ServicePanel>(UIPanel.ServicePanel);
}
return null;
}
/// <summary>
/// 新会话通知(客服端)
/// </summary>