requested changes
parent
d9c94b8e4c
commit
bd9d01382d
17
chat.go
17
chat.go
|
@ -13,20 +13,13 @@ import (
|
||||||
// about a chat command that's taking long to execute.
|
// about a chat command that's taking long to execute.
|
||||||
var ChatCmdTimeout = 10 * time.Second
|
var ChatCmdTimeout = 10 * time.Second
|
||||||
|
|
||||||
// Exec handles a string as if it where send by a client.
|
// DoChatMsg does a chatcommand
|
||||||
// string is imediate returnvalue of chatcommand (if applicable)
|
func (cc *ClientConn) DoChatMsg(msg string) (string, bool) {
|
||||||
// bool is if msg is getting forwarded to the minetest server
|
cmd := &mt.ToSrvChatMsg{Msg: msg}
|
||||||
func (cc *ClientConn) Exec(msg string) (string, bool) {
|
|
||||||
pkt := &mt.ToSrvChatMsg{
|
|
||||||
Msg: msg,
|
|
||||||
}
|
|
||||||
|
|
||||||
str, fwd := onChatMsg(cc, pkt)
|
|
||||||
|
|
||||||
|
str, fwd := onChatMsg(cc, cmd)
|
||||||
if fwd {
|
if fwd {
|
||||||
cc.server().Send(*&mt.Pkt{
|
cc.server().SendCmd(cmd)
|
||||||
Cmd: pkt,
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return str, fwd
|
return str, fwd
|
||||||
|
|
Loading…
Reference in New Issue