This commit is contained in:
aozhiwei 2023-09-24 14:05:44 +08:00
parent 44e3126dc2
commit 6d65053204
3 changed files with 7 additions and 0 deletions

View File

@ -13,6 +13,7 @@ import (
type Room interface {
GetRoomState() int32
OnPlayerOffline(Player)
OnPlayerOnline(Player)
}
type RoomMgr interface {

View File

@ -61,6 +61,9 @@ func (this *player) reBind(socket f5.WspCliConn) {
}
this.socket = socket
_playerMgr.socketHash[this.socket] = this
if this.room != nil {
this.room.OnPlayerOnline(this)
}
}
func (this *player) GetAccountId() string {

View File

@ -180,6 +180,9 @@ func (this *room) fillMFCurrentRoom(pb *cs.MFCurrentRoom) {
func (this *room) OnPlayerOffline(hum common.Player) {
}
func (this *room) OnPlayerOnline(hum common.Player) {
}
func (this *room) CMDisbandRoom(hdr *f5.MsgHdr, msg *cs.CMDisbandRoom) {
hum := hdr.Context.(common.Player)
rspMsg := &cs.SMDisbandRoom{}