func (s *Server) addPeer(sid proto.SID, peer *Peer) {
	log.Infof("addPeer sid=%s uid=%s", sid, peer.uid)
	room := s.getRoom(sid)
	if room == nil {
		room = newRoom(sid)
		s.roomLock.Lock()
		s.rooms[sid] = room
		s.roomLock.Unlock()
	}
	room.addPeer(peer)
}
// addPeer add a peer to room
addPeer add a peer to room
// addPeer add a peer to room
func (s *Server) addPeer(sid proto.SID, peer *Peer) {
	log.Infof("addPeer sid=%s uid=%s", sid, peer.uid)
	room := s.getRoom(sid)
	if room == nil {
		room = newRoom(sid)
		s.roomLock.Lock()
		s.rooms[sid] = room
		s.roomLock.Unlock()
	}
	room.addPeer(peer)
}
func ( s * Server ) addPeer ( sid proto . SID , peer * Peer ) { log . Infof ( " " , sid , peer . uid ) room := s . getRoom ( sid ) if room == nil { room = newRoom ( sid ) s . roomLock . Lock ( ) s . rooms [ sid ] = room s . roomLock . Unlock ( ) } room . addPeer ( peer ) }
addPeer add a peer to room
addPeer add a peer to room