mirror of
https://github.com/genxium/DelayNoMore
synced 2025-10-09 00:26:39 +00:00
Fixed libuv multithreading.
This commit is contained in:
@@ -162,7 +162,15 @@ cc.Class({
|
||||
authKey: Math.floor(Math.random() * 65535),
|
||||
}).finish()
|
||||
const res2 = DelayNoMore.UdpSession.punchToServer("127.0.0.1", 3000, holePunchData);
|
||||
const res3 = DelayNoMore.UdpSession.upsertPeerUdpAddr(self.selfPlayerInfo.JoinIndex, "192.168.31.194", 6789, 123456, 2, self.selfPlayerInfo.JoinIndex);
|
||||
const res3 = DelayNoMore.UdpSession.upsertPeerUdpAddr([window.pb.protos.PeerUdpAddr.create({
|
||||
ip: "192.168.31.194",
|
||||
port: 6789,
|
||||
authKey: 123456,
|
||||
}), window.pb.protos.PeerUdpAddr.create({
|
||||
ip: "192.168.1.101",
|
||||
port: 8771,
|
||||
authKey: 654321,
|
||||
})], 2, self.selfPlayerInfo.JoinIndex);
|
||||
//const res4 = DelayNoMore.UdpSession.closeUdpSession();
|
||||
}
|
||||
self.onRoomDownsyncFrame(startRdf);
|
||||
|
@@ -222,8 +222,7 @@ window.initPersistentSessionClient = function(onopenCb, expectedRoomId) {
|
||||
const peerJoinIndex = resp.peerJoinIndex;
|
||||
const peerAddrList = resp.rdf.peerUdpAddrList;
|
||||
console.log(`Got DOWNSYNC_MSG_ACT_PEER_UDP_ADDR peerAddrList=${JSON.stringify(peerAddrList)}; boundRoomCapacity=${window.boundRoomCapacity}`);
|
||||
const peerAddr = peerAddrList[peerJoinIndex - 1];
|
||||
DelayNoMore.UdpSession.upsertPeerUdpAddr(peerJoinIndex, peerAddr.ip, peerAddr.port, peerAddr.authKey, window.boundRoomCapacity, window.mapIns.selfPlayerInfo.JoinIndex); // In C++ impl it actually broadcasts the peer-punching message to all known peers within "window.boundRoomCapacity"
|
||||
DelayNoMore.UdpSession.upsertPeerUdpAddr(peerAddrList, window.boundRoomCapacity, window.mapIns.selfPlayerInfo.JoinIndex); // In C++ impl it actually broadcasts the peer-punching message to all known peers within "window.boundRoomCapacity"
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
Reference in New Issue
Block a user