Multiplayer Chinese

From Necesse Wiki
Jump to navigation Jump to search

本文介绍Necesse游戏服务器的完整架设过程.

If you want to set up a Linux dedicated server specifically, you can follow this guide.

购买服务器[edit]

如果你想购买服务器,在这里推荐腾讯云的轻量应用型服务器:

  • 等打折的时候买,70左右能买一年1H2G4M配置左右的服务器,配置完全够用
  • 如果是在校大学生可以申请教育优惠,买服务器便宜不少

下载服务器文件[edit]

下载服务器文件可以通过两种不同的方式进行,见下文:


通过steam直接下载 打开steam库,显示筛选选择工具,详情见右侧图

找到 'Necesse Dedicated Server' 点击下载,下载完右键浏览本地文件


通过官方网站下载

官方网址如下:https://necessegame.com/server/

开放服务器端口[edit]

你需要在您的路由表及windows防火墙上开放14159端口(UDP协议)

路由器

鉴于大家都是买的服务器,请大家在服务器的控制台开放UDP协议的14159端口

Windows 防火墙

windows设置中搜索 "Windows defender 防火墙"

点击 "高级设置" .

右击入站规则,选择 "新建规则"

选择"端口" 点击 "下一步"

Error creating thumbnail: File missing

选择 (UDP) 输入端口号 (如果你想保持默认,请直接输入14159) 点击下一步.

选择 "允许链接" 点击下一步.

勾选所有.

名称填写"Necesse Server" 点击完成.

Port Forwarding Testing

Test that your ports are forwarded correctly by entering your public IP address and the port number on this site:

!开服![edit]

解压下载的文件,建议解压在C盘根目录

双击"StartServer.bat",如果没有反应请安装java环境

双击之后会弹出控制台,会询问你服务器的名称(推荐使用全英文),输入完成之后单击回车

If you want custom server options, type in "y" and click "Enter", if you do not, type "n" and click "Enter"

如果你想要自定义服务器选项,输入 "y "并点击 "Enter",如果你不想要,输入 "n "并点击 "Enter"

It will ask you to specify the "host port" this is the port we forwarded earlier, so type in 14159 and then click "Enter"

会询问你的端口号,我们直接输入14159就好,输入完成按回车

Then, it will ask for the amount of player slots, type in a number between 1 and 250, and click "Enter"

然后,会询问你服务器支持在线的最大玩家数,范围是1-250,输入后按回车

Next, it will ask whether you want a server password, if you do, type in the server password, don't type anything if you don't want a server password, and click "Enter"

然后,会询问你服务器是否需要密码,留空则是没有密码,输入后回车

It will ask you to specify custom spawn island, leave blank for random or enter a custom spawn island in the format: <x>,<y> and click "Enter"

是否自定义出生岛,留空为随机,或以格式输入自定义出生岛。格式为<x>,<y>然后点击 "Enter"(例<1>,<1>)

Then you'll be asked to specify spawn seed, enter a random number or leave blank for random, and click "Enter"

是否需要自定义世界种子号,留空为随机,输入完回车

You'll then be asked to choose whether to spawn the guide house, type in "y" for yes or "n" for no, and click "Enter"

是否需要生成初始房屋(推荐生成),输入"y"后回车

最后按一下回车,以启动服务器

Leave the dedicated server program window open to keep the server running, when you want to shut down the server, type "quit" into the text box and click "Enter" or click the X at the top right of the window.

如何加入服务器[edit]

Steam中打开游戏

点击"多人游戏"

点击"添加服务器"

输入一个服务器名字,在 "名称" 框

输入你的IP地址 (可以在如下网站找到你的公网IP地址: https://www.ip138.com/) 您的iP地址是:[xxx.xxx.xxx.xxx]

输入端口号,如果在之前的教程没有更改就输入14159

点击 "添加"

你的服务器就会展示在多人游戏列表里面,双击相应服务器就能进入游戏

配置服务器[edit]

If you want to change the configuration of your server (after the initial setup) you will need to edit some files. They can be edited using any Text Editor program, such as Notepad (pre-installed to all Windows based PC's)

Before editing any configuration files, you should ALWAYS stop your server first.

To navigate to the server's configuration files (and save files) type %appdata% into the Windows search bar, then double-click the "Necesse" folder

The server configuration file is named "server.cfg" and is located at C:\Users\YourPCUsernameHere\AppData\Roaming\Necesse\cfg

The world configuration file is named "worldSettings.cfg" and is located at C:\Users\YourPCUsernameHere\AppData\Roaming\Necesse\saves\YourWorldNamehere.zip

The world is in a Compressed (zipped) .zip folder by default, meaning you will have to extract the files contained inside by right-clicking and selecting "Extract Here" - rename the original YourWorldNameHere.zip to something different.

然后你需要修改 "worldSettings.cfg" 文件.

Then right-click the YourWorldNameHere folder, and hover over "Send to" and click "Compressed (zipped) folder"

服务器相关文件位置[edit]

默认如下

服务器配置及相关设置 "server.cfg" 在如下位置 C:\Users\电脑用户名\AppData\Roaming\Necesse\cfg

游戏世界相关设置文件 "worldSettings.cfg" 在如下位置 C:\Users\电脑用户名\AppData\Roaming\Necesse\saves\YourWorldNamehere.zip

服务器保存的输入命名方式 "世界名.zip" , 在如下位置 C:\Users\电脑用户名\AppData\Roaming\Necesse\saves\

服务器日志文件位置如下 C:\Users\电脑用户名\AppData\Roaming\Necesse\logs


Customizations

Forcing configs to the game directory can be done with the -localdir parameter in bat file