Merge multiple init funcs into one
parent
bdf3f7a7fc
commit
96c9201586
|
@ -4,10 +4,6 @@ import "encoding/binary"
|
|||
|
||||
var aoIDs map[PeerID]map[uint16]bool
|
||||
|
||||
func InitAOMap() {
|
||||
aoIDs = make(map[PeerID]map[uint16]bool)
|
||||
}
|
||||
|
||||
func processAORmAdd(p *Peer, data []byte) []byte {
|
||||
countRm := binary.BigEndian.Uint16(data[2:4])
|
||||
aoRm := make([]uint16, countRm)
|
||||
|
|
|
@ -19,7 +19,7 @@ force_default_server: true
|
|||
`)
|
||||
|
||||
// LoadConfig loads the configuration file
|
||||
func LoadConfig() error {
|
||||
func loadConfig() error {
|
||||
os.Mkdir("config", 0775)
|
||||
|
||||
_, err := os.Stat("config/multiserver.yml")
|
||||
|
|
5
init.go
5
init.go
|
@ -509,3 +509,8 @@ func Init(p, p2 *Peer, ignMedia bool, fin chan struct{}) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
func InitMultiserver() {
|
||||
aoIDs = make(map[PeerID]map[uint16]bool)
|
||||
loadConfig()
|
||||
}
|
||||
|
|
|
@ -9,9 +9,7 @@ import (
|
|||
)
|
||||
|
||||
func main() {
|
||||
multiserver.InitAOMap()
|
||||
|
||||
multiserver.LoadConfig()
|
||||
multiserver.InitMultiserver()
|
||||
|
||||
multiserver.InitLua()
|
||||
defer multiserver.CloseLua()
|
||||
|
|
Loading…
Reference in New Issue