-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCraftingDead_default.ps1
More file actions
119 lines (109 loc) · 4.48 KB
/
CraftingDead_default.ps1
File metadata and controls
119 lines (109 loc) · 4.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
Function New-LaunchScriptCraftingDeadPS {
# Crafting Dead Dedicated Server
# APP ID # 685100
# https://www.craftingdead.net/
################## Change Default Variables #################
# Server IP
$global:ip = "${ip}"
# Server Name
$global:hostname = "SERVERNAME"
# Server Port
$global:port = 28091
# Server Query Port
$global:queryport = 28092
# Server Max Players
$global:maxplayers = 20
# Server Password
$global:serverpassword = ""
# World Name
$global:worldname = "World"
# Rcon Port
$global:rconport = 28093
# Rcon Password
$global:rconpassword = "$RANDOMPASSWORD"
##############################/\##############################
###################### Do not change below #####################
# System Directory
$global:systemdir = "$serverdir"
# Server Config Directory
$global:servercfgdir = "$serverdir"
# Server Executable
$global:executable = "```"Crafting Dead```""
# Server Executable Directory
$global:executabledir = "$serverdir"
# Gamedig Query
$global:querytype = "protocol-valve"
# Game Process
$global:process = "Crafting Dead"
# Log Directory
$global:logdirectory = "$serverdir\Logs"
# Server Log
$global:consolelog = "Launch.log"
# Game-Server-Config Directory
$global:gamedirname = ""
# Game-Server-Config
$global:servercfg = "properties.json"
# Server Launch Command
$global:launchParams = '@("/c ${executable}")'
# Advanced must be set to "0"
Get-UserInput
Get-CraftingDeadInstallChanges
}
function Get-CraftingDeadInstallChanges {
Get-Infomessage " Creating $servercfg " 'info'
Write-log "Create $servercfgdir\$servercfg"
Get-Infomessage "*** Editing Default Server Name $servercfg ***" 'info'
$a = Get-Content "$servercfgdir\$servercfg" -raw | ConvertFrom-Json
$a.game_title = "${hostname}"
$a.game_port = ${port}
$a.steam_port_messages = ${queryport}
$a.world_name = "${worldname}"
$a.player_count = ${maxplayers}
$a.rcon_port = ${rconport}
$a.rcon_password = "${rconpassword}"
# $a.IpAddress = "${ip}"
# $a.Password = "${serverpassword}"
# $a.SkipNetworkAccessibilityTest = "$true"
# $a.Rcon.Enabled = $true
Get-Infomessage "*** setting Default Server Name $servercfg ***" 'info'
# $a | ConvertTo-Json | set-content "$servercfgdir\$servercfg" -Force
$a | ConvertTo-Json -Depth 10 | set-content "$servercfgdir\$servercfg" -Force
# new-item -Path ${servercfgdir} -Name ${servercfg} -ItemType File -Value `
# "
# {
# `"game_title`": `"$hostname`",
# `"game_description`": `"`",
# `"game_port`": $port,
# `"steam_port_messages`": $queryport,
# `"world_name`": `"$worldname`",
# `"world_map`": `"Fellvern Island`",
# `"player_count`": $maxplayers,
# `"player_admins`": [
# ],
# `"rcon`": false,
# `"rcon_port`": $rconport,
# `"rcon_password`": `"$rconpassword`"
# }
# "
}
# Function Edit-armareforgeservercfg {
# Get-Infomessage "*** Editing Default Server Name $servercfg ***" 'info'
# $a = Get-Content "$servercfgdir\$servercfg" -raw | ConvertFrom-Json
# $a.gameHostBindAddress = "${ip}"
# $a.region = "US"
# $a.gameHostBindPort = "${port}"
# $a.adminPassword = "${adminpassword}"
# $a.game.playerCountLimit = "${maxplayers}"
# $a.game.name = "${hostname}"
# $a.steamQueryPort = "${queryport}"
# # $a.Port = ${port}
# # $a.QueryPort = ${queryport}
# # $a.Password = "${serverpassword}"
# # $a.MaxConnectedUsers = ${maxplayers}
# # $a.SaveName = "${worldname}"
# # $a.Rcon.Enabled = $true
# # $a.Rcon.Port = ${rconport}
# # $a.Rcon.Password = "${rconpassword}"
# Get-Infomessage "*** setting Default Server Name $servercfg ***" 'info'
# $a | ConvertTo-Json | set-content "$servercfgdir\$servercfg" -Force
# }