Skip to content

Commit 7da01cf

Browse files
committed
Refactor Dict Allocation
1 parent aa22ab8 commit 7da01cf

File tree

18 files changed

+468
-446
lines changed

18 files changed

+468
-446
lines changed

Zolian.GameServer/Zolian.GameServer.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
</PropertyGroup>
4242

4343
<ItemGroup>
44-
<PackageReference Include="Chaos-Networking" Version="3.0.2" />
44+
<PackageReference Include="Chaos-Networking" Version="3.0.3" />
4545
<PackageReference Include="Microsoft.Data.SqlClient" Version="7.0.0-preview2.25289.6" />
4646
<PackageReference Include="Microsoft.DependencyValidation.Analyzers" Version="0.11.0" />
4747
<PackageReference Include="Microsoft.Extensions.Hosting" Version="10.0.2">

Zolian.Server.Base/Database/AreaStorage.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,8 @@ public async void CacheFromDatabase()
8080

8181
if (!string.IsNullOrEmpty(temp.ScriptKey))
8282
{
83-
var scriptToType = ScriptManager.Load<AreaScript>(temp.ScriptKey, temp);
84-
var scriptFoundGetValue = scriptToType.TryGetValue(temp.ScriptKey, out var script);
85-
if (scriptFoundGetValue)
86-
temp.Script = new Tuple<string, AreaScript>(temp.ScriptKey, script);
83+
if (ScriptManager.TryCreate<AreaScript>(temp.ScriptKey, out var script, temp) && script != null)
84+
temp.Script = Tuple.Create(temp.ScriptKey, script);
8785
}
8886

8987
ServerSetup.Instance.TempGlobalMapCache[temp.ID] = temp;

0 commit comments

Comments
 (0)