강동현

닉네임 제약 조건 추가

...@@ -77,6 +77,10 @@ export class Connection { ...@@ -77,6 +77,10 @@ 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) {
81 + return { ok: false };
82 + }
83 +
80 this.user = new User(message.nickname, this); 84 this.user = new User(message.nickname, this);
81 // console.log(`User ${message.username} has logged in!`); 85 // console.log(`User ${message.username} has logged in!`);
82 86
......