Browse Source

Log RPC

master
HimbeerserverDE 1 year ago
parent
commit
e7ee6b4841
No known key found for this signature in database
GPG Key ID: 1A651504791E6A8B
  1. 5
      rpc.go

5
rpc.go

@ -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})

Loading…
Cancel
Save