-
Notifications
You must be signed in to change notification settings - Fork 0
/
globals.js
109 lines (89 loc) · 2.08 KB
/
globals.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
console.log("importing globals");
express = require('express');
exports.app = express();
http = require('http').Server(exports.app);
//exports.DEBUG = true;
//exports.NO_SC = true;
//simple db using monk & mongodb
exports.URL = 'localhost:27017/ConditionalLove';
exports.MONK = require('monk');
exports.DB = exports.MONK(exports.URL);
exports.DB .addMiddleware(require('monk-middleware-debug'))
exports.DB.then(() => {
console.log('Connected correctly to server')
})
exports.UserData = exports.DB.get('UserData');
exports.Votes = exports.DB.get('Votes');
exports.Rooms = exports.DB.get('Rooms'); //This might become a variable ?
exports.Presets = exports.DB.get('Presets'); //not using so far - probably should just be json
exports.usrobj =
{
mode: "wait",
connected: true,
rooms: [],
groups: [],
currentVoteId: -1,
currentVotePair: [0,0]
}
exports.LoveParameters =
{
state: 0,
state_z: 0,
isSplat: false,
isMobile: false,
isDying: false,
maxState: 2,
envTime: 8,
blobSeed: 0.01,
colSeed: 0.01,
colMode: 0, //0 -> 3 (int),
death: 0
}
exports.fonts = [
"AlexBrush",
"Pacifico",
"Chunkfive",
"KaushanScript",
"Ostrich",
"Oswald",
"Arial",
"Times"];
exports.fontColours = [
"255,0,0",
"0,255,0",
"255,255,0",
"255,0,255",
"0,255,255",
"255,180,0",
"0,150,0",
"100,100,255"
];
var k = Object.keys(exports.LoveParameters);
for(var i = 0; i < k.length; i++)
{
exports.usrobj[k[i]] = exports.LoveParameters[k[i]];
}
exports.storyCurrText = [""];
exports.storyNumChars = 0;
exports.storyRooms = [];
io = require('socket.io')(http);
exports.admin = io.of('/admin');
exports.display = io.of('/display');
exports.players = io.of('/player');
exports.sockets = {};
exports.checkins = {};
exports.checkinProcs = {}; //checkin processes only
exports.procs = {}; //all timeout and interval processes - excluding checkins
exports.pendingVotes = [];
exports.voteDisplaySlots =
{
a: [0,0,0,0],
b: [0,0,0,0]
};
exports.currentConcludedVote = null;
var osc = require("osc");
exports.udpPort = new osc.UDPPort({
localAddress: "127.0.0.1",
localPort: 12345
});
exports.udpPort.open();