-
Notifications
You must be signed in to change notification settings - Fork 0
/
user.js
62 lines (60 loc) · 2.32 KB
/
user.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
var userConnection=require('./userConnection.js');
console.log('executed!')
//key=Z6fdHqcmNVwaYWPyq8
var callback= function (/*MultiUser*/ user, /*String*/ method, /*String*/ data) {
console.log('callback!',arguments)
/*
if (user != null && !users.contains(user) && !user.isDummy()) {
return;
}
//System.out.println("callback: '" + user + "', '" + method + "', '" + data + "'");
if (method.equals("captcha")) {
if (user.isPulseEver()) {
lastPulse = 0;
}
captchad(user, data);
} else if (method.equals("ban")) {
if (user.isPulseEver()) {
lastPulse = 0;
}
banned(user.getProxy(), data);
} else if (method.equals("died")) {
user.getProxy().dirty();
switchProxy();
tellAdmin("Connection died: " + user);
remove(user);
} else if (method.equals("disconnected")) {
remove(user);
} else if (method.equals("typing")) {
typing(user);
} else if (method.equals("stoppedtyping")) {
stoppedTyping(user);
} else if (method.equals("message")) {
hear(user, data);
} else if (method.equals("connected") || method.equals("accepted")) {
welcome(user);
} else if (method.equals("interests")) {
tellAdmin("Joined with " + data);
} else if (method.equals("pulse success")) {
tellAdmin("Pulse, joined with " + data);
addPulse();
} else if (method.equals("chatname")) {
chatName = data;
} else if (method.equals("tor found")) {
tellAdmin("Tor circuit found for: " + data);
if (proxy.isBanned() || proxy.isDirty()) {
switchProxy();
}
} else if (method.equals("tor aborted")) {
tellAdmin("Tor search aborted for: " + data);
} else if (method.equals("tor failed")) {
tellAdmin("Tor search failed for: " + data);
} else if (method.equals("tor duplicate")) {
checkTorDuplicate(data);
} else {
System.err.println("\n\n\nUNKNOWN CALLBACK METHOD '" + method + "'\n\n\n");
}
*/
}
var user=new userConnection(callback);
user.init();