3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-22 11:59:40 +01:00

Support network name

This commit is contained in:
Daniel Oaks 2016-04-12 15:44:00 +10:00
parent c88cd328f8
commit a013205fd1
3 changed files with 20 additions and 6 deletions

View File

@ -21,14 +21,18 @@ func (conf *PassConfig) PasswordBytes() []byte {
}
type Config struct {
Network struct {
Name string
}
Server struct {
PassConfig
Name string
Database string
Listen []string
Wslisten string
Log string
MOTD string
Name string
}
Operator map[string]*PassConfig
@ -67,6 +71,9 @@ func LoadConfig(filename string) (config *Config, err error) {
return nil, err
}
if config.Network.Name == "" {
return nil, errors.New("Network name missing")
}
if config.Server.Name == "" {
return nil, errors.New("Server name missing")
}

View File

@ -91,7 +91,7 @@ func NewServer(config *Config) *Server {
server.isupport.Add("KICKLEN", "") //TODO(dan): Support kick length?
server.isupport.Add("MAXLIST", "") //TODO(dan): Support max list length?
server.isupport.Add("MODES", "") //TODO(dan): Support max modes?
server.isupport.Add("NETWORK", "NetNameHere") //TODO(dan): Support network name
server.isupport.Add("NETWORK", config.Network.Name)
server.isupport.Add("NICKLEN", "") //TODO(dan): Support nick length
server.isupport.Add("PREFIX", "(ov)@+")
server.isupport.Add("STATUSMSG", "@+") //TODO(dan): Autogenerate based on PREFIXes, make sure it's actually supported

View File

@ -1,4 +1,11 @@
# oragono IRCd config
# network configuration
network:
# name of the network
name: OragonoTest
# server configuration
server:
# server name
name: oragono.test