Skip to content

Commit

Permalink
Fix internet connect
Browse files Browse the repository at this point in the history
  • Loading branch information
ccomrade committed Jun 11, 2021
1 parent c51d398 commit f841e19
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [Unreleased]
### Changed
- Connecting to internet servers without GameSpy account is now possible.

## [2.5] - 2020-12-22
### Fixed
- Unlocked memory above 2 GB in 32-bit version. Thanks to Vladislav.
Expand Down
98 changes: 98 additions & 0 deletions Code/Launcher/Patch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,103 @@ namespace
}
}

/**
* @brief Allows connecting to Internet servers without GameSpy account.
*/
void FixInternetConnect(const CrysisLibs & libs)
{
void *pCryNetwork = libs.getCryNetwork().getHandle();

switch (libs.getGameVersion())
{
#ifdef BUILD_64BIT
case 5767:
{
FillNOP(RVA(pCryNetwork, 0x18C716), 0x18);
break;
}
case 5879:
{
FillNOP(RVA(pCryNetwork, 0x184136), 0x18);
break;
}
case 6115:
{
FillNOP(RVA(pCryNetwork, 0x189596), 0x18);
break;
}
case 6156:
{
FillNOP(RVA(pCryNetwork, 0x189896), 0x18);
break;
}
case 6566:
{
FillNOP(RVA(pCryNetwork, 0x19602B), 0x18);
break;
}
case 6586:
{
FillNOP(RVA(pCryNetwork, 0x18B0A6), 0x18);
break;
}
case 6627:
case 6670:
case 6729:
{
FillNOP(RVA(pCryNetwork, 0x18B0B6), 0x18);
break;
}
#else
case 5767:
{
FillNOP(RVA(pCryNetwork, 0x3F4B5), 0xD);
break;
}
case 5879:
{
FillNOP(RVA(pCryNetwork, 0x3DBCC), 0xD);
break;
}
case 6115:
{
FillNOP(RVA(pCryNetwork, 0x3FA9C), 0xD);
break;
}
case 6156:
{
FillNOP(RVA(pCryNetwork, 0x3FB7C), 0xD);
break;
}
case 6527:
{
FillNOP(RVA(pCryNetwork, 0x3FB77), 0xD);
break;
}
case 6566:
{
FillNOP(RVA(pCryNetwork, 0x50892), 0xD);
break;
}
case 6586:
case 6627:
case 6670:
case 6729:
{
FillNOP(RVA(pCryNetwork, 0x3FF87), 0xD);
break;
}
#endif
case 687:
case 710:
case 711:
{
// Crysis Warhead doesn't have multiplayer
break;
}
}
}

/**
* @brief Disables the SecuROM crap in 64-bit CrySystem.
* It does nothing in 32-bit build.
Expand Down Expand Up @@ -1273,6 +1370,7 @@ void Patch(const CrysisLibs & libs)
// CryNetwork
EnablePreordered(libs);
AllowSameCDKeys(libs);
FixInternetConnect(libs);

// CrySystem
UnhandledExceptions(libs);
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ It provides a better game launcher and dedicated server launcher with additional
- It's possible to run multiple Crysis instances at once.
- Advantages of pre-ordered version are available to everyone.
- Details of any game or server crash are automatically written to the log file.
- The `connect [IP] [PORT]` console command now works even without GameSpy account.

## Supported game versions

Expand Down

0 comments on commit f841e19

Please sign in to comment.