Releases: Tencent/sluaunreal
Releases · Tencent/sluaunreal
2.1.4 Release
新增功能:
- 优化Array元素为struct类型的遍历,新增PairsLessGC API,使用PairsLessGC遍历时,只会生成一个userdata且复用它。
- Array、Set遍历支持反向遍历。
- lua值复制支持:REPNOTIFY_Always 选项,当它生效时,DS端的赋值无论值是否改变都会通知客户端.
示例:
local LuaActor ={}
function LuaActor:GetLifetimeReplicatedProps()
local ELifetimeCondition = import("ELifetimeCondition")
return {
{ "HP", ELifetimeCondition.COND_None, EPropertyClass.Float, RepNotifyCondition = 1},
}
end
return Class(nil, nil, LuaActor)
- LuaWrapper里面导出的类型,原本有"+"、"-"、"*"、"/"等操作支持的,分别增加add、sub、mul、div等API,区别在于操作符运算结果返回会新增一个userdata,而add、sub、mul、div等会把结果加到自身以减少对象生成减少GC压力。
local A = FVector(1,2,3)
local B = FVector(2,3,4)
print(A, A:add(B)) --地址将会是A、A
print(A、A+B) --地址将会A和一个新对象
- 调用有返回值的UFunction函数,支持多传一个额外参数接收返回结果,以减少对象生成减少GC压力。
- Delegate的绑定支持直接绑定UObject和它的UFunction,且它们无须手工解绑,范例:
-- 绑定操作,如果是单播Delegate则用Bind替代Add
Button.OnClicked:Add(UIRoot, "OnButtonClickedBlueprintFunction")
--解绑操作,一般不需要
Button.OnClicked:Remove(UIRoot, "OnButtonClickedBlueprintFunction")
机制优化或者bug fixed:
- Array、Set等普通遍历,比之前少生成一个对象。
- Array、Set、Map等类型参数检查加强:之前没有检查它们的内部元素是否匹配,现在改为严格匹配内部元素。
- 修复checkUInterfaceProperty函数的错误提醒格式,之前可能会导致崩溃。
- 修复可能存在的UObject的lua函数存在判定错误。
- LuaWrapper导出的类型,访问它的static变量时,只生成一份数据
- Fixed #587 #589 #590
- Delegate返回值由lightuserdata改为int64类型。
- 优化访问Delegate类型成员变量,不再每次访问都生成一个userdata
- 加速SimpleString的hash计算
- 修复Lua值复制DS端赋值同样的变量(REPNOTIFY_OnChanged条件下),可能导致变量不变但是也通知到客户端的bug
- 修复UObject按Instance Hook比CDO类函数多的时候,可能会导致前者函数Hook被跳过的bug
- lua支持到5.4.3版本
- 补全UE5.1/5.2下缺失的LuaWrapper API
- 完整适配 Unreal Engine 5.4
Full Changelog: 2.1.3...2.1.4
2.1.3 release
bug fixes:
- Fixed TArray member access as binary string instead of TArray type.
- Fixed TArray<TEnumAsByte> member access as TArray instead of binary string type.
- Fixed UUserDefinedEnum access error: GetDisplayNameTextByIndex API may receive Localized Text as Source Text, which will cause a nil value to be returned.
- lua replicated:
- Fixed: values also have their shadow data participate in GC marking to prevent wild pointers.
- Fixed: Changed the Value Type of ClassLuaReplicatedMap class to pointer type to avoid memory invalidation bug caused by Resize.
- Fixed: When Lua replicated data is of Array type, unsynchronized data may occur when the array is expanded and the old data is not updated.
- Fixed the shared serialization copy error when the Lua replication type is set to Array.
- Fixed:Out of range in FLuaNetSerialization::Write with arraySharedSerializetion SharedPropertyInfo.
- Remove the restriction of assigning values to ReadOnly Properties in Lua.
- Fixed: Value misalignment when iterating through UObject and UStruct: when encountering types such as Struct, Array, Map, and Set, the value of the previous member variable will be overwritten. eg.
local SluaTestCase=import('SluaTestCase');
local t=SluaTestCase()
for k, v in pairs(t) do
print("SluaTestCase iter", k, v)
end
print("SluaTestCase weakptr:", t.weakptr) --error: t.weakptr will be LuaArray instead of uobject type.
- Fixed memory leak caused by the assignment error in returnProperty, which resulted in the failure to destruct the return value by returnProperty->DestroyValue_InContainer(locals).
- Fixed When executing the ProcessContextOpcode bytecode and triggering the luaOverrideFunc function, the lack of destruction of the initialized parameters in Stack.Step(Code) leads to memory leaks.
- Standardize the processing of FLantent type parameters: change from name-based determination to more accurate Property type determination.
- Add wrapper struct type check in the checkValue operator.
- Fixed:luaFuncClosure cache with CDO override type Object will incorrectly replace "Instance" override type Object's pure lua function.
2.1.2 release
- 修复luaReplicatedIndex初始化错误等
- 调整一些类的 _PostConstruct 函数调用时机
- 添加ALuaPawn、ALuaCharacter类
- 删除一些老版本开关代码
2.1.1 release
- Add support for FSoftObjectPtr struct, FSoftObjectProperty, and FSoftClassProperty.
- Lua defined Net Replication Property usage optimise, eg:
function LuaGameState:GetLifetimeReplicatedProps()
local FVectorType = import("Vector")
{ "Position", ELifetimeCondition.COND_SimulatedOnly, FVectorType},
end
before:
self.Position.X = 100
self.Position = self.Position
after:
self.Position.X = 100
Not need to write "self.Position = self.Position".
- Update LuaWrapper tool and corresponding code.
- Fixed RPC function cleanup bug.
- Allow Lua and Blueprint classes to inherit without strict correspondence, solving the problem of generating multiple RPC functions with the same name.
- Fixed lua replicated bugs.
- Support Unreal Engine 5.3
2.1.0 release
Stable version verified in PUBG Mobile.
1、Add AddLuaNetListener/RemoveLuaNetListener API for lua net property monitoring.
2、Optimise GC :The Override object of the Instance type performs cache processing when calling a Lua function through userdata to prevent generating a closure every time it is called.
3、UEnum optimization:UEnum type maybe got nil because FName Case Insensitive.
4、Add struct clone api,eg: FVector():clone()
5、fixed many bugs
2.0.2 release
Merge pull request #526 from zjhongxian/master fixed bugs
2.0.1 release
Merge pull request #522 from zjhongxian/master Fixes many bugs
2.0.0 release
slua unreal 2.0.0 version.