游客你好,登录后能编辑wiki哦!

全站通知:

多人联机服务器建设简单教程

阅读

    

2020-03-31更新

    

最新编辑:逗比的马老师

阅读:

  

更新日期:2020-03-31

  

最新编辑:逗比的马老师

来自异星工厂WIKI_BWIKI_哔哩哔哩
跳到导航 跳到搜索
页面贡献者 :
逗比的马老师
No-building-material-icon.png
本文章为 (字母) 原创,未经作者允许,请勿擅自修改,转载请注明出处并附带 本页链接
Signal each.png
,请注意文章时效!
  • 在游戏跟目录新建一个文本文件,并重命名为start.bat
  • start.bat内容为以下代码:
@echo off 
::============================================================================================================== 
::Replace the appropriate entries below to suit your installation (Default install example shown)
::============================================================================================================== 
set FactorioExeLocation=%cd%\bin\x64
::游戏运行位置
set SaveFileName=2.zip 
set SaveLocation=%cd%\saves\
::存档名和位置
set ServerSettingsFileName=server-settings.example.json
set ServerSettingsLocation=%cd%\
::服务端配置文件名和位置
::============================================================================================================== 
cd %FactorioExeLocation%
echo.
echo.
echo PREPARING TO LAUNCH FACTORIO SERVER... 
echo. 
echo Save to be loaded:
echo %SaveLocation%%SaveFileName%
echo.
echo Server Settings to load:
echo %ServerSettingsLocation%%ServerSettingsFileName% 
echo. 
echo. 
echo *** Remember to use Ctrl+C to ensure saving when finished instead of simply closing this window *** 
echo.
echo.
pause 
::============================================================================================================== 
:: ***NOTE: The line below launches factorio in headless mode with desired server settings, add any other 
:: desired arguments to end of the line. Use "factorio.exe --help" for a list of all supported arguments. 
::============================================================================================================== 
factorio.exe --start-server "%SaveLocation%%SaveFileName%" --server-settings "%ServerSettingsLocation%%ServerSettingsFileName%"
pause
  • 注:关闭服务器请使用 CTRL + C 停止进程后再关闭服务器窗口


  • 服务器配置文件server-settings.example.json,在根目录data文件夹下,此处可复制到游戏根目录然后按以下格式配置
{
  "name": "服务器名",
  "description": "服务器介绍",
  "tags": ["game", "tags"],服务器标签

  "_comment_max_players": "Maximum number of players allowed, admins can join even a full server. 0 means unlimited.",
  "max_players": 0,服务器最大人数0为不限制

  "_comment_visibility": ["public: Game will be published on the official Factorio matching server",
                          "lan: Game will be broadcast on LAN"],
  "visibility":
  {
    "public": true,是否在互联网公开
    "lan": true是否在局域网公开
  },

  "_comment_credentials": "Your factorio.com login credentials. Required for games with visibility public",
  "username": "",
  "password": "",账户名和密码

  "_comment_token": "Authentication token. May be used instead of 'password' above.",
  "token": "",服务器秘钥

  "game_password": "",服务器密码

  "_comment_require_user_verification": "When set to true, the server will only allow clients that have a valid Factorio.com account",
  "require_user_verification": true,正版验证,开启后只有正版才能加入

  "_comment_max_upload_in_kilobytes_per_second" : "optional, default value is 0. 0 means unlimited.",
  "max_upload_in_kilobytes_per_second": 0,最大上传速度,0为不限制

  "_comment_minimum_latency_in_ticks": "optional one tick is 16ms in default speed, default value is 0. 0 means no minimum.",
  "minimum_latency_in_ticks": 0,低于这个延迟的才能加入,0为不限制

  "_comment_ignore_player_limit_for_returning_players": "Players that played on this map already can join even when the max player limit was reached.",
  "ignore_player_limit_for_returning_players": false,已经加入过服务器的,是否能在满员后加入

  "_comment_allow_commands": "possible values are, true, false and admins-only",
  "allow_commands": "admins-only",控制台权限,开,关和仅限管理员

  "_comment_autosave_interval": "Autosave interval in minutes",
  "autosave_interval": 30,自动存档时间

  "_comment_autosave_slots": "server autosave slots, it is cycled through when the server autosaves.",
  "autosave_slots": 5,自动存档数量

  "_comment_afk_autokick_interval": "How many minutes until someone is kicked when doing nothing, 0 for never.",
  "afk_autokick_interval": 0,挂机多长时间后被踢出,0为不开启

  "_comment_auto_pause": "Whether should the server be paused when no players are present.",
  "auto_pause": true,无人时是否暂停

  "only_admins_can_pause_the_game": true,暂停游戏权限,开启时只有管理员能暂停游戏

  "_comment_autosave_only_on_server": "Whether autosaves should be saved only on server or also on all connected clients. Default is true.",
  "autosave_only_on_server": true,
  
  "_comment_non_blocking_saving": "Highly experimental feature, enable only at your own risk of losing your saves. On UNIX systems, server will fork itself to create an autosave. Autosaving on connected Windows clients will be disabled regardless of autosave_only_on_server option.",
  "non_blocking_saving": false,

  "_comment_admins": "List of case insensitive usernames, that will be promoted immediately",
  "admins": []管理员列表,使用方法参见标签栏
}
  • 服务器配置完成后双击打开sstart.bat
Adfaf4c8d91538ee.png
  • 按任意建后
E9aeded1c6b6fc0a.gif
  • 出现Matching server connection resumed字样时服务器开设成功