Skip to content

Releases: Tencent/sluaunreal

2.1.4 beta

20 May 03:40
02d658f
Compare
Choose a tag to compare
2.1.4 beta Pre-release
Pre-release

新增功能:

  1. 优化Array元素为struct类型的遍历,新增PairsLessGC API,使用PairsLessGC遍历时,只会生成一个userdata且复用它。
  2. Array、Set遍历支持反向遍历。
  3. 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)
  1. 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(AA+B) --地址将会A和一个新对象
  1. 调用有返回值的UFunction函数,支持多传一个额外参数接收返回结果,以减少对象生成减少GC压力。
  2. Delegate的绑定支持直接绑定UObject和它的UFunction,且它们无须手工解绑,范例:
-- 绑定操作,如果是单播Delegate则用Bind替代Add
Button.OnClicked:Add(UIRoot, "OnButtonClickedBlueprintFunction")

--解绑操作,一般不需要
Button.OnClicked:Remove(UIRoot, "OnButtonClickedBlueprintFunction")

机制优化或者bug fixed:

  1. Array、Set等普通遍历,比之前少生成一个对象。
  2. Array、Set、Map等类型参数检查加强:之前没有检查它们的内部元素是否匹配,现在改为严格匹配内部元素。
  3. 修复checkUInterfaceProperty函数的错误提醒格式,之前可能会导致崩溃。
  4. 修复可能存在的UObject的lua函数存在判定错误。
  5. LuaWrapper导出的类型,访问它的static变量时,只生成一份数据
  6. Fixed #587 #589 #590
  7. Delegate返回值由lightuserdata改为int64类型。
  8. 优化访问Delegate类型成员变量,不再每次访问都生成一个userdata
  9. 加速SimpleString的hash计算
  10. 完整适配 Unreal Engine 5.4

2.1.3 release

11 Mar 10:20
bcdfdc5
Compare
Choose a tag to compare

bug fixes:

  1. Fixed TArray member access as binary string instead of TArray type.
  2. Fixed TArray<TEnumAsByte> member access as TArray instead of binary string type.
  3. Fixed UUserDefinedEnum access error: GetDisplayNameTextByIndex API may receive Localized Text as Source Text, which will cause a nil value to be returned.
  4. 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.
  5. Remove the restriction of assigning values to ReadOnly Properties in Lua.
  6. 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.
  1. 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).
  2. 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.
  3. Standardize the processing of FLantent type parameters: change from name-based determination to more accurate Property type determination.
  4. Add wrapper struct type check in the checkValue operator.
  5. Fixed:luaFuncClosure cache with CDO override type Object will incorrectly replace "Instance" override type Object's pure lua function.

2.1.2 release

08 Nov 08:38
ff71449
Compare
Choose a tag to compare
  1. 修复luaReplicatedIndex初始化错误等
  2. 调整一些类的 _PostConstruct 函数调用时机
  3. 添加ALuaPawn、ALuaCharacter类
  4. 删除一些老版本开关代码

2.1.1 release

02 Nov 08:39
61e9851
Compare
Choose a tag to compare
  1. Add support for FSoftObjectPtr struct, FSoftObjectProperty, and FSoftClassProperty.
  2. 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".

  1. Update LuaWrapper tool and corresponding code.
  2. Fixed RPC function cleanup bug.
  3. Allow Lua and Blueprint classes to inherit without strict correspondence, solving the problem of generating multiple RPC functions with the same name.
  4. Fixed lua replicated bugs.
  5. Support Unreal Engine 5.3

2.1.0 release

12 Jul 02:48
6b72315
Compare
Choose a tag to compare

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

09 Jun 11:58
762d64a
Compare
Choose a tag to compare
Merge pull request #526 from zjhongxian/master

fixed bugs

2.0.1 release

09 Jun 11:56
71dcb58
Compare
Choose a tag to compare
Merge pull request #522 from zjhongxian/master

Fixes many bugs

2.0.0 release

11 May 12:45
eebb18f
Compare
Choose a tag to compare

slua unreal 2.0.0 version.

1.3.3 release

01 Sep 09:47
54f6b66
Compare
Choose a tag to compare

fix #344
fix #349
fix #350
fix #351
fix #352
fix #363
fix #364
many minor fixes

1.3.2 release

23 Jul 02:48
Compare
Choose a tag to compare

fix building error on UE 4.24
add type information to CheckSelf while object had free.
fix #323
fix #330
fix #290
fix replace-all mistake to gc a value type