feat: Improved ListRange functionality and updated build artifacts
This commit enhances the `ListRangeAsync` function within the ArmaRAMDb extension and updates the build artifacts. Specifically, the following changes were made: * **ListStore.cs:** * Modified `ListRangeAsync` to handle an `endIndex` of -1, treating it as the last element of the list. * Added checks to ensure valid ranges and return an empty array if the range is invalid or the result is empty. * Added a check to return an empty array if the list is not found. * **Build Artifacts:** * Updated the `ArmaRAMDb_x64.dll` and `ArmaRAMDb_x64.so` files in the root directory and the extension/bin/Release/net8.0/win-x64/publish and extension/bin/Release/net8.0/linux-x64/publish directories.
This commit is contained in:
parent
3af3adeec6
commit
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.
@ -69,6 +69,10 @@ namespace ArmaRAMDb
|
|||||||
{
|
{
|
||||||
int start = int.Parse(startIndex);
|
int start = int.Parse(startIndex);
|
||||||
int end = int.Parse(endIndex);
|
int end = int.Parse(endIndex);
|
||||||
|
|
||||||
|
if (end == -1)
|
||||||
|
end = list.Count - 1;
|
||||||
|
|
||||||
start = Math.Max(0, start);
|
start = Math.Max(0, start);
|
||||||
end = Math.Min(list.Count - 1, end);
|
end = Math.Min(list.Count - 1, end);
|
||||||
|
|
||||||
@ -80,8 +84,18 @@ namespace ArmaRAMDb
|
|||||||
Main.Log($"ListRange: {listName} - StartIndex: {start} - EndIndex: {end} - Count: {count}", "debug");
|
Main.Log($"ListRange: {listName} - StartIndex: {start} - EndIndex: {end} - Count: {count}", "debug");
|
||||||
Utils.CheckByteCount(uniqueId, $"[{data}]", function, entity, Convert.ToBoolean(call), bufferSize);
|
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)
|
public static async Task ListSetAsync(string listName, string index, string value)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user