2016-11-07 20:25:08 +00:00
|
|
|
const io = require('socket.io')()
|
|
|
|
const signalling = require('./signal')
|
|
|
|
const junto = require('./junto')
|
|
|
|
const map = require('./map')
|
|
|
|
const global = require('./global')
|
|
|
|
const stunservers = [{'url': 'stun:stun.l.google.com:19302'}]
|
2014-02-10 07:03:06 +00:00
|
|
|
|
2016-10-21 13:29:04 +00:00
|
|
|
const { createStore } = require('redux')
|
2016-10-21 22:04:18 +00:00
|
|
|
const reducer = require('./reducer')
|
2016-10-21 13:29:04 +00:00
|
|
|
|
|
|
|
let store = createStore(reducer)
|
2014-02-10 07:03:06 +00:00
|
|
|
|
2016-10-21 13:29:04 +00:00
|
|
|
global(io, store)
|
|
|
|
signalling(io, stunservers, store)
|
|
|
|
junto(io, store)
|
|
|
|
map(io, store)
|
|
|
|
|
2016-11-08 20:51:39 +00:00
|
|
|
io.listen(parseInt(process.env.NODE_REALTIME_PORT) || 5000)
|
2016-12-21 08:56:29 +00:00
|
|
|
console.log('booting up', process.env.NODE_REALTIME_PORT || 5000)
|