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.lock.Lock()
|
||||||
p.conns.Store(id, &Conn{ws: *conn})
|
p.conns.Store(id, &Conn{ws: *conn})
|
||||||
p.lock.Unlock()
|
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 {
|
func (p *Pool) Broadcast(mt int, r io.Reader) error {
|
||||||
|
|
|
||||||
|
|
@ -166,6 +166,9 @@ class Entropy {
|
||||||
// Ignore messages from ourself
|
// Ignore messages from ourself
|
||||||
if (signal.uuid == Config.getUUID()) return;
|
if (signal.uuid == Config.getUUID()) return;
|
||||||
|
|
||||||
|
if (signal.joined)
|
||||||
|
Log.info("a challenjour has appeared", JSON.stringify(signal));
|
||||||
|
|
||||||
if (signal.sdp) {
|
if (signal.sdp) {
|
||||||
Entropy.rtc.conn.setRemoteDescription(new RTCSessionDescription(signal.sdp)).then(function() {
|
Entropy.rtc.conn.setRemoteDescription(new RTCSessionDescription(signal.sdp)).then(function() {
|
||||||
// Only create answers in response to offers
|
// Only create answers in response to offers
|
||||||
|
|
@ -258,7 +261,7 @@ for (var i in ["log", "info", "warn", "error"]) {
|
||||||
window.console = console;
|
window.console = console;
|
||||||
|
|
||||||
function pageReady() {
|
function pageReady() {
|
||||||
Config.newUUID();
|
//Config.newUUID();
|
||||||
var host = window.location.hostname;
|
var host = window.location.hostname;
|
||||||
if (window.location.port) {
|
if (window.location.port) {
|
||||||
host += ":" + window.location.port;
|
host += ":" + window.location.port;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue