Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
NLua
Commits
db21506a
Commit
db21506a
authored
Oct 05, 2021
by
Kagamia
Committed by
Vinicius Jarina
Oct 05, 2021
Browse files
Fix passing bytearray from lua.
parent
4a6440e9
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/CheckType.cs
View file @
db21506a
...
...
@@ -167,12 +167,10 @@ namespace NLua
else
return
null
;
}
else
{
object
obj
=
_translator
.
GetNetObject
(
luaState
,
stackPos
);
if
(
obj
!=
null
&&
paramType
.
IsInstanceOfType
(
obj
))
return
_extractNetObject
;
}
object
netObj
=
_translator
.
GetNetObject
(
luaState
,
stackPos
);
if
(
netObj
!=
null
&&
paramType
.
IsInstanceOfType
(
netObj
))
return
_extractNetObject
;
return
null
;
}
...
...
tests/src/LuaTests.cs
View file @
db21506a
...
...
@@ -2776,6 +2776,29 @@ namespace NLuaTest
WriteBinary (value);
"
);
}
}
[
Test
]
public
void
RawByteArrayParameter
()
{
using
(
var
lua
=
new
Lua
())
{
lua
.
LoadCLRPackage
();
lua
[
"WriteBinary"
]
=
(
Action
<
byte
[
]>
)
WriteBinary
;
lua
.
DoString
(
@"
import 'System'
local value = Byte[8]
value[0] = 1
value[1] = 2
value[2] = 3
value[3] = 0x3f
value[4] = 0x40
value[5] = 0xff
value[6] = 0xf3
value[7] = 0x9f
WriteBinary (value);
"
);
}
}
Entity
myEntity
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment