mirror of
https://github.com/giongto35/cloud-game.git
synced 2026-08-04 07:43:58 +00:00
Remove session after rejoin few times
This commit is contained in:
parent
485b30389d
commit
401940b717
9 changed files with 105 additions and 20 deletions
|
|
@ -94,11 +94,13 @@ func (s *Session) RegisterBrowserClient() {
|
|||
// Create new room
|
||||
// TODO: check if roomID is in the current server
|
||||
room := s.handler.getRoom(s.RoomID)
|
||||
log.Println("Got Room from local ", room, " ID: ", s.RoomID)
|
||||
if room == nil {
|
||||
room = s.handler.createNewRoom(s.GameName, s.RoomID, s.PlayerIndex)
|
||||
}
|
||||
|
||||
// Attach peerconnection to room
|
||||
s.handler.detachPeerConn(s.peerconnection)
|
||||
room.AddConnectionToRoom(s.peerconnection, s.PlayerIndex)
|
||||
s.RoomID = room.ID
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue