aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdzell <derz@elidragon.com>2022-04-21 14:12:40 +0200
committerEdzell <derz@elidragon.com>2022-04-21 14:12:40 +0200
commitcf9ed6257694b661df8d0752a0af39c9e5780545 (patch)
tree765f5358a02f14a2f05cf608dd1e8916f448f853
parent2ceb71f684e57756ede828829fbfc05b89b0ff28 (diff)
parent5902469d620479caa111cc453cf9d86d890d0617 (diff)
gitignore & merge
-rw-r--r--auth_files.go1
-rw-r--r--chat.go2
-rw-r--r--cmd/mt-multiserver-proxy/.gitignore1
-rw-r--r--config.go6
-rw-r--r--mediacache.go2
-rw-r--r--process.go3
6 files changed, 6 insertions, 9 deletions
diff --git a/auth_files.go b/auth_files.go
index e6b4abf..e05cff3 100644
--- a/auth_files.go
+++ b/auth_files.go
@@ -146,7 +146,6 @@ func (a authFiles) Unban(id string) error {
if string(name) == id {
return os.Remove(Path("ban/", f.Name()))
- break
}
}
}
diff --git a/chat.go b/chat.go
index 8a10f05..61e8ca8 100644
--- a/chat.go
+++ b/chat.go
@@ -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) {
diff --git a/cmd/mt-multiserver-proxy/.gitignore b/cmd/mt-multiserver-proxy/.gitignore
index ef1a813..238faa1 100644
--- a/cmd/mt-multiserver-proxy/.gitignore
+++ b/cmd/mt-multiserver-proxy/.gitignore
@@ -2,3 +2,4 @@ config.json
cache/
*.log
auth/
+mt-multiserver-proxy
diff --git a/config.go b/config.go
index f19e35b..4adb4ae 100644
--- a/config.go
+++ b/config.go
@@ -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.
diff --git a/mediacache.go b/mediacache.go
index a812c94..f50540c 100644
--- a/mediacache.go
+++ b/mediacache.go
@@ -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
}
diff --git a/process.go b/process.go
index 0ad63c6..fd4f19b 100644
--- a/process.go
+++ b/process.go
@@ -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
}