diff --git a/src/Luban.Job.Cfg/Source/Generate/CppCodeBinRender.cs b/src/Luban.Job.Cfg/Source/Generate/CppCodeBinRender.cs index d1e72da..dfcbaeb 100644 --- a/src/Luban.Job.Cfg/Source/Generate/CppCodeBinRender.cs +++ b/src/Luban.Job.Cfg/Source/Generate/CppCodeBinRender.cs @@ -47,7 +47,7 @@ class {{name}} : public {{if parent_def_type}} {{parent_def_type.cpp_full_name}} { public: - static bool deserialize{{name}}(ByteBuf& _buf, std::shared_ptr<{{name}}>& _out); + static bool deserialize{{name}}(ByteBuf& _buf, ::bright::SharedPtr<{{name}}>& _out); {{name}}() { @@ -273,7 +273,7 @@ namespace {{x.top_module}} return true; } - bool {{type.cpp_full_name}}::deserialize{{type.name}}(ByteBuf& _buf, std::shared_ptr<{{type.cpp_full_name}}>& _out) + bool {{type.cpp_full_name}}::deserialize{{type.name}}(ByteBuf& _buf, ::bright::SharedPtr<{{type.cpp_full_name}}>& _out) { {{~if type.is_abstract_type~}} int id; diff --git a/src/Luban.Job.Common/Source/Defs/DefAssemblyBase.cs b/src/Luban.Job.Common/Source/Defs/DefAssemblyBase.cs index 989bb11..c81e40d 100644 --- a/src/Luban.Job.Common/Source/Defs/DefAssemblyBase.cs +++ b/src/Luban.Job.Common/Source/Defs/DefAssemblyBase.cs @@ -147,15 +147,24 @@ namespace Luban.Job.Common.Defs switch (type) { case "bool": return nullable ? TBool.NullableIns : TBool.Ins; + case "uint8": case "byte": return nullable ? TByte.NullableIns : TByte.Ins; + case "int16": case "short": return nullable ? TShort.NullableIns : TShort.Ins; + case "fint16": case "fshort": return nullable ? TFshort.NullableIns : TFshort.Ins; + case "int32": case "int": return nullable ? TInt.NullableIns : TInt.Ins; + case "fint32": case "fint": return nullable ? TFint.NullableIns : TFint.Ins; + case "int64": case "long": return nullable ? TLong.NullableIns : TLong.Ins; case "bigint": return nullable ? TLong.NullableBigIns : TLong.BigIns; + case "fint64": case "flong": return nullable ? TFlong.NullableIns : TFlong.Ins; + case "float32": case "float": return nullable ? TFloat.NullableIns : TFloat.Ins; + case "float64": case "double": return nullable ? TDouble.NullableIns : TDouble.Ins; case "bytes": return TBytes.Ins; case "string": return nullable ? TString.NullableIns : TString.Ins;