Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 84
Xml Trigger#459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Xml Trigger #459
Changes from all commits
298edbcb528d4d3e7a31a9054dbf41a9d5f6d10f523bdda8001712751459ff2File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,3 @@ | ||
| [submodule "Maple2.Server.Game/Scripting/Scripts"] | ||
| path = Maple2.Server.Game/Scripting/Scripts | ||
| url = https://github.com/AngeloTadeucci/maple2-scripts.git | ||
| [submodule "Maple2.Server.Game/Navmeshes"] | ||
| path = Maple2.Server.Game/Navmeshes | ||
| url = https://github.com/AngeloTadeucci/Maple2.Navmeshes |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| using System.Diagnostics.CodeAnalysis; | ||
| using Maple2.Database.Context; | ||
| using Maple2.Model.Metadata; | ||
| namespace Maple2.Database.Storage; | ||
| public class TriggerScriptMetadata(MetadataContext context) : MetadataStorage<(string, string), TriggerMetadata>(context, CACHE_SIZE) { | ||
| private const int CACHE_SIZE = 5000; // ~5k total triggers | ||
| public bool TryGet(string mapXBlock, string triggerName, [NotNullWhen(true)] out TriggerMetadata? trigger) { | ||
| if (Cache.TryGet((mapXBlock, triggerName), out trigger)) { | ||
| return true; | ||
| } | ||
| lock (Context) { | ||
| // Double-checked locking | ||
| if (Cache.TryGet((mapXBlock, triggerName), out trigger)) { | ||
| return true; | ||
| } | ||
| trigger = Context.TriggerMetadata.Find(mapXBlock, triggerName); | ||
| if (trigger == null) { | ||
| return false; | ||
| } | ||
| Cache.AddReplace((mapXBlock, triggerName), trigger); | ||
| } | ||
| return true; | ||
| } | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.