tModLoader CentOS服務(wù)器搭建
* 這里以?tModLoader v0.11.8(1.3.5.3)為例
* 這里以?tModLoader v0.11.8.5(1.3.5.3)為例
首先你得有(mai)一臺(tái)服務(wù)器,且設(shè)置好SSH連接,個(gè)人推薦使用FinalShell來進(jìn)行SSH連接,首先它不僅是免費(fèi)的,還有幾個(gè)非常實(shí)用的功能,用它可以直觀地看到服務(wù)器上文件,上傳和下載也很方便,同時(shí)還能實(shí)時(shí)查看內(nèi)存和CPU的占用情況。


下載tModLoader
首先安裝wget工具,完成后使用wget直接將tModLoader(后面簡(jiǎn)稱“tmod”)下載到服務(wù)器上
yum install wget
wget https://github.com/tModLoader/tModLoader/releases/download/v0.11.8/tModLoader.Linux.v0.11.8.zip

由于我買的服務(wù)器在國(guó)內(nèi),下載經(jīng)常失敗,此時(shí)可以手動(dòng)下載,然后通過FinalShell上傳到服務(wù)器,文件大小在48mb左右,官方下載地址:https://github.com/tModLoader/tModLoader/releases
解壓tmod
安裝unzip,用它來解壓zip
yum install?unzip
unzip tModLoader.Linux.v0.11.8.zip -d /root/tModLoader

安裝mono
tmod需要mono跨平臺(tái)運(yùn)行環(huán)境,mono安裝方法來自:https://www.mono-project.com/download/stable/#download-lin-centos。
首先添加mono的資料信息到centos中
CentOS8
rpmkeys --import "http://pool.sks-keyservers.net/pks/lookup?op=get&search=0x3fa7e0328081bff6a14da29aa6a19b38d3d831ef"
su -c 'curl https://download.mono-project.com/repo/centos8-stable.repo | tee /etc/yum.repos.d/mono-centos8-stable.repo'
CentOS7
rpmkeys --import "http://pool.sks-keyservers.net/pks/lookup?op=get&search=0x3fa7e0328081bff6a14da29aa6a19b38d3d831ef"
su -c 'curl https://download.mono-project.com/repo/centos7-stable.repo | tee /etc/yum.repos.d/mono-centos7-stable.repo'
CentOS8
CentOS7
安裝mono
yum install mono-devel

由于網(wǎng)絡(luò)原因安裝mono很容易失敗,如果你的也是CentOS8,請(qǐng)閱讀我寫的這篇文章:

啟動(dòng)tmod
將 相關(guān)文件(?tModLoaderServer、tModLoaderServer.bin.x86_64等)設(shè)置為可執(zhí)行,然后執(zhí)行啟動(dòng)腳本。
chmod u+x /root/tModLoader/tModLoaderServer*
/root/tModLoader/tModLoaderServer


安裝 screen
tmod服務(wù)器開啟后,如果我們直接關(guān)閉終端,服務(wù)器會(huì)被強(qiáng)制退出,安裝screen后,就能夠后臺(tái)運(yùn)行tmod。
一般直接安裝即可
yum install screen
CentOS8上可能提示錯(cuò)誤“Error: Unable to find a match: screen”,先安裝epel就可以解決了
yum install epel-release
yum install screen
screen使用方法
首先創(chuàng)建一個(gè)screen 它的名字是 tmod,執(zhí)行后會(huì)打開一個(gè)新的終端會(huì)話
screen -S tmod
然后執(zhí)行tmod的開服腳本即可
/root/tModLoader/tModLoaderServer
然后斷開終端連接,tmod服務(wù)器仍然會(huì)運(yùn)行,當(dāng)我們?cè)俅芜B接終端時(shí),輸入以下命令即可恢復(fù)
screen -r

上傳mod或地圖
運(yùn)行一次,讓tmod創(chuàng)建相關(guān)文件夾,然后按 Ctrl+Z 退出

tmod相關(guān)的文件會(huì)被存放在?(/root/.local/share/Terraria/ModLoader)
其中Mods目錄是mod目錄,Worlds是地圖存檔目錄

在FinalShell的文件窗口,找到mods目錄,將你玩mod拖進(jìn)來,當(dāng)你松開鼠標(biāo)左鍵時(shí),F(xiàn)inalShell會(huì)自動(dòng)將mod傳到該目錄。上傳地圖也是同樣的操作。
上傳進(jìn)度界面是浮動(dòng)的,會(huì)自動(dòng)隱藏,可以在軟件界面的右上角找到顯示開關(guān),當(dāng)有文件在傳輸時(shí)圖標(biāo)是橙色的。

啟用mod
運(yùn)行腳本啟動(dòng)程序,出現(xiàn)超過4個(gè)選項(xiàng),自下而上分別是 Mod Browser(模組瀏覽器)、Mods Menu(模組管理)、Delete World(刪除世界)、New World(創(chuàng)建世界)等。
1、輸入字母“m”,然后敲Enter鍵,執(zhí)行“Mods Menu”操作,這步相當(dāng)于在tmod的主界面上點(diǎn)擊了模組管理。


2、此時(shí)會(huì)列出mod目錄下的相關(guān)模組,在模組的名字后面可以看到(disabled)字樣,說明該模組未被啟用。輸入模組名稱左邊的序號(hào)啟用對(duì)應(yīng)模組,例如要啟用 Localizer,首先輸入1,然后敲Enter鍵,此時(shí)對(duì)應(yīng)選項(xiàng)變?yōu)?"1? ? ?Localizer(enabled)"。要啟用模組,只需輸入“e”,然后敲Enter鍵即可,啟用操作幾乎是一瞬間完成的,但事實(shí)上得執(zhí)行完重載mod操作才算啟用成功,所以選擇要要啟用的mod后,輸入“r”然后敲Enter鍵,,讓剛才的啟用操作生效。


mod啟用成功后,選擇地圖進(jìn)行開服。tmod默認(rèn)也是使用7777端口的,請(qǐng)記得去服務(wù)器后臺(tái)開放這個(gè)端口權(quán)限哦!
后續(xù)還有些步驟,就暫時(shí)寫到這吧~~~~
~Enjoy~