Explorar el Código

Remove rubbish

master
Pete Shadbolt hace 8 años
padre
commit
95c23a0beb
Se han modificado 2 ficheros con 0 adiciones y 34 borrados
  1. +0
    -1
      .agignore
  2. +0
    -33
      server/server.py

+ 0
- 1
.agignore Ver fichero

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

+ 0
- 33
server/server.py Ver fichero

@@ -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()


Cargando…
Cancelar
Guardar