Working on making server and client uuid in sync but a challenjour has appeared is good
parent
d6ea697f57
commit
fab2ab97d7
2
pool.go
2
pool.go
|
|
@ -30,7 +30,7 @@ func (p *Pool) Push(id string, conn *websocket.Conn) {
|
|||
p.lock.Lock()
|
||||
p.conns.Store(id, &Conn{ws: *conn})
|
||||
p.lock.Unlock()
|
||||
p.Broadcast(websocket.TextMessage, strings.NewReader(`{"joined":"`+id+`"}`))
|
||||
p.Broadcast(websocket.TextMessage, strings.NewReader(`{"joined":"`+id+`", "uuid":"`+id+`"}`))
|
||||
}
|
||||
|
||||
func (p *Pool) Broadcast(mt int, r io.Reader) error {
|
||||
|
|
|
|||
|
|
@ -166,6 +166,9 @@ class Entropy {
|
|||
// Ignore messages from ourself
|
||||
if (signal.uuid == Config.getUUID()) return;
|
||||
|
||||
if (signal.joined)
|
||||
Log.info("a challenjour has appeared", JSON.stringify(signal));
|
||||
|
||||
if (signal.sdp) {
|
||||
Entropy.rtc.conn.setRemoteDescription(new RTCSessionDescription(signal.sdp)).then(function() {
|
||||
// Only create answers in response to offers
|
||||
|
|
@ -258,7 +261,7 @@ for (var i in ["log", "info", "warn", "error"]) {
|
|||
window.console = console;
|
||||
|
||||
function pageReady() {
|
||||
Config.newUUID();
|
||||
//Config.newUUID();
|
||||
var host = window.location.hostname;
|
||||
if (window.location.port) {
|
||||
host += ":" + window.location.port;
|
||||
|
|
|
|||
Loading…
Reference in New Issue