diff --git a/geoguessr.js b/geoguessr.js index e29fc31..9937777 100644 --- a/geoguessr.js +++ b/geoguessr.js @@ -5,6 +5,21 @@ var cam = document.getElementById("camera"); // カメラ var dir = "image/"; // 画像格納ディレクトリ var inirot = {}; // カメラの初期の向き + var connect = document.getElementById("connect"); + var conn, PORT = 8888, server = location.hostname||"localhost"; + + function initConn() { + try { + conn = new Websocket('ws://' + server + ':' + PORT + '/'); + conn.onopen function() {}; + conn.onerror = function(err) { + alert('WebSocket failure:' + err) + }; + conn.onmessage = function(ev) { + info.textContent = ev.data; + }; + } + } function addSphere(attr) { // CSVの該当行の位置に球を配置する // photo,color,radius,opacity,x,y,z,next