Fix Example

This commit is contained in:
2022-06-13 16:42:47 +08:00
parent 835c4c32c9
commit e40735d2d3
3 changed files with 16 additions and 8 deletions

View File

@ -12,7 +12,7 @@ import (
type EventsListener struct {
GameStart func() error
ChatMsg func(c *PlayerMessage, pos byte, uuid uuid.UUID) error
ChatMsg func(c *PlayerMessage) error
SystemMsg func(c chat.Message, pos byte) error
Disconnect func(reason chat.Message) error
HealthChange func(health float32) error
@ -106,7 +106,7 @@ func (e *EventsListener) onPlayerMsg(p pk.Packet) error {
if err := message.SenderTeamName.UnmarshalJSON([]byte(senderDisplayName)); err != nil {
return Error{err}
}
return e.ChatMsg(&message, byte(message.Position), message.Sender)
return e.ChatMsg(&message)
}
return nil
}