@@ -9,10 +9,9 @@
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
require("./library.js");
|
||||
require("./library");
|
||||
const net = require("net");
|
||||
var ConnectIDCount = 1;
|
||||
let RBTree = global.RBTree;
|
||||
module.exports = class CNode {
|
||||
addrStr
|
||||
ip
|
||||
@@ -154,7 +153,7 @@ module.exports = class CNode {
|
||||
this.CanHardTraffic = 0
|
||||
this.BufWriteLength = 0
|
||||
this.BufWrite = Buffer.alloc(0)
|
||||
this.SendPacket = new RBTree(function(a, b) {
|
||||
this.SendPacket = new global.RBTree(function(a, b) {
|
||||
return b.PacketNum - a.PacketNum;
|
||||
})
|
||||
this.ConnectCount = 0
|
||||
@@ -343,19 +342,19 @@ module.exports = class CNode {
|
||||
var Buf = global.BufLib.GetObjectFromBuffer(data, global.FORMAT_POW_TO_CLIENT, {});
|
||||
}
|
||||
catch (e) {
|
||||
global.SERVER.Sendglobal.CloseSocket(Socket, "FORMAT_POW_TO_CLIENT")
|
||||
global.SERVER.SendCloseSocket(Socket, "FORMAT_POW_TO_CLIENT")
|
||||
return 0;
|
||||
}
|
||||
if (global.CompareArr(Buf.addrArr, global.SERVER.addrArr) === 0) {
|
||||
Node.Self = true
|
||||
global.AddNodeInfo(Node, "END: SELF")
|
||||
global.SERVER.Sendglobal.CloseSocket(Socket, "SELF")
|
||||
global.SERVER.SendCloseSocket(Socket, "SELF")
|
||||
return;
|
||||
}
|
||||
var addrStr = global.GetHexFromAddres(Buf.addrArr);
|
||||
if (!Node.StartFindList && addrStr !== Node.addrStr) {
|
||||
global.AddNodeInfo(Node, "END: CHANGED ADDR: " + Node.addrStr.substr(0, 16) + "->" + addrStr.substr(0, 16))
|
||||
global.SERVER.Sendglobal.CloseSocket(Socket, "ADDRESS_HAS_BEEN_CHANGED")
|
||||
global.SERVER.SendCloseSocket(Socket, "ADDRESS_HAS_BEEN_CHANGED")
|
||||
return;
|
||||
}
|
||||
if (Node.addrStrTemp) {
|
||||
@@ -373,7 +372,7 @@ module.exports = class CNode {
|
||||
if (!Result) {
|
||||
global.ToLog("END: ERROR_SIGN_SERVER ADDR: " + addrStr.substr(0, 16) + " from ip: " + Socket.remoteAddress)
|
||||
global.AddNodeInfo(Node, "END: ERROR_SIGN_SERVER ADDR: " + addrStr.substr(0, 16) + " from ip: " + Socket.remoteAddress)
|
||||
global.SERVER.Sendglobal.CloseSocket(Socket, "ERROR_SIGN_SERVER")
|
||||
global.SERVER.SendCloseSocket(Socket, "ERROR_SIGN_SERVER")
|
||||
return;
|
||||
}
|
||||
if (Buf.MIN_POWER_POW_HANDSHAKE > 1 + global.MIN_POWER_POW_HANDSHAKE) {
|
||||
|
||||
Reference in New Issue
Block a user