mirror of
https://github.com/giongto35/cloud-game.git
synced 2026-07-22 17:47:11 +00:00
Remove unncessary
This commit is contained in:
parent
2a782100a0
commit
58b49131b2
4 changed files with 14 additions and 15 deletions
|
|
@ -51,9 +51,9 @@ func (console *Console) Step() int {
|
|||
console.PPU.Step()
|
||||
console.Mapper.Step()
|
||||
}
|
||||
//for i := 0; i < cpuCycles; i++ {
|
||||
//console.APU.Step()
|
||||
//}
|
||||
for i := 0; i < cpuCycles; i++ {
|
||||
console.APU.Step()
|
||||
}
|
||||
return cpuCycles
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ func (h *Handler) WS(w http.ResponseWriter, r *http.Request) {
|
|||
wssession.BrowserClient.Listen()
|
||||
|
||||
// TODO: Use callback
|
||||
// listen to socket done to close peerconnection
|
||||
// If peerconnection is done (client.Done is signalled), we close peerconnection
|
||||
go func() {
|
||||
for {
|
||||
<-client.Done
|
||||
|
|
|
|||
|
|
@ -75,9 +75,8 @@ func (s *Session) RouteOverlord() {
|
|||
"start",
|
||||
func(resp cws.WSPacket) (req cws.WSPacket) {
|
||||
log.Println("Received a start request from overlord")
|
||||
log.Println("Add the connection to current room on the host")
|
||||
log.Println("Add the connection to current room on the host ", resp.SessionID)
|
||||
|
||||
log.Println("SessionID : ", resp.SessionID)
|
||||
peerconnection := oclient.peerconnections[resp.SessionID]
|
||||
log.Println("start session")
|
||||
|
||||
|
|
|
|||
|
|
@ -148,9 +148,8 @@ func (r *Room) CleanSession(peerconnection *webrtc.WebRTC) {
|
|||
|
||||
func (r *Room) removeSession(w *webrtc.WebRTC) {
|
||||
fmt.Println("Cleaning session: ", w)
|
||||
//r.sessionsLock.Lock()
|
||||
//defer r.sessionsLock.Unlock()
|
||||
fmt.Println("Sessions list", r.rtcSessions)
|
||||
// TODO: get list of r.rtcSessions in lock
|
||||
for i, s := range r.rtcSessions {
|
||||
fmt.Println("found session: ", s, w)
|
||||
if s.ID == w.ID {
|
||||
|
|
@ -171,14 +170,15 @@ func (r *Room) removeSession(w *webrtc.WebRTC) {
|
|||
}
|
||||
|
||||
func (r *Room) Close() {
|
||||
if r.Done == false {
|
||||
log.Println("Closing room", r.ID)
|
||||
log.Println("Closing director of room ", r.ID)
|
||||
close(r.director.Done)
|
||||
log.Println("Closing input of room ", r.ID)
|
||||
close(r.inputChannel)
|
||||
r.Done = true
|
||||
if r.Done {
|
||||
return
|
||||
}
|
||||
|
||||
log.Println("Closing room", r.ID)
|
||||
log.Println("Closing director of room ", r.ID)
|
||||
close(r.director.Done)
|
||||
log.Println("Closing input of room ", r.ID)
|
||||
close(r.inputChannel)
|
||||
r.Done = true
|
||||
// Close here is a bit wrong because this read channel
|
||||
//close(r.imageChannel)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue