8e22d37b64
Send keepalive pings. Remove players who haven't sent pings.
20 lines
362 B
Python
20 lines
362 B
Python
from flask import Flask, render_template
|
|
from flask_socketio import SocketIO, emit
|
|
|
|
app = Flask(__name__)
|
|
socketio = SocketIO(app)
|
|
|
|
|
|
@app.route('/')
|
|
def index():
|
|
return render_template('index.html')
|
|
|
|
|
|
@socketio.event
|
|
def message(data):
|
|
emit('message', data, broadcast=True)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
socketio.run(app, log_output=True, debug=True)
|