Skip to content

Commit

Permalink
Merge pull request #166 from MBU-Team/natholepunch
Browse files Browse the repository at this point in the history
NAT Hole Punching
  • Loading branch information
HumanGamer authored Jun 2, 2023
2 parents 320ee2e + bdfa96f commit 6137365
Show file tree
Hide file tree
Showing 31 changed files with 1,243 additions and 362 deletions.
4 changes: 2 additions & 2 deletions engine/source/core/torqueConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

/// Version number is major * 1000 + minor * 100 + revision * 10.
/// Different engines (TGE, T2D, etc.) will have different version numbers.
#define TORQUE_VERSION 900 // version 0.9
#define TORQUE_VERSION 901 // version 0.9

/// What engine are we running? The presence and value of this define are
/// used to determine what engine (TGE, T2D, etc.) and version thereof we're
Expand All @@ -46,7 +46,7 @@
#define TORQUE_HIFI_NET

/// Define me to enable Torque Hole Punching support
//#define TORQUE_NET_HOLEPUNCHING
#define TORQUE_NET_HOLEPUNCHING

/// Define me to enable shader caching support (Unfinished and really only needed for some versions of Wine or Proton)
//#define TORQUE_SHADER_CACHING
Expand Down
12 changes: 8 additions & 4 deletions engine/source/game/gameConnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,10 @@ void GameConnection::onConnectionEstablished(bool isInitiator)
{
setGhostFrom(false);
setGhostTo(true);
setSendingEvents(true);
setTranslatesStrings(true);
if (!isEstablished()) {
setSendingEvents(true);
setTranslatesStrings(true);
}
setIsConnectionToServer();
mServerConnection = this;
Con::printf("Connection established %d", getId());
Expand All @@ -160,8 +162,10 @@ void GameConnection::onConnectionEstablished(bool isInitiator)
{
setGhostFrom(true);
setGhostTo(false);
setSendingEvents(true);
setTranslatesStrings(true);
if (!isEstablished()) {
setSendingEvents(true);
setTranslatesStrings(true);
}
Sim::getClientGroup()->addObject(this);
mTotalServerTicks = ServerTicksUninitialized;

Expand Down
Loading

0 comments on commit 6137365

Please sign in to comment.