mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2025-12-12 18:27:24 +01:00
Update StateApi.cs
This commit is contained in:
parent
da1db70635
commit
c31f6c19a6
1 changed files with 10 additions and 0 deletions
|
|
@ -180,6 +180,16 @@ public sealed class StateApi : IGlamourerApiState, IApiService, IDisposable
|
|||
return ApiHelpers.Return(GlamourerApiEc.Success, args);
|
||||
}
|
||||
|
||||
public (GlamourerApiEc, bool?) IsUnlocked(int objectIndex, uint key)
|
||||
{
|
||||
var args = ApiHelpers.Args("Index", objectIndex, "Key", key);
|
||||
if (_helpers.FindExistingState(objectIndex, out var state) != GlamourerApiEc.Success)
|
||||
return (ApiHelpers.Return(GlamourerApiEc.ActorNotFound, args), null);
|
||||
if (state == null)
|
||||
return (ApiHelpers.Return(GlamourerApiEc.InvalidState, args), null); // Possibly, the error type could be changed. I just looked at what was available.
|
||||
return (ApiHelpers.Return(GlamourerApiEc.Success, args), state.CanUnlock(key));
|
||||
}
|
||||
|
||||
public GlamourerApiEc UnlockStateName(string playerName, uint key)
|
||||
{
|
||||
var args = ApiHelpers.Args("Name", playerName, "Key", key);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue