Skip to content

Commit

Permalink
Update to 2.5.0
Browse files Browse the repository at this point in the history
- Fix Summon Unit for FeiXiao
- Fix Challenge
  • Loading branch information
StopWuyu committed Sep 21, 2024
1 parent 662a4f9 commit 47ef405
Show file tree
Hide file tree
Showing 118 changed files with 1,172 additions and 749 deletions.
5 changes: 2 additions & 3 deletions Command/Command/CommandManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ public void RegisterCommands()
{
Instance = this;
foreach (var type in Assembly.GetExecutingAssembly().GetTypes())
{
if (typeof(ICommand).IsAssignableFrom(type) && !type.IsAbstract) RegisterCommand(type);
}
if (typeof(ICommand).IsAssignableFrom(type) && !type.IsAbstract)
RegisterCommand(type);

Logger.Info(I18NManager.Translate("Server.ServerInfo.RegisterItem", Commands.Count.ToString(),
I18NManager.Translate("Word.Command")));
Expand Down
1 change: 1 addition & 0 deletions Common/Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<PackageReference Include="SQLitePCLRaw.core" Version="2.1.8" />
<PackageReference Include="SQLitePCLRaw.provider.e_sqlite3" Version="2.1.8" />
<PackageReference Include="SqlSugarCore" Version="5.1.4.167" />
<PackageReference Include="System.IO.Pipelines" Version="8.0.0" />
<PackageReference Include="System.Management" Version="8.0.0" />
</ItemGroup>

Expand Down
9 changes: 5 additions & 4 deletions Common/Data/Config/Scene/FloorInfo.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
using EggLink.DanhengServer.Enums.Scene;
using System.Collections.Concurrent;
using EggLink.DanhengServer.Enums.Scene;
using Newtonsoft.Json;

namespace EggLink.DanhengServer.Data.Config.Scene;

public class FloorInfo
{
[JsonIgnore] public Dictionary<int, PropInfo> CachedTeleports = [];
[JsonIgnore] public ConcurrentDictionary<int, PropInfo> CachedTeleports = [];

[JsonIgnore] public Dictionary<int, GroupInfo> Groups = [];
[JsonIgnore] public ConcurrentDictionary<int, GroupInfo> Groups = [];

[JsonIgnore] public bool Loaded;

[JsonIgnore] public List<PropInfo> UnlockedCheckpoints = [];
[JsonIgnore] public ConcurrentBag<PropInfo> UnlockedCheckpoints = [];

public int FloorID { get; set; }
public int StartGroupIndex { get; set; }
Expand Down
1 change: 1 addition & 0 deletions Common/Data/Config/Scene/PropInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public class PropInfo : PositionInfo
public int CocoonID { get; set; }
public int FarmElementID { get; set; }
public bool IsClientOnly { get; set; }
public bool LoadOnInitial { get; set; }

public PropValueSource? ValueSource { get; set; }
public string? InitLevelGraph { get; set; }
Expand Down
4 changes: 4 additions & 0 deletions Common/Data/Config/SummonUnit/SummonUnitConfigInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,20 @@ public class SummonUnitConfigInfo
{
public string GroupConfigName { get; set; } = "";
public string ConfigEntityPath { get; set; } = "";

public string TickLodTemplateName { get; set; } = "";

//public TriggerEffect[] ResidentEffects { get; set; }
public string ShoesType { get; set; } = "";
public bool ShowShadow { get; set; }
public bool ColliderIsTrigger { get; set; }

public string AttachPoint { get; set; } = "";

//public MVector3 LocalPosition { get; set; }
//public MVector3 LocalRotation { get; set; }
public DynamicFloat Duration { get; set; } = new();

//public TaskConfigInfo[] OnCreate { get; set; }
//public TaskConfigInfo[] OnDestroy { get; set; }
//public TaskConfigInfo[] OnBeReplaced { get; set; }
Expand Down
11 changes: 8 additions & 3 deletions Common/Data/Config/SummonUnit/UnitCustomTriggerConfigInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,14 @@ public class UnitCustomTriggerConfigInfo
public float RayStartOffsetY { get; set; }
public bool ForceSyncTargetToSever { get; set; }
public bool DependOnServerTarget { get; set; }

public bool IsSingle { get; set; }

// EntityType TargetEntityType { get; set; }
public DynamicFloat TargetGroupID { get; set; }
public DynamicFloat TargetID { get; set; }
public DynamicFloat TargetGroupID { get; set; } = new();

public DynamicFloat TargetID { get; set; } = new();

// EntityType[] TargetTypes { get; set; }
// PredicateConfigInfo TargetFilter { get; set; }
public string ColliderRelativePath { get; set; } = "";
Expand Down Expand Up @@ -98,7 +102,8 @@ public static UnitCustomTriggerConfigInfo LoadFromJsonObject(JObject obj)
info.OnTriggerExit = value.Select(x => TaskConfigInfo.LoadFromJsonObject((x as JObject)!)).ToList();

if (obj.TryGetValue(nameof(OnTriggerEnterRollback), out value))
info.OnTriggerEnterRollback = value.Select(x => TaskConfigInfo.LoadFromJsonObject((x as JObject)!)).ToList();
info.OnTriggerEnterRollback =
value.Select(x => TaskConfigInfo.LoadFromJsonObject((x as JObject)!)).ToList();

if (obj.TryGetValue(nameof(BlockDialogueInRange), out value))
info.BlockDialogueInRange = value.Value<bool>();
Expand Down
3 changes: 1 addition & 2 deletions Common/Data/Config/Task/AddMazeBuff.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using EggLink.DanhengServer.Enums.Scene;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Linq;

namespace EggLink.DanhengServer.Data.Config.Task;

Expand Down
3 changes: 2 additions & 1 deletion Common/Data/Config/TaskInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ public class LifeTimeInfo
public int GetLifeTime()
{
if (IsDynamic) return 20; // find a better way to get the value
if (FixedValue.Value <= 0) return -1; // infinite
if (FixedValue.Value <= 0 && FixedValue.Value >= -30000) return -1; // infinite
if (FixedValue.Value < -30000) return 20;
return (int)(FixedValue.Value * 10);
}
}
Expand Down
2 changes: 1 addition & 1 deletion Common/Data/Excel/ChallengeBossExtraExcel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public override int GetId()
return ID;
}

public override void Loaded()
public override void AfterAllDone()
{
if (GameData.ChallengeConfigData.ContainsKey(ID))
{
Expand Down
1 change: 1 addition & 0 deletions Common/Data/Excel/ChallengeConfigExcel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public class ChallengeConfigExcel : ExcelResource
public int ID { get; set; }
public int GroupID { get; set; }
public int MapEntranceID { get; set; }
public int MapEntranceID2 { get; set; }
public int StageNum { get; set; }
public int ChallengeCountDown { get; set; }
public int MazeBuffID { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion Common/Data/Excel/ChallengeStoryExtraExcel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public override int GetId()
return ID;
}

public override void Loaded()
public override void AfterAllDone()
{
if (GameData.ChallengeConfigData.ContainsKey(ID))
{
Expand Down
1 change: 1 addition & 0 deletions Common/Data/Excel/RelicConfigExcel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public class RelicConfigExcel : ExcelResource

[JsonConverter(typeof(StringEnumConverter))]
public RelicTypeEnum Type { get; set; }

public int MainAffixGroup { get; set; }
public int SubAffixGroup { get; set; }
public int MaxLevel { get; set; }
Expand Down
9 changes: 6 additions & 3 deletions Common/Data/Excel/RogueBuffGroupExcel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ namespace EggLink.DanhengServer.Data.Excel;
[ResourceEntity("RogueBuffGroup.json")]
public class RogueBuffGroupExcel : ExcelResource
{
[JsonProperty("MNNPAFJEGJC")] public int GroupID { get; set; }
[JsonProperty("IOMDAGGIAME")] public int GroupID { get; set; }

[JsonProperty("KCFPNHGBGIA")] public List<int> BuffTagList { get; set; } = [];
[JsonProperty("HLKMFHBOAIA")] public List<int> BuffTagList { get; set; } = [];

[JsonIgnore] public List<RogueBuffExcel> BuffList { get; set; } = [];

Expand All @@ -35,7 +35,9 @@ public void LoadBuff()
if (IsLoaded) return;
var count = 0;
foreach (var buffId in BuffTagList)
if (GameData.RogueBuffData.FirstOrDefault(x => x.Value.RogueBuffTag == buffId).Value is RogueBuffExcel buff)
{
List<RogueBuffExcel> buffs = [.. GameData.RogueBuffData.Values];
if (buffs.FirstOrDefault(x => x.RogueBuffTag == buffId) is { } buff)
{
BuffList.SafeAdd(buff);
count++;
Expand All @@ -48,6 +50,7 @@ public void LoadBuff()
BuffList.SafeAddRange(group.BuffList);
count++;
}
}

if (count == BuffTagList.Count) IsLoaded = true;
}
Expand Down
5 changes: 4 additions & 1 deletion Common/Data/Excel/RogueTournBuffGroupExcel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ public void LoadBuff()
if (IsLoaded) return;
var count = 0;
foreach (var buffId in RogueBuffDrop)
if (GameData.RogueTournBuffData.FirstOrDefault(x => x.Value.RogueBuffTag == buffId).Value is { } buff)
{
List<RogueTournBuffExcel> buffs = [.. GameData.RogueTournBuffData.Values];
if (buffs.FirstOrDefault(x => x.RogueBuffTag == buffId) is { } buff)
{
BuffList.SafeAdd(buff);
count++;
Expand All @@ -47,6 +49,7 @@ public void LoadBuff()
BuffList.SafeAddRange(group.BuffList);
count++;
}
}

if (count == RogueBuffDrop.Count) IsLoaded = true;
}
Expand Down
5 changes: 4 additions & 1 deletion Common/Data/Excel/SpecialAvatarExcel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ public override void Loaded()

public override void AfterAllDone()
{
// TODO Relic handler
}

public AvatarInfo ToAvatarData(int uid)
Expand Down Expand Up @@ -84,9 +83,13 @@ public AvatarInfo ToAvatarData(int uid)
});

if (avatarConfig != null)
{
foreach (var skill in avatarConfig.DefaultSkillTree)
instance.SkillTree.Add(skill.PointID, skill.Level);

instance.Excel = avatarConfig;
}

return instance;
}
}
48 changes: 27 additions & 21 deletions Common/Data/Excel/StageConfigExcel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace EggLink.DanhengServer.Data.Excel;

[ResourceEntity("StageConfig.json", false)]
[ResourceEntity("StageConfig.json,StageTestConfig.json", true)]
public class StageConfigExcel : ExcelResource
{
public int StageID { get; set; } = 0;
Expand Down Expand Up @@ -33,30 +33,36 @@ public List<SceneMonsterWave> ToProto()
BattleStageId = (uint)StageID
};

proto.MonsterList.Add(new SceneMonster
{
MonsterId = (uint)monsters.Monster0
});
if (monsters.Monster0 != 0)
proto.MonsterList.Add(new SceneMonster
{
MonsterId = (uint)monsters.Monster0
});

proto.MonsterList.Add(new SceneMonster
{
MonsterId = (uint)monsters.Monster1
});

proto.MonsterList.Add(new SceneMonster
{
MonsterId = (uint)monsters.Monster2
});
if (monsters.Monster1 != 0)
proto.MonsterList.Add(new SceneMonster
{
MonsterId = (uint)monsters.Monster1
});

proto.MonsterList.Add(new SceneMonster
{
MonsterId = (uint)monsters.Monster3
});
if (monsters.Monster2 != 0)
proto.MonsterList.Add(new SceneMonster
{
MonsterId = (uint)monsters.Monster2
});

proto.MonsterList.Add(new SceneMonster
{
MonsterId = (uint)monsters.Monster4
});
if (monsters.Monster3 != 0)
proto.MonsterList.Add(new SceneMonster
{
MonsterId = (uint)monsters.Monster3
});

if (monsters.Monster4 != 0)
proto.MonsterList.Add(new SceneMonster
{
MonsterId = (uint)monsters.Monster4
});

proto.MonsterParam = new SceneMonsterWaveParam();
result.Add(proto);
Expand Down
2 changes: 1 addition & 1 deletion Common/Data/Excel/SummonUnitDataExcel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class SummonUnitDataExcel : ExcelResource
public string JsonPath { get; set; } = "";
public bool DestroyOnEnterBattle { get; set; }
public bool RemoveMazeBuffOnDestroy { get; set; }

public bool IsClient { get; set; }

public SummonUnitConfigInfo? ConfigInfo { get; set; }
Expand Down
5 changes: 3 additions & 2 deletions Common/Data/GameData.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using EggLink.DanhengServer.Data.Config.Scene;
using System.Collections.Concurrent;
using EggLink.DanhengServer.Data.Config.Scene;
using EggLink.DanhengServer.Data.Custom;
using EggLink.DanhengServer.Data.Excel;
using EggLink.DanhengServer.Enums.Rogue;
Expand Down Expand Up @@ -98,7 +99,7 @@ public static Dictionary<RogueDLCBlockTypeEnum, List<ChessRogueRoomConfig>>
#region Maze

public static Dictionary<int, NPCDataExcel> NpcDataData { get; private set; } = [];
public static Dictionary<string, FloorInfo> FloorInfoData { get; } = [];
public static ConcurrentDictionary<string, FloorInfo> FloorInfoData { get; } = [];
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; } = [];
Expand Down
Loading

0 comments on commit 47ef405

Please sign in to comment.