(
-
+
@@ -127,9 +122,6 @@ export default function RankPage() {
);
-
-
-
return (
@@ -141,9 +133,6 @@ export default function RankPage() {
{renderRankingList('Efficiency', effRanks)}
{/* 사이에 여백 */}
{BattingKingList('Rich', CoinRanks)}
-
-
-
);
diff --git a/front-end/src/components/arena/Statsistics.jsx b/front-end/src/components/arena/Statsistics.jsx
index 854369de..e1c6b6d5 100644
--- a/front-end/src/components/arena/Statsistics.jsx
+++ b/front-end/src/components/arena/Statsistics.jsx
@@ -32,8 +32,8 @@ export default function StatsisticsPage() {
fontSize: '16px',
};
- // 차트에 보이는 퍼센트 값을 직접 계산하여 표시하는 함수
- const formatPercent = (value) => `${(value * 100).toFixed(0)}%`;
+ // 차트에 보이는 퍼센트 값을 계산하여 표시하는 함수
+ // const formatPercent = (value) => `${(value * 100).toFixed(0)}%`;
useEffect(()=> {
const headers = {
@@ -46,7 +46,7 @@ export default function StatsisticsPage() {
return {name:key.split('Count'), value:value}
}))
setMatchs(res.data.data.recentMatches)
- console.log("record 확인 :", res.data.data.recentMatches)
+ // console.log("record 확인 :", res.data.data.recentMatches)
})
.catch((err) => {
console.log("에러!!! :", err)
diff --git a/front-end/src/components/arena/TopBanner.jsx b/front-end/src/components/arena/TopBanner.jsx
index a36847e6..5742c714 100644
--- a/front-end/src/components/arena/TopBanner.jsx
+++ b/front-end/src/components/arena/TopBanner.jsx
@@ -73,16 +73,15 @@ export default function TopBanner() {
socket.current = new WebSocket('wss://codearena.shop/matching');
socket.current.addEventListener("open", function (event) {
- console.log(event)
+ console.log("웹소켓 연결 확인", event)
})
socket.current.addEventListener("message", function (event) {
- console.log("Message from server ", event.data);
-
- const object = JSON.parse(event.data)
- console.log("recive data :", object)
-
+ // console.log("Message from server ", event.data);
+ const object = JSON.parse(event.data)
+ // console.log("recive data :", object)
+
if (object.type) {
setType2(object.type)
matchId.current = object.matchId;
@@ -121,7 +120,7 @@ export default function TopBanner() {
startTime: startTime.current,
queueKey: queueKey.current,
}));
- console.log("setGameInfo를 찍었습니다 :", setGameInfo)
+ // console.log("setGameInfo 확인 :", setGameInfo)
navigate(`/game-list/competition/play/${object.gameId}`)
}
@@ -145,7 +144,6 @@ export default function TopBanner() {
if (socket.current.readyState === WebSocket.OPEN && type2) {
startMatchingTimer();
}
-
});
socket.current.addEventListener("error", function (event) {
@@ -158,19 +156,16 @@ export default function TopBanner() {
}
};
};
-
- ////////////////// 위에서 websocket 통신 연결 //////////////////////////
// 1. 언어 3가지 중 하나 선택하기
const handleLanguageSelection = (lang) => {
setSelectedLanguage(lang);
- console.log("lang :", lang)
+ // console.log("lang :", lang)
};
-
// 2. 언어 선택 모달 활성화
const openLanguageModal = () => {
- console.log('언어 선택 모달 호출함!!');
+ // console.log('언어 선택 모달 호출함!!');
const languageModal = document.getElementById('language_modal');
const matchingModal = document.getElementById('matching_modal');
@@ -191,7 +186,7 @@ export default function TopBanner() {
// 3. 매칭 진행 모달
const openMatchingModal = () => {
- console.log('매칭 진행 모달 호출함!!');
+ // console.log('매칭 진행 모달 호출함!!');
const languageModal = document.getElementById('language_modal');
const matchingModal = document.getElementById('matching_modal');
@@ -219,18 +214,16 @@ export default function TopBanner() {
// 매칭 모달이 닫힐 때 타이머 중지
matchingModal.addEventListener('close', () => {
- console.log("너가 아니길 빈다.... 머리아프다")
clearInterval(timerInterval.current); // 타이머 중지
languageModal.close();
});
};
// 타이머 중지
- // let timerInterval///
const closeMatchingModalHandler = () => {
- console.log('타이머 중지!!');
+ // console.log('타이머 중지!!');
setType2(null)
- console.log('진짜 마지막 타입 확인 :', type2)
+ // console.log('진짜 마지막 타입 확인 :', type2)
// 선택된 언어 초기화
setSelectedLanguage(null);
const matchingCompleteModal = document.getElementById('matching_complete_modal');
@@ -253,8 +246,6 @@ export default function TopBanner() {
clearInterval(timerInterval.current);
timerInterval.current = null;
}
-
- // 언어 선택 모달 중복호출이 안되도록
};
// 4. 매칭이 돌아가면 타이머 소환
@@ -283,23 +274,16 @@ export default function TopBanner() {
// 원하는 시간까지 진행 후 타이머 중지
// const desiredTimeInSeconds = 10;
- console.log('Start Matching Timer type : ', type2)
-
+ // console.log('Start Matching Timer type : ', type2)
};
useEffect(()=> {
- console.log('!!!!!!!!!!!!!!!타입2',type2);
if (type2 && type2 === "QUERY") {
const interval = timerInterval.current
clearInterval(interval);
timerInterval.current = interval;
handleMatchingComplete(); // 수락&거절 모달 함수 호출
- } else if (type2 && type2 === 'RESPONSE') {
-
- }
- // if (socket.current.readyState === WebSocket.OPEN && type2) {
- // startMatchingTimer();
- // }
+ }
},[type2])
const startQueryTimer = () => {
@@ -313,12 +297,8 @@ export default function TopBanner() {
// 타이머 초마다 상승하고 문자열로 표기
timerElements.textContent = `${String(minutes).padStart(2, '0')}:${String(remainingSeconds).padStart(2, '0')}`;
- // if (type2 && type2 === 'CONTINUE') {
- // clearInterval(timerInterval.current); // 초기화
- // }
-
if (seconds === 0) {
- console.log("startQueryTimer의 타이머 확인@@")
+ // console.log("startQueryTimer의 타이머 확인@@")
socket.current.send(
JSON.stringify({
matchId: matchId.current,
@@ -345,7 +325,7 @@ export default function TopBanner() {
timerInterval.current = setInterval(updateTimer, 1000);
}
- // 5. "매칭 완료!" 문구와 동시에 "수락", "취소" 모달 띄우기
+ // 5-1. "매칭 완료!" 문구와 동시에 "수락", "취소" 모달 띄우기
const handleMatchingComplete = () => {
setMatchingState({
userImgSrc: userImgSrc.current,
@@ -362,10 +342,10 @@ export default function TopBanner() {
}, 1500);
};
- // 5-1. 매칭 완료 후 띄워질 "수락", "취소" 마지막 모달
+ // 5-2. 매칭 완료 후 띄워질 "수락", "취소" 마지막 모달
const openMatchingCompleteModal = () => {
// MatchingCompleteModal 열기
- console.log("마지막 수락 거절 모달 호출되니?")
+ // console.log("마지막 수락 거절 모달 호출되니?")
const matchingCompleteModal = document.getElementById('matching_complete_modal');
matchingCompleteModal.style.left = '50%';
matchingCompleteModal.style.top = '50%';
@@ -387,9 +367,9 @@ export default function TopBanner() {
});
};
- // 마지막 모달에서 "거절" 모든 모달 닫기 (중복 호출 방지)
+ // 마지막 모달에서 "거절" 누를 시 모든 모달 닫기 (중복 호출 방지)
const handleCancel = () => {
- console.log("매칭을 거절했어요 !")
+ // console.log("매칭을 거절했어요 !")
const send_obj = {
matchId: matchId.current,
userId: userId.current,
@@ -429,9 +409,9 @@ export default function TopBanner() {
}
};
- // 마지막 "수락" 버튼을 눌렀을 때 호출될 함수..
+ // 마지막 "수락" 버튼을 눌렀을 때 호출될 함수
const handleAccept = () => {
- console.log("매칭을 수락했어요 !")
+ // console.log("매칭을 수락했어요 !")
const send_obj = {
matchId: matchId.current,
userId: userId.current,
@@ -447,23 +427,14 @@ export default function TopBanner() {
type: 'YES',
};
- console.log("수락 :", send_obj)
-
socket.current.send (
JSON.stringify (send_obj)
);
- // clearInterval(timerInterval.current);
-
// 중복 호출 방지를 위한 선언 및 모든 모달 닫기
- // const matchingCompleteModal = document.getElementById('matching_complete_modal');
const languageModal = document.getElementById('language_modal');
const matchingModal = document.getElementById('matching_modal');
- // if (matchingCompleteModal && matchingCompleteModal.open) {
- // matchingCompleteModal.close();
- // }
-
if (languageModal && languageModal.open) {
languageModal.close();
}
@@ -473,11 +444,6 @@ export default function TopBanner() {
}
};
- // 게임 생성 모달 닫기
- const closeModal = () => {
- setIsModalOpen(false);
- };
-
return (
{/* 상단 배너 */}
{/* 경쟁 매칭 버튼*/}
-