앱: 멀티플레이·계정·리더보드·광고 연결 (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:
@@ -10,6 +10,8 @@ export class GameRoomDO extends DurableObject {
|
||||
constructor(ctx, env) {
|
||||
super(ctx, env);
|
||||
this.logic = null;
|
||||
// 클라이언트 keepalive: DO 를 깨우지 않고 런타임이 바로 응답한다.
|
||||
ctx.setWebSocketAutoResponse(new WebSocketRequestResponsePair('{"t":"ping"}', '{"t":"pong"}'));
|
||||
}
|
||||
|
||||
async load() {
|
||||
@@ -50,7 +52,7 @@ export class GameRoomDO extends DurableObject {
|
||||
const l = await this.load();
|
||||
if (!l) return new Response("no such room", { status: 404 });
|
||||
const uid = req.headers.get("x-uid");
|
||||
const info = JSON.parse(req.headers.get("x-info") || "{}");
|
||||
const info = JSON.parse(decodeURIComponent(req.headers.get("x-info") || "%7B%7D"));
|
||||
const pair = new WebSocketPair();
|
||||
const [client, server] = Object.values(pair);
|
||||
// 같은 유저의 이전 소켓은 정리 (재접속)
|
||||
@@ -162,11 +164,14 @@ export class GameRoomDO extends DurableObject {
|
||||
} catch (err) {
|
||||
console.error("league_end failed", err);
|
||||
}
|
||||
l.lastEnd = {};
|
||||
for (const uid of [e.winner, e.loser]) {
|
||||
l.send(uid, {
|
||||
const msg = {
|
||||
t: "match_end", winner: e.winner, score: e.score,
|
||||
trDelta: result?.[uid]?.trDelta ?? null, before: result?.[uid]?.before ?? null, after: result?.[uid]?.after ?? null,
|
||||
});
|
||||
};
|
||||
l.lastEnd[uid] = msg;
|
||||
l.send(uid, msg);
|
||||
}
|
||||
} else if (e.type === "custom_end") {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user