Skip to content

Commit

Permalink
move
Browse files Browse the repository at this point in the history
  • Loading branch information
oq-x committed Sep 18, 2024
1 parent b3f3420 commit 1710644
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
6 changes: 6 additions & 0 deletions server/session/events.go
Original file line number Diff line number Diff line change
@@ -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}
}
Expand Down Expand Up @@ -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()))
}
7 changes: 0 additions & 7 deletions server/session/onSessionAdd.go

This file was deleted.

0 comments on commit 1710644

Please sign in to comment.