서버 아키텍처 흐름도

패킷 흐름도

sequenceDiagram
    autonumber
    actor C as 클라이언트
    participant S as 게임 서버

    Note over C, S: [로그인 단계]
    C->>+S: CS_Login (userID, userPW)
    Note right of S: 비밀번호 검증<br/>중복 로그인 체크
    
    alt 로그인 성공
        S-->>C: SC_Login (result: SUCCESS)
    else 로그인 실패
        S-->>-C: SC_Login (result: FAIL_Reason)
        Note over C: 로그인 화면으로 돌아감
    end
    
	  Note over C, S: [로비 입장]
	  C->>+S: CS_LobbyEnter ()
	  Note right of S: 방 목록을 보내줌 (5초마다 계속 보냄)
	   S-->>C: SC_LobbyEnter (roomCount, RoomList..)

    Note over C, S: [방 입장 단계]
    C->>+S: CS_RoomEnter (roomIndex)
    Note right of S: 방 존재 유무 확인<br/>방 인원 꽉 찼는지 확인
    
    alt 입장 성공
        S-->>C: SC_RoomEnter (result: SUCCESS)
        Note right of C: 다른 유저 정보 로딩 및<br/>자신을 초기 위치(x,y,z)에 생성

        par 다른 유저들에게 알림 (Broadcasting)
            S->>C: SC_RoomEnterNotify (userID, userIndex)
            Note right of C: "OOO님이 입장했습니다" 표시<br/>다른 클라에 신규 캐릭터 생성
        end
    else 입장 실패
        S-->>-C: SC_RoomEnter (result: FAIL_Reason)
        Note over C: 로비 화면으로 돌아감
    end
    
    
    alt [룸 대기실]
     Note over C, S: [룸 채팅]
     C->>+S: CS_RoomChat(chatMsg)
     Note right of S: 비속어 필터링
     par 다른 유저에게 알림 (Broadcasting)
	     S-->>C: SC_RoomChatNotify (userIndex, chatMsg)
     end
     Note over C, S: [룸 나가기]
     C->>+S: CS_RoomLeave()
     par 다른 유저에게 알림 (Broadcasting)
	     S-->>C: SC_RoomLeaveNotify(roomIndex)
	   end
    end
    
    Note over C, S: [게임 시작]
    C->>+S: CS_RoomStart()
    Note right of S: 인원수 확인
    alt 시작 성공
	    S-->>C: SC_RoomStart(result: SUCCESS)
	  else 시작 실패
		  S-->>C: SC_RoomStart(result: FAIL_Reason)
    end
    
    alt 인게임
     Note over C, S: [게임 플레이 단계]
     C->>+S: CS_Move(inputFlag, raw)
     Note right of S: 입력값으로 위치 계산
     par 다른 유저에게 알림 (Broadcasting)
	     S-->>C: SC_MoveNotify (userIndex, inputFlag, x, y, z, yaw)
     end
    end