gitignore & merge

master
Edzell 2022-04-21 14:12:40 +02:00
commit cf9ed62576
6 changed files with 6 additions and 9 deletions

View File

@ -146,7 +146,6 @@ func (a authFiles) Unban(id string) error {
if string(name) == id {
return os.Remove(Path("ban/", f.Name()))
break
}
}
}

View File

@ -20,7 +20,7 @@ func (cc *ClientConn) SendChatMsg(msg ...string) {
// Colorize returns the minetest-colorized version of the input.
func Colorize(text, color string) string {
return string(0x1b) + "(c@" + color + ")" + text + string(0x1b) + "(c@#FFF)"
return string([]rune{0x1b}) + "(c@" + color + ")" + text + string([]rune{0x1b}) + "(c@#FFF)"
}
func onChatMsg(cc *ClientConn, cmd *mt.ToSrvChatMsg) (string, bool) {

View File

@ -2,3 +2,4 @@ config.json
cache/
*.log
auth/
mt-multiserver-proxy

View File

@ -86,7 +86,7 @@ func FallbackServers(server string) []string {
fallbacks := make([]string, 0)
conf := Conf()
// find server
for _, srv := range conf.Servers {
if srv.Name == server {
@ -100,13 +100,11 @@ func FallbackServers(server string) []string {
if len(conf.Servers) == 0 {
return fallbacks
}
return append(fallbacks, conf.Servers[0].Name)
} else {
return append(fallbacks, conf.FallbackServers...)
}
return fallbacks
}
// LoadConfig attempts to parse the configuration file.

View File

@ -37,7 +37,7 @@ func (cc *contentConn) updateCache() {
for _, f := range cc.media {
hash, err := b64.DecodeString(f.base64SHA1)
if err != nil {
cc.log("<-", err)
cc.log("<-", f.base64SHA1, ": ", err)
continue
}

View File

@ -538,7 +538,6 @@ func (sc *ServerConn) process(pkt mt.Pkt) {
return
case *mt.ToCltKick:
sc.Log("<-", "deny access", cmd)
if cmd.Reason == mt.Shutdown || cmd.Reason == mt.Crash || cmd.Reason == mt.SrvErr || cmd.Reason == mt.TooManyClts || cmd.Reason == mt.UnsupportedVer {
clt.SendChatMsg(cmd.String())
for _, srvName := range FallbackServers(sc.name) {
@ -547,7 +546,7 @@ func (sc *ServerConn) process(pkt mt.Pkt) {
break
}
}
return
}