Compare commits
2 Commits
344f58286d
...
192ddb67d9
Author | SHA1 | Date | |
---|---|---|---|
![]() |
192ddb67d9 | ||
![]() |
5e4cfcb945 |
Binary file not shown.
BIN
ArmaRAMDb_x64.so
BIN
ArmaRAMDb_x64.so
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -60,15 +60,19 @@ namespace ArmaRAMDb
|
||||
}
|
||||
|
||||
public static async Task ListRangeAsync(string listName, string startIndex, string endIndex, string function, string uniqueId, string entity = null, string call = "false", int bufferSize = Main.ARDB_BUFFERSIZE)
|
||||
{
|
||||
{
|
||||
await Task.Yield();
|
||||
|
||||
|
||||
if (_lists.TryGetValue(listName, out var list))
|
||||
{
|
||||
lock (list)
|
||||
{
|
||||
int start = int.Parse(startIndex);
|
||||
int end = int.Parse(endIndex);
|
||||
|
||||
if (end == -1)
|
||||
end = list.Count - 1;
|
||||
|
||||
start = Math.Max(0, start);
|
||||
end = Math.Min(list.Count - 1, end);
|
||||
|
||||
@ -80,8 +84,18 @@ namespace ArmaRAMDb
|
||||
Main.Log($"ListRange: {listName} - StartIndex: {start} - EndIndex: {end} - Count: {count}", "debug");
|
||||
Utils.CheckByteCount(uniqueId, $"[{data}]", function, entity, Convert.ToBoolean(call), bufferSize);
|
||||
}
|
||||
else
|
||||
{
|
||||
Main.Log($"ListRange: {listName} - Invalid range or empty result", "debug");
|
||||
Utils.CheckByteCount(uniqueId, "[]", function, entity, Convert.ToBoolean(call), bufferSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Main.Log($"ListRange: {listName} - List not found", "debug");
|
||||
Utils.CheckByteCount(uniqueId, "[]", function, entity, Convert.ToBoolean(call), bufferSize);
|
||||
}
|
||||
}
|
||||
|
||||
public static async Task ListSetAsync(string listName, string index, string value)
|
||||
|
Loading…
x
Reference in New Issue
Block a user