mirror of
https://github.com/EggLinks/DanhengServer-OpenSource.git
synced 2026-01-02 20:26:03 +08:00
fix many bugs
This commit is contained in:
@@ -24,6 +24,7 @@ namespace EggLink.DanhengServer.Data.Config
|
||||
public int ParamInt3 { get; set; }
|
||||
public List<int> ParamIntList { get; set; } = [];
|
||||
public List<FinishActionInfo> FinishActionList { get; set; } = [];
|
||||
public int Progress { get; set; }
|
||||
}
|
||||
|
||||
public class FinishActionInfo
|
||||
|
||||
45
Common/Data/Config/SkillAbilityInfo.cs
Normal file
45
Common/Data/Config/SkillAbilityInfo.cs
Normal file
@@ -0,0 +1,45 @@
|
||||
using EggLink.DanhengServer.Data.Excel;
|
||||
using EggLink.DanhengServer.Util;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EggLink.DanhengServer.Data.Config
|
||||
{
|
||||
public class SkillAbilityInfo
|
||||
{
|
||||
public List<AbilityInfo> AbilityList { get; set; } = [];
|
||||
|
||||
public void Loaded(AvatarConfigExcel excel)
|
||||
{
|
||||
foreach (var ability in AbilityList)
|
||||
{
|
||||
ability.Loaded();
|
||||
if (ability.Name.EndsWith("MazeSkill"))
|
||||
{
|
||||
excel.MazeSkill = ability;
|
||||
}
|
||||
else if (ability.Name.Contains("NormalAtk"))
|
||||
{
|
||||
excel.MazeAtk = ability;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class AbilityInfo
|
||||
{
|
||||
public string Name { get; set; } = "";
|
||||
public List<TaskInfo> OnStart { get; set; } = [];
|
||||
|
||||
public void Loaded()
|
||||
{
|
||||
foreach (var task in OnStart)
|
||||
{
|
||||
task.Loaded();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
93
Common/Data/Config/TaskInfo.cs
Normal file
93
Common/Data/Config/TaskInfo.cs
Normal file
@@ -0,0 +1,93 @@
|
||||
using EggLink.DanhengServer.Enums;
|
||||
using EggLink.DanhengServer.Util;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EggLink.DanhengServer.Data.Config
|
||||
{
|
||||
public class TaskInfo
|
||||
{
|
||||
public string Type { get; set; } = "";
|
||||
|
||||
public int ID { get; set; }
|
||||
public int SummonUnitID { get; set; }
|
||||
|
||||
public bool TriggerBattle { get; set; } = true;
|
||||
|
||||
public List<TaskInfo> OnAttack { get; set; } = [];
|
||||
public List<TaskInfo> OnBattle { get; set; } = [];
|
||||
public List<TaskInfo> SuccessTaskList { get; set; } = [];
|
||||
public List<TaskInfo> OnProjectileHit { get; set; } = [];
|
||||
public List<TaskInfo> OnProjectileLifetimeFinish { get; set; } = [];
|
||||
|
||||
[JsonIgnore]
|
||||
public TaskTypeEnum TaskType { get; set; } = TaskTypeEnum.None;
|
||||
|
||||
public void Loaded()
|
||||
{
|
||||
foreach (var task in OnAttack)
|
||||
{
|
||||
task.Loaded();
|
||||
}
|
||||
foreach (var task in OnBattle)
|
||||
{
|
||||
task.Loaded();
|
||||
}
|
||||
foreach (var task in SuccessTaskList)
|
||||
{
|
||||
task.Loaded();
|
||||
}
|
||||
foreach (var task in OnProjectileHit)
|
||||
{
|
||||
task.Loaded();
|
||||
}
|
||||
foreach (var task in OnProjectileLifetimeFinish)
|
||||
{
|
||||
task.Loaded();
|
||||
}
|
||||
if (Type.Contains("AddMazeBuff"))
|
||||
{
|
||||
TaskType = TaskTypeEnum.AddMazeBuff;
|
||||
} else if (Type.Contains("RemoveMazeBuff"))
|
||||
{
|
||||
TaskType = TaskTypeEnum.RemoveMazeBuff;
|
||||
} else if (Type.Contains("AdventureModifyTeamPlayerHP"))
|
||||
{
|
||||
TaskType = TaskTypeEnum.AdventureModifyTeamPlayerHP;
|
||||
} else if (Type.Contains("AdventureModifyTeamPlayerSP"))
|
||||
{
|
||||
TaskType = TaskTypeEnum.AdventureModifyTeamPlayerSP;
|
||||
} else if (Type.Contains("CreateSummonUnit"))
|
||||
{
|
||||
TaskType = TaskTypeEnum.CreateSummonUnit;
|
||||
} else if (Type.Contains("AdventureSetAttackTargetMonsterDie"))
|
||||
{
|
||||
TaskType = TaskTypeEnum.AdventureSetAttackTargetMonsterDie;
|
||||
} else if (Type.Contains("AdventureTriggerAttack"))
|
||||
{
|
||||
TaskType = TaskTypeEnum.AdventureTriggerAttack;
|
||||
} else if (Type.Contains("AdventureFireProjectile"))
|
||||
{
|
||||
TaskType = TaskTypeEnum.AdventureFireProjectile;
|
||||
}
|
||||
}
|
||||
|
||||
public int GetID()
|
||||
{
|
||||
return ID > 0 ? ID : SummonUnitID;
|
||||
}
|
||||
|
||||
public List<TaskInfo> GetAttackInfo()
|
||||
{
|
||||
var attackInfo = new List<TaskInfo>();
|
||||
attackInfo.AddRange(OnAttack);
|
||||
attackInfo.AddRange(OnBattle);
|
||||
return attackInfo;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -71,7 +71,7 @@ namespace EggLink.DanhengServer.Data.Custom
|
||||
} else
|
||||
{
|
||||
// 4 - 3 star
|
||||
if (IsRate4())
|
||||
if (IsRate4() || data.LastGachaPurpleFailedCount >= 10)
|
||||
{
|
||||
if (IsRateUp4())
|
||||
{
|
||||
@@ -80,9 +80,11 @@ namespace EggLink.DanhengServer.Data.Custom
|
||||
{
|
||||
item = allNormalItems[random.Next(0, allNormalItems.Count)];
|
||||
}
|
||||
data.LastGachaPurpleFailedCount = 0;
|
||||
} else
|
||||
{
|
||||
item = blueWeapons[random.Next(0, blueWeapons.Count)];
|
||||
data.LastGachaPurpleFailedCount += 1;
|
||||
}
|
||||
}
|
||||
DatabaseHelper.Instance?.UpdateInstance(data);
|
||||
@@ -105,13 +107,13 @@ namespace EggLink.DanhengServer.Data.Custom
|
||||
public bool IsRateUp4()
|
||||
{
|
||||
var random = new Random();
|
||||
return random.Next(0, 1000) < 50;
|
||||
return random.Next(0, 100) < 50;
|
||||
}
|
||||
|
||||
public bool IsRate4()
|
||||
{
|
||||
var random = new Random();
|
||||
return random.Next(0, 1000) < 61;
|
||||
return random.Next(0, 100) < 31;
|
||||
}
|
||||
|
||||
public int GetRateUpItem5(List<int> gold, bool forceUp)
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
using EggLink.DanhengServer.Enums;
|
||||
using EggLink.DanhengServer.Data.Config;
|
||||
using EggLink.DanhengServer.Enums;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace EggLink.DanhengServer.Data.Excel
|
||||
{
|
||||
@@ -11,6 +13,7 @@ namespace EggLink.DanhengServer.Data.Excel
|
||||
public HashName AvatarName { get; set; } = new();
|
||||
public int ExpGroup { get; set; } = 0;
|
||||
public List<int> RankIDList { get; set; } = [];
|
||||
public string? JsonPath { get; set; } = "";
|
||||
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public RarityEnum Rarity { get; set; } = 0;
|
||||
@@ -21,6 +24,14 @@ namespace EggLink.DanhengServer.Data.Excel
|
||||
[JsonIgnore()]
|
||||
public int RankUpItemId { get; set; }
|
||||
|
||||
[JsonIgnore()]
|
||||
public string NameKey { get; set; } = "";
|
||||
|
||||
[JsonIgnore()]
|
||||
public AbilityInfo? MazeSkill { get; set; }
|
||||
[JsonIgnore()]
|
||||
public AbilityInfo? MazeAtk { get; set; }
|
||||
|
||||
public override int GetId()
|
||||
{
|
||||
return AvatarID;
|
||||
@@ -30,6 +41,14 @@ namespace EggLink.DanhengServer.Data.Excel
|
||||
{
|
||||
GameData.AvatarConfigData.Add(AvatarID, this);
|
||||
RankUpItemId = AvatarID + 10000;
|
||||
|
||||
var regex = new Regex(@"(?<=Avatar_)(.*?)(?=_Config)");
|
||||
var match = regex.Match(JsonPath??"");
|
||||
if (match.Success)
|
||||
{
|
||||
NameKey = match.Value;
|
||||
}
|
||||
JsonPath = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
35
Common/Data/Excel/MazeBuffExcel.cs
Normal file
35
Common/Data/Excel/MazeBuffExcel.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using EggLink.DanhengServer.Proto;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EggLink.DanhengServer.Data.Excel
|
||||
{
|
||||
[ResourceEntity("MazeBuff.json")]
|
||||
public class MazeBuffExcel : ExcelResource
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public int Lv { get; set; }
|
||||
|
||||
public override int GetId()
|
||||
{
|
||||
return ID * 10 + Lv;
|
||||
}
|
||||
|
||||
public override void Loaded()
|
||||
{
|
||||
GameData.MazeBuffData.Add(GetId(), this);
|
||||
}
|
||||
|
||||
public BattleBuff ToProto()
|
||||
{
|
||||
return new BattleBuff()
|
||||
{
|
||||
Id = (uint)ID,
|
||||
Level = (uint)Lv,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
28
Common/Data/Excel/MessageContactsConfigExcel.cs
Normal file
28
Common/Data/Excel/MessageContactsConfigExcel.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EggLink.DanhengServer.Data.Excel
|
||||
{
|
||||
[ResourceEntity("MessageContactsConfig.json")]
|
||||
public class MessageContactsConfigExcel : ExcelResource
|
||||
{
|
||||
public int ID { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public List<MessageGroupConfigExcel> Groups { get; set; } = [];
|
||||
|
||||
public override int GetId()
|
||||
{
|
||||
return ID;
|
||||
}
|
||||
|
||||
public override void Loaded()
|
||||
{
|
||||
GameData.MessageContactsConfigData.Add(ID, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
39
Common/Data/Excel/MessageGroupConfigExcel.cs
Normal file
39
Common/Data/Excel/MessageGroupConfigExcel.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EggLink.DanhengServer.Data.Excel
|
||||
{
|
||||
[ResourceEntity("MessageGroupConfig.json")]
|
||||
public class MessageGroupConfigExcel : ExcelResource
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public int MessageContactsID { get; set; }
|
||||
public List<int> MessageSectionIDList { get; set; } = [];
|
||||
|
||||
public override int GetId()
|
||||
{
|
||||
return ID;
|
||||
}
|
||||
|
||||
public override void Loaded()
|
||||
{
|
||||
GameData.MessageGroupConfigData.Add(ID, this);
|
||||
}
|
||||
|
||||
public override void AfterAllDone()
|
||||
{
|
||||
GameData.MessageContactsConfigData[MessageContactsID].Groups.Add(this);
|
||||
MessageSectionIDList.ForEach(m =>
|
||||
{
|
||||
GameData.MessageSectionConfigData.TryGetValue(m, out var section);
|
||||
if (section != null)
|
||||
{
|
||||
section.GroupID = ID;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
39
Common/Data/Excel/MessageItemConfigExcel.cs
Normal file
39
Common/Data/Excel/MessageItemConfigExcel.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EggLink.DanhengServer.Data.Excel
|
||||
{
|
||||
[ResourceEntity("MessageItemConfig.json")]
|
||||
public class MessageItemConfigExcel : ExcelResource
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public List<int> NextItemIDList { get; set; } = [];
|
||||
public int SectionID { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public int GroupID { get; set; }
|
||||
|
||||
public override int GetId()
|
||||
{
|
||||
return ID;
|
||||
}
|
||||
|
||||
public override void Loaded()
|
||||
{
|
||||
GameData.MessageItemConfigData.Add(ID, this);
|
||||
}
|
||||
|
||||
public override void AfterAllDone()
|
||||
{
|
||||
if (GameData.MessageSectionConfigData.TryGetValue(SectionID, out MessageSectionConfigExcel? value))
|
||||
{
|
||||
value.Items.Add(this);
|
||||
GroupID = value.GroupID;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
34
Common/Data/Excel/MessageSectionConfigExcel.cs
Normal file
34
Common/Data/Excel/MessageSectionConfigExcel.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EggLink.DanhengServer.Data.Excel
|
||||
{
|
||||
[ResourceEntity("MessageSectionConfig.json")]
|
||||
public class MessageSectionConfigExcel : ExcelResource
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public List<int> StartMessageItemIDList { get; set; } = [];
|
||||
public bool IsPerformMessage { get; set; }
|
||||
public int MainMissionLink { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public List<MessageItemConfigExcel> Items { get; set; } = [];
|
||||
|
||||
[JsonIgnore]
|
||||
public int GroupID { get; set; }
|
||||
|
||||
public override int GetId()
|
||||
{
|
||||
return ID;
|
||||
}
|
||||
|
||||
public override void Loaded()
|
||||
{
|
||||
GameData.MessageSectionConfigData.Add(ID, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
27
Common/Data/Excel/ShopConfigExcel.cs
Normal file
27
Common/Data/Excel/ShopConfigExcel.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EggLink.DanhengServer.Data.Excel
|
||||
{
|
||||
[ResourceEntity("ShopConfig.json")]
|
||||
public class ShopConfigExcel : ExcelResource
|
||||
{
|
||||
public int ShopID { get; set; }
|
||||
public int ShopType { get; set; }
|
||||
|
||||
public List<ShopGoodsConfigExcel> Goods { get; set; } = [];
|
||||
|
||||
public override int GetId()
|
||||
{
|
||||
return ShopID;
|
||||
}
|
||||
|
||||
public override void Loaded()
|
||||
{
|
||||
GameData.ShopConfigData.Add(GetId(), this);
|
||||
}
|
||||
}
|
||||
}
|
||||
50
Common/Data/Excel/ShopGoodsConfigExcel.cs
Normal file
50
Common/Data/Excel/ShopGoodsConfigExcel.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
using EggLink.DanhengServer.Proto;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EggLink.DanhengServer.Data.Excel
|
||||
{
|
||||
[ResourceEntity("ShopGoodsConfig.json")]
|
||||
public class ShopGoodsConfigExcel : ExcelResource
|
||||
{
|
||||
public int GoodsID { get; set; }
|
||||
public int ShopID { get; set; }
|
||||
public int ItemID { get; set; }
|
||||
public int ItemCount { get; set; }
|
||||
public List<int> CurrencyList { get; set; } = [];
|
||||
public List<int> CurrencyCostList { get; set; } = [];
|
||||
|
||||
[JsonIgnore]
|
||||
public Dictionary<int, int> CostList { get; set; } = [];
|
||||
|
||||
public override int GetId()
|
||||
{
|
||||
return GoodsID;
|
||||
}
|
||||
|
||||
public override void Loaded()
|
||||
{
|
||||
for (int i = 0; i < CurrencyList.Count; i++)
|
||||
{
|
||||
CostList.Add(CurrencyList[i], CurrencyCostList[i]);
|
||||
}
|
||||
}
|
||||
|
||||
public override void AfterAllDone()
|
||||
{
|
||||
var shopConfig = GameData.ShopConfigData[ShopID];
|
||||
shopConfig.Goods.Add(this);
|
||||
}
|
||||
|
||||
public Goods ToProto() => new()
|
||||
{
|
||||
EndTime = long.MaxValue,
|
||||
GoodsId = (uint)GoodsID,
|
||||
ItemId = (uint)ItemID,
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -12,11 +12,10 @@ namespace EggLink.DanhengServer.Data
|
||||
public static Dictionary<int, AvatarExpItemConfigExcel> AvatarExpItemConfigData { get; private set; } = [];
|
||||
public static Dictionary<int, AvatarSkillTreeConfigExcel> AvatarSkillTreeConfigData { get; private set; } = [];
|
||||
public static Dictionary<int, ExpTypeExcel> ExpTypeData { get; private set; } = [];
|
||||
|
||||
public static Dictionary<int, CocoonConfigExcel> CocoonConfigData { get; private set; } = [];
|
||||
public static Dictionary<int, StageConfigExcel> StageConfigData { get; private set; } = [];
|
||||
public static Dictionary<int, MapEntranceExcel> MapEntranceData { get; private set; } = [];
|
||||
public static Dictionary<int, MazePlaneExcel> MazePlaneData { get; private set; } = [];
|
||||
public static Dictionary<int, MazePropExcel> MazePropData { get; private set; } = [];
|
||||
public static Dictionary<int, MazeBuffExcel> MazeBuffData { get; private set; } = [];
|
||||
public static Dictionary<int, InteractConfigExcel> InteractConfigData { get; private set; } = [];
|
||||
public static Dictionary<int, NPCMonsterDataExcel> NpcMonsterDataData { get; private set; } = [];
|
||||
public static Dictionary<int, MonsterConfigExcel> MonsterConfigData { get; private set; } = [];
|
||||
@@ -25,6 +24,10 @@ namespace EggLink.DanhengServer.Data
|
||||
public static Dictionary<int, PlayerLevelConfigExcel> PlayerLevelConfigData { get; private set; } = [];
|
||||
|
||||
public static Dictionary<string, FloorInfo> FloorInfoData { get; private set; } = [];
|
||||
public static Dictionary<int, MapEntranceExcel> MapEntranceData { get; private set; } = [];
|
||||
public static Dictionary<int, MazePlaneExcel> MazePlaneData { get; private set; } = [];
|
||||
public static Dictionary<int, MazePropExcel> MazePropData { get; private set; } = [];
|
||||
|
||||
public static Dictionary<int, ItemConfigExcel> ItemConfigData { get; private set; } = [];
|
||||
public static Dictionary<int, EquipmentConfigExcel> EquipmentConfigData { get; private set; } = [];
|
||||
public static Dictionary<int, EquipmentExpTypeExcel> EquipmentExpTypeData { get; private set; } = [];
|
||||
@@ -40,6 +43,12 @@ namespace EggLink.DanhengServer.Data
|
||||
public static Dictionary<int, MainMissionExcel> MainMissionData { get; private set; } = [];
|
||||
public static Dictionary<int, SubMissionExcel> SubMissionData { get; private set; } = [];
|
||||
public static Dictionary<int, RewardDataExcel> RewardDataData { get; private set; } = [];
|
||||
public static Dictionary<int, MessageGroupConfigExcel> MessageGroupConfigData { get; private set; } = [];
|
||||
public static Dictionary<int, MessageSectionConfigExcel> MessageSectionConfigData { get; private set; } = [];
|
||||
public static Dictionary<int, MessageContactsConfigExcel> MessageContactsConfigData { get; private set; } = [];
|
||||
public static Dictionary<int, MessageItemConfigExcel> MessageItemConfigData { get; private set; } = [];
|
||||
|
||||
public static Dictionary<int, ShopConfigExcel> ShopConfigData { get; private set; } = [];
|
||||
|
||||
public static BannersConfig BannersConfig { get; set; } = new();
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ namespace EggLink.DanhengServer.Data
|
||||
LoadExcel();
|
||||
LoadFloorInfo();
|
||||
LoadMissionInfo();
|
||||
LoadMazeSkill();
|
||||
LoadBanner();
|
||||
}
|
||||
|
||||
@@ -242,5 +243,33 @@ namespace EggLink.DanhengServer.Data
|
||||
}
|
||||
Logger.Info("Loaded " + GameData.BannersConfig.Banners.Count + " banner infos.");
|
||||
}
|
||||
|
||||
public static void LoadMazeSkill()
|
||||
{
|
||||
var count = 0;
|
||||
foreach (var avatar in GameData.AvatarConfigData.Values)
|
||||
{
|
||||
var path = ConfigManager.Config.Path.ResourcePath + "/Config/ConfigAdventureAbility/LocalPlayer/LocalPlayer_" + avatar.NameKey + "_Ability.json";
|
||||
var file = new FileInfo(path);
|
||||
if (!file.Exists) continue;
|
||||
try
|
||||
{
|
||||
using var reader = file.OpenRead();
|
||||
using StreamReader reader2 = new(reader);
|
||||
var text = reader2.ReadToEnd().Replace("$type", "Type");
|
||||
var skillAbilityInfo = JsonConvert.DeserializeObject<SkillAbilityInfo>(text);
|
||||
skillAbilityInfo?.Loaded(avatar);
|
||||
count += skillAbilityInfo == null ? 0 : 1;
|
||||
} catch (Exception ex)
|
||||
{
|
||||
Logger.Error("Error in reading" + file.Name, ex);
|
||||
}
|
||||
}
|
||||
if (count < GameData.AvatarConfigData.Count)
|
||||
{
|
||||
Logger.Warn("Maze skill infos are missing, please check your resources folder: " + ConfigManager.Config.Path.ResourcePath + "/Config/ConfigAdventureAbility/LocalPlayer. Maze skills may not work!");
|
||||
}
|
||||
Logger.Info("Loaded " + count + " maze skill infos.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,8 +12,8 @@ namespace EggLink.DanhengServer.Database.Avatar
|
||||
[SugarTable("Avatar")]
|
||||
public class AvatarData : BaseDatabaseData
|
||||
{
|
||||
[SugarColumn(IsNullable = true, IsJson = true)]
|
||||
public List<AvatarInfo>? Avatars { get; set; }
|
||||
[SugarColumn(IsJson = true)]
|
||||
public List<AvatarInfo> Avatars { get; set; } = [];
|
||||
|
||||
[SugarColumn(IsJson = true)]
|
||||
public List<int> AssistAvatars { get; set; } = [];
|
||||
|
||||
@@ -82,6 +82,18 @@ namespace EggLink.DanhengServer.Database
|
||||
}
|
||||
}
|
||||
|
||||
public T GetInstanceOrCreateNew<T>(int uid) where T : class, new()
|
||||
{
|
||||
var instance = GetInstance<T>(uid);
|
||||
if (instance == null)
|
||||
{
|
||||
instance = new();
|
||||
(instance as BaseDatabaseData)!.Uid = uid;
|
||||
SaveInstance(instance);
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
public List<T>? GetAllInstance<T>() where T : class, new()
|
||||
{
|
||||
try
|
||||
|
||||
@@ -15,6 +15,7 @@ namespace EggLink.DanhengServer.Database.Gacha
|
||||
public bool LastAvatarGachaFailed { get; set; } = false;
|
||||
public bool LastWeaponGachaFailed { get; set; } = false;
|
||||
public int LastGachaFailedCount { get; set; } = 0;
|
||||
public int LastGachaPurpleFailedCount { get; set; } = 0;
|
||||
}
|
||||
|
||||
public class GachaInfo
|
||||
|
||||
39
Common/Database/Message/MessageData.cs
Normal file
39
Common/Database/Message/MessageData.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using EggLink.DanhengServer.Proto;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EggLink.DanhengServer.Database.Message
|
||||
{
|
||||
[SugarTable("Message")]
|
||||
public class MessageData : BaseDatabaseData
|
||||
{
|
||||
[SugarColumn(IsJson = true)]
|
||||
public Dictionary<int, MessageGroupData> Groups { get; set; } = [];
|
||||
}
|
||||
|
||||
public class MessageGroupData
|
||||
{
|
||||
public int GroupId { get; set; }
|
||||
public List<MessageSectionData> Sections { get; set; } = [];
|
||||
public MessageGroupStatus Status { get; set; } = MessageGroupStatus.MessageGroupNone;
|
||||
public long RefreshTime { get; set; }
|
||||
public int CurrentSectionId { get; set; }
|
||||
}
|
||||
|
||||
public class MessageSectionData
|
||||
{
|
||||
public int SectionId { get; set; }
|
||||
public MessageSectionStatus Status { get; set; } = MessageSectionStatus.MessageSectionNone;
|
||||
public List<MessageItemData> Items { get; set; } = [];
|
||||
public List<int> ToChooseItemId { get; set; } = [];
|
||||
}
|
||||
|
||||
public class MessageItemData
|
||||
{
|
||||
public int ItemId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -8,33 +8,33 @@ namespace EggLink.DanhengServer.Database.Player
|
||||
[SugarTable("Player")]
|
||||
public class PlayerData : BaseDatabaseData
|
||||
{
|
||||
public string? Name { get; set; }
|
||||
public string? Signature { get; set; }
|
||||
public int Birthday { get; set; }
|
||||
public int CurBasicType { get; set; }
|
||||
public int HeadIcon { get; set; }
|
||||
public int PhoneTheme { get; set; }
|
||||
public int ChatBubble { get; set; }
|
||||
public int CurrentBgm { get; set; }
|
||||
public Gender? CurrentGender { get; set; }
|
||||
public int Level { get; set; }
|
||||
public int Exp { get; set; }
|
||||
public int WorldLevel { get; set; }
|
||||
public int Scoin { get; set; } // Credits
|
||||
public int Hcoin { get; set; } // Jade
|
||||
public int Mcoin { get; set; } // Crystals
|
||||
public int TalentPoints { get; set; } // Rogue talent points
|
||||
public string? Name { get; set; } = "无名客";
|
||||
public string? Signature { get; set; } = "";
|
||||
public int Birthday { get; set; } = 0;
|
||||
public int CurBasicType { get; set; } = 8001;
|
||||
public int HeadIcon { get; set; } = 208001;
|
||||
public int PhoneTheme { get; set; } = 221000;
|
||||
public int ChatBubble { get; set; } = 222000;
|
||||
public int CurrentBgm { get; set; } = 210000;
|
||||
public Gender CurrentGender { get; set; } = Gender.Man;
|
||||
public int Level { get; set; } = 1;
|
||||
public int Exp { get; set; } = 0;
|
||||
public int WorldLevel { get; set; } = 0;
|
||||
public int Scoin { get; set; } = 0; // Credits
|
||||
public int Hcoin { get; set; } = 0; // Jade
|
||||
public int Mcoin { get; set; } = 0; // Crystals
|
||||
public int TalentPoints { get; set; } = 0; // Rogue talent points
|
||||
|
||||
public int Stamina { get; set; }
|
||||
public double StaminaReserve { get; set; }
|
||||
public long NextStaminaRecover { get; set; }
|
||||
public int Stamina { get; set; } = 240;
|
||||
public double StaminaReserve { get; set; } = 0;
|
||||
public long NextStaminaRecover { get; set; } = 0;
|
||||
|
||||
[SugarColumn(IsNullable = true, IsJson = true)]
|
||||
public Position? Pos { get; set; }
|
||||
[SugarColumn(IsNullable = true, IsJson = true)]
|
||||
public Position? Rot { get; set; }
|
||||
[SugarColumn(IsNullable = true)]
|
||||
public int PlaneId { get; set; }
|
||||
public int PlaneId { get; set; }
|
||||
[SugarColumn(IsNullable = true)]
|
||||
public int FloorId { get; set; }
|
||||
[SugarColumn(IsNullable = true)]
|
||||
|
||||
21
Common/Enums/TaskTypeEnum.cs
Normal file
21
Common/Enums/TaskTypeEnum.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EggLink.DanhengServer.Enums
|
||||
{
|
||||
public enum TaskTypeEnum
|
||||
{
|
||||
None = 0,
|
||||
AddMazeBuff = 1,
|
||||
RemoveMazeBuff = 2,
|
||||
AdventureModifyTeamPlayerHP = 3,
|
||||
AdventureModifyTeamPlayerSP = 4,
|
||||
CreateSummonUnit = 5,
|
||||
AdventureSetAttackTargetMonsterDie = 6,
|
||||
AdventureTriggerAttack = 7,
|
||||
AdventureFireProjectile = 8,
|
||||
}
|
||||
}
|
||||
@@ -25,13 +25,13 @@ namespace EggLink.DanhengServer.Proto {
|
||||
byte[] descriptorData = global::System.Convert.FromBase64String(
|
||||
string.Concat(
|
||||
"Ch1HZXROcGNNZXNzYWdlR3JvdXBTY1JzcC5wcm90bxoSTWVzc2FnZUdyb3Vw",
|
||||
"LnByb3RvIk4KF0dldE5wY01lc3NhZ2VHcm91cFNjUnNwEg8KB3JldGNvZGUY",
|
||||
"AyABKA0SIgoLUEpNSEtESkFQQkoYByADKAsyDS5NZXNzYWdlR3JvdXBCHqoC",
|
||||
"G0VnZ0xpbmsuRGFuaGVuZ1NlcnZlci5Qcm90b2IGcHJvdG8z"));
|
||||
"LnByb3RvIlAKF0dldE5wY01lc3NhZ2VHcm91cFNjUnNwEg8KB3JldGNvZGUY",
|
||||
"AyABKA0SJAoNbWVzc2FnZV9ncm91cBgHIAMoCzINLk1lc3NhZ2VHcm91cEIe",
|
||||
"qgIbRWdnTGluay5EYW5oZW5nU2VydmVyLlByb3RvYgZwcm90bzM="));
|
||||
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
|
||||
new pbr::FileDescriptor[] { global::EggLink.DanhengServer.Proto.MessageGroupReflection.Descriptor, },
|
||||
new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
|
||||
new pbr::GeneratedClrTypeInfo(typeof(global::EggLink.DanhengServer.Proto.GetNpcMessageGroupScRsp), global::EggLink.DanhengServer.Proto.GetNpcMessageGroupScRsp.Parser, new[]{ "Retcode", "PJMHKDJAPBJ" }, null, null, null, null)
|
||||
new pbr::GeneratedClrTypeInfo(typeof(global::EggLink.DanhengServer.Proto.GetNpcMessageGroupScRsp), global::EggLink.DanhengServer.Proto.GetNpcMessageGroupScRsp.Parser, new[]{ "Retcode", "MessageGroup" }, null, null, null, null)
|
||||
}));
|
||||
}
|
||||
#endregion
|
||||
@@ -74,7 +74,7 @@ namespace EggLink.DanhengServer.Proto {
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public GetNpcMessageGroupScRsp(GetNpcMessageGroupScRsp other) : this() {
|
||||
retcode_ = other.retcode_;
|
||||
pJMHKDJAPBJ_ = other.pJMHKDJAPBJ_.Clone();
|
||||
messageGroup_ = other.messageGroup_.Clone();
|
||||
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
|
||||
}
|
||||
|
||||
@@ -96,15 +96,15 @@ namespace EggLink.DanhengServer.Proto {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Field number for the "PJMHKDJAPBJ" field.</summary>
|
||||
public const int PJMHKDJAPBJFieldNumber = 7;
|
||||
private static readonly pb::FieldCodec<global::EggLink.DanhengServer.Proto.MessageGroup> _repeated_pJMHKDJAPBJ_codec
|
||||
/// <summary>Field number for the "message_group" field.</summary>
|
||||
public const int MessageGroupFieldNumber = 7;
|
||||
private static readonly pb::FieldCodec<global::EggLink.DanhengServer.Proto.MessageGroup> _repeated_messageGroup_codec
|
||||
= pb::FieldCodec.ForMessage(58, global::EggLink.DanhengServer.Proto.MessageGroup.Parser);
|
||||
private readonly pbc::RepeatedField<global::EggLink.DanhengServer.Proto.MessageGroup> pJMHKDJAPBJ_ = new pbc::RepeatedField<global::EggLink.DanhengServer.Proto.MessageGroup>();
|
||||
private readonly pbc::RepeatedField<global::EggLink.DanhengServer.Proto.MessageGroup> messageGroup_ = new pbc::RepeatedField<global::EggLink.DanhengServer.Proto.MessageGroup>();
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public pbc::RepeatedField<global::EggLink.DanhengServer.Proto.MessageGroup> PJMHKDJAPBJ {
|
||||
get { return pJMHKDJAPBJ_; }
|
||||
public pbc::RepeatedField<global::EggLink.DanhengServer.Proto.MessageGroup> MessageGroup {
|
||||
get { return messageGroup_; }
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
@@ -123,7 +123,7 @@ namespace EggLink.DanhengServer.Proto {
|
||||
return true;
|
||||
}
|
||||
if (Retcode != other.Retcode) return false;
|
||||
if(!pJMHKDJAPBJ_.Equals(other.pJMHKDJAPBJ_)) return false;
|
||||
if(!messageGroup_.Equals(other.messageGroup_)) return false;
|
||||
return Equals(_unknownFields, other._unknownFields);
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ namespace EggLink.DanhengServer.Proto {
|
||||
public override int GetHashCode() {
|
||||
int hash = 1;
|
||||
if (Retcode != 0) hash ^= Retcode.GetHashCode();
|
||||
hash ^= pJMHKDJAPBJ_.GetHashCode();
|
||||
hash ^= messageGroup_.GetHashCode();
|
||||
if (_unknownFields != null) {
|
||||
hash ^= _unknownFields.GetHashCode();
|
||||
}
|
||||
@@ -155,7 +155,7 @@ namespace EggLink.DanhengServer.Proto {
|
||||
output.WriteRawTag(24);
|
||||
output.WriteUInt32(Retcode);
|
||||
}
|
||||
pJMHKDJAPBJ_.WriteTo(output, _repeated_pJMHKDJAPBJ_codec);
|
||||
messageGroup_.WriteTo(output, _repeated_messageGroup_codec);
|
||||
if (_unknownFields != null) {
|
||||
_unknownFields.WriteTo(output);
|
||||
}
|
||||
@@ -170,7 +170,7 @@ namespace EggLink.DanhengServer.Proto {
|
||||
output.WriteRawTag(24);
|
||||
output.WriteUInt32(Retcode);
|
||||
}
|
||||
pJMHKDJAPBJ_.WriteTo(ref output, _repeated_pJMHKDJAPBJ_codec);
|
||||
messageGroup_.WriteTo(ref output, _repeated_messageGroup_codec);
|
||||
if (_unknownFields != null) {
|
||||
_unknownFields.WriteTo(ref output);
|
||||
}
|
||||
@@ -184,7 +184,7 @@ namespace EggLink.DanhengServer.Proto {
|
||||
if (Retcode != 0) {
|
||||
size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Retcode);
|
||||
}
|
||||
size += pJMHKDJAPBJ_.CalculateSize(_repeated_pJMHKDJAPBJ_codec);
|
||||
size += messageGroup_.CalculateSize(_repeated_messageGroup_codec);
|
||||
if (_unknownFields != null) {
|
||||
size += _unknownFields.CalculateSize();
|
||||
}
|
||||
@@ -200,7 +200,7 @@ namespace EggLink.DanhengServer.Proto {
|
||||
if (other.Retcode != 0) {
|
||||
Retcode = other.Retcode;
|
||||
}
|
||||
pJMHKDJAPBJ_.Add(other.pJMHKDJAPBJ_);
|
||||
messageGroup_.Add(other.messageGroup_);
|
||||
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
|
||||
}
|
||||
|
||||
@@ -221,7 +221,7 @@ namespace EggLink.DanhengServer.Proto {
|
||||
break;
|
||||
}
|
||||
case 58: {
|
||||
pJMHKDJAPBJ_.AddEntriesFrom(input, _repeated_pJMHKDJAPBJ_codec);
|
||||
messageGroup_.AddEntriesFrom(input, _repeated_messageGroup_codec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -244,7 +244,7 @@ namespace EggLink.DanhengServer.Proto {
|
||||
break;
|
||||
}
|
||||
case 58: {
|
||||
pJMHKDJAPBJ_.AddEntriesFrom(ref input, _repeated_pJMHKDJAPBJ_codec);
|
||||
messageGroup_.AddEntriesFrom(ref input, _repeated_messageGroup_codec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,16 +24,16 @@ namespace EggLink.DanhengServer.Proto {
|
||||
static MessageSectionReflection() {
|
||||
byte[] descriptorData = global::System.Convert.FromBase64String(
|
||||
string.Concat(
|
||||
"ChRNZXNzYWdlU2VjdGlvbi5wcm90bxoRTWVzc2FnZUl0ZW0ucHJvdG8aGk1l",
|
||||
"c3NhZ2VTZWN0aW9uU3RhdHVzLnByb3RvIpIBCg5NZXNzYWdlU2VjdGlvbhIX",
|
||||
"ChRNZXNzYWdlU2VjdGlvbi5wcm90bxoaTWVzc2FnZVNlY3Rpb25TdGF0dXMu",
|
||||
"cHJvdG8aEU1lc3NhZ2VJdGVtLnByb3RvIpgBCg5NZXNzYWdlU2VjdGlvbhIX",
|
||||
"Cg9tZXNzYWdlX2l0ZW1faWQYCyABKA0SJQoGc3RhdHVzGAQgASgOMhUuTWVz",
|
||||
"c2FnZVNlY3Rpb25TdGF0dXMSEwoLQUJLTEpDTUZBSkkYDSADKA0SHwoJaXRl",
|
||||
"bV9saXN0GAEgAygLMgwuTWVzc2FnZUl0ZW0SCgoCaWQYAyABKA1CHqoCG0Vn",
|
||||
"Z0xpbmsuRGFuaGVuZ1NlcnZlci5Qcm90b2IGcHJvdG8z"));
|
||||
"c2FnZVNlY3Rpb25TdGF0dXMSGQoRdG9fY2hvb3NlX2l0ZW1faWQYDSADKA0S",
|
||||
"HwoJaXRlbV9saXN0GAEgAygLMgwuTWVzc2FnZUl0ZW0SCgoCaWQYAyABKA1C",
|
||||
"HqoCG0VnZ0xpbmsuRGFuaGVuZ1NlcnZlci5Qcm90b2IGcHJvdG8z"));
|
||||
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
|
||||
new pbr::FileDescriptor[] { global::EggLink.DanhengServer.Proto.MessageItemReflection.Descriptor, global::EggLink.DanhengServer.Proto.MessageSectionStatusReflection.Descriptor, },
|
||||
new pbr::FileDescriptor[] { global::EggLink.DanhengServer.Proto.MessageSectionStatusReflection.Descriptor, global::EggLink.DanhengServer.Proto.MessageItemReflection.Descriptor, },
|
||||
new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
|
||||
new pbr::GeneratedClrTypeInfo(typeof(global::EggLink.DanhengServer.Proto.MessageSection), global::EggLink.DanhengServer.Proto.MessageSection.Parser, new[]{ "MessageItemId", "Status", "ABKLJCMFAJI", "ItemList", "Id" }, null, null, null, null)
|
||||
new pbr::GeneratedClrTypeInfo(typeof(global::EggLink.DanhengServer.Proto.MessageSection), global::EggLink.DanhengServer.Proto.MessageSection.Parser, new[]{ "MessageItemId", "Status", "ToChooseItemId", "ItemList", "Id" }, null, null, null, null)
|
||||
}));
|
||||
}
|
||||
#endregion
|
||||
@@ -77,7 +77,7 @@ namespace EggLink.DanhengServer.Proto {
|
||||
public MessageSection(MessageSection other) : this() {
|
||||
messageItemId_ = other.messageItemId_;
|
||||
status_ = other.status_;
|
||||
aBKLJCMFAJI_ = other.aBKLJCMFAJI_.Clone();
|
||||
toChooseItemId_ = other.toChooseItemId_.Clone();
|
||||
itemList_ = other.itemList_.Clone();
|
||||
id_ = other.id_;
|
||||
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
|
||||
@@ -113,15 +113,15 @@ namespace EggLink.DanhengServer.Proto {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Field number for the "ABKLJCMFAJI" field.</summary>
|
||||
public const int ABKLJCMFAJIFieldNumber = 13;
|
||||
private static readonly pb::FieldCodec<uint> _repeated_aBKLJCMFAJI_codec
|
||||
/// <summary>Field number for the "to_choose_item_id" field.</summary>
|
||||
public const int ToChooseItemIdFieldNumber = 13;
|
||||
private static readonly pb::FieldCodec<uint> _repeated_toChooseItemId_codec
|
||||
= pb::FieldCodec.ForUInt32(106);
|
||||
private readonly pbc::RepeatedField<uint> aBKLJCMFAJI_ = new pbc::RepeatedField<uint>();
|
||||
private readonly pbc::RepeatedField<uint> toChooseItemId_ = new pbc::RepeatedField<uint>();
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public pbc::RepeatedField<uint> ABKLJCMFAJI {
|
||||
get { return aBKLJCMFAJI_; }
|
||||
public pbc::RepeatedField<uint> ToChooseItemId {
|
||||
get { return toChooseItemId_; }
|
||||
}
|
||||
|
||||
/// <summary>Field number for the "item_list" field.</summary>
|
||||
@@ -164,7 +164,7 @@ namespace EggLink.DanhengServer.Proto {
|
||||
}
|
||||
if (MessageItemId != other.MessageItemId) return false;
|
||||
if (Status != other.Status) return false;
|
||||
if(!aBKLJCMFAJI_.Equals(other.aBKLJCMFAJI_)) return false;
|
||||
if(!toChooseItemId_.Equals(other.toChooseItemId_)) return false;
|
||||
if(!itemList_.Equals(other.itemList_)) return false;
|
||||
if (Id != other.Id) return false;
|
||||
return Equals(_unknownFields, other._unknownFields);
|
||||
@@ -176,7 +176,7 @@ namespace EggLink.DanhengServer.Proto {
|
||||
int hash = 1;
|
||||
if (MessageItemId != 0) hash ^= MessageItemId.GetHashCode();
|
||||
if (Status != global::EggLink.DanhengServer.Proto.MessageSectionStatus.MessageSectionNone) hash ^= Status.GetHashCode();
|
||||
hash ^= aBKLJCMFAJI_.GetHashCode();
|
||||
hash ^= toChooseItemId_.GetHashCode();
|
||||
hash ^= itemList_.GetHashCode();
|
||||
if (Id != 0) hash ^= Id.GetHashCode();
|
||||
if (_unknownFields != null) {
|
||||
@@ -210,7 +210,7 @@ namespace EggLink.DanhengServer.Proto {
|
||||
output.WriteRawTag(88);
|
||||
output.WriteUInt32(MessageItemId);
|
||||
}
|
||||
aBKLJCMFAJI_.WriteTo(output, _repeated_aBKLJCMFAJI_codec);
|
||||
toChooseItemId_.WriteTo(output, _repeated_toChooseItemId_codec);
|
||||
if (_unknownFields != null) {
|
||||
_unknownFields.WriteTo(output);
|
||||
}
|
||||
@@ -234,7 +234,7 @@ namespace EggLink.DanhengServer.Proto {
|
||||
output.WriteRawTag(88);
|
||||
output.WriteUInt32(MessageItemId);
|
||||
}
|
||||
aBKLJCMFAJI_.WriteTo(ref output, _repeated_aBKLJCMFAJI_codec);
|
||||
toChooseItemId_.WriteTo(ref output, _repeated_toChooseItemId_codec);
|
||||
if (_unknownFields != null) {
|
||||
_unknownFields.WriteTo(ref output);
|
||||
}
|
||||
@@ -251,7 +251,7 @@ namespace EggLink.DanhengServer.Proto {
|
||||
if (Status != global::EggLink.DanhengServer.Proto.MessageSectionStatus.MessageSectionNone) {
|
||||
size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Status);
|
||||
}
|
||||
size += aBKLJCMFAJI_.CalculateSize(_repeated_aBKLJCMFAJI_codec);
|
||||
size += toChooseItemId_.CalculateSize(_repeated_toChooseItemId_codec);
|
||||
size += itemList_.CalculateSize(_repeated_itemList_codec);
|
||||
if (Id != 0) {
|
||||
size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Id);
|
||||
@@ -274,7 +274,7 @@ namespace EggLink.DanhengServer.Proto {
|
||||
if (other.Status != global::EggLink.DanhengServer.Proto.MessageSectionStatus.MessageSectionNone) {
|
||||
Status = other.Status;
|
||||
}
|
||||
aBKLJCMFAJI_.Add(other.aBKLJCMFAJI_);
|
||||
toChooseItemId_.Add(other.toChooseItemId_);
|
||||
itemList_.Add(other.itemList_);
|
||||
if (other.Id != 0) {
|
||||
Id = other.Id;
|
||||
@@ -312,7 +312,7 @@ namespace EggLink.DanhengServer.Proto {
|
||||
}
|
||||
case 106:
|
||||
case 104: {
|
||||
aBKLJCMFAJI_.AddEntriesFrom(input, _repeated_aBKLJCMFAJI_codec);
|
||||
toChooseItemId_.AddEntriesFrom(input, _repeated_toChooseItemId_codec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -348,7 +348,7 @@ namespace EggLink.DanhengServer.Proto {
|
||||
}
|
||||
case 106:
|
||||
case 104: {
|
||||
aBKLJCMFAJI_.AddEntriesFrom(ref input, _repeated_aBKLJCMFAJI_codec);
|
||||
toChooseItemId_.AddEntriesFrom(ref input, _repeated_toChooseItemId_codec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,14 +24,14 @@ namespace EggLink.DanhengServer.Proto {
|
||||
static PlayerSyncScNotifyReflection() {
|
||||
byte[] descriptorData = global::System.Convert.FromBase64String(
|
||||
string.Concat(
|
||||
"ChhQbGF5ZXJTeW5jU2NOb3RpZnkucHJvdG8aFVdhaXREZWxSZXNvdXJjZS5w",
|
||||
"cm90bxoLUmVsaWMucHJvdG8aE1NlY3Rpb25TdGF0dXMucHJvdG8aEEF2YXRh",
|
||||
"clN5bmMucHJvdG8aG1BsYXllckJvYXJkTW9kdWxlU3luYy5wcm90bxoRTWlz",
|
||||
"c2lvblN5bmMucHJvdG8aEUdyb3VwU3RhdHVzLnByb3RvGgtRdWVzdC5wcm90",
|
||||
"bxoWTWlzc2lvbkV2ZW50U3luYy5wcm90bxodUGxheWVySGVyb0Jhc2ljVHlw",
|
||||
"ZUluZm8ucHJvdG8aEUxKSUNKTU1IQkJCLnByb3RvGg9FcXVpcG1lbnQucHJv",
|
||||
"dG8aDkl0ZW1MaXN0LnByb3RvGg5NYXRlcmlhbC5wcm90bxoVUGxheWVyQmFz",
|
||||
"aWNJbmZvLnByb3RvGhFCYXNpY01vZHVsZS5wcm90byKGBgoSUGxheWVyU3lu",
|
||||
"ChhQbGF5ZXJTeW5jU2NOb3RpZnkucHJvdG8aFk1pc3Npb25FdmVudFN5bmMu",
|
||||
"cHJvdG8aEUdyb3VwU3RhdHVzLnByb3RvGhVXYWl0RGVsUmVzb3VyY2UucHJv",
|
||||
"dG8aC1JlbGljLnByb3RvGhBBdmF0YXJTeW5jLnByb3RvGhFMSklDSk1NSEJC",
|
||||
"Qi5wcm90bxoVUGxheWVyQmFzaWNJbmZvLnByb3RvGgtRdWVzdC5wcm90bxod",
|
||||
"UGxheWVySGVyb0Jhc2ljVHlwZUluZm8ucHJvdG8aDkl0ZW1MaXN0LnByb3Rv",
|
||||
"GhNTZWN0aW9uU3RhdHVzLnByb3RvGg5NYXRlcmlhbC5wcm90bxobUGxheWVy",
|
||||
"Qm9hcmRNb2R1bGVTeW5jLnByb3RvGhFCYXNpY01vZHVsZS5wcm90bxoRTWlz",
|
||||
"c2lvblN5bmMucHJvdG8aD0VxdWlwbWVudC5wcm90byKSBgoSUGxheWVyU3lu",
|
||||
"Y1NjTm90aWZ5EjAKD2JvYXJkX2RhdGFfc3luYxjgAyABKAsyFi5QbGF5ZXJC",
|
||||
"b2FyZE1vZHVsZVN5bmMSFAoLTlBHUE1LSkROSEkYvwsgAygNEiIKC0ZPR0FC",
|
||||
"R0hQTkFFGM0CIAMoCzIMLkxKSUNKTU1IQkJCEiAKC2F2YXRhcl9zeW5jGAsg",
|
||||
@@ -41,19 +41,20 @@ namespace EggLink.DanhengServer.Proto {
|
||||
"b3VyY2VfbGlzdBgJIAMoCzIQLldhaXREZWxSZXNvdXJjZRIiCg5lcXVpcG1l",
|
||||
"bnRfbGlzdBgEIAMoCzIKLkVxdWlwbWVudBIiCgxtaXNzaW9uX3N5bmMYCCAB",
|
||||
"KAsyDC5NaXNzaW9uU3luYxIfCgtJRkFMUEFFR0pOTRjzByADKAsyCS5NYXRl",
|
||||
"cmlhbBIkCgtPSklES0dETEpDRhjUBiADKAsyDi5TZWN0aW9uU3RhdHVzEiEK",
|
||||
"C0lNSkFERkVFTU5FGAYgASgLMgwuQmFzaWNNb2R1bGUSGgoKcmVsaWNfbGlz",
|
||||
"dBgOIAMoCzIGLlJlbGljEh8KC09LRUxMUE1JT0RFGO4FIAEoCzIJLkl0ZW1M",
|
||||
"aXN0EiIKC09IQ0hGSUdPR0tBGNoBIAMoCzIMLkdyb3VwU3RhdHVzEiQKCmJh",
|
||||
"c2ljX2luZm8YDyABKAsyEC5QbGF5ZXJCYXNpY0luZm8SIAoNbWF0ZXJpYWxf",
|
||||
"bGlzdBgMIAMoCzIJLk1hdGVyaWFsEhoKCnF1ZXN0X2xpc3QYAiADKAsyBi5R",
|
||||
"dWVzdBIeChV0b3RhbF9hY2hpZXZlbWVudF9leHAYng4gASgNEhYKDmRlbF9y",
|
||||
"ZWxpY19saXN0GA0gAygNEhoKEmRlbF9lcXVpcG1lbnRfbGlzdBgHIAMoDUIe",
|
||||
"qgIbRWdnTGluay5EYW5oZW5nU2VydmVyLlByb3RvYgZwcm90bzM="));
|
||||
"cmlhbBInCg5zZWN0aW9uX3N0YXR1cxjUBiADKAsyDi5TZWN0aW9uU3RhdHVz",
|
||||
"EiEKC0lNSkFERkVFTU5FGAYgASgLMgwuQmFzaWNNb2R1bGUSGgoKcmVsaWNf",
|
||||
"bGlzdBgOIAMoCzIGLlJlbGljEh8KC09LRUxMUE1JT0RFGO4FIAEoCzIJLkl0",
|
||||
"ZW1MaXN0EisKFG1lc3NhZ2VfZ3JvdXBfc3RhdHVzGNoBIAMoCzIMLkdyb3Vw",
|
||||
"U3RhdHVzEiQKCmJhc2ljX2luZm8YDyABKAsyEC5QbGF5ZXJCYXNpY0luZm8S",
|
||||
"IAoNbWF0ZXJpYWxfbGlzdBgMIAMoCzIJLk1hdGVyaWFsEhoKCnF1ZXN0X2xp",
|
||||
"c3QYAiADKAsyBi5RdWVzdBIeChV0b3RhbF9hY2hpZXZlbWVudF9leHAYng4g",
|
||||
"ASgNEhYKDmRlbF9yZWxpY19saXN0GA0gAygNEhoKEmRlbF9lcXVpcG1lbnRf",
|
||||
"bGlzdBgHIAMoDUIeqgIbRWdnTGluay5EYW5oZW5nU2VydmVyLlByb3RvYgZw",
|
||||
"cm90bzM="));
|
||||
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
|
||||
new pbr::FileDescriptor[] { global::EggLink.DanhengServer.Proto.WaitDelResourceReflection.Descriptor, global::EggLink.DanhengServer.Proto.RelicReflection.Descriptor, global::EggLink.DanhengServer.Proto.SectionStatusReflection.Descriptor, global::EggLink.DanhengServer.Proto.AvatarSyncReflection.Descriptor, global::EggLink.DanhengServer.Proto.PlayerBoardModuleSyncReflection.Descriptor, global::EggLink.DanhengServer.Proto.MissionSyncReflection.Descriptor, global::EggLink.DanhengServer.Proto.GroupStatusReflection.Descriptor, global::EggLink.DanhengServer.Proto.QuestReflection.Descriptor, global::EggLink.DanhengServer.Proto.MissionEventSyncReflection.Descriptor, global::EggLink.DanhengServer.Proto.PlayerHeroBasicTypeInfoReflection.Descriptor, global::EggLink.DanhengServer.Proto.LJICJMMHBBBReflection.Descriptor, global::EggLink.DanhengServer.Proto.EquipmentReflection.Descriptor, global::EggLink.DanhengServer.Proto.ItemListReflection.Descriptor, global::EggLink.DanhengServer.Proto.MaterialReflection.Descriptor, global::EggLink.DanhengServer.Proto.PlayerBasicInfoReflection.Descriptor, global::EggLink.DanhengServer.Proto.BasicModuleReflection.Descriptor, },
|
||||
new pbr::FileDescriptor[] { global::EggLink.DanhengServer.Proto.MissionEventSyncReflection.Descriptor, global::EggLink.DanhengServer.Proto.GroupStatusReflection.Descriptor, global::EggLink.DanhengServer.Proto.WaitDelResourceReflection.Descriptor, global::EggLink.DanhengServer.Proto.RelicReflection.Descriptor, global::EggLink.DanhengServer.Proto.AvatarSyncReflection.Descriptor, global::EggLink.DanhengServer.Proto.LJICJMMHBBBReflection.Descriptor, global::EggLink.DanhengServer.Proto.PlayerBasicInfoReflection.Descriptor, global::EggLink.DanhengServer.Proto.QuestReflection.Descriptor, global::EggLink.DanhengServer.Proto.PlayerHeroBasicTypeInfoReflection.Descriptor, global::EggLink.DanhengServer.Proto.ItemListReflection.Descriptor, global::EggLink.DanhengServer.Proto.SectionStatusReflection.Descriptor, global::EggLink.DanhengServer.Proto.MaterialReflection.Descriptor, global::EggLink.DanhengServer.Proto.PlayerBoardModuleSyncReflection.Descriptor, global::EggLink.DanhengServer.Proto.BasicModuleReflection.Descriptor, global::EggLink.DanhengServer.Proto.MissionSyncReflection.Descriptor, global::EggLink.DanhengServer.Proto.EquipmentReflection.Descriptor, },
|
||||
new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
|
||||
new pbr::GeneratedClrTypeInfo(typeof(global::EggLink.DanhengServer.Proto.PlayerSyncScNotify), global::EggLink.DanhengServer.Proto.PlayerSyncScNotify.Parser, new[]{ "BoardDataSync", "NPGPMKJDNHI", "FOGABGHPNAE", "AvatarSync", "BasicTypeInfoList", "MissionEventSync", "WaitDelResourceList", "EquipmentList", "MissionSync", "IFALPAEGJNM", "OJIDKGDLJCF", "IMJADFEEMNE", "RelicList", "OKELLPMIODE", "OHCHFIGOGKA", "BasicInfo", "MaterialList", "QuestList", "TotalAchievementExp", "DelRelicList", "DelEquipmentList" }, null, null, null, null)
|
||||
new pbr::GeneratedClrTypeInfo(typeof(global::EggLink.DanhengServer.Proto.PlayerSyncScNotify), global::EggLink.DanhengServer.Proto.PlayerSyncScNotify.Parser, new[]{ "BoardDataSync", "NPGPMKJDNHI", "FOGABGHPNAE", "AvatarSync", "BasicTypeInfoList", "MissionEventSync", "WaitDelResourceList", "EquipmentList", "MissionSync", "IFALPAEGJNM", "SectionStatus", "IMJADFEEMNE", "RelicList", "OKELLPMIODE", "MessageGroupStatus", "BasicInfo", "MaterialList", "QuestList", "TotalAchievementExp", "DelRelicList", "DelEquipmentList" }, null, null, null, null)
|
||||
}));
|
||||
}
|
||||
#endregion
|
||||
@@ -105,11 +106,11 @@ namespace EggLink.DanhengServer.Proto {
|
||||
equipmentList_ = other.equipmentList_.Clone();
|
||||
missionSync_ = other.missionSync_ != null ? other.missionSync_.Clone() : null;
|
||||
iFALPAEGJNM_ = other.iFALPAEGJNM_.Clone();
|
||||
oJIDKGDLJCF_ = other.oJIDKGDLJCF_.Clone();
|
||||
sectionStatus_ = other.sectionStatus_.Clone();
|
||||
iMJADFEEMNE_ = other.iMJADFEEMNE_ != null ? other.iMJADFEEMNE_.Clone() : null;
|
||||
relicList_ = other.relicList_.Clone();
|
||||
oKELLPMIODE_ = other.oKELLPMIODE_ != null ? other.oKELLPMIODE_.Clone() : null;
|
||||
oHCHFIGOGKA_ = other.oHCHFIGOGKA_.Clone();
|
||||
messageGroupStatus_ = other.messageGroupStatus_.Clone();
|
||||
basicInfo_ = other.basicInfo_ != null ? other.basicInfo_.Clone() : null;
|
||||
materialList_ = other.materialList_.Clone();
|
||||
questList_ = other.questList_.Clone();
|
||||
@@ -239,15 +240,15 @@ namespace EggLink.DanhengServer.Proto {
|
||||
get { return iFALPAEGJNM_; }
|
||||
}
|
||||
|
||||
/// <summary>Field number for the "OJIDKGDLJCF" field.</summary>
|
||||
public const int OJIDKGDLJCFFieldNumber = 852;
|
||||
private static readonly pb::FieldCodec<global::EggLink.DanhengServer.Proto.SectionStatus> _repeated_oJIDKGDLJCF_codec
|
||||
/// <summary>Field number for the "section_status" field.</summary>
|
||||
public const int SectionStatusFieldNumber = 852;
|
||||
private static readonly pb::FieldCodec<global::EggLink.DanhengServer.Proto.SectionStatus> _repeated_sectionStatus_codec
|
||||
= pb::FieldCodec.ForMessage(6818, global::EggLink.DanhengServer.Proto.SectionStatus.Parser);
|
||||
private readonly pbc::RepeatedField<global::EggLink.DanhengServer.Proto.SectionStatus> oJIDKGDLJCF_ = new pbc::RepeatedField<global::EggLink.DanhengServer.Proto.SectionStatus>();
|
||||
private readonly pbc::RepeatedField<global::EggLink.DanhengServer.Proto.SectionStatus> sectionStatus_ = new pbc::RepeatedField<global::EggLink.DanhengServer.Proto.SectionStatus>();
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public pbc::RepeatedField<global::EggLink.DanhengServer.Proto.SectionStatus> OJIDKGDLJCF {
|
||||
get { return oJIDKGDLJCF_; }
|
||||
public pbc::RepeatedField<global::EggLink.DanhengServer.Proto.SectionStatus> SectionStatus {
|
||||
get { return sectionStatus_; }
|
||||
}
|
||||
|
||||
/// <summary>Field number for the "IMJADFEEMNE" field.</summary>
|
||||
@@ -285,15 +286,15 @@ namespace EggLink.DanhengServer.Proto {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Field number for the "OHCHFIGOGKA" field.</summary>
|
||||
public const int OHCHFIGOGKAFieldNumber = 218;
|
||||
private static readonly pb::FieldCodec<global::EggLink.DanhengServer.Proto.GroupStatus> _repeated_oHCHFIGOGKA_codec
|
||||
/// <summary>Field number for the "message_group_status" field.</summary>
|
||||
public const int MessageGroupStatusFieldNumber = 218;
|
||||
private static readonly pb::FieldCodec<global::EggLink.DanhengServer.Proto.GroupStatus> _repeated_messageGroupStatus_codec
|
||||
= pb::FieldCodec.ForMessage(1746, global::EggLink.DanhengServer.Proto.GroupStatus.Parser);
|
||||
private readonly pbc::RepeatedField<global::EggLink.DanhengServer.Proto.GroupStatus> oHCHFIGOGKA_ = new pbc::RepeatedField<global::EggLink.DanhengServer.Proto.GroupStatus>();
|
||||
private readonly pbc::RepeatedField<global::EggLink.DanhengServer.Proto.GroupStatus> messageGroupStatus_ = new pbc::RepeatedField<global::EggLink.DanhengServer.Proto.GroupStatus>();
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public pbc::RepeatedField<global::EggLink.DanhengServer.Proto.GroupStatus> OHCHFIGOGKA {
|
||||
get { return oHCHFIGOGKA_; }
|
||||
public pbc::RepeatedField<global::EggLink.DanhengServer.Proto.GroupStatus> MessageGroupStatus {
|
||||
get { return messageGroupStatus_; }
|
||||
}
|
||||
|
||||
/// <summary>Field number for the "basic_info" field.</summary>
|
||||
@@ -389,11 +390,11 @@ namespace EggLink.DanhengServer.Proto {
|
||||
if(!equipmentList_.Equals(other.equipmentList_)) return false;
|
||||
if (!object.Equals(MissionSync, other.MissionSync)) return false;
|
||||
if(!iFALPAEGJNM_.Equals(other.iFALPAEGJNM_)) return false;
|
||||
if(!oJIDKGDLJCF_.Equals(other.oJIDKGDLJCF_)) return false;
|
||||
if(!sectionStatus_.Equals(other.sectionStatus_)) return false;
|
||||
if (!object.Equals(IMJADFEEMNE, other.IMJADFEEMNE)) return false;
|
||||
if(!relicList_.Equals(other.relicList_)) return false;
|
||||
if (!object.Equals(OKELLPMIODE, other.OKELLPMIODE)) return false;
|
||||
if(!oHCHFIGOGKA_.Equals(other.oHCHFIGOGKA_)) return false;
|
||||
if(!messageGroupStatus_.Equals(other.messageGroupStatus_)) return false;
|
||||
if (!object.Equals(BasicInfo, other.BasicInfo)) return false;
|
||||
if(!materialList_.Equals(other.materialList_)) return false;
|
||||
if(!questList_.Equals(other.questList_)) return false;
|
||||
@@ -417,11 +418,11 @@ namespace EggLink.DanhengServer.Proto {
|
||||
hash ^= equipmentList_.GetHashCode();
|
||||
if (missionSync_ != null) hash ^= MissionSync.GetHashCode();
|
||||
hash ^= iFALPAEGJNM_.GetHashCode();
|
||||
hash ^= oJIDKGDLJCF_.GetHashCode();
|
||||
hash ^= sectionStatus_.GetHashCode();
|
||||
if (iMJADFEEMNE_ != null) hash ^= IMJADFEEMNE.GetHashCode();
|
||||
hash ^= relicList_.GetHashCode();
|
||||
if (oKELLPMIODE_ != null) hash ^= OKELLPMIODE.GetHashCode();
|
||||
hash ^= oHCHFIGOGKA_.GetHashCode();
|
||||
hash ^= messageGroupStatus_.GetHashCode();
|
||||
if (basicInfo_ != null) hash ^= BasicInfo.GetHashCode();
|
||||
hash ^= materialList_.GetHashCode();
|
||||
hash ^= questList_.GetHashCode();
|
||||
@@ -474,7 +475,7 @@ namespace EggLink.DanhengServer.Proto {
|
||||
output.WriteRawTag(122);
|
||||
output.WriteMessage(BasicInfo);
|
||||
}
|
||||
oHCHFIGOGKA_.WriteTo(output, _repeated_oHCHFIGOGKA_codec);
|
||||
messageGroupStatus_.WriteTo(output, _repeated_messageGroupStatus_codec);
|
||||
fOGABGHPNAE_.WriteTo(output, _repeated_fOGABGHPNAE_codec);
|
||||
if (boardDataSync_ != null) {
|
||||
output.WriteRawTag(130, 30);
|
||||
@@ -484,7 +485,7 @@ namespace EggLink.DanhengServer.Proto {
|
||||
output.WriteRawTag(242, 46);
|
||||
output.WriteMessage(OKELLPMIODE);
|
||||
}
|
||||
oJIDKGDLJCF_.WriteTo(output, _repeated_oJIDKGDLJCF_codec);
|
||||
sectionStatus_.WriteTo(output, _repeated_sectionStatus_codec);
|
||||
iFALPAEGJNM_.WriteTo(output, _repeated_iFALPAEGJNM_codec);
|
||||
nPGPMKJDNHI_.WriteTo(output, _repeated_nPGPMKJDNHI_codec);
|
||||
if (TotalAchievementExp != 0) {
|
||||
@@ -529,7 +530,7 @@ namespace EggLink.DanhengServer.Proto {
|
||||
output.WriteRawTag(122);
|
||||
output.WriteMessage(BasicInfo);
|
||||
}
|
||||
oHCHFIGOGKA_.WriteTo(ref output, _repeated_oHCHFIGOGKA_codec);
|
||||
messageGroupStatus_.WriteTo(ref output, _repeated_messageGroupStatus_codec);
|
||||
fOGABGHPNAE_.WriteTo(ref output, _repeated_fOGABGHPNAE_codec);
|
||||
if (boardDataSync_ != null) {
|
||||
output.WriteRawTag(130, 30);
|
||||
@@ -539,7 +540,7 @@ namespace EggLink.DanhengServer.Proto {
|
||||
output.WriteRawTag(242, 46);
|
||||
output.WriteMessage(OKELLPMIODE);
|
||||
}
|
||||
oJIDKGDLJCF_.WriteTo(ref output, _repeated_oJIDKGDLJCF_codec);
|
||||
sectionStatus_.WriteTo(ref output, _repeated_sectionStatus_codec);
|
||||
iFALPAEGJNM_.WriteTo(ref output, _repeated_iFALPAEGJNM_codec);
|
||||
nPGPMKJDNHI_.WriteTo(ref output, _repeated_nPGPMKJDNHI_codec);
|
||||
if (TotalAchievementExp != 0) {
|
||||
@@ -574,7 +575,7 @@ namespace EggLink.DanhengServer.Proto {
|
||||
size += 1 + pb::CodedOutputStream.ComputeMessageSize(MissionSync);
|
||||
}
|
||||
size += iFALPAEGJNM_.CalculateSize(_repeated_iFALPAEGJNM_codec);
|
||||
size += oJIDKGDLJCF_.CalculateSize(_repeated_oJIDKGDLJCF_codec);
|
||||
size += sectionStatus_.CalculateSize(_repeated_sectionStatus_codec);
|
||||
if (iMJADFEEMNE_ != null) {
|
||||
size += 1 + pb::CodedOutputStream.ComputeMessageSize(IMJADFEEMNE);
|
||||
}
|
||||
@@ -582,7 +583,7 @@ namespace EggLink.DanhengServer.Proto {
|
||||
if (oKELLPMIODE_ != null) {
|
||||
size += 2 + pb::CodedOutputStream.ComputeMessageSize(OKELLPMIODE);
|
||||
}
|
||||
size += oHCHFIGOGKA_.CalculateSize(_repeated_oHCHFIGOGKA_codec);
|
||||
size += messageGroupStatus_.CalculateSize(_repeated_messageGroupStatus_codec);
|
||||
if (basicInfo_ != null) {
|
||||
size += 1 + pb::CodedOutputStream.ComputeMessageSize(BasicInfo);
|
||||
}
|
||||
@@ -635,7 +636,7 @@ namespace EggLink.DanhengServer.Proto {
|
||||
MissionSync.MergeFrom(other.MissionSync);
|
||||
}
|
||||
iFALPAEGJNM_.Add(other.iFALPAEGJNM_);
|
||||
oJIDKGDLJCF_.Add(other.oJIDKGDLJCF_);
|
||||
sectionStatus_.Add(other.sectionStatus_);
|
||||
if (other.iMJADFEEMNE_ != null) {
|
||||
if (iMJADFEEMNE_ == null) {
|
||||
IMJADFEEMNE = new global::EggLink.DanhengServer.Proto.BasicModule();
|
||||
@@ -649,7 +650,7 @@ namespace EggLink.DanhengServer.Proto {
|
||||
}
|
||||
OKELLPMIODE.MergeFrom(other.OKELLPMIODE);
|
||||
}
|
||||
oHCHFIGOGKA_.Add(other.oHCHFIGOGKA_);
|
||||
messageGroupStatus_.Add(other.messageGroupStatus_);
|
||||
if (other.basicInfo_ != null) {
|
||||
if (basicInfo_ == null) {
|
||||
BasicInfo = new global::EggLink.DanhengServer.Proto.PlayerBasicInfo();
|
||||
@@ -748,7 +749,7 @@ namespace EggLink.DanhengServer.Proto {
|
||||
break;
|
||||
}
|
||||
case 1746: {
|
||||
oHCHFIGOGKA_.AddEntriesFrom(input, _repeated_oHCHFIGOGKA_codec);
|
||||
messageGroupStatus_.AddEntriesFrom(input, _repeated_messageGroupStatus_codec);
|
||||
break;
|
||||
}
|
||||
case 2666: {
|
||||
@@ -770,7 +771,7 @@ namespace EggLink.DanhengServer.Proto {
|
||||
break;
|
||||
}
|
||||
case 6818: {
|
||||
oJIDKGDLJCF_.AddEntriesFrom(input, _repeated_oJIDKGDLJCF_codec);
|
||||
sectionStatus_.AddEntriesFrom(input, _repeated_sectionStatus_codec);
|
||||
break;
|
||||
}
|
||||
case 8090: {
|
||||
@@ -871,7 +872,7 @@ namespace EggLink.DanhengServer.Proto {
|
||||
break;
|
||||
}
|
||||
case 1746: {
|
||||
oHCHFIGOGKA_.AddEntriesFrom(ref input, _repeated_oHCHFIGOGKA_codec);
|
||||
messageGroupStatus_.AddEntriesFrom(ref input, _repeated_messageGroupStatus_codec);
|
||||
break;
|
||||
}
|
||||
case 2666: {
|
||||
@@ -893,7 +894,7 @@ namespace EggLink.DanhengServer.Proto {
|
||||
break;
|
||||
}
|
||||
case 6818: {
|
||||
oJIDKGDLJCF_.AddEntriesFrom(ref input, _repeated_oJIDKGDLJCF_codec);
|
||||
sectionStatus_.AddEntriesFrom(ref input, _repeated_sectionStatus_codec);
|
||||
break;
|
||||
}
|
||||
case 8090: {
|
||||
|
||||
21
GameServer/Command/Cmd/CommandReload.cs
Normal file
21
GameServer/Command/Cmd/CommandReload.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using EggLink.DanhengServer.Data;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EggLink.DanhengServer.Command.Cmd
|
||||
{
|
||||
[CommandInfo("reload", "Reload the banners", "/reload")]
|
||||
public class CommandReload : ICommand
|
||||
{
|
||||
[CommandDefault]
|
||||
public void Reload(CommandArg arg)
|
||||
{
|
||||
// Reload the banners
|
||||
ResourceManager.LoadBanner();
|
||||
arg.SendMsg("Banners reloaded");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,28 +11,15 @@ namespace EggLink.DanhengServer.Game.Avatar
|
||||
{
|
||||
public class AvatarManager : BasePlayerManager
|
||||
{
|
||||
public AvatarData? AvatarData { get; private set; }
|
||||
public AvatarData AvatarData { get; private set; }
|
||||
|
||||
public AvatarManager(PlayerInstance player) : base(player)
|
||||
{
|
||||
var avatars = DatabaseHelper.Instance?.GetInstance<AvatarData>(player.Uid);
|
||||
if (avatars == null)
|
||||
AvatarData = DatabaseHelper.Instance!.GetInstanceOrCreateNew<AvatarData>(player.Uid);
|
||||
foreach (var avatar in AvatarData.Avatars)
|
||||
{
|
||||
AvatarData = new()
|
||||
{
|
||||
Uid = player.Uid,
|
||||
Avatars = [],
|
||||
};
|
||||
DatabaseHelper.Instance?.SaveInstance(AvatarData);
|
||||
}
|
||||
else
|
||||
{
|
||||
AvatarData = avatars;
|
||||
foreach (var avatar in AvatarData?.Avatars ?? [])
|
||||
{
|
||||
avatar.PlayerData = player.Data;
|
||||
avatar.Excel = GameData.AvatarConfigData[avatar.AvatarId];
|
||||
}
|
||||
avatar.PlayerData = player.Data;
|
||||
avatar.Excel = GameData.AvatarConfigData[avatar.AvatarId];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,10 +46,6 @@ namespace EggLink.DanhengServer.Game.Avatar
|
||||
avatar.HeroId = avatarId;
|
||||
}
|
||||
|
||||
if (AvatarData?.Avatars == null)
|
||||
{
|
||||
AvatarData!.Avatars = [];
|
||||
}
|
||||
avatar.PlayerData = Player.Data;
|
||||
AvatarData.Avatars.Add(avatar);
|
||||
DatabaseHelper.Instance?.UpdateInstance(AvatarData);
|
||||
@@ -73,12 +56,12 @@ namespace EggLink.DanhengServer.Game.Avatar
|
||||
public AvatarInfo? GetAvatar(int baseAvatarId)
|
||||
{
|
||||
if (baseAvatarId > 8000) baseAvatarId = 8001;
|
||||
return AvatarData?.Avatars?.Find(avatar => avatar.AvatarId == baseAvatarId);
|
||||
return AvatarData.Avatars.Find(avatar => avatar.AvatarId == baseAvatarId);
|
||||
}
|
||||
|
||||
public AvatarInfo? GetHero()
|
||||
{
|
||||
return AvatarData?.Avatars?.Find(avatar => avatar.HeroId > 0);
|
||||
return AvatarData.Avatars.Find(avatar => avatar.HeroId > 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ using EggLink.DanhengServer.Data.Excel;
|
||||
using EggLink.DanhengServer.Database;
|
||||
using EggLink.DanhengServer.Database.Avatar;
|
||||
using EggLink.DanhengServer.Game.Player;
|
||||
using EggLink.DanhengServer.Game.Scene;
|
||||
using EggLink.DanhengServer.Game.Scene.Entity;
|
||||
using EggLink.DanhengServer.Proto;
|
||||
|
||||
@@ -17,11 +18,13 @@ namespace EggLink.DanhengServer.Game.Battle
|
||||
public int MappingInfoId { get; set; }
|
||||
public int RoundLimit { get; set; }
|
||||
public int StageId { get; set; } = stages.Count > 0 ? stages[0].StageID : 0;
|
||||
public int CasterIndex { get; set; }
|
||||
public BattleEndStatus BattleEndStatus { get; set; }
|
||||
|
||||
public List<StageConfigExcel> Stages { get; set; } = stages;
|
||||
public Database.Lineup.LineupInfo Lineup { get; set; } = lineup;
|
||||
public List<EntityMonster> EntityMonsters { get; set; } = new();
|
||||
public List<EntityMonster> EntityMonsters { get; set; } = [];
|
||||
public List<SceneBuff> Buffs { get; set; } = [];
|
||||
|
||||
public BattleInstance(PlayerInstance player, Database.Lineup.LineupInfo lineup, List<EntityMonster> monsters) : this(player, lineup, new List<StageConfigExcel>())
|
||||
{
|
||||
@@ -91,6 +94,7 @@ namespace EggLink.DanhengServer.Game.Battle
|
||||
proto.BattleAvatarList.Add(avatarInstance.ToBattleProto(Player.LineupManager!.GetCurLineup()!, Player.InventoryManager!.Data, avatarType));
|
||||
}
|
||||
|
||||
proto.BuffList.AddRange(Buffs.Select(buff => buff.ToProto(CasterIndex, 1 >> Stages.Count)));
|
||||
return proto;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using EggLink.DanhengServer.Data;
|
||||
using EggLink.DanhengServer.Data.Excel;
|
||||
using EggLink.DanhengServer.Database;
|
||||
using EggLink.DanhengServer.Game.Battle.Skill;
|
||||
using EggLink.DanhengServer.Game.Player;
|
||||
using EggLink.DanhengServer.Game.Scene.Entity;
|
||||
using EggLink.DanhengServer.Proto;
|
||||
@@ -12,14 +13,18 @@ namespace EggLink.DanhengServer.Game.Battle
|
||||
{
|
||||
public class BattleManager(PlayerInstance player) : BasePlayerManager(player)
|
||||
{
|
||||
public void StartBattle(SceneCastSkillCsReq req)
|
||||
public void StartBattle(SceneCastSkillCsReq req, MazeSkill skill, int casterAvatarId)
|
||||
{
|
||||
if (Player.BattleInstance != null) return;
|
||||
var targetList = new List<EntityMonster>();
|
||||
var propList = new List<EntityProp>();
|
||||
if (!skill.TriggerBattle)
|
||||
{
|
||||
Player.SendPacket(new PacketSceneCastSkillScRsp(req.CastEntityId));
|
||||
return;
|
||||
}
|
||||
if (Player.SceneInstance!.AvatarInfo.ContainsKey((int)req.AttackedByEntityId))
|
||||
{
|
||||
|
||||
foreach (var entity in req.HitTargetEntityIdList)
|
||||
{
|
||||
Player.SceneInstance!.Entities.TryGetValue((int)entity, out var entityInstance);
|
||||
@@ -77,8 +82,11 @@ namespace EggLink.DanhengServer.Game.Battle
|
||||
BattleInstance battleInstance = new(Player, Player.LineupManager!.GetCurLineup()!, targetList)
|
||||
{
|
||||
WorldLevel = Player.Data.WorldLevel,
|
||||
CasterIndex = (int)req.CastEntityId,
|
||||
};
|
||||
Player.BattleInstance = battleInstance;
|
||||
battleInstance.CasterIndex = Player.LineupManager!.GetCurLineup()!.BaseAvatars!.FindIndex(x => x.BaseAvatarId == casterAvatarId);
|
||||
skill.OnEnterBattle(battleInstance);
|
||||
Player.SendPacket(new PacketSceneCastSkillScRsp(req.CastEntityId, battleInstance));
|
||||
} else
|
||||
{
|
||||
|
||||
23
GameServer/Game/Battle/Skill/Action/MazeAddMazeBuff.cs
Normal file
23
GameServer/Game/Battle/Skill/Action/MazeAddMazeBuff.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using EggLink.DanhengServer.Data;
|
||||
using EggLink.DanhengServer.Game.Scene;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EggLink.DanhengServer.Game.Battle.Skill.Action
|
||||
{
|
||||
public class MazeAddMazeBuff(int buffId) : IMazeSkillAction
|
||||
{
|
||||
public void OnCast()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void OnEnterBattle(BattleInstance instance)
|
||||
{
|
||||
instance.Buffs.Add(new SceneBuff(buffId, 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
15
GameServer/Game/Battle/Skill/IMazeSkillAction.cs
Normal file
15
GameServer/Game/Battle/Skill/IMazeSkillAction.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EggLink.DanhengServer.Game.Battle.Skill
|
||||
{
|
||||
public interface IMazeSkillAction
|
||||
{
|
||||
public void OnEnterBattle(BattleInstance instance);
|
||||
|
||||
public void OnCast();
|
||||
}
|
||||
}
|
||||
84
GameServer/Game/Battle/Skill/MazeSkill.cs
Normal file
84
GameServer/Game/Battle/Skill/MazeSkill.cs
Normal file
@@ -0,0 +1,84 @@
|
||||
using EggLink.DanhengServer.Data.Config;
|
||||
using EggLink.DanhengServer.Game.Battle.Skill.Action;
|
||||
using EggLink.DanhengServer.Util;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EggLink.DanhengServer.Game.Battle.Skill
|
||||
{
|
||||
public class MazeSkill
|
||||
{
|
||||
public List<IMazeSkillAction> Actions { get; private set; } = [];
|
||||
public bool TriggerBattle { get; private set; } = true;
|
||||
public MazeSkill(List<TaskInfo> taskInfos)
|
||||
{
|
||||
foreach (var task in taskInfos)
|
||||
{
|
||||
AddAction(task);
|
||||
foreach (var t in task.SuccessTaskList)
|
||||
{
|
||||
AddAction(t);
|
||||
}
|
||||
foreach (var t in task.GetAttackInfo())
|
||||
{
|
||||
AddAction(t);
|
||||
}
|
||||
|
||||
foreach (var t in task.OnProjectileHit)
|
||||
{
|
||||
AddAction(t);
|
||||
}
|
||||
foreach (var t in task.OnProjectileLifetimeFinish)
|
||||
{
|
||||
AddAction(t);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void AddAction(TaskInfo task)
|
||||
{
|
||||
switch (task.TaskType)
|
||||
{
|
||||
case Enums.TaskTypeEnum.None:
|
||||
break;
|
||||
case Enums.TaskTypeEnum.AddMazeBuff:
|
||||
Actions.Add(new MazeAddMazeBuff(task.ID));
|
||||
break;
|
||||
case Enums.TaskTypeEnum.RemoveMazeBuff:
|
||||
break;
|
||||
case Enums.TaskTypeEnum.AdventureModifyTeamPlayerHP:
|
||||
break;
|
||||
case Enums.TaskTypeEnum.AdventureModifyTeamPlayerSP:
|
||||
break;
|
||||
case Enums.TaskTypeEnum.CreateSummonUnit:
|
||||
break;
|
||||
case Enums.TaskTypeEnum.AdventureSetAttackTargetMonsterDie:
|
||||
break;
|
||||
case Enums.TaskTypeEnum.AdventureTriggerAttack:
|
||||
foreach (var t in task.GetAttackInfo())
|
||||
{
|
||||
AddAction(t);
|
||||
}
|
||||
break;
|
||||
case Enums.TaskTypeEnum.AdventureFireProjectile:
|
||||
break;
|
||||
}
|
||||
|
||||
if (!task.TriggerBattle)
|
||||
{
|
||||
TriggerBattle = false;
|
||||
}
|
||||
}
|
||||
|
||||
public void OnEnterBattle(BattleInstance instance)
|
||||
{
|
||||
foreach (var action in Actions)
|
||||
{
|
||||
action.OnEnterBattle(instance);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
31
GameServer/Game/Battle/Skill/MazeSkillManager.cs
Normal file
31
GameServer/Game/Battle/Skill/MazeSkillManager.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using EggLink.DanhengServer.Data;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EggLink.DanhengServer.Game.Battle.Skill
|
||||
{
|
||||
public static class MazeSkillManager
|
||||
{
|
||||
public static MazeSkill GetSkill(int baseAvatarId, int skillIndex)
|
||||
{
|
||||
GameData.AvatarConfigData.TryGetValue(baseAvatarId, out var avatarConfig);
|
||||
MazeSkill mazeSkill = new([]);
|
||||
if (avatarConfig == null) return mazeSkill;
|
||||
|
||||
if (skillIndex == 0)
|
||||
{
|
||||
// normal atk
|
||||
mazeSkill = new(avatarConfig.MazeAtk?.OnStart.ToList() ?? []);
|
||||
}
|
||||
else
|
||||
{
|
||||
// maze skill
|
||||
mazeSkill = new(avatarConfig.MazeSkill?.OnStart.ToList() ?? []);
|
||||
}
|
||||
return mazeSkill;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,36 +1,18 @@
|
||||
using EggLink.DanhengServer.Data;
|
||||
using EggLink.DanhengServer.Database;
|
||||
using EggLink.DanhengServer.Database.Gacha;
|
||||
using EggLink.DanhengServer.Database.Inventory;
|
||||
using EggLink.DanhengServer.Database.Message;
|
||||
using EggLink.DanhengServer.Enums;
|
||||
using EggLink.DanhengServer.Game.Player;
|
||||
using EggLink.DanhengServer.Proto;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Numerics;
|
||||
|
||||
namespace EggLink.DanhengServer.Game.Gacha
|
||||
{
|
||||
public class GachaManager : BasePlayerManager
|
||||
public class GachaManager(PlayerInstance player) : BasePlayerManager(player)
|
||||
{
|
||||
public GachaData GachaData { get; private set; }
|
||||
public GachaManager(PlayerInstance player) : base(player)
|
||||
{
|
||||
var gacha = DatabaseHelper.Instance?.GetInstance<GachaData>(player.Uid);
|
||||
if (gacha == null)
|
||||
{
|
||||
GachaData = new()
|
||||
{
|
||||
Uid = player.Uid,
|
||||
};
|
||||
DatabaseHelper.Instance?.SaveInstance(GachaData);
|
||||
}
|
||||
else
|
||||
{
|
||||
GachaData = gacha;
|
||||
}
|
||||
}
|
||||
public GachaData GachaData { get; private set; } = DatabaseHelper.Instance!.GetInstanceOrCreateNew<GachaData>(player.Uid);
|
||||
|
||||
public List<int> GetPurpleAvatars()
|
||||
{
|
||||
@@ -180,18 +162,17 @@ namespace EggLink.DanhengServer.Game.Gacha
|
||||
var avatar = Player.AvatarManager?.GetAvatar(item);
|
||||
if (avatar != null)
|
||||
{
|
||||
star += 20;
|
||||
star += 40;
|
||||
var rankUpItemId = avatar.Excel?.RankUpItemId;
|
||||
if (rankUpItemId != null)
|
||||
{
|
||||
var rankUpItem = Player.InventoryManager!.GetItem(rankUpItemId.Value);
|
||||
if (avatar.Rank + rankUpItem?.Count >= 6)
|
||||
{
|
||||
star += 80;
|
||||
star += 60;
|
||||
}
|
||||
else
|
||||
{
|
||||
Player.InventoryManager?.AddItem(rankUpItemId.Value, 1, false);
|
||||
var dupeItem = new ItemList();
|
||||
dupeItem.ItemList_.Add(new Item()
|
||||
{
|
||||
@@ -227,7 +208,6 @@ namespace EggLink.DanhengServer.Game.Gacha
|
||||
}
|
||||
else
|
||||
{
|
||||
Player.InventoryManager?.AddItem(rankUpItemId.Value, 1, false);
|
||||
var dupeItem = new ItemList();
|
||||
dupeItem.ItemList_.Add(new Item()
|
||||
{
|
||||
@@ -247,12 +227,11 @@ namespace EggLink.DanhengServer.Game.Gacha
|
||||
{
|
||||
dirt += 20;
|
||||
}
|
||||
var result = Player.InventoryManager?.AddItem(item, 1, false);
|
||||
if (result == null) continue;
|
||||
Player.InventoryManager?.AddItem(item, 1, false, false);
|
||||
gachaItem.GachaItem_ = new()
|
||||
{
|
||||
ItemId = (uint)result.ItemId,
|
||||
Num = (uint)result.Count,
|
||||
ItemId = (uint)item,
|
||||
Num = 1,
|
||||
Level = 1,
|
||||
Rank = 1,
|
||||
};
|
||||
@@ -260,7 +239,7 @@ namespace EggLink.DanhengServer.Game.Gacha
|
||||
var tokenItem = new ItemList();
|
||||
if (dirt > 0)
|
||||
{
|
||||
Player.InventoryManager?.AddItem(251, dirt, false);
|
||||
Player.InventoryManager?.AddItem(251, dirt, false, false);
|
||||
tokenItem.ItemList_.Add(new Item()
|
||||
{
|
||||
ItemId = 251,
|
||||
@@ -270,7 +249,7 @@ namespace EggLink.DanhengServer.Game.Gacha
|
||||
|
||||
if (star > 0)
|
||||
{
|
||||
Player.InventoryManager?.AddItem(252, star, false);
|
||||
Player.InventoryManager?.AddItem(252, star, false, false);
|
||||
tokenItem.ItemList_.Add(new Item()
|
||||
{
|
||||
ItemId = 252,
|
||||
@@ -288,6 +267,7 @@ namespace EggLink.DanhengServer.Game.Gacha
|
||||
};
|
||||
proto.GachaItemList.AddRange(gachaItems);
|
||||
DatabaseHelper.Instance?.UpdateInstance(GachaData);
|
||||
DatabaseHelper.Instance?.UpdateInstance(Player.InventoryManager!.Data);
|
||||
|
||||
return proto;
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ using EggLink.DanhengServer.Database.Inventory;
|
||||
using EggLink.DanhengServer.Enums;
|
||||
using EggLink.DanhengServer.Game.Player;
|
||||
using EggLink.DanhengServer.Proto;
|
||||
using EggLink.DanhengServer.Server.Packet.Send.Avatar;
|
||||
using EggLink.DanhengServer.Server.Packet.Send.Player;
|
||||
using EggLink.DanhengServer.Server.Packet.Send.Scene;
|
||||
using EggLink.DanhengServer.Util;
|
||||
@@ -11,24 +12,21 @@ using System.Text.RegularExpressions;
|
||||
|
||||
namespace EggLink.DanhengServer.Game.Inventory
|
||||
{
|
||||
public class InventoryManager : BasePlayerManager
|
||||
public class InventoryManager(PlayerInstance player) : BasePlayerManager(player)
|
||||
{
|
||||
public InventoryData Data;
|
||||
public InventoryManager(PlayerInstance player) : base(player)
|
||||
public InventoryData Data = DatabaseHelper.Instance!.GetInstanceOrCreateNew<InventoryData>(player.Uid);
|
||||
|
||||
public void AddItems(List<ItemData> items, bool notify = true)
|
||||
{
|
||||
var inventory = DatabaseHelper.Instance?.GetInstance<InventoryData>(player.Uid);
|
||||
if (inventory == null)
|
||||
foreach (var item in items)
|
||||
{
|
||||
DatabaseHelper.Instance?.SaveInstance(new InventoryData()
|
||||
{
|
||||
Uid = player.Uid,
|
||||
});
|
||||
inventory = DatabaseHelper.Instance?.GetInstance<InventoryData>(player.Uid);
|
||||
AddItem(item.ItemId, items.Count, true, false);
|
||||
}
|
||||
Data = inventory!;
|
||||
|
||||
DatabaseHelper.Instance?.UpdateInstance(Data);
|
||||
}
|
||||
|
||||
public ItemData? AddItem(int itemId, int count, bool notify = true)
|
||||
public ItemData? AddItem(int itemId, int count, bool notify = true, bool save = true)
|
||||
{
|
||||
GameData.ItemConfigData.TryGetValue(itemId, out var itemConfig);
|
||||
if (itemConfig == null) return null;
|
||||
@@ -105,11 +103,15 @@ namespace EggLink.DanhengServer.Game.Inventory
|
||||
var avatar = Player.AvatarManager?.GetAvatar(itemId);
|
||||
if (avatar != null && avatar.Excel != null)
|
||||
{
|
||||
PutItem(avatar.Excel.RankUpItemId, 1);
|
||||
var rankUpItem = Player.InventoryManager!.GetItem(avatar.Excel.RankUpItemId);
|
||||
if (avatar.Rank + rankUpItem?.Count <= 5)
|
||||
itemData = PutItem(avatar.Excel.RankUpItemId, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
Player.AddAvatar(itemId);
|
||||
itemData = new() { ItemId = itemId, Count = 1 };
|
||||
Player.SendPacket(new PacketAddAvatarScNotify(itemId));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
itemData = PutItem(itemId, Math.Min(count, itemConfig.PileLimit));
|
||||
@@ -125,7 +127,8 @@ namespace EggLink.DanhengServer.Game.Inventory
|
||||
}
|
||||
}
|
||||
|
||||
DatabaseHelper.Instance?.UpdateInstance(Data);
|
||||
if (save)
|
||||
DatabaseHelper.Instance?.UpdateInstance(Data);
|
||||
|
||||
return itemData;
|
||||
}
|
||||
@@ -456,9 +459,16 @@ namespace EggLink.DanhengServer.Game.Inventory
|
||||
|
||||
foreach (var cost in item.ItemList)
|
||||
{
|
||||
GameData.ItemConfigData.TryGetValue((int)cost.PileItem.ItemId, out var itemConfig);
|
||||
if (itemConfig == null) continue;
|
||||
exp += itemConfig.Exp * (int)cost.PileItem.ItemNum;
|
||||
if (cost.PileItem == null)
|
||||
{
|
||||
// TODO : add equipment
|
||||
exp += 100;
|
||||
} else
|
||||
{
|
||||
GameData.ItemConfigData.TryGetValue((int)cost.PileItem.ItemId, out var itemConfig);
|
||||
if (itemConfig == null) continue;
|
||||
exp += itemConfig.Exp * (int)cost.PileItem.ItemNum;
|
||||
}
|
||||
}
|
||||
|
||||
// payment
|
||||
@@ -466,7 +476,16 @@ namespace EggLink.DanhengServer.Game.Inventory
|
||||
if (Player.Data.Scoin < costScoin) return [];
|
||||
foreach (var cost in item.ItemList)
|
||||
{
|
||||
RemoveItem((int)cost.PileItem.ItemId, (int)cost.PileItem.ItemNum);
|
||||
if (cost.PileItem == null)
|
||||
{
|
||||
// TODO : add equipment
|
||||
var costItem = Data.EquipmentItems.Find(x => x.UniqueId == cost.EquipmentUniqueId);
|
||||
if (costItem == null) continue;
|
||||
RemoveItem(costItem.ItemId, 1, (int)cost.EquipmentUniqueId);
|
||||
} else
|
||||
{
|
||||
RemoveItem((int)cost.PileItem.ItemId, (int)cost.PileItem.ItemNum);
|
||||
}
|
||||
}
|
||||
RemoveItem(2, costScoin);
|
||||
|
||||
@@ -543,15 +562,17 @@ namespace EggLink.DanhengServer.Game.Inventory
|
||||
|
||||
public void RankUpEquipment(int equipmentUniqueId, ItemCostData costData)
|
||||
{
|
||||
var rank = 0;
|
||||
foreach (var cost in costData.ItemList)
|
||||
{
|
||||
var costItem = Data.EquipmentItems.Find(x => x.UniqueId == cost.EquipmentUniqueId);
|
||||
if (costItem == null) continue;
|
||||
RemoveItem(costItem.ItemId, 0, (int)cost.EquipmentUniqueId);
|
||||
rank++;
|
||||
}
|
||||
var itemData = Data.EquipmentItems.Find(x => x.UniqueId == equipmentUniqueId);
|
||||
if (itemData == null) return;
|
||||
itemData.Rank++;
|
||||
itemData.Rank += rank;
|
||||
DatabaseHelper.Instance!.UpdateInstance(Data);
|
||||
Player.SendPacket(new PacketPlayerSyncScNotify(itemData));
|
||||
}
|
||||
|
||||
@@ -10,38 +10,20 @@ namespace EggLink.DanhengServer.Game.Lineup
|
||||
public class LineupManager : BasePlayerManager
|
||||
{
|
||||
public LineupData LineupData { get; private set; }
|
||||
public Dictionary<int, LineupInfo> LineupInfo { get; private set; }
|
||||
|
||||
public LineupManager(PlayerInstance player) : base(player)
|
||||
{
|
||||
var lineup = DatabaseHelper.Instance?.GetInstance<LineupData>(player.Uid);
|
||||
if (lineup == null)
|
||||
LineupData = DatabaseHelper.Instance!.GetInstanceOrCreateNew<LineupData>(player.Uid);
|
||||
foreach (var lineupInfo in LineupData.Lineups.Values)
|
||||
{
|
||||
LineupData = new()
|
||||
{
|
||||
Uid = player.Uid,
|
||||
CurLineup = 1,
|
||||
};
|
||||
DatabaseHelper.Instance?.SaveInstance(LineupData);
|
||||
lineupInfo.LineupData = LineupData;
|
||||
lineupInfo.AvatarData = player.AvatarManager!.AvatarData;
|
||||
}
|
||||
else
|
||||
{
|
||||
LineupData = lineup;
|
||||
if (LineupData.Lineups != null)
|
||||
{
|
||||
foreach (var lineupInfo in LineupData.Lineups?.Values!)
|
||||
{
|
||||
lineupInfo.LineupData = LineupData;
|
||||
lineupInfo.AvatarData = player.AvatarManager!.AvatarData;
|
||||
}
|
||||
}
|
||||
}
|
||||
LineupInfo = LineupData.Lineups ?? [];
|
||||
}
|
||||
|
||||
public LineupInfo? GetLineup(int lineupIndex)
|
||||
{
|
||||
LineupInfo.TryGetValue(lineupIndex, out var lineup);
|
||||
LineupData.Lineups.TryGetValue(lineupIndex, out var lineup);
|
||||
return lineup;
|
||||
}
|
||||
|
||||
@@ -52,7 +34,7 @@ namespace EggLink.DanhengServer.Game.Lineup
|
||||
|
||||
public void SetCurLineup(int lineupIndex)
|
||||
{
|
||||
if (lineupIndex < 0 || !LineupInfo.ContainsKey(lineupIndex))
|
||||
if (lineupIndex < 0 || !LineupData.Lineups.ContainsKey(lineupIndex))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -66,7 +48,7 @@ namespace EggLink.DanhengServer.Game.Lineup
|
||||
{
|
||||
return;
|
||||
}
|
||||
LineupInfo.TryGetValue(lineupIndex, out LineupInfo? lineup);
|
||||
LineupData.Lineups.TryGetValue(lineupIndex, out LineupInfo? lineup);
|
||||
if (lineup == null)
|
||||
{
|
||||
lineup = new()
|
||||
@@ -77,11 +59,11 @@ namespace EggLink.DanhengServer.Game.Lineup
|
||||
LineupData = LineupData,
|
||||
AvatarData = Player.AvatarManager!.AvatarData,
|
||||
};
|
||||
LineupInfo.Add(lineupIndex, lineup);
|
||||
LineupData.Lineups.Add(lineupIndex, lineup);
|
||||
} else
|
||||
{
|
||||
lineup.BaseAvatars?.Add(new() { BaseAvatarId = avatarId });
|
||||
LineupInfo[lineupIndex] = lineup;
|
||||
LineupData.Lineups[lineupIndex] = lineup;
|
||||
}
|
||||
DatabaseHelper.Instance?.UpdateInstance(LineupData);
|
||||
if (sendPacket)
|
||||
@@ -101,7 +83,7 @@ namespace EggLink.DanhengServer.Game.Lineup
|
||||
|
||||
public void AddSpecialAvatarToCurTeam(int specialAvatarId, bool sendPacket = true)
|
||||
{
|
||||
LineupInfo.TryGetValue(LineupData.CurLineup, out LineupInfo? lineup);
|
||||
LineupData.Lineups.TryGetValue(LineupData.CurLineup, out LineupInfo? lineup);
|
||||
GameData.SpecialAvatarData.TryGetValue(specialAvatarId, out var specialAvatar);
|
||||
if (specialAvatar == null)
|
||||
{
|
||||
@@ -117,11 +99,11 @@ namespace EggLink.DanhengServer.Game.Lineup
|
||||
LineupData = LineupData,
|
||||
AvatarData = Player.AvatarManager!.AvatarData,
|
||||
};
|
||||
LineupInfo.Add(LineupData.CurLineup, lineup);
|
||||
LineupData.Lineups.Add(LineupData.CurLineup, lineup);
|
||||
} else
|
||||
{
|
||||
lineup.BaseAvatars?.Add(new() { BaseAvatarId = specialAvatar.AvatarID, SpecialAvatarId = specialAvatarId });
|
||||
LineupInfo[LineupData.CurLineup] = lineup;
|
||||
LineupData.Lineups[LineupData.CurLineup] = lineup;
|
||||
}
|
||||
DatabaseHelper.Instance?.UpdateInstance(LineupData);
|
||||
if (sendPacket)
|
||||
@@ -137,13 +119,13 @@ namespace EggLink.DanhengServer.Game.Lineup
|
||||
{
|
||||
return;
|
||||
}
|
||||
LineupInfo.TryGetValue(lineupIndex, out LineupInfo? lineup);
|
||||
LineupData.Lineups.TryGetValue(lineupIndex, out LineupInfo? lineup);
|
||||
if (lineup == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
lineup.BaseAvatars?.RemoveAll(avatar => avatar.BaseAvatarId == avatarId);
|
||||
LineupInfo[lineupIndex] = lineup;
|
||||
LineupData.Lineups[lineupIndex] = lineup;
|
||||
DatabaseHelper.Instance?.UpdateInstance(LineupData);
|
||||
if (lineupIndex == LineupData.CurLineup)
|
||||
{
|
||||
@@ -159,13 +141,13 @@ namespace EggLink.DanhengServer.Game.Lineup
|
||||
|
||||
public void RemoveSpecialAvatarFromCurTeam(int specialAvatarId)
|
||||
{
|
||||
LineupInfo.TryGetValue(LineupData.CurLineup, out LineupInfo? lineup);
|
||||
LineupData.Lineups.TryGetValue(LineupData.CurLineup, out LineupInfo? lineup);
|
||||
if (lineup == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
lineup.BaseAvatars?.RemoveAll(avatar => avatar.SpecialAvatarId == specialAvatarId);
|
||||
LineupInfo[LineupData.CurLineup] = lineup;
|
||||
LineupData.Lineups[LineupData.CurLineup] = lineup;
|
||||
DatabaseHelper.Instance?.UpdateInstance(LineupData);
|
||||
Player.SceneInstance?.SyncLineup();
|
||||
Player.SendPacket(new PacketSyncLineupNotify(lineup));
|
||||
@@ -173,18 +155,18 @@ namespace EggLink.DanhengServer.Game.Lineup
|
||||
|
||||
public void ReplaceLineup(Proto.ReplaceLineupCsReq req)
|
||||
{
|
||||
if (req.Index < 0 || !LineupInfo.ContainsKey((int)(req.Index + 1)))
|
||||
if (req.Index < 0 || !LineupData.Lineups.ContainsKey((int)req.Index))
|
||||
{
|
||||
return;
|
||||
}
|
||||
var lineup = LineupInfo[(int)(req.Index + 1)];
|
||||
var lineup = LineupData.Lineups[(int)(req.Index)];
|
||||
lineup.BaseAvatars = [];
|
||||
foreach (var avatar in req.LineupSlotList)
|
||||
{
|
||||
AddAvatar((int)(req.Index + 1), (int)avatar.Id, false);
|
||||
AddAvatar((int)req.Index, (int)avatar.Id, false);
|
||||
}
|
||||
DatabaseHelper.Instance?.UpdateInstance(LineupData);
|
||||
if (req.Index + 1 == LineupData.CurLineup)
|
||||
if (req.Index == LineupData.CurLineup)
|
||||
{
|
||||
Player.SceneInstance?.SyncLineup();
|
||||
}
|
||||
|
||||
214
GameServer/Game/Message/MessageManager.cs
Normal file
214
GameServer/Game/Message/MessageManager.cs
Normal file
@@ -0,0 +1,214 @@
|
||||
using EggLink.DanhengServer.Data;
|
||||
using EggLink.DanhengServer.Database;
|
||||
using EggLink.DanhengServer.Database.Message;
|
||||
using EggLink.DanhengServer.Game.Player;
|
||||
using EggLink.DanhengServer.Proto;
|
||||
using EggLink.DanhengServer.Server.Packet.Send.Player;
|
||||
using EggLink.DanhengServer.Util;
|
||||
using Microsoft.EntityFrameworkCore.Storage;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EggLink.DanhengServer.Game.Message
|
||||
{
|
||||
public class MessageManager(PlayerInstance player) : BasePlayerManager(player)
|
||||
{
|
||||
public MessageData Data { get; private set; } = DatabaseHelper.Instance!.GetInstanceOrCreateNew<MessageData>(player.Uid);
|
||||
|
||||
#region Get
|
||||
|
||||
public MessageSectionData? GetMessageSectionData(int sectionId)
|
||||
{
|
||||
GameData.MessageSectionConfigData.TryGetValue(sectionId, out var sectionConfig);
|
||||
if (sectionConfig == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
var groupId = sectionConfig.GroupID;
|
||||
if (!Data.Groups.TryGetValue(groupId, out var group))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return group.Sections.FirstOrDefault(m => m.SectionId == sectionId);
|
||||
}
|
||||
|
||||
public List<MessageGroup> GetMessageGroup(int contactId)
|
||||
{
|
||||
GameData.MessageContactsConfigData.TryGetValue(contactId, out var contactConfig);
|
||||
if (contactConfig == null)
|
||||
{
|
||||
return [];
|
||||
}
|
||||
var result = new List<MessageGroup>();
|
||||
foreach (var item in contactConfig.Groups)
|
||||
{
|
||||
if (Data.Groups.TryGetValue(item.ID, out var group))
|
||||
{
|
||||
var groupInfo = new MessageGroup
|
||||
{
|
||||
Id = (uint)item.ID,
|
||||
Status = group.Status,
|
||||
RefreshTime = group.RefreshTime,
|
||||
};
|
||||
foreach (var section in group.Sections)
|
||||
{
|
||||
var sectionInfo = new MessageSection
|
||||
{
|
||||
Id = (uint)section.SectionId,
|
||||
Status = section.Status,
|
||||
};
|
||||
sectionInfo.ToChooseItemId.AddRange(section.ToChooseItemId.Select(m => (uint)m));
|
||||
sectionInfo.ItemList.AddRange(section.Items.Select(m => new MessageItem()
|
||||
{
|
||||
ItemId = (uint)m.ItemId,
|
||||
}));
|
||||
groupInfo.MessageSectionList.Add(sectionInfo);
|
||||
}
|
||||
groupInfo.MessageSectionId = (uint)group.CurrentSectionId;
|
||||
result.Add(groupInfo);
|
||||
}
|
||||
else
|
||||
{
|
||||
result.Add(new MessageGroup
|
||||
{
|
||||
Id = (uint)item.ID,
|
||||
Status = MessageGroupStatus.MessageGroupNone,
|
||||
RefreshTime = 0,
|
||||
});
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Action
|
||||
|
||||
public void AddMessageSection(int sectionId)
|
||||
{
|
||||
GameData.MessageSectionConfigData.TryGetValue(sectionId, out var sectionConfig);
|
||||
if (sectionConfig == null) return;
|
||||
foreach (var item in sectionConfig.StartMessageItemIDList)
|
||||
{
|
||||
AddMessageItem(item);
|
||||
}
|
||||
}
|
||||
|
||||
public void AddMessageItem(int itemId)
|
||||
{
|
||||
GameData.MessageItemConfigData.TryGetValue(itemId, out var itemConfig);
|
||||
if (itemConfig == null) return;
|
||||
var groupId = itemConfig.GroupID;
|
||||
var sectionId = itemConfig.SectionID;
|
||||
if (!Data.Groups.TryGetValue(groupId, out var group))
|
||||
{
|
||||
group = new MessageGroupData
|
||||
{
|
||||
GroupId = groupId,
|
||||
CurrentSectionId = sectionId,
|
||||
RefreshTime = Extensions.GetUnixSec(),
|
||||
Status = MessageGroupStatus.MessageGroupDoing,
|
||||
};
|
||||
group.Sections.Add(new MessageSectionData
|
||||
{
|
||||
SectionId = sectionId,
|
||||
Status = MessageSectionStatus.MessageSectionDoing,
|
||||
ToChooseItemId = itemConfig.NextItemIDList,
|
||||
});
|
||||
Data.Groups.Add(groupId, group);
|
||||
}
|
||||
else
|
||||
{
|
||||
group.CurrentSectionId = sectionId;
|
||||
group.RefreshTime = Extensions.GetUnixSec();
|
||||
group.Status = MessageGroupStatus.MessageGroupDoing;
|
||||
if (!group.Sections.Any(m => m.SectionId == sectionId))
|
||||
{
|
||||
group.Sections.Add(new MessageSectionData
|
||||
{
|
||||
SectionId = sectionId,
|
||||
Status = MessageSectionStatus.MessageSectionDoing,
|
||||
ToChooseItemId = itemConfig.NextItemIDList,
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
group.Sections.First(m => m.SectionId == sectionId).Status = MessageSectionStatus.MessageSectionDoing;
|
||||
}
|
||||
}
|
||||
|
||||
DatabaseHelper.Instance!.UpdateInstance(Data);
|
||||
|
||||
// sync
|
||||
var notify = new PacketPlayerSyncScNotify(group, group.Sections.First(m => m.SectionId == sectionId));
|
||||
Player.SendPacket(notify);
|
||||
}
|
||||
|
||||
public void FinishSection(int sectionId)
|
||||
{
|
||||
GameData.MessageSectionConfigData.TryGetValue(sectionId, out var sectionConfig);
|
||||
if (sectionConfig == null) return;
|
||||
var groupId = sectionConfig.GroupID;
|
||||
if (!Data.Groups.TryGetValue(groupId, out var group)) return;
|
||||
var section = group.Sections.First(m => m.SectionId == sectionId);
|
||||
if (section.Status != MessageSectionStatus.MessageSectionDoing) return;
|
||||
section.Status = MessageSectionStatus.MessageSectionFinish;
|
||||
if (group.Sections.All(m => m.Status == MessageSectionStatus.MessageSectionFinish))
|
||||
{
|
||||
group.Status = MessageGroupStatus.MessageGroupFinish;
|
||||
}
|
||||
DatabaseHelper.Instance!.UpdateInstance(Data);
|
||||
|
||||
// sync
|
||||
var notify = new PacketPlayerSyncScNotify(group, section);
|
||||
Player.SendPacket(notify);
|
||||
|
||||
}
|
||||
|
||||
public void FinishMessageItem(int itemId)
|
||||
{
|
||||
GameData.MessageItemConfigData.TryGetValue(itemId, out var itemConfig);
|
||||
if (itemConfig == null) return;
|
||||
var groupId = itemConfig.GroupID;
|
||||
var sectionId = itemConfig.SectionID;
|
||||
if (!Data.Groups.TryGetValue(groupId, out var group)) return;
|
||||
var section = group.Sections.First(m => m.SectionId == sectionId);
|
||||
if (section.Status != MessageSectionStatus.MessageSectionDoing) return;
|
||||
if (!section.ToChooseItemId.Contains(itemId)) return;
|
||||
section.ToChooseItemId.Clear();
|
||||
section.Items.Add(new MessageItemData
|
||||
{
|
||||
ItemId = itemId,
|
||||
});
|
||||
if (itemConfig.NextItemIDList.Count == 0)
|
||||
{
|
||||
// finish
|
||||
section.Status = MessageSectionStatus.MessageSectionFinish;
|
||||
if (group.Sections.All(m => m.Status == MessageSectionStatus.MessageSectionFinish))
|
||||
{
|
||||
group.Status = MessageGroupStatus.MessageGroupFinish;
|
||||
}
|
||||
} else
|
||||
{
|
||||
section.ToChooseItemId.AddRange(itemConfig.NextItemIDList);
|
||||
}
|
||||
|
||||
group.RefreshTime = Extensions.GetUnixSec();
|
||||
|
||||
DatabaseHelper.Instance!.UpdateInstance(Data);
|
||||
// sync
|
||||
var notify = new PacketPlayerSyncScNotify(group, section);
|
||||
Player.SendPacket(notify);
|
||||
|
||||
// broadcast to mission system
|
||||
Player.MissionManager!.HandleFinishType(Enums.MissionFinishTypeEnum.MessagePerformSectionFinish);
|
||||
Player.MissionManager!.HandleFinishType(Enums.MissionFinishTypeEnum.MessageSectionFinish);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using EggLink.DanhengServer.Enums;
|
||||
using EggLink.DanhengServer.Game.Player;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EggLink.DanhengServer.Game.Mission.FinishAction.Handler
|
||||
{
|
||||
[MissionFinishAction(FinishActionTypeEnum.addMissionItem)]
|
||||
public class MissionHandlerAddMissionItem : MissionFinishActionHandler
|
||||
{
|
||||
public override void OnHandle(List<int> Params, PlayerInstance Player)
|
||||
{
|
||||
if (Params.Count < 2) return;
|
||||
var itemId = Params[0];
|
||||
var count = Params[1];
|
||||
Player.InventoryManager!.AddItem(itemId, count);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using EggLink.DanhengServer.Data.Config;
|
||||
using EggLink.DanhengServer.Enums;
|
||||
using EggLink.DanhengServer.Game.Player;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EggLink.DanhengServer.Game.Mission.FinishType.Handler
|
||||
{
|
||||
[MissionFinishType(MissionFinishTypeEnum.MessagePerformSectionFinish)]
|
||||
public class MissionHandlerMessagePerformSectionFinish : MissionFinishTypeHandler
|
||||
{
|
||||
public override void Init(PlayerInstance player, SubMissionInfo info, object? arg)
|
||||
{
|
||||
player.MessageManager!.AddMessageSection(info.ParamInt1);
|
||||
}
|
||||
|
||||
public override void HandleFinishType(PlayerInstance player, SubMissionInfo info, object? arg)
|
||||
{
|
||||
var data = player.MessageManager!.GetMessageSectionData(info.ParamInt1);
|
||||
if (data == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (data.Status == Proto.MessageSectionStatus.MessageSectionFinish)
|
||||
{
|
||||
player.MissionManager!.FinishSubMission(info.ID);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -23,16 +23,7 @@ namespace EggLink.DanhengServer.Game.Mission
|
||||
|
||||
public MissionManager(PlayerInstance player) : base(player)
|
||||
{
|
||||
var mission = DatabaseHelper.Instance?.GetInstance<MissionData>(player.Uid);
|
||||
if (mission == null)
|
||||
{
|
||||
DatabaseHelper.Instance?.SaveInstance(new MissionData()
|
||||
{
|
||||
Uid = player.Uid,
|
||||
});
|
||||
mission = DatabaseHelper.Instance?.GetInstance<MissionData>(player.Uid);
|
||||
}
|
||||
Data = mission!;
|
||||
Data = DatabaseHelper.Instance!.GetInstanceOrCreateNew<MissionData>(player.Uid);
|
||||
|
||||
var types = Assembly.GetExecutingAssembly().GetTypes();
|
||||
foreach (var type in types)
|
||||
@@ -154,7 +145,7 @@ namespace EggLink.DanhengServer.Game.Mission
|
||||
{
|
||||
Id = (uint)missionId,
|
||||
Status = Proto.MissionStatus.MissionFinish,
|
||||
Progress = 1
|
||||
Progress = (uint)(subMission.SubMissionInfo?.Progress ?? 1)
|
||||
});
|
||||
|
||||
// get next sub mission
|
||||
@@ -260,6 +251,18 @@ namespace EggLink.DanhengServer.Game.Mission
|
||||
Player.SendPacket(new PacketScenePlaneEventScNotify(ItemList));
|
||||
}
|
||||
|
||||
public void HandleFinishType(MissionFinishTypeEnum finishType, object? arg = null)
|
||||
{
|
||||
FinishTypeHandlers.TryGetValue(finishType, out var handler);
|
||||
foreach (var mission in GetRunningSubMissionList())
|
||||
{
|
||||
if (mission.FinishType == finishType)
|
||||
{
|
||||
handler?.HandleFinishType(Player, mission, arg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Mission Status
|
||||
|
||||
@@ -11,9 +11,11 @@ using EggLink.DanhengServer.Game.Battle;
|
||||
using EggLink.DanhengServer.Game.Gacha;
|
||||
using EggLink.DanhengServer.Game.Inventory;
|
||||
using EggLink.DanhengServer.Game.Lineup;
|
||||
using EggLink.DanhengServer.Game.Message;
|
||||
using EggLink.DanhengServer.Game.Mission;
|
||||
using EggLink.DanhengServer.Game.Scene;
|
||||
using EggLink.DanhengServer.Game.Scene.Entity;
|
||||
using EggLink.DanhengServer.Game.Shop;
|
||||
using EggLink.DanhengServer.Proto;
|
||||
using EggLink.DanhengServer.Server;
|
||||
using EggLink.DanhengServer.Server.Packet;
|
||||
@@ -35,6 +37,8 @@ namespace EggLink.DanhengServer.Game.Player
|
||||
public BattleInstance? BattleInstance { get; set; }
|
||||
public MissionManager? MissionManager { get; private set; }
|
||||
public GachaManager? GachaManager { get; private set; }
|
||||
public MessageManager? MessageManager { get; private set; }
|
||||
public ShopService? ShopService { get; private set; }
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -60,34 +64,13 @@ namespace EggLink.DanhengServer.Game.Player
|
||||
{
|
||||
// new player
|
||||
IsNewPlayer = true;
|
||||
Data.Name = "无名客"; // Trailblazer in EN TODO: Add localization
|
||||
Data.Signature = "";
|
||||
Data.Birthday = 0;
|
||||
Data.CurBasicType = 8001;
|
||||
Data.HeadIcon = 208001;
|
||||
Data.PhoneTheme = 221000;
|
||||
Data.ChatBubble = 220000;
|
||||
Data.CurrentBgm = 210000;
|
||||
Data.CurrentGender = Gender.Man;
|
||||
Data.Stamina = 240;
|
||||
Data.StaminaReserve = 0;
|
||||
Data.NextStaminaRecover = Extensions.GetUnixMs();
|
||||
Data.Level = 1;
|
||||
Data.Exp = 0;
|
||||
Data.WorldLevel = 0;
|
||||
Data.Scoin = 0;
|
||||
Data.Hcoin = 0;
|
||||
Data.Mcoin = 0;
|
||||
Data.PlaneId = 20001;
|
||||
Data.FloorId = 20001001;
|
||||
Data.TalentPoints = 0;
|
||||
DatabaseHelper.Instance?.SaveInstance(Data);
|
||||
|
||||
InitialPlayerManager();
|
||||
|
||||
//AddAvatar(8001);
|
||||
AddAvatar(8001);
|
||||
AddAvatar(1001);
|
||||
LineupManager?.SetCurLineup(1);
|
||||
//LineupManager?.AddAvatarToCurTeam(8001);
|
||||
LineupManager?.AddSpecialAvatarToCurTeam(10010050);
|
||||
|
||||
MissionManager!.AcceptMainMission(1000101);
|
||||
@@ -104,12 +87,16 @@ namespace EggLink.DanhengServer.Game.Player
|
||||
BattleManager = new(this);
|
||||
MissionManager = new(this);
|
||||
GachaManager = new(this);
|
||||
MessageManager = new(this);
|
||||
ShopService = new(this);
|
||||
|
||||
PlayerUnlockData = InitializeDatabase<PlayerUnlockData>();
|
||||
SceneData = InitializeDatabase<SceneData>();
|
||||
TutorialData = InitializeDatabase<TutorialData>();
|
||||
TutorialGuideData = InitializeDatabase<TutorialGuideData>();
|
||||
|
||||
Data.LastActiveTime = Extensions.GetUnixSec();
|
||||
DatabaseHelper.Instance?.UpdateInstance(Data);
|
||||
|
||||
LoadScene(Data.PlaneId, Data.FloorId, Data.EntryId, Data.Pos!, Data.Rot!, false);
|
||||
if (SceneInstance == null)
|
||||
@@ -190,7 +177,12 @@ namespace EggLink.DanhengServer.Game.Player
|
||||
GameData.PlayerLevelConfigData.TryGetValue(Data.Level + 1, out var config);
|
||||
if (config == null) return;
|
||||
var nextExp = config.PlayerExp;
|
||||
|
||||
for (int i = 1; i <= Data.Level; i++)
|
||||
{
|
||||
GameData.PlayerLevelConfigData.TryGetValue(i, out config);
|
||||
if (config == null) continue;
|
||||
nextExp -= config.PlayerExp;
|
||||
}
|
||||
while (Data.Exp >= nextExp)
|
||||
{
|
||||
Data.Exp -= nextExp;
|
||||
@@ -198,6 +190,12 @@ namespace EggLink.DanhengServer.Game.Player
|
||||
GameData.PlayerLevelConfigData.TryGetValue(Data.Level + 1, out config);
|
||||
if (config == null) break;
|
||||
nextExp = config.PlayerExp;
|
||||
for (int i = 1; i <= Data.Level; i++)
|
||||
{
|
||||
GameData.PlayerLevelConfigData.TryGetValue(i, out config);
|
||||
if (config == null) continue;
|
||||
nextExp -= config.PlayerExp;
|
||||
}
|
||||
}
|
||||
|
||||
OnLevelChange();
|
||||
|
||||
30
GameServer/Game/Scene/SceneBuff.cs
Normal file
30
GameServer/Game/Scene/SceneBuff.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using EggLink.DanhengServer.Proto;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EggLink.DanhengServer.Game.Scene
|
||||
{
|
||||
public class SceneBuff
|
||||
{
|
||||
public int BuffID { get; private set; }
|
||||
public int BuffLevel { get; private set; }
|
||||
|
||||
public SceneBuff(int buffID, int buffLevel)
|
||||
{
|
||||
BuffID = buffID;
|
||||
BuffLevel = buffLevel;
|
||||
}
|
||||
|
||||
public BattleBuff ToProto(int owner, int waveFlag) => new()
|
||||
{
|
||||
Id = (uint)BuffID,
|
||||
Level = (uint)BuffLevel,
|
||||
OwnerIndex = (uint)owner,
|
||||
WaveFlag = (uint)waveFlag,
|
||||
TargetIndexList = { (uint)owner },
|
||||
};
|
||||
}
|
||||
}
|
||||
54
GameServer/Game/Shop/ShopService.cs
Normal file
54
GameServer/Game/Shop/ShopService.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
using EggLink.DanhengServer.Data;
|
||||
using EggLink.DanhengServer.Database;
|
||||
using EggLink.DanhengServer.Database.Inventory;
|
||||
using EggLink.DanhengServer.Game.Player;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EggLink.DanhengServer.Game.Shop
|
||||
{
|
||||
public class ShopService(PlayerInstance player) : BasePlayerManager(player)
|
||||
{
|
||||
public List<ItemData> BuyItem(int shopId, int goodsId, int count)
|
||||
{
|
||||
GameData.ShopConfigData.TryGetValue(shopId, out var shopConfig);
|
||||
if (shopConfig == null) return [];
|
||||
var goods = shopConfig.Goods.Find(g => g.GoodsID == goodsId);
|
||||
if (goods == null) return [];
|
||||
GameData.ItemConfigData.TryGetValue(goods.ItemID, out var itemConfig);
|
||||
if (itemConfig == null) return [];
|
||||
|
||||
foreach (var cost in goods.CostList)
|
||||
{
|
||||
Player.InventoryManager!.RemoveItem(cost.Key, cost.Value * count);
|
||||
}
|
||||
var items = new List<ItemData>();
|
||||
if (itemConfig.ItemMainType == Enums.ItemMainTypeEnum.Equipment || itemConfig.ItemMainType == Enums.ItemMainTypeEnum.Relic)
|
||||
{
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
var item = Player.InventoryManager!.AddItem(itemConfig.ID, 1, false, false);
|
||||
if (item != null)
|
||||
{
|
||||
items.Add(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var item = Player.InventoryManager!.AddItem(itemConfig.ID, count, false, false);
|
||||
if (item != null)
|
||||
{
|
||||
items.Add(item);
|
||||
}
|
||||
}
|
||||
|
||||
DatabaseHelper.Instance?.UpdateInstance(Player.InventoryManager!.Data);
|
||||
|
||||
return items;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,7 @@
|
||||
using EggLink.DanhengServer.Proto;
|
||||
using EggLink.DanhengServer.Data;
|
||||
using EggLink.DanhengServer.Game.Battle.Skill;
|
||||
using EggLink.DanhengServer.Game.Scene;
|
||||
using EggLink.DanhengServer.Proto;
|
||||
using EggLink.DanhengServer.Server.Packet.Send.Battle;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -16,11 +19,19 @@ namespace EggLink.DanhengServer.Server.Packet.Recv.Battle
|
||||
var req = SceneCastSkillCsReq.Parser.ParseFrom(data);
|
||||
if (req != null)
|
||||
{
|
||||
connection.Player!.SceneInstance!.AvatarInfo.TryGetValue((int)req.AttackedByEntityId, out var info);
|
||||
MazeSkill mazeSkill = new([]);
|
||||
var id = 0;
|
||||
if (info != null)
|
||||
{
|
||||
id = info.AvatarInfo.AvatarId;
|
||||
mazeSkill = MazeSkillManager.GetSkill(info.AvatarInfo.AvatarId, (int)req.SkillIndex);
|
||||
}
|
||||
if (req.HitTargetEntityIdList.Count == 0)
|
||||
{
|
||||
// didnt hit any target
|
||||
connection.SendPacket(new PacketSceneCastSkillScRsp(req.CastEntityId));
|
||||
} else connection.Player!.BattleManager!.StartBattle(req);
|
||||
} else connection.Player!.BattleManager!.StartBattle(req, mazeSkill, id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
using EggLink.DanhengServer.Proto;
|
||||
using EggLink.DanhengServer.Server.Packet.Send.Mission;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EggLink.DanhengServer.Server.Packet.Recv.Mission
|
||||
{
|
||||
[Opcode(CmdIds.FinishItemIdCsReq)]
|
||||
public class HandlerFinishItemIdCsReq : Handler
|
||||
{
|
||||
public override void OnHandle(Connection connection, byte[] header, byte[] data)
|
||||
{
|
||||
var req = FinishItemIdCsReq.Parser.ParseFrom(data);
|
||||
var player = connection.Player!;
|
||||
player.MessageManager!.FinishMessageItem((int)req.ItemId);
|
||||
|
||||
connection.SendPacket(new PacketFinishItemIdScRsp(req.ItemId));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
using System;
|
||||
using EggLink.DanhengServer.Proto;
|
||||
using EggLink.DanhengServer.Server.Packet.Send.Mission;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -11,7 +13,11 @@ namespace EggLink.DanhengServer.Server.Packet.Recv.Mission
|
||||
{
|
||||
public override void OnHandle(Connection connection, byte[] header, byte[] data)
|
||||
{
|
||||
connection.SendPacket(CmdIds.FinishPerformSectionIdScRsp);
|
||||
var req = FinishPerformSectionIdCsReq.Parser.ParseFrom(data);
|
||||
|
||||
connection.Player!.MessageManager!.FinishSection((int)req.SectionId);
|
||||
|
||||
connection.SendPacket(new PacketFinishPerformSectionIdScRsp(req.SectionId));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,16 +23,13 @@ namespace EggLink.DanhengServer.Server.Packet.Recv.Player
|
||||
{
|
||||
player.Data.CurBasicType = 8002;
|
||||
player.Data.CurrentGender = Gender.Woman;
|
||||
player.AddAvatar(8002);
|
||||
DatabaseHelper.Instance?.UpdateInstance(player.Data);
|
||||
} else
|
||||
{
|
||||
player.Data.CurBasicType = 8001;
|
||||
player.Data.CurrentGender = Gender.Man;
|
||||
player.AddAvatar(8001);
|
||||
DatabaseHelper.Instance?.UpdateInstance(player.Data);
|
||||
}
|
||||
player.AddAvatar(1001);
|
||||
player.LineupManager!.AddAvatarToCurTeam(8001);
|
||||
player.LineupManager!.AddAvatarToCurTeam(1001);
|
||||
player.MissionManager!.FinishSubMission(100010134);
|
||||
|
||||
18
GameServer/Server/Packet/Recv/Shop/HandlerBuyGoodsCsReq.cs
Normal file
18
GameServer/Server/Packet/Recv/Shop/HandlerBuyGoodsCsReq.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using EggLink.DanhengServer.Proto;
|
||||
using EggLink.DanhengServer.Server.Packet.Send.Shop;
|
||||
|
||||
namespace EggLink.DanhengServer.Server.Packet.Recv.Shop
|
||||
{
|
||||
[Opcode(CmdIds.BuyGoodsCsReq)]
|
||||
public class HandlerBuyGoodsCsReq : Handler
|
||||
{
|
||||
public override void OnHandle(Connection connection, byte[] header, byte[] data)
|
||||
{
|
||||
var player = connection.Player!;
|
||||
var req = BuyGoodsCsReq.Parser.ParseFrom(data);
|
||||
var items = player.ShopService!.BuyItem((int)req.ShopId, (int)req.GoodsId, (int)req.GoodsNum);
|
||||
|
||||
connection.SendPacket(new PacketBuyGoodsScRsp(req, items));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using EggLink.DanhengServer.Proto;
|
||||
using EggLink.DanhengServer.Server.Packet.Send.Shop;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EggLink.DanhengServer.Server.Packet.Recv.Shop
|
||||
{
|
||||
[Opcode(CmdIds.GetShopListCsReq)]
|
||||
public class HandlerGetShopListCsReq : Handler
|
||||
{
|
||||
public override void OnHandle(Connection connection, byte[] header, byte[] data)
|
||||
{
|
||||
var req = GetShopListCsReq.Parser.ParseFrom(data);
|
||||
|
||||
connection.SendPacket(new PacketGetShopListScRsp(req.ShopType));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@ namespace EggLink.DanhengServer.Server.Packet.Recv.Tutorial
|
||||
{
|
||||
public override void OnHandle(Connection connection, byte[] header, byte[] data)
|
||||
{
|
||||
//connection.SendPacket(new PacketGetTutorialGuideScRsp(connection.Player!)); // somebug
|
||||
connection.SendPacket(new PacketGetTutorialGuideScRsp(connection.Player!)); // some bug
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
using EggLink.DanhengServer.Proto;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EggLink.DanhengServer.Server.Packet.Send.Avatar
|
||||
{
|
||||
public class PacketAddAvatarScNotify : BasePacket
|
||||
{
|
||||
public PacketAddAvatarScNotify(int avatarId) : base(CmdIds.AddAvatarScNotify)
|
||||
{
|
||||
var packet = new AddAvatarScNotify()
|
||||
{
|
||||
BaseAvatarId = (uint)avatarId,
|
||||
IsNew = true,
|
||||
Src = AddAvatarSrcState.AddAvatarSrcGacha,
|
||||
};
|
||||
|
||||
SetData(packet);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@ namespace EggLink.DanhengServer.Server.Packet.Send.Avatar
|
||||
{
|
||||
var proto = new GetHeroBasicTypeInfoScRsp()
|
||||
{
|
||||
Gender = player.Data.CurrentGender ?? Gender.None,
|
||||
Gender = player.Data.CurrentGender,
|
||||
CurBasicType = (HeroBasicType)player.Data.CurBasicType,
|
||||
};
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace EggLink.DanhengServer.Server.Packet.Send.Lineup
|
||||
{
|
||||
CurIndex = (uint)(player.LineupManager!.LineupData.CurLineup - 1),
|
||||
};
|
||||
foreach (var lineup in player.LineupManager.LineupInfo.Values)
|
||||
foreach (var lineup in player.LineupManager.LineupData.Lineups.Values)
|
||||
{
|
||||
proto.LineupList.Add(lineup.ToProto());
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
using EggLink.DanhengServer.Proto;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EggLink.DanhengServer.Server.Packet.Send.Mission
|
||||
{
|
||||
public class PacketFinishItemIdScRsp : BasePacket
|
||||
{
|
||||
public PacketFinishItemIdScRsp(uint itemId) : base(CmdIds.FinishItemIdScRsp)
|
||||
{
|
||||
var proto = new FinishItemIdScRsp
|
||||
{
|
||||
ItemId = itemId
|
||||
};
|
||||
SetData(proto);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using EggLink.DanhengServer.Proto;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EggLink.DanhengServer.Server.Packet.Send.Mission
|
||||
{
|
||||
public class PacketFinishPerformSectionIdScRsp : BasePacket
|
||||
{
|
||||
public PacketFinishPerformSectionIdScRsp(uint sectionId) : base(CmdIds.FinishPerformSectionIdScRsp)
|
||||
{
|
||||
var proto = new FinishPerformSectionIdScRsp
|
||||
{
|
||||
SectionId = sectionId
|
||||
};
|
||||
|
||||
SetData(proto);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
using EggLink.DanhengServer.Data;
|
||||
using EggLink.DanhengServer.Database.Avatar;
|
||||
using EggLink.DanhengServer.Database.Inventory;
|
||||
using EggLink.DanhengServer.Database.Message;
|
||||
using EggLink.DanhengServer.Enums;
|
||||
using EggLink.DanhengServer.Proto;
|
||||
using System;
|
||||
@@ -81,6 +82,32 @@ namespace EggLink.DanhengServer.Server.Packet.Send.Player
|
||||
SetData(proto);
|
||||
}
|
||||
|
||||
public PacketPlayerSyncScNotify(MessageGroupData? groupData, MessageSectionData? sectionData) : base(CmdIds.PlayerSyncScNotify)
|
||||
{
|
||||
var proto = new PlayerSyncScNotify();
|
||||
|
||||
if (groupData != null)
|
||||
{
|
||||
proto.MessageGroupStatus.Add(new GroupStatus
|
||||
{
|
||||
GroupId = (uint)groupData.GroupId,
|
||||
GroupStatus_ = groupData.Status,
|
||||
RefreshTime = groupData.RefreshTime,
|
||||
});
|
||||
}
|
||||
|
||||
if (sectionData != null)
|
||||
{
|
||||
proto.SectionStatus.Add(new SectionStatus
|
||||
{
|
||||
SectionId = (uint)sectionData.SectionId,
|
||||
SectionStatus_ = sectionData.Status,
|
||||
});
|
||||
}
|
||||
|
||||
SetData(proto);
|
||||
}
|
||||
|
||||
private void AddItemToProto(ItemData item, PlayerSyncScNotify notify)
|
||||
{
|
||||
GameData.ItemConfigData.TryGetValue(item.ItemId, out var itemConfig);
|
||||
|
||||
29
GameServer/Server/Packet/Send/Shop/PacketBuyGoodsScRsp.cs
Normal file
29
GameServer/Server/Packet/Send/Shop/PacketBuyGoodsScRsp.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using EggLink.DanhengServer.Database.Inventory;
|
||||
using EggLink.DanhengServer.Proto;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EggLink.DanhengServer.Server.Packet.Send.Shop
|
||||
{
|
||||
public class PacketBuyGoodsScRsp : BasePacket
|
||||
{
|
||||
public PacketBuyGoodsScRsp(BuyGoodsCsReq req, List<ItemData> items) : base(CmdIds.BuyGoodsScRsp)
|
||||
{
|
||||
var proto = new BuyGoodsScRsp()
|
||||
{
|
||||
ShopId = req.ShopId,
|
||||
GoodsBuyTimes = req.GoodsNum,
|
||||
GoodsId = req.GoodsId,
|
||||
ReturnItemList = new()
|
||||
{
|
||||
ItemList_ = { items.Select(item => item.ToProto()) }
|
||||
}
|
||||
};
|
||||
|
||||
SetData(proto);
|
||||
}
|
||||
}
|
||||
}
|
||||
34
GameServer/Server/Packet/Send/Shop/PacketGetShopListScRsp.cs
Normal file
34
GameServer/Server/Packet/Send/Shop/PacketGetShopListScRsp.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using EggLink.DanhengServer.Data;
|
||||
using EggLink.DanhengServer.Proto;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EggLink.DanhengServer.Server.Packet.Send.Shop
|
||||
{
|
||||
public class PacketGetShopListScRsp : BasePacket
|
||||
{
|
||||
public PacketGetShopListScRsp(uint shopType) : base(CmdIds.GetShopListScRsp)
|
||||
{
|
||||
var proto = new GetShopListScRsp();
|
||||
|
||||
foreach (var item in GameData.ShopConfigData.Values)
|
||||
{
|
||||
if (item.ShopType == shopType)
|
||||
{
|
||||
proto.ShopList.Add(new Proto.Shop()
|
||||
{
|
||||
ShopId = (uint)item.ShopID,
|
||||
CityLevel = 1,
|
||||
EndTime = long.MaxValue,
|
||||
GoodsList = { item.Goods.Select(g => g.ToProto()) }
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
SetData(proto);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user