From 9667eec16b35e4bdbc1d7bcd26f4c54846fa87a1 Mon Sep 17 00:00:00 2001 From: kercylan98 Date: Thu, 11 May 2023 14:43:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=BF=E9=97=B4=E9=94=99=E8=AF=AF=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game/builtin/room.go | 2 +- game/builtin/room_errors.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/game/builtin/room.go b/game/builtin/room.go index 221e63b..c5ee1c3 100644 --- a/game/builtin/room.go +++ b/game/builtin/room.go @@ -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) diff --git a/game/builtin/room_errors.go b/game/builtin/room_errors.go index 17f0d80..a8e8e41 100644 --- a/game/builtin/room_errors.go +++ b/game/builtin/room_errors.go @@ -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") )