앱: 멀티플레이·계정·리더보드·광고 연결 (Phase 4~7 클라이언트)

- 게스트 자동 발급, 이메일 가입/로그인(게스트 기록 이전), 닉네임 변경, 계정 삭제
- 커스텀 방 만들기/참가, 로비(호스트 규칙), 1:1·FFA 대전, 가비지 게이지·상쇄·삽입,
  상대 미니보드 탭 타겟팅, KO 피드, 관전, 리매치 투표, 재접속
- 리그 대기열·매칭·FT3/FT5·결과(TR/배치), 리더보드 4종, 프로필 전적
- AdMob(UMP 동의) 배너·결과 카드·전면(3판당 1회, 첫 판 제외), 기본은 테스트 ID
- 서버: 앱 레벨 keepalive(auto-response), KO 후 로비 갱신, 재접속 시 결과 재전송,
  x-info 헤더 ASCII 인코딩, 계정 삭제 API
- 개인정보처리방침·스토어 등록정보 갱신 (온라인·광고 반영)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-04 10:43:32 +09:00
parent 8fcef8e720
commit c05c39ff36
29 changed files with 2341 additions and 167 deletions

View File

@@ -31,7 +31,8 @@ export class RoomLogic {
this.roundStartAt = 0;
this.nextRoundAt = 0;
this.matchId = null;
this.finished = false; // 리그 경기 종료 후 방 폐기 표시
this.finished = false;
this.lastEnd = null; // 끊겼다 돌아온 사람에게 다시 보낼 match_end ({uid|"*": msg}) // 리그 경기 종료 후 방 폐기 표시
this.outbox = []; // {to: uid|null, except?: uid, msg}
this.effects = []; // {type, ...}
@@ -58,7 +59,7 @@ export class RoomLogic {
id: this.id, kind: this.kind, code: this.code, allowed: this.allowed, rules: this.rules,
players: [...this.players.values()], order: this.order, host: this.host, phase: this.phase,
round: this.round, roundStartAt: this.roundStartAt, nextRoundAt: this.nextRoundAt,
matchId: this.matchId, finished: this.finished,
matchId: this.matchId, finished: this.finished, lastEnd: this.lastEnd,
};
}
static fromJSON(j, deps = {}) {
@@ -66,6 +67,7 @@ export class RoomLogic {
Object.assign(r, {
rules: j.rules, order: j.order, host: j.host, phase: j.phase, round: j.round,
roundStartAt: j.roundStartAt, nextRoundAt: j.nextRoundAt, matchId: j.matchId, finished: j.finished,
lastEnd: j.lastEnd ?? null,
});
for (const p of j.players) r.players.set(p.uid, p);
return r;
@@ -113,6 +115,10 @@ export class RoomLogic {
existing.disconnectedAt = 0;
Object.assign(existing, pickInfo(info));
this.send(uid, this.syncMsg(uid));
if (this.phase === "match_end" && this.lastEnd) {
const end = this.lastEnd[uid] ?? this.lastEnd["*"];
if (end) this.send(uid, end);
}
if (existing.pendingGarbage?.length) {
for (const g of existing.pendingGarbage) this.send(uid, g);
existing.pendingGarbage = [];
@@ -375,6 +381,7 @@ export class RoomLogic {
this.broadcast({ t: "ko", who: uid, by: p.lastAttacker, place: p.place });
const left = this.alive;
if (left.length <= 1) this.endRound(left[0] ?? null);
else this.broadcast(this.lobbyMsg()); // 생존 인원·KO 표시 갱신
}
endRound(winner) {
@@ -416,7 +423,9 @@ export class RoomLogic {
// match_end 메시지는 레이팅 반영 후 래퍼가 trDelta 를 붙여 보낸다.
} else {
this.effects.push({ type: "custom_end", standings, size: this.order.length });
this.broadcast({ t: "match_end", result: standings, winner: winnerUid });
const msg = { t: "match_end", result: standings, winner: winnerUid };
this.lastEnd = { "*": msg };
this.broadcast(msg);
this.broadcastRematch();
}
this.broadcast(this.lobbyMsg());
@@ -434,6 +443,7 @@ export class RoomLogic {
}
resetWins() {
this.lastEnd = null;
for (const p of this.players.values()) {
p.wins = 0;
p.rematch = false;