Skip to content

Commit

Permalink
#12 Added documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcelEwinger authored and christofplie committed May 1, 2022
1 parent 130d5ff commit 739f24b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions backend/client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<script type="module">
import { io } from "https://cdn.socket.io/4.4.1/socket.io.esm.min.js";

const socket = io('http://localhost:3000');
//const socket = io('https://mankomania-backend.herokuapp.com');
//const socket = io('http://localhost:3000');
const socket = io('https://mankomania-backend.herokuapp.com');
let lobby;

socket.on("connect", () => {
Expand Down
16 changes: 8 additions & 8 deletions backend/server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ const rooms = {};


/**
* Check if a private Room was send
* Check if a private Room was send or a new room should be created or join to an room
* @param socket A connected socket.io socket
* @param room Name of the room
* @param io
* @param io server instance
*/
function validateRoom(socket, room, io){
if(room === ''){
Expand Down Expand Up @@ -69,10 +69,10 @@ function searchEmptyRooms(){
}
}
/**
* Will connect a socket to a specified room
* Will connect an socket to an specified room
* @param socket A connected socket.io socket
* @param room An object that represents a room from the `rooms` instance variable object
* @param io
* @param io server instance
*/
function joinRoom(socket, room, io) {
room.sockets.push(socket.id);
Expand Down Expand Up @@ -119,10 +119,10 @@ function leaveRooms(socket){
}

/**
*
* @param socket
* @param room
* @param io
* Increase the ready counter for thr room object
* @param socket A connected socket.io socket
* @param room room An object that represents a room from the `rooms` instance variable object
* @param io io server instance
*/
function increaseReadyCounterForRoom(socket, room, io){
if(rooms[room] !== undefined){
Expand Down

0 comments on commit 739f24b

Please sign in to comment.