Add default value for host

master
HimbeerserverDE 2021-03-13 19:17:27 +01:00
parent c1775eb525
commit d2993c4401
No known key found for this signature in database
GPG Key ID: 1A651504791E6A8B
4 changed files with 10 additions and 8 deletions

View File

@ -28,7 +28,6 @@ The configuration file is located in `WORKING_DIR/config/multiserver.yml`
- Default config file
```yml
host: "0.0.0.0:33000"
servers:
lobby:
address: "127.0.0.1:30000"
@ -39,7 +38,8 @@ force_default_server: true
> `host`
```
Type: String
Description: The IP address and port the proxy will be running on
Description: The IP address and port the proxy will be running on,
default is 0.0.0.0:33000
```
> `player_limit`
```

View File

@ -9,8 +9,7 @@ import (
var config map[interface{}]interface{}
var defaultConfig []byte = []byte(`host: "0.0.0.0:33000"
servers:
var defaultConfig []byte = []byte(`servers:
lobby:
address: "127.0.0.1:30000"
default_server: lobby

View File

@ -25,7 +25,7 @@ func main() {
host, ok := ConfKey("host").(string)
if !ok {
log.Fatal("Host not set or not a string")
host = "0.0.0.0:33000"
}
lc, err := net.ListenPacket("udp", host)

View File

@ -25,7 +25,10 @@ func Announce(action string) error {
log.Print("Updating server list announcement")
host := ConfKey("host").(string)
host, ok := ConfKey("host").(string)
if !ok {
host = "0.0.0.0:33000"
}
addr, err := net.ResolveUDPAddr("udp", host)
if err != nil {
@ -74,8 +77,8 @@ func Announce(action string) error {
data["name"] = conf("serverlist_name")
data["description"] = conf("serverlist_desc")
data["version"] = "multiserver v1.9.2"
data["proto_min"] = 37
data["proto_max"] = 39
data["proto_min"] = ProtoMin
data["proto_max"] = ProtoLatest
data["url"] = conf("serverlist_display_url")
data["creative"] = confBool("serverlist_creative")
data["damage"] = confBool("serverlist_damage")