use rcon
This commit is contained in:
parent
11ec55ba70
commit
ccd41c2e1b
10
bot.go
10
bot.go
@ -309,13 +309,9 @@ func botSay(m *tb.Message) {
|
||||
|
||||
msg := r.ReplaceAllString(m.Text, "${Message}")
|
||||
|
||||
px := PacketServerChat{
|
||||
Packet: Packet{PType: AdminPacketServerChat},
|
||||
ActionID: AdminNetworkActionChat,
|
||||
DestinationID: AdminDestinationTypeBroadcast,
|
||||
ClientID: 4294967295,
|
||||
Message: msg,
|
||||
Amount: 0,
|
||||
px := PacketAdminRCon{
|
||||
Packet: Packet{PType: AdminPacketAdminRCon},
|
||||
Command: fmt.Sprintf("say %s", msg),
|
||||
}
|
||||
srv.Send(px.Bytes())
|
||||
|
||||
|
16
packet.go
16
packet.go
@ -505,22 +505,6 @@ func (p *PacketServerChat) Read(b []byte) {
|
||||
p.Amount = binary.LittleEndian.Uint64(bs[0:])
|
||||
}
|
||||
|
||||
func (p *PacketServerChat) Bytes() []byte {
|
||||
buf := new(bytes.Buffer)
|
||||
p.PLength = uint16(len(p.Message) + 17)
|
||||
|
||||
binary.Write(buf, binary.LittleEndian, p.PLength)
|
||||
binary.Write(buf, binary.LittleEndian, p.ActionID)
|
||||
binary.Write(buf, binary.LittleEndian, p.DestinationID)
|
||||
binary.Write(buf, binary.LittleEndian, p.ClientID)
|
||||
buf.WriteString(p.Message)
|
||||
buf.WriteByte(0)
|
||||
binary.Write(buf, binary.LittleEndian, p.Amount)
|
||||
|
||||
return buf.Bytes()
|
||||
|
||||
}
|
||||
|
||||
func (p *PacketServerConsole) Read(b []byte) {
|
||||
r := bufio.NewReader(bytes.NewReader(b))
|
||||
r.Discard(3)
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Code generated by version.sh (@generated) DO NOT EDIT.
|
||||
package main
|
||||
var githash = "40a0b5e"
|
||||
var buildstamp = "2021-11-13_05:56:40"
|
||||
var commits = "194"
|
||||
var version = "40a0b5e-b194 - 2021-11-13_05:56:40"
|
||||
var githash = "11ec55b"
|
||||
var buildstamp = "2021-11-13_06:23:25"
|
||||
var commits = "197"
|
||||
var version = "11ec55b-b197 - 2021-11-13_06:23:25"
|
||||
|
Loading…
Reference in New Issue
Block a user