Skip to content

Commit

Permalink
add:IEventData 增加 UniqueId() int64
Browse files Browse the repository at this point in the history
  • Loading branch information
phantacix committed Apr 7, 2023
1 parent ef11a1e commit d67f470
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
4 changes: 4 additions & 0 deletions examples/demo_game_cluster/internal/event/player_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ func NewPlayerCreate(playerId int64, playerName string, gender int32) PlayerCrea
func (PlayerCreate) Name() string {
return PlayerCreateKey
}

func (p PlayerCreate) UniqueId() int64 {
return p.PlayerId
}
4 changes: 4 additions & 0 deletions examples/demo_game_cluster/internal/event/player_login.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@ func NewPlayerLogin(actorId string, playerId int64) PlayerLogin {
func (PlayerLogin) Name() string {
return PlayerLoginKey
}

func (p PlayerLogin) UniqueId() int64 {
return p.PlayerId
}
4 changes: 4 additions & 0 deletions examples/demo_game_cluster/internal/event/player_logout.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,7 @@ func NewPlayerLogout(actorId string, playerId int64) PlayerLogout {
func (PlayerLogout) Name() string {
return PlayerLogoutKey
}

func (p PlayerLogout) UniqueId() int64 {
return p.PlayerId
}
3 changes: 2 additions & 1 deletion facade/actor.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ type (

type (
IEventData interface {
Name() string // 事件名
Name() string // 事件名
UniqueId() int64 // 唯一id
}
)

0 comments on commit d67f470

Please sign in to comment.