Browse Source

Remove rubbish

master
Pete Shadbolt 8 years ago
parent
commit
95c23a0beb
2 changed files with 0 additions and 34 deletions
  1. +0
    -1
      .agignore
  2. +0
    -33
      server/server.py

+ 0
- 1
.agignore View File

@@ -1 +0,0 @@
static/scripts/three.js

+ 0
- 33
server/server.py View File

@@ -1,33 +0,0 @@
from websocket_server import WebsocketServer
import threading
import abp
import json

clients = []

def new_message(client, server, message):
decoded_message = json.loads(message)
if "diff" in decoded_message:
server.send_message_to_all(message)
elif "method" in decoded_message:
message = compute_diff(decoded_message)
server.send_message_to_all(message)
else:
print "Could not interpret message"


def new_client(client, server):
print "Client {} connected.".format(client["id"])
clients.append(client)

def client_left(client, server):
print "Client {} disconnected.".format(client["id"])
clients.remove(client)

if __name__ == '__main__':
server = WebsocketServer(5001)
server.set_fn_new_client(new_client)
server.set_fn_message_received(new_message)
server.set_fn_client_left(client_left)
server.run_forever()


Loading…
Cancel
Save