-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.js
40 lines (31 loc) · 1.46 KB
/
main.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
// Yes, this is it. This is all you need for a minimal package.
console.log('[IPL]: IPlogger started...');
const fs = require('fs');
jcmp.events.Add('ClientConnected', client => {
var d = new Date();
//plus 1 to month because js
var datetime = `${d.getFullYear()}-${d.getMonth()+1}-${d.getDate()} ${d.getHours()}:${d.getMinutes()}:${d.getSeconds()}`;
fs.appendFile("logs/IPlogger.log", `${datetime} JOIN - name : ${client.name} - ip : ${client.ipAddress} - steamId : ${client.steamId}\n`, function(err) {
if(err) {
return console.log(err);
}
})
console.log(`[IPL] JOIN ${datetime} - name : ${client.name} - IP : ${client.ipAddress} - steamId : ${client.steamId}`);
// login only IPs on JOIN
fs.appendFile("logs/IPs.log", `${client.ipAddress}\n`, function(err) {
if(err) {
return console.log(err);
}
})
});
jcmp.events.Add('ClientDisconnected', client => {
var d = new Date();
//plus 1 to month because js
var datetime = `${d.getFullYear()}-${d.getMonth()+1}-${d.getDate()} ${d.getHours()}:${d.getMinutes()}:${d.getSeconds()}`;
fs.appendFile("logs/IPlogger.log", `${datetime} LEAVE - name : ${client.name} - ip : ${client.ipAddress} - steamId : ${client.steamId}\n`, function(err) {
if(err) {
return console.log(err);
}
})
console.log(`[IPL] LEAVE ${datetime} - name : ${client.name} - IP : ${client.ipAddress} - steamId : ${client.steamId}`);
});