Giter Club home page Giter Club logo

rock-paper-scissors's Introduction

rock-paper-scissors

Simple rock-paper-scissors game with WebRTC

Socket은 서버를 통한 (양방향)통신이지만, WebRTC는 P2P 통신입니다.

구조

src
│   server.js       # App entry point
└───controllers     # Express route 컨트롤러
└───config          # 환경변수
└───loaders         # 모듈 로더
└───public          # html, css, js

설명

Player A, Partner B

  1. [FE] A가 최초 접속 시, socket emit 'join-room'
  2. [BE] 접속에 대한 처리, 만약 key가 없다면 uuid pakage를 통해 생성
    • A(Player)에게 socket emit joined-room
    • B(Partner)에게 socket emit 'partner-joined-room'
  3. [FE] Join room에 대한 처리
    • A(Player)가 socket on joined-room 를 통한 redirect 처리 등
    • B(Partner)가 socket on partner-joined-room 통해 offer 작성 후, A(Player)에게 전송
  4. 이후, FE emit call-user => BE emit call-made => FE emit make-answer => BE emit answer-made 흐름
  5. dataChannel.send && onmessage를 통해 가위바위보 진행

참조

rock-paper-scissors's People

Contributors

junha-ahn avatar

Watchers

 avatar  avatar

rock-paper-scissors's Issues

후보 찾기 (finding candidates)

개요

  1. 최초 접속시 key(query)가 없다면, 방을 만들고 key 생성 후 redirect
  2. key가 있다면 해당 방에 들어가면서 게임 시작

상세 목표

  • key 생성 후, create Room & redirect
  • key 를 통한 접속 가능화
    • join Room
    • 2인 제한 처리
    • key를 통해 접속 시, Room에 접속된 유저에게 emit event
  • disconnect 처리

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.