Skip to content

Commit 058d81e

Browse files
committed
Merge branch 'main' into feature/savegameinfo
2 parents 1893e96 + ae83a8c commit 058d81e

File tree

6 files changed

+36
-8
lines changed

6 files changed

+36
-8
lines changed

README.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1+
**CnCNet Spawner** is a project that allows CnCNet client application (like [XNA CnCNet Client](https://github.com/CnCNet/xna-cncnet-client)) to "spawn" (launch) the game right into a battle, skipping the menus and configuring game's own and CnCNet-specific things using a config file (`spawn.ini`).
2+
3+
This particular spawner is written using a framework set up by [Ares](https://github.com/Ares-developers/Ares), [Phobos](https://github.com/Phobos-developers/Phobos) projects, uses [YRpp](https://github.com/Phobos-developers/YRpp) to interface with the game and is a rewrite of the original [YR patches](https://github.com/CnCNet/yr-patches) made by CnCNet team. It is built as a DLL loadable by [Syringe](https://github.com/Phobos-developers/Syringe).
4+
15
Downloads
26
---------
7+
38
- [Latest releases](https://github.com/CnCNet/yrpp-spawner/releases)
49

510
Building manually
611
-----------------
712

8-
1. Install **Visual Studio** (2022 is recommended, 2019 is minimum) with the dependencies listed in `.vsconfig` (it will prompt you to install missing dependencies when you open the project, or you can run VS installer and import the config). If you prefer to use **Visual Studio Code** you may install **VS Build Tools** with the dependencies from `.vsconfig` instead. Not using a code editor or IDE and building via **command line scripts** included with the project is also an option.
9-
2. Clone this repo recursively via your favorite git client (that will also clone YRpp and private submodule, if you have access).
13+
1. Install **Visual Studio** (2022 is required) with the dependencies listed in `.vsconfig` (it will prompt you to install missing dependencies when you open the project, or you can run VS installer and import the config). If you prefer to use **Visual Studio Code** you may install **VS Build Tools** with the dependencies from `.vsconfig` instead. Not using a code editor or IDE and building via **command line scripts** included with the project is also an option.
14+
2. Clone this repo either recursively, if you are a member of CnCNet org, or if you are not (you don't have access to private submodule) - clone non-recursively, then init-and-update the YRpp submodule only.
1015
3. To build the extension:
1116
- in Visual Studio: open the solution file in VS and build it (`Debug` build config is recommended);
1217
- in VSCode: open the project folder, hit `Run Build Task...` (`Ctrl + Shift + B`) and select the needed config;
@@ -17,12 +22,24 @@ Please note that you can build the hardened version only if you have access to i
1722

1823
Credits
1924
-------
20-
- **[Belonit](https://github.com/Belonit)** - Porting and adapting
25+
26+
- **[Belonit](https://github.com/Belonit)**
27+
- Porting and adapting of the original spawner
28+
- Further maintenance
29+
- Fix for drawing maps smaller than the screen
2130
- **[Kerbiter (Metadorius)](https://github.com/Metadorius)**
2231
- Further maintenance
2332
- Event verification checks
2433
- Save button for multiplayer pause menu
2534
- Beacon crash fix for multiplayer save/load
35+
- Game speed slider toggle
36+
- Fake multiplayer flag
37+
- **[ZivDero](https://github.com/ZivDero)**
38+
- Handicaps (difficulty & credits) support
39+
- **[Starkku](https://github.com/Starkku)**
40+
- Allow customizing whether or not special house is ally to all players via spawn.ini option (#51)
41+
- **[RAZER](https://github.com/CnCRAZER)**
42+
- Game speed slider toggle
2643
- **[TaranDahl](https://github.com/TaranDahl)**
2744
- Porting of multiplayer save/load
2845
- Porting of autosaves
@@ -36,6 +53,7 @@ Credits
3653

3754
Legal and License
3855
-----
56+
3957
[![GPL v3](https://www.gnu.org/graphics/gplv3-127x51.png)](https://opensource.org/licenses/GPL-3.0)
4058

4159
This project is an unofficial open-source community collaboration project to patch the Red Alert 2 Yuri's Revenge engine for CnCNet support & compatibility purposes.
@@ -44,6 +62,7 @@ This project has no direct affiliation with Electronic Arts Inc. Command & Conqu
4462

4563
Sponsored by
4664
------------
65+
4766
<a href="https://www.digitalocean.com/?refcode=337544e2ec7b&utm_campaign=Referral_Invite&utm_medium=opensource&utm_source=CnCNet" title="Powered by Digital Ocean" target="_blank">
4867
<img src="https://opensource.nyc3.cdn.digitaloceanspaces.com/attribution/assets/PoweredByDO/DO_Powered_by_Badge_blue.svg" width="201px" alt="Powered By Digital Ocean" />
4968
</a>

src/Misc/Observers.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,15 @@ DEFINE_HOOK(0x658473, RadarClass__658330_SetObserverFlag, 0x5)
7373

7474
#pragma endregion HouseClass is Observer
7575

76-
// Allow skirmish observer to control gamespeed
77-
// TODO: Allow control speed in skirmish if all human players is Observer
7876
DEFINE_HOOK(0x4E20BA, GameControlsClass__SomeDialog, 0x5)
7977
{
8078
enum { AllowControlSpeed = 0x4E211A, ForbidControlSpeed = 0x4E20C3 };
8179

80+
if (Spawner::Enabled && Spawner::GetConfig()->DisableGameSpeed)
81+
return ForbidControlSpeed;
82+
83+
// Allow skirmish observer to control gamespeed (vanilla game doesn't allow this)
84+
// TODO: Allow control speed in skirmish if all human players is Observer
8285
return (SessionClass::IsSkirmish() && Game::ObserverMode)
8386
? AllowControlSpeed
8487
: 0;

src/Spawner/Spawner.Config.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ void SpawnerConfig::LoadFromINIFile(CCINIClass* pINI)
8585
MaxAhead = pINI->ReadInteger(pSettingsSection, "MaxAhead", MaxAhead);
8686
PreCalcMaxAhead = pINI->ReadInteger(pSettingsSection, "PreCalcMaxAhead", PreCalcMaxAhead);
8787
MaxLatencyLevel = (byte)pINI->ReadInteger(pSettingsSection, "MaxLatencyLevel", (int)MaxLatencyLevel);
88+
ForceMultiplayer = pINI->ReadBool(pSettingsSection, "ForceMultiplayer", ForceMultiplayer);
8889
}
8990

9091
{ // Tunnel Options
@@ -109,6 +110,7 @@ void SpawnerConfig::LoadFromINIFile(CCINIClass* pINI)
109110
// Extended Options
110111
{
111112
Ra2Mode = pINI->ReadBool(pSettingsSection, "Ra2Mode", Ra2Mode);
113+
DisableGameSpeed = pINI->ReadBool(pSettingsSection, "DisableGameSpeed", DisableGameSpeed);
112114
QuickMatch = pINI->ReadBool(pSettingsSection, "QuickMatch", QuickMatch);
113115
SkipScoreScreen = pINI->ReadBool(pSettingsSection, "SkipScoreScreen", SkipScoreScreen);
114116
WriteStatistics = pINI->ReadBool(pSettingsSection, "WriteStatistics", WriteStatistics);

src/Spawner/Spawner.Config.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ class SpawnerConfig
123123
int MaxAhead;
124124
int PreCalcMaxAhead;
125125
byte MaxLatencyLevel;
126+
bool ForceMultiplayer;
126127

127128
// Tunnel Options
128129
int TunnelId;
@@ -138,6 +139,7 @@ class SpawnerConfig
138139

139140
// Extended Options
140141
bool Ra2Mode;
142+
bool DisableGameSpeed;
141143
bool QuickMatch;
142144
bool SkipScoreScreen;
143145
bool WriteStatistics;
@@ -196,6 +198,7 @@ class SpawnerConfig
196198
, MaxAhead { -1 }
197199
, PreCalcMaxAhead { 0 }
198200
, MaxLatencyLevel { 0xFF }
201+
, ForceMultiplayer { false }
199202

200203
// Tunnel Options
201204
, TunnelId { 0 }
@@ -231,6 +234,7 @@ class SpawnerConfig
231234

232235
// Extended Options
233236
, Ra2Mode { false }
237+
, DisableGameSpeed { false }
234238
, QuickMatch { false }
235239
, SkipScoreScreen { Main::GetConfig()->SkipScoreScreen }
236240
, WriteStatistics { false }

src/Spawner/Spawner.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ bool Spawner::StartScenario(const char* pScenarioName)
292292
{ // Set SessionType
293293
if (Spawner::Config->IsCampaign)
294294
pSession->GameMode = GameMode::Campaign;
295-
else if (Game::PlayerCount > 1)
295+
else if (Game::PlayerCount > 1 || Spawner::Config->ForceMultiplayer)
296296
pSession->GameMode = GameMode::Internet; // HACK: will be set to LAN later
297297
else
298298
pSession->GameMode = GameMode::Skirmish;

src/version.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#define _STR_(x) #x
88

99
// Build number. Incremented on each released build
10-
#define BUILD_NUMBER 10
10+
#define BUILD_NUMBER 11
1111

1212
// Indicates project maturity and completeness
1313
#define VERSION_MAJOR 0
@@ -16,7 +16,7 @@
1616
// Indicates minor changes, like vanilla bugfixes, unhardcodings or hacks
1717
#define VERSION_REVISION 0
1818
// Indicates YRpp-Spawner-related bugfixes only
19-
#define VERSION_PATCH 10
19+
#define VERSION_PATCH 11
2020

2121
#if defined(IS_CNCNET_YR_VER) && defined(IS_HARDENED_VER)
2222
#define PRODUCT_TYPE "(CnCNet YR, hardened)"

0 commit comments

Comments
 (0)