mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2025-12-27 14:00:35 +00:00
Work around not being able to reach the shard from a local connection
In certain circumstances, like when running a private server through Hamachi, the shard IP will be set to an address the local machine can't reach itself from, preventing only the local player from getting past character selection. This workaround detects local connections and sends a loopback address for the shard instead of the configured one. This makes those use cases feasible.
This commit is contained in:
@@ -63,7 +63,7 @@ CNPacketData::CNPacketData(void* b, uint32_t t, int l): buf(b), size(l), type(t)
|
||||
|
||||
// ========================================================[[ CNSocket ]]========================================================
|
||||
|
||||
CNSocket::CNSocket(SOCKET s, PacketHandler ph): sock(s), pHandler(ph) {
|
||||
CNSocket::CNSocket(SOCKET s, struct sockaddr_in &addr, PacketHandler ph): sock(s), sockaddr(addr), pHandler(ph) {
|
||||
EKey = (uint64_t)(*(uint64_t*)&CNSocketEncryption::defaultKey[0]);
|
||||
}
|
||||
|
||||
@@ -390,7 +390,7 @@ void CNServer::start() {
|
||||
addPollFD(newConnectionSocket);
|
||||
|
||||
// add connection to list!
|
||||
CNSocket* tmp = new CNSocket(newConnectionSocket, pHandler);
|
||||
CNSocket* tmp = new CNSocket(newConnectionSocket, address, pHandler);
|
||||
connections[newConnectionSocket] = tmp;
|
||||
newConnection(tmp);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user