master
HimbeerserverDE 2021-01-10 11:02:51 +01:00
parent 79e6aaacde
commit d4868fa178
10 changed files with 6 additions and 17 deletions

View File

@ -7,7 +7,7 @@ import (
"gopkg.in/yaml.v2"
)
var Config map[interface{}]interface{}
var config map[interface{}]interface{}
var defaultConfig []byte = []byte(`host: "0.0.0.0:33000"
player_limit: -1
@ -30,9 +30,9 @@ func LoadConfig() error {
return err
}
Config = make(map[interface{}]interface{})
config = make(map[interface{}]interface{})
err = yaml.Unmarshal(data, &Config)
err = yaml.Unmarshal(data, &config)
if err != nil {
return err
}
@ -43,7 +43,7 @@ func LoadConfig() error {
// GetKey returns a key in the configuration
func GetConfKey(key string) interface{} {
keys := strings.Split(key, ":")
c := Config
c := config
for i := 0; i < len(keys)-1; i++ {
if c[keys[i]] == nil {
return nil

View File

@ -5,7 +5,6 @@ import (
"log"
"strings"
"time"
"github.com/yuin/gopher-lua"
)

View File

@ -1,8 +1,6 @@
package multiserver
import (
"github.com/yuin/gopher-lua"
)
import "github.com/yuin/gopher-lua"
func luaGetConfKey(L *lua.LState) int {
key := L.ToString(1)

View File

@ -2,7 +2,6 @@ package multiserver
import (
"log"
"github.com/yuin/gopher-lua"
)

View File

@ -3,7 +3,6 @@ package multiserver
import (
"encoding/binary"
"log"
"github.com/yuin/gopher-lua"
)

View File

@ -2,7 +2,6 @@ package multiserver
import (
"log"
"github.com/yuin/gopher-lua"
)

View File

@ -2,7 +2,6 @@ package multiserver
import (
"log"
"github.com/yuin/gopher-lua"
)

View File

@ -2,7 +2,6 @@ package multiserver
import (
"strings"
"github.com/yuin/gopher-lua"
)

View File

@ -115,9 +115,6 @@ func (p *Peer) Forward() bool { return p.forward }
// StopForwarding tells the Proxy func to stop
func (p *Peer) StopForwarding() { p.forward = false }
// StartForwarding makes forwarding possible again
func (p *Peer) StartForwarding() { p.forward = true }
// Server returns the Peer this Peer is connected to
// if this Peer is not a server
func (p *Peer) Server() *Peer { return p.srv }

View File

@ -2,8 +2,8 @@ package multiserver
import (
"database/sql"
_ "github.com/mattn/go-sqlite3"
"strings"
_ "github.com/mattn/go-sqlite3"
)
// encodePrivs encodes priv map into DB-ready string