Adding scripting functionality to .NET applications

前端 未结 9 1492
不思量自难忘°
不思量自难忘° 2020-11-29 21:55

I have a little game written in C#. It uses a database as back-end. It\'s a trading card game, and I wanted to implement the function of the cards as a script.

What

9条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-29 22:42

    I'm using LuaInterface1.3 + Lua 5.0 for a NET 1.1 application.

    The issue with Boo is that every time you parse/compile/eval your code on the fly, it creates a set of boo classes so you will get memory leaks.

    Lua in the other hand, does not do that, so it's very very stable and works wonderful (I can pass objects from C# to Lua and backwards).

    So far I haven't put it in PROD yet, but seems very promising.

    I did have memory leaks issues in PROD using LuaInterface + Lua 5.0, therefore I used Lua 5.2 and linked directly into C# with DllImport. The memory leaks were inside the LuaInterface library.

    Lua 5.2: from http://luabinaries.sourceforge.net and http://sourceforge.net/projects/luabinaries/files/5.2/Windows%20Libraries/Dynamic/lua-5.2_Win32_dll7_lib.zip/download

    Once I did this, all my memory leaks were gone and the application was very stable.

提交回复
热议问题