Working on making server and client uuid in sync but a challenjour has appeared is good

master
Bel LaPointe 2020-05-13 16:42:12 -06:00
parent d6ea697f57
commit fab2ab97d7
2 changed files with 13 additions and 10 deletions

View File

@ -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 {

View File

@ -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;