房间错误信息修正

This commit is contained in:
kercylan98 2023-05-11 14:43:10 +08:00
parent 844e165a7d
commit 9667eec16b
2 changed files with 2 additions and 1 deletions

View File

@ -68,7 +68,7 @@ func (slf *Room[PlayerID, Player]) ChangeOwner(id PlayerID) {
func (slf *Room[PlayerID, Player]) Join(player Player) error {
if slf.players.Size() >= slf.playerLimit && slf.playerLimit > 0 {
return ErrWorldPlayerLimit
return ErrRoomPlayerLimit
}
log.Debug("Room.Join", zap.Any("guid", slf.GetGuid()), zap.Any("player", player.GetID()))
slf.players.Set(player.GetID(), player)

View File

@ -3,6 +3,7 @@ package builtin
import "errors"
var (
ErrRoomPlayerLimit = errors.New("the number of players in the room has reached the upper limit") // 玩家数量达到上限
ErrRoomNoHasMaster = errors.New("room not has master, can't kick player")
ErrRoomNotIsOwner = errors.New("not is room owner, can't kick player")
)