Showing
1 changed file
with
5 additions
and
2 deletions
... | @@ -77,8 +77,11 @@ export class Connection { | ... | @@ -77,8 +77,11 @@ export class Connection { |
77 | private handleLogin( | 77 | private handleLogin( |
78 | message: ServerInboundMessage<"login"> | 78 | message: ServerInboundMessage<"login"> |
79 | ): ServerResponse<"login"> { | 79 | ): ServerResponse<"login"> { |
80 | - if (message.nickname.length > 12 || message.nickname.trim().length === 0) { | 80 | + if (message.nickname.length > 12) { |
81 | - return { ok: false }; | 81 | + return { ok: false, reason: "닉네임은 최대 12글자입니다." }; |
82 | + } | ||
83 | + if (message.nickname.trim().length === 0) { | ||
84 | + return { ok: false, reason: "닉네임을 공백으로 설정할 수 없습니다." }; | ||
82 | } | 85 | } |
83 | 86 | ||
84 | this.user = new User(message.nickname, this); | 87 | this.user = new User(message.nickname, this); | ... | ... |
-
Please register or login to post a comment