{"id":26868760,"url":"https://github.com/devbong92/sparta-multi-game","last_synced_at":"2025-03-31T05:34:56.823Z","repository":{"id":259358627,"uuid":"877073356","full_name":"devbong92/sparta-multi-game","owner":"devbong92","description":"[내일배움캠프] Node.js 주특기 플러스 개인과제","archived":false,"fork":false,"pushed_at":"2024-10-24T17:10:51.000Z","size":31,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-24T20:19:03.697Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devbong92.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-23T03:24:23.000Z","updated_at":"2024-10-24T17:10:55.000Z","dependencies_parsed_at":"2024-10-24T20:25:54.598Z","dependency_job_id":"7c3386c4-8a68-4268-b2e4-218f5539b7ef","html_url":"https://github.com/devbong92/sparta-multi-game","commit_stats":null,"previous_names":["devbong92/sparta-multi-game"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devbong92%2Fsparta-multi-game","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devbong92%2Fsparta-multi-game/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devbong92%2Fsparta-multi-game/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devbong92%2Fsparta-multi-game/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devbong92","download_url":"https://codeload.github.com/devbong92/sparta-multi-game/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246423523,"owners_count":20774796,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-31T05:34:56.243Z","updated_at":"2025-03-31T05:34:56.804Z","avatar_url":"https://github.com/devbong92.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [ Chapter 5 ] 멀티 플레이 과제\n\n![alt text](./docs/game_img.png)\n\n## 필수 과제\n\n- [x] 프로젝트의 구성\n- [x] 게임 인스턴스 생성\n- [x] 유저 접속 처리\n\n## 도전 과제\n\n- [x] DB 연동 (마지막 위치 저장 및 전송)\n- [x] Latency를 이용한 추측항법\n- [ ] 테스트 클라이언트 개발\n\n## 트러블 슈팅 [(링크)](https://velog.io/@vamuzz/TIL-%EB%82%B4%EC%9D%BC%EB%B0%B0%EC%9B%80%EC%BA%A0%ED%94%84-24.10.31-%EB%AA%A9)\n\n- 유저 중복 스폰 문제 [ ✅ ]\n  - 게임 세션 내 유저 정보 전달 시, 본인 제외하는 방식으로 해결\n- AWS RDS 프리티어로 생성해서 사용해도 과금되는 문제 [ ✅ ] : [(링크)](https://velog.io/@vamuzz/AWS-RDS-%ED%94%84%EB%A6%AC%ED%8B%B0%EC%96%B4-%EA%B3%BC%EA%B8%88)\n- 테스트 클라이언트로 접속 및 종료 시 일부 클라이언트가 종료안되는 문제 [ 😂 ]\n- AWS EC2 접속이 안되던 문제.. [ 😂 ]\n  - EC2인스턴스 재부팅 및 컴퓨터 재시동하니까 해결은 됨..[ 😂 ]\n- pm2로 서버 실행 중 과부하(?) 시 pm2 명령어가 반응이 없는 문제.. [ 😂 ]\n\n## 프로젝트 파일 구조\n\n```\n📁 Root\n├── README.md\n├── client.js                                          // 테스트 클라이언트\n├── package-lock.json\n├── package.json\n└── 📁 src                                             // 서버\n    ├── 📁 classes                                     // 매니저 클래스 모음\n    │   ├── 📁 managers                                // 매니저 모음\n    │   │   ├── base.manager.js                        // 베이스 매니저(부모)\n    │   │   └── interval.manager.js                    // 인터벌 매니저\n    │   └── 📁 models                                  // 모델 클래스 모음\n    │       ├── game.class.js                          // 게임 클래스\n    │       └── user.class.js                          // 유저 클래스\n    ├── 📁 config\n    │   └── config.js                                  // 설정 파일\n    ├── 📁 constants                                   // 전역 관련\n    │   ├── env.js                                     // .env 파일 관리\n    │   ├── handlerIds.js                              // 핸들러 ID 모음\n    │   └── header.js                                  // 헤더 모음 (길이,패킷타입 등)\n    ├── 📁 db\n    │   ├── database.js\n    │   ├── 📁 migration                               // 마이그레이션\n    │   │   └── createSchemas.js                       // 쿼리 실행 설정\n    │   ├── 📁 sql\n    │   │   └── user_db.sql                            // User 데이터베이스 테이블 생성 쿼리 (DDL)\n    │   └── 📁 user\n    │       ├── user.db.js                             // User 데이터베이스 쿼리 함수\n    │       └── user.queries.js                        // User 데이터베이스 쿼리 모음 (DML)\n    ├── 📁 events                                      // TCP 이벤트 모음\n    │   ├── onConnection.js                            // on connection 이벤트\n    │   ├── onData.js                                  // on data 이벤트\n    │   ├── onEnd.js                                   // on end 이벤트\n    │   └── onError.js                                 // on error 이벤트\n    ├── 📁 handlers                                    // 핸들러 모음\n    │   ├── 📁 game                                    // 게임 핸들러\n    │   │   └── locationUpdate.handler.js              // 위치동기화 핸들러\n    │   ├── index.js                                   // 핸들러 매핑용\n    │   └── 📁 user                                    // 유저 핸들러\n    │       └── initial.handler.js                     // 유저 최초 연결 핸들러\n    ├── 📁 init                                        // 서버 시작 시 기능 모음\n    │   ├── createGameSession.js                       // 게임 세션 생성\n    │   ├── index.js                                   // 서버 시작 시 기능 호출\n    │   └── loadProtos.js                              // 프로토버퍼 파일 읽어오기\n    ├── 📁 protobuf                                    // 프로토버퍼 파일 모음\n    │   ├── 📁 notification                            // 알림용 프로토버퍼 모음\n    │   │   └── game.notification.proto                // 게임 알림용 프로토버퍼(위치동기화)\n    │   ├── packNames.js                               // 프로토버퍼 이름 파일\n    │   ├── 📁 request                                 // 요청용 프로토버퍼 모음\n    │   │   ├── common.proto                           // 공용 프로토버퍼 (공통패킷,핑)\n    │   │   └── game.proto                             // 게임 프로토버퍼 (위치동기화)\n    │   │   └── initial.proto                          // 접속 프로토버퍼\n    │   └── 📁 response                                // 응답용 프로토버퍼 모음\n    │       └── response.proto                         // 응답 프로토버퍼\n    ├── server.js                                      // 서버 실행 코드\n    ├── 📁 session                                     // 세션 모음\n    │   ├── game.session.js                            // 게임 세션 (게임세션추가,삭제,정보조회)\n    │   ├── sessions.js                                // 세션 저장소\n    │   └── user.session.js                            // 유저 세션 (유저추가,삭제,다음시퀀스,조회)\n    └── 📁 utils                                       // 유틸 모음\n        ├── dateFormatter.js                           // 날짜 포맷 변경 유틸\n        ├── 📁 db                                      // DB 관련 유틸\n        │   └── testConnection.js                      // 테스트 연결용\n        ├── 📁 error                                   // 에러 관련 유틸\n        │   ├── customError.js                         // 커스텀 에러\n        │   ├── errorCodes.js                          // 에러코드 모음\n        │   └── errorHandler.js                        // 에러핸들러\n        ├── 📁 notification                            // 알림 유틸\n        │   └── game.notification.js                   // 게임 알림 유틸(패킷 생성)\n        ├── 📁 parser                                  // 파싱 유틸\n        │   └── packetParser.js                        // 프로토버퍼 디코딩 유틸\n        ├── 📁 response                                // 응답\n        │   └── createResponse.js                      // 응답 패킷 생성\n        └── transformCase.js                           // 스네이크케이스 카멜케이스로 변환 유틸\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevbong92%2Fsparta-multi-game","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevbong92%2Fsparta-multi-game","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevbong92%2Fsparta-multi-game/lists"}