From 1710644ffbb34db9cdd68d53711e8b9e5c7b30c9 Mon Sep 17 00:00:00 2001 From: oq Date: Wed, 18 Sep 2024 14:13:14 +0300 Subject: [PATCH] move --- server/session/events.go | 6 ++++++ server/session/onSessionAdd.go | 7 ------- 2 files changed, 6 insertions(+), 7 deletions(-) delete mode 100644 server/session/onSessionAdd.go diff --git a/server/session/events.go b/server/session/events.go index d428c3b..1e44672 100644 --- a/server/session/events.go +++ b/server/session/events.go @@ -1,5 +1,7 @@ package session +import "github.com/zeppelinmc/zeppelin/protocol/text" + func NewEvent[T any](handlers ...func(T)) Event[T] { return Event[T]{handlers} } @@ -63,3 +65,7 @@ type EventManager struct { var Default = EventManager{ OnSessionAdd: NewEvent(onSessionAdd), } + +func onSessionAdd(s Session) { + s.Broadcast().SystemChatMessage(text.Unmarshalf('&', "&e%s joined the game", s.Username())) +} diff --git a/server/session/onSessionAdd.go b/server/session/onSessionAdd.go deleted file mode 100644 index ad00345..0000000 --- a/server/session/onSessionAdd.go +++ /dev/null @@ -1,7 +0,0 @@ -package session - -import "github.com/zeppelinmc/zeppelin/protocol/text" - -func onSessionAdd(s Session) { - s.Broadcast().SystemChatMessage(text.Unmarshalf('&', "&e%s joined the game", s.Username())) -}