1 분 소요

오전 작업

  • 클리어 체크 : 보스 몬스터를 잡았을 때 clear 패킷을 보내고 있다. 현재 클라이언트 쪽에는 별다른 로직 없이 게임 오버와 마찬가지로 화면을 띄우고 있다.
if (monster.isBossMonster()) {
    const gameClearNotification = [
      config.packetType.S_GAME_CLEAR_NOTIFICATION,
      {
      }
    ]

    game.broadcast(gameClearNotification);
    console.log("이 위치에 보스가 사망하고 클리어 했다는 패킷 전송하기");
  }
  • 부활 체크 : 현재 프로젝트에서 소생을 하는 코어 주변의 범위를 측정하여 바운더리 내에서 생성이 되도록 만듦
  • 기존 방식은 원의 둘레에 소환되는 방식을 사용했으나 코어 구역과 몬스터들이 나오는 구역의 구분이 사각형이 되었으므로 수정함.
for (const [userId, user] of this.users) {
          if (user.player.getPlayerHp() > 0) {
            continue;
          }
          let dx;
          let dy;
          const revivalpart = Math.floor(Math.random() * 4 + 1);
          switch (revivalpart) {
            case 1:
              dx = -4 - Math.random() * 2 + this.corePosition.x;
              dy = 3 + Math.random() + this.corePosition.y;
              break;
            case 2:
              dx = -4 - Math.random() * 2 + this.corePosition.x;
              dy = -3 - Math.random() + this.corePosition.y;
              break;
            case 3:
              dx = 4 + Math.random() * 2 + this.corePosition.x;
              dy = -3 - Math.random() + this.corePosition.y;
              break;
            case 4:
              dx = 4 + Math.random() * 2 + this.corePosition.x;
              dy = 3 + Math.random() + this.corePosition.y;
              break;
          }

          user.player.revival(dx, dy);

          const revivalPayloadInfos = [config.packetType.S_PLAYER_REVIVAL_NOTIFICATION, {
            playerId: userId,
            position: {
              x: dx,
              y: dy
            }
          }];

          this.broadcast(revivalPayloadInfos);
        }

오후 작업

  • 클라이언트에서 채팅을 당당하는 uigame을 손보게 되면서 채팅 기능을 어느 정도 구현했다. 로컬 환경에선 작동하는 걸 확인했으나 서버와 연결은 아직이다. 서버 쪽의 핸들러에 등록은 했지만 실행 되지 않는 부분을 내일 보완하면 될 것으로 보인다.

태그:

카테고리:

업데이트: