mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 02:00:11 -08:00
adding theater-mode, fixes #15
This commit is contained in:
parent
a3df727c47
commit
d5bdc78d55
10 changed files with 212 additions and 31 deletions
|
|
@ -29,6 +29,8 @@ type Config struct {
|
|||
}
|
||||
|
||||
Operator map[string]*PassConfig
|
||||
|
||||
Theater map[string]*PassConfig
|
||||
}
|
||||
|
||||
func (conf *Config) Operators() map[Name][]byte {
|
||||
|
|
@ -39,6 +41,18 @@ func (conf *Config) Operators() map[Name][]byte {
|
|||
return operators
|
||||
}
|
||||
|
||||
func (conf *Config) Theaters() map[Name][]byte {
|
||||
theaters := make(map[Name][]byte)
|
||||
for s, theaterConf := range conf.Theater {
|
||||
name := NewName(s)
|
||||
if !name.IsChannel() {
|
||||
log.Fatal("config uses a non-channel for a theater!")
|
||||
}
|
||||
theaters[name] = theaterConf.PasswordBytes()
|
||||
}
|
||||
return theaters
|
||||
}
|
||||
|
||||
func LoadConfig(filename string) (config *Config, err error) {
|
||||
config = &Config{}
|
||||
err = gcfg.ReadFileInto(config, filename)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue