more fmt
parent
79e6aaacde
commit
d4868fa178
|
@ -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
|
||||
|
|
|
@ -5,7 +5,6 @@ import (
|
|||
"log"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/yuin/gopher-lua"
|
||||
)
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
1
l_log.go
1
l_log.go
|
@ -2,7 +2,6 @@ package multiserver
|
|||
|
||||
import (
|
||||
"log"
|
||||
|
||||
"github.com/yuin/gopher-lua"
|
||||
)
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@ package multiserver
|
|||
import (
|
||||
"encoding/binary"
|
||||
"log"
|
||||
|
||||
"github.com/yuin/gopher-lua"
|
||||
)
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@ package multiserver
|
|||
|
||||
import (
|
||||
"log"
|
||||
|
||||
"github.com/yuin/gopher-lua"
|
||||
)
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@ package multiserver
|
|||
|
||||
import (
|
||||
"log"
|
||||
|
||||
"github.com/yuin/gopher-lua"
|
||||
)
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@ package multiserver
|
|||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/yuin/gopher-lua"
|
||||
)
|
||||
|
||||
|
|
3
peer.go
3
peer.go
|
@ -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 }
|
||||
|
|
Loading…
Reference in New Issue