我在 VPS 上使用 TerrariaServer 启动 mono 时遇到问题。我安装了 mono-runtime 和所有“必需”包,如下所示:
$ sudo apt-get install -f mono-runtime
然后我在 /home 目录中创建了一个文件夹来保存游戏服务器配置
$ mkdir terraria_server && cd terraria_server
然后我下载了最新的 TShock 服务器版本并解压它
$ wget https://github.com/Pryaxis/TShock/releases/download/v4.3.25/tshock_4.3.25.zip
$ unzip tshock_4.3.25.zip
毕竟我想用单声道开始
$ sudo mono TerrariaServer.exe
但我遇到了这个错误
Can't find custom attr constructor image:
/home/thetanadu/terraria_server/OTAPI.dll mtoken: 0x0a000085 Unhandled
loader error: 8, (null) System.Core, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089 (null)
* Assertion: should not be reached at loader.c:298
Stacktrace:
at <unknown> <0xffffffff> at OTAPI.Shims.TShock.Program.Main
(string[]) <0x0008b> at (wrapper runtime-invoke)
<Module>.runtime_invoke_void_object (object,intptr,intptr,intptr)
<0xffffffff>
Native stacktrace:
mono() [0x49ff2f]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x11390) [0x7f975d676390]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x38) [0x7f975d2d0428]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x16a) [0x7f975d2d202a]
mono() [0x630409]
mono() [0x63069c]
mono() [0x630833]
mono() [0x54357a]
mono(mono_class_from_typeref_checked+0x223) [0x524c63]
mono() [0x5234ad]
mono() [0x560fb4]
mono() [0x561354]
mono(mono_metadata_parse_type+0x18) [0x5616a8]
mono() [0x560e73]
mono() [0x561354]
mono(mono_metadata_parse_mh_full+0x1f8) [0x561e18]
mono() [0x433fd6]
mono() [0x500b39]
mono() [0x501fbd]
mono() [0x425db6]
mono() [0x426749]
mono(mono_runtime_invoke+0x3d) [0x5ac68d]
mono() [0x5acace]
mono() [0x461fc5]
mono() [0x500b39]
mono() [0x501fbd]
mono() [0x425db6]
mono() [0x42634b]
mono() [0x4a11b1]
[0x40e3517d]
Debug info from gdb:
=================================================================
Got a SIGABRT while executing native code. This usually indicates a fatal
error in the mono runtime or one of the native libraries used by your
application.
=================================================================
Aborted (core dumped)
这是我在服务器上的文件夹 - 我认为它应该可以正常工作,因为那里有“OTAPI.dll”。
thetanadu@thetanadu:~/terraria_server$ ls -a
. GeoIP.dat OTAPI.dll sqlite3.dll tshock_4.3.25.zip
.. Newtonsoft.Json.dll ServerPlugins TerrariaServer.exe
我知道 exe 和 dll 库适用于 Windows,但 mono 应该模拟该环境 - 对吗?
编辑 - 我安装了软件包“mono-complete”并且开始正常工作:D 可能最新的 mono 没有什么重要的东西:)