Anders and Briegel in Python
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
481B

  1. var ws;
  2. function connect_to_server() {
  3. ws = new WebSocket("ws://localhost:5001");
  4. ws.onopen = function()
  5. {
  6. console.log("Connected to server.");
  7. };
  8. ws.onmessage = function (evt)
  9. {
  10. var new_state = JSON.parse(evt.data);
  11. vops = new_state.vops;
  12. ngbh = new_state.ngbh;
  13. meta = new_state.meta;
  14. updateScene();
  15. };
  16. ws.onclose = function()
  17. {
  18. console.log("Connection was closed.");
  19. };
  20. }