Remove unnecessary log

This commit is contained in:
giongto35 2019-04-20 16:13:04 +08:00
parent 1c26d12805
commit 6abd977d3e
2 changed files with 3 additions and 3 deletions

View file

@ -131,13 +131,11 @@ func initRoom(roomID, gameName string) string {
// TODO: If we remove sessions from room anytime a session is closed, we can check if the sessions list is empty or not.
func isRoomRunning(roomID string) bool {
// If no roomID is registered
fmt.Println("rooms list ", rooms)
if _, ok := rooms[roomID]; !ok {
return false
}
// If there is running session
fmt.Println("Running session", len(rooms[roomID].rtcSessions))
for _, s := range rooms[roomID].rtcSessions {
if !s.IsClosed() {
return true
@ -153,7 +151,6 @@ func startSession(webRTC *webrtc.WebRTC, gameName string, roomID string, playerI
// If the roomID is empty,
// or the roomID doesn't have any running sessions (room was closed)
// we spawn a new room
log.Println("Is Room Running", isRoomRunning(roomID))
if roomID == "" || !isRoomRunning(roomID) {
roomID = initRoom(roomID, gameName)
isNewRoom = true

3
static/js/ws.js vendored
View file

@ -33,6 +33,9 @@ conn.onmessage = e => {
curPacketID = d["packet_id"];
log("Received request offer ", curPacketID)
startWebRTC();
//pc.createOffer({offerToReceiveVideo: true, offerToReceiveAudio: false}).then(d => {
//pc.setLocalDescription(d).catch(log);
//})
//case "sdpremote":
//log("Got remote sdp");