master
HimbeerserverDE 2021-04-22 17:02:27 +02:00
parent cd2bc2c92f
commit e7ee6b4841
No known key found for this signature in database
GPG Key ID: 1A651504791E6A8B
1 changed files with 5 additions and 0 deletions

5
rpc.go
View File

@ -74,6 +74,8 @@ func processRpc(c *Conn, r *bytes.Reader) bool {
rq := strings.Split(msg, " ")[0]
log.Print("RPC from ", c.Addr().String(), ": ", strings.Join(strings.Split(msg, " ")[1:], " "))
switch cmd := strings.Split(msg, " ")[1]; cmd {
case "<-ALERT":
ChatSendAll(strings.Join(strings.Split(msg, " ")[2:], " "))
@ -205,6 +207,7 @@ func processRpc(c *Conn, r *bytes.Reader) bool {
}
rpcSrvMu.Unlock()
}
return true
}
@ -213,6 +216,8 @@ func (c *Conn) doRpc(rpc, rq string) {
return
}
log.Print("RPC to ", c.Addr().String(), ": ", rpc)
msg := rq + " " + rpc
w := bytes.NewBuffer([]byte{0x00, ToServerModChannelMsg})