mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
Merged Multi Player Project into main branch
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@2144 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=".\;..\;"..\Standard Gaming Platform";..\TileEngine;..\Tactical;..\Utils;..\TacticalAI;..\Editor;..\lua;..\Strategic;..\Res"
|
||||
AdditionalIncludeDirectories=".\;..\;..\Multiplayer;"..\Standard Gaming Platform";..\TileEngine;..\Tactical;..\Utils;..\TacticalAI;..\Editor;..\lua;..\Strategic;..\Res"
|
||||
PreprocessorDefinitions="PRECOMPILEDHEADERS;_DEBUG;WIN32;_WINDOWS;JA2;_VTUNE_PROFILING;XML_STATIC;CINTERFACE"
|
||||
MinimalRebuild="FALSE"
|
||||
BasicRuntimeChecks="0"
|
||||
@@ -72,7 +72,7 @@
|
||||
FavorSizeOrSpeed="1"
|
||||
OptimizeForProcessor="3"
|
||||
OptimizeForWindowsApplication="TRUE"
|
||||
AdditionalIncludeDirectories=".\;..\;"..\Standard Gaming Platform";..\TileEngine;..\Tactical;..\Utils;..\TacticalAI;..\Editor;..\Strategic;..\Console;..\Res"
|
||||
AdditionalIncludeDirectories="..\Multiplayer;.\;..\;"..\Standard Gaming Platform";..\TileEngine;..\Tactical;..\Utils;..\TacticalAI;..\Editor;..\Strategic;..\Console;..\Res"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="0"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8,00"
|
||||
Version="8.00"
|
||||
Name="Console_2005Express"
|
||||
ProjectGUID="{F962CFA1-2215-4124-938F-253973A27591}"
|
||||
RootNamespace="Console"
|
||||
@@ -50,7 +50,7 @@
|
||||
AdditionalOptions="/D "_CRT_SECURE_NO_DEPRECATE""
|
||||
Optimization="0"
|
||||
FavorSizeOrSpeed="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
AdditionalIncludeDirectories="..\Multiplayer"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
@@ -136,7 +136,7 @@
|
||||
AdditionalOptions="/D "_CRT_SECURE_NO_DEPRECATE""
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="c:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\src\mfc"
|
||||
AdditionalIncludeDirectories=""c:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\src\mfc";..\Multiplayer"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
|
||||
@@ -232,7 +232,7 @@
|
||||
FavorSizeOrSpeed="1"
|
||||
OptimizeForProcessor="3"
|
||||
OptimizeForWindowsApplication="TRUE"
|
||||
AdditionalIncludeDirectories=""..\Standard Gaming Platform";..\TileEngine;..\;..\Tactical;..\Utils;..\tacticalai;..\strategic;..\Laptop;.\"
|
||||
AdditionalIncludeDirectories="..\Multiplayer;"..\Standard Gaming Platform";..\TileEngine;..\;..\Tactical;..\Utils;..\tacticalai;..\strategic;..\Laptop;.\"
|
||||
PreprocessorDefinitions="PRECOMPILEDHEADERS;NDEBUG;WIN32;_WINDOWS;JA2;XML_STATIC;CINTERFACE"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="0"
|
||||
@@ -387,7 +387,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""..\Standard Gaming Platform";..\TileEngine;..\;..\Tactical;..\Utils;..\tacticalai;..\strategic;..\lua;..\Laptop;.\"
|
||||
AdditionalIncludeDirectories="..\Multiplayer;"..\Standard Gaming Platform";..\TileEngine;..\;..\Tactical;..\Utils;..\tacticalai;..\strategic;..\lua;..\Laptop;.\"
|
||||
PreprocessorDefinitions="PRECOMPILEDHEADERS;_DEBUG;WIN32;_WINDOWS;JA2;_VTUNE_PROFILING;XML_STATIC;CINTERFACE"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="2"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8,00"
|
||||
Version="8.00"
|
||||
Name="Editor_2005Express"
|
||||
ProjectGUID="{60D793F2-90B4-43C9-83B5-221EE11B37E6}"
|
||||
RootNamespace="Editor_2005Express"
|
||||
@@ -41,6 +41,7 @@
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/D "_CRT_SECURE_NO_DEPRECATE""
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\Multiplayer"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
@@ -104,6 +105,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/D "_CRT_SECURE_NO_DEPRECATE""
|
||||
AdditionalIncludeDirectories="..\Multiplayer"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;"
|
||||
RuntimeLibrary="0"
|
||||
RuntimeTypeInfo="false"
|
||||
|
||||
+120
-17
@@ -24,6 +24,10 @@
|
||||
#include "Soldier Profile.h"
|
||||
#endif
|
||||
|
||||
#include "gameloop.h"
|
||||
#include "connect.h"
|
||||
#include "saveloadscreen.h"
|
||||
|
||||
////////////////////////////////////////////
|
||||
//
|
||||
// Global Defines
|
||||
@@ -65,11 +69,11 @@
|
||||
#define GIO_GUN_SETTINGS_Y iScreenHeightOffset + 242
|
||||
#define GIO_GUN_SETTINGS_WIDTH GIO_DIF_SETTINGS_WIDTH
|
||||
|
||||
/*
|
||||
#define GIO_TIMED_TURN_SETTING_X GIO_DIF_SETTINGS_X
|
||||
#define GIO_TIMED_TURN_SETTING_Y GIO_GAME_SETTINGS_Y
|
||||
|
||||
#define GIO_TIMED_TURN_SETTING_X GIO_GUN_SETTINGS_X
|
||||
#define GIO_TIMED_TURN_SETTING_Y GIO_IRON_MAN_SETTING_Y//hayden
|
||||
#define GIO_TIMED_TURN_SETTING_WIDTH GIO_DIF_SETTINGS_WIDTH
|
||||
*/
|
||||
|
||||
|
||||
// Madd
|
||||
#define GIO_BR_SETTING_X iScreenWidthOffset + 340
|
||||
@@ -136,7 +140,7 @@ enum
|
||||
|
||||
// JA2Gold: no more timed turns setting
|
||||
|
||||
/*
|
||||
|
||||
//enum for the timed turns setting
|
||||
enum
|
||||
{
|
||||
@@ -144,8 +148,8 @@ enum
|
||||
GIO_TIMED_TURNS,
|
||||
|
||||
GIO_NUM_TIMED_TURN_OPTIONS,
|
||||
};
|
||||
*/
|
||||
};//hayden : re-enabled
|
||||
|
||||
|
||||
// Iron man mode
|
||||
|
||||
@@ -163,7 +167,8 @@ enum
|
||||
GIO_NOTHING,
|
||||
GIO_CANCEL,
|
||||
GIO_EXIT,
|
||||
GIO_IRON_MAN_MODE
|
||||
GIO_IRON_MAN_MODE,
|
||||
MP_LOAD
|
||||
};
|
||||
|
||||
////////////////////////////////////////////
|
||||
@@ -209,6 +214,11 @@ void BtnGIOCancelCallback(GUI_BUTTON *btn,INT32 reason);
|
||||
UINT32 guiGIOCancelButton;
|
||||
INT32 giGIOCancelBtnImage;
|
||||
|
||||
// MP LOAD Button
|
||||
void MPBtnGIOCancelCallback(GUI_BUTTON *btn,INT32 reason);
|
||||
UINT32 MPguiGIOCancelButton;
|
||||
INT32 MPgiGIOCancelBtnImage;
|
||||
|
||||
|
||||
//checkbox to toggle the Diff level
|
||||
UINT32 guiDifficultySettingsToggles[ NUM_DIFF_SETTINGS ];
|
||||
@@ -223,11 +233,11 @@ UINT32 guiGunOptionToggles[ NUM_GUN_OPTIONS ];
|
||||
void BtnGunOptionsTogglesCallback(GUI_BUTTON *btn,INT32 reason);
|
||||
|
||||
// JA2Gold: no more timed turns setting
|
||||
/*
|
||||
//hayden : re-enabled
|
||||
//checkbox to toggle Timed turn option on or off
|
||||
UINT32 guiTimedTurnToggles[ GIO_NUM_TIMED_TURN_OPTIONS ];
|
||||
void BtnTimedTurnsTogglesCallback(GUI_BUTTON *btn,INT32 reason);
|
||||
*/
|
||||
|
||||
|
||||
//checkbox to toggle Save style
|
||||
UINT32 guiGameSaveToggles[ NUM_SAVE_OPTIONS ];
|
||||
@@ -260,7 +270,7 @@ void RestoreGIOButtonBackGrounds();
|
||||
void DoneFadeOutForExitGameInitOptionScreen( void );
|
||||
void DoneFadeInForExitGameInitOptionScreen( void );
|
||||
// JA2Gold: no more timed turns setting
|
||||
//UINT8 GetCurrentTimedTurnsButtonSetting();
|
||||
UINT8 GetCurrentTimedTurnsButtonSetting();//hayden : re-enabled
|
||||
BOOLEAN DoGioMessageBox( UINT8 ubStyle, const STR16 zString, UINT32 uiExitScreen, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback );
|
||||
void DisplayMessageToUserAboutGameDifficulty();
|
||||
void ConfirmGioDifSettingMessageBoxCallBack( UINT8 bExitValue );
|
||||
@@ -392,7 +402,19 @@ BOOLEAN EnterGIOScreen()
|
||||
DEFAULT_MOVE_CALLBACK, BtnGIOCancelCallback );
|
||||
SpecifyButtonSoundScheme( guiGIOCancelButton, BUTTON_SOUND_SCHEME_BIGSWITCH3 );
|
||||
|
||||
//MP button
|
||||
if(is_networked)
|
||||
{
|
||||
MPgiGIOCancelBtnImage = UseLoadedButtonImage( giGIODoneBtnImage, -1,1,-1,3,-1 );
|
||||
MPguiGIOCancelButton = CreateIconAndTextButton( giGIOCancelBtnImage, gzGIOScreenText[30], OPT_BUTTON_FONT,
|
||||
OPT_BUTTON_ON_COLOR, DEFAULT_SHADOW,
|
||||
OPT_BUTTON_OFF_COLOR, DEFAULT_SHADOW,
|
||||
TEXT_CJUSTIFIED,
|
||||
GIO_CANCEL_X-180, GIO_BTN_OK_Y, BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
|
||||
DEFAULT_MOVE_CALLBACK, MPBtnGIOCancelCallback );
|
||||
SpecifyButtonSoundScheme( guiGIOCancelButton, BUTTON_SOUND_SCHEME_BIGSWITCH3 );
|
||||
|
||||
}
|
||||
//
|
||||
//Check box to toggle Difficulty settings
|
||||
//
|
||||
@@ -581,9 +603,16 @@ BOOLEAN ExitGIOScreen()
|
||||
//Delete the main options screen background
|
||||
DeleteVideoObjectFromIndex( guiGIOMainBackGroundImage );
|
||||
|
||||
if(is_networked)
|
||||
{
|
||||
RemoveButton( MPguiGIOCancelButton );
|
||||
UnloadButtonImage( MPgiGIOCancelBtnImage );
|
||||
}
|
||||
|
||||
RemoveButton( guiGIOCancelButton );
|
||||
RemoveButton( guiGIODoneButton );
|
||||
|
||||
|
||||
UnloadButtonImage( giGIOCancelBtnImage );
|
||||
UnloadButtonImage( giGIODoneBtnImage );
|
||||
|
||||
@@ -644,6 +673,27 @@ void HandleGIOScreen()
|
||||
gubGIOExitScreen = MAINMENU_SCREEN;
|
||||
gfGIOScreenExit = TRUE;
|
||||
break;
|
||||
|
||||
case MP_LOAD:
|
||||
gubGIOExitScreen = SAVE_LOAD_SCREEN;
|
||||
gfSaveGame = FALSE;
|
||||
//gfCameDirectlyFromGame = TRUE;
|
||||
gfGIOScreenExit = TRUE;
|
||||
guiPreviousOptionScreen = GAME_INIT_OPTIONS_SCREEN;
|
||||
|
||||
//guiPreviousOptionScreen = guiCurrentScreen;
|
||||
//guiMainMenuExitScreen = SAVE_LOAD_SCREEN;
|
||||
//gbHandledMainMenu = 0;
|
||||
//gfSaveGame = FALSE;
|
||||
//gfMainMenuScreenExit = TRUE;
|
||||
//guiPreviousOptionScreen = guiCurrentScreen;
|
||||
//guiMainMenuExitScreen = SAVE_LOAD_SCREEN;
|
||||
//gbHandledMainMenu = 0;
|
||||
//gfSaveGame = FALSE;
|
||||
//gfMainMenuScreenExit = TRUE;
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case GIO_EXIT:
|
||||
{
|
||||
@@ -1073,8 +1123,8 @@ void BtnGunOptionsTogglesCallback( GUI_BUTTON *btn, INT32 reason )
|
||||
}
|
||||
|
||||
// JA2Gold: no more timed turns setting
|
||||
/*
|
||||
void BtnTimedTurnsTogglesCallback( GUI_BUTTON *btn, INT32 reason )
|
||||
|
||||
void BtnTimedTurnsTogglesCallback( GUI_BUTTON *btn, INT32 reason )//hayden : re-enabled
|
||||
{
|
||||
if( reason & MSYS_CALLBACK_REASON_LBUTTON_UP )
|
||||
{
|
||||
@@ -1111,7 +1161,7 @@ void BtnTimedTurnsTogglesCallback( GUI_BUTTON *btn, INT32 reason )
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1127,12 +1177,19 @@ void BtnGIODoneCallback(GUI_BUTTON *btn,INT32 reason)
|
||||
{
|
||||
btn->uiFlags &= (~BUTTON_CLICKED_ON );
|
||||
|
||||
if(!is_networked)
|
||||
{
|
||||
//if the user doesnt have IRON MAN mode selected
|
||||
if( !DisplayMessageToUserAboutIronManMode() )
|
||||
{
|
||||
//Confirm the difficulty setting
|
||||
DisplayMessageToUserAboutGameDifficulty();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gubGameOptionScreenHandler = GIO_EXIT;
|
||||
}
|
||||
|
||||
|
||||
InvalidateRegion(btn->Area.RegionTopLeftX, btn->Area.RegionTopLeftY, btn->Area.RegionBottomRightX, btn->Area.RegionBottomRightY);
|
||||
@@ -1158,6 +1215,46 @@ void BtnGIOCancelCallback(GUI_BUTTON *btn,INT32 reason)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void MPBtnGIOCancelCallback(GUI_BUTTON *btn,INT32 reason)
|
||||
{
|
||||
if(reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
|
||||
{
|
||||
btn->uiFlags |= BUTTON_CLICKED_ON;
|
||||
InvalidateRegion(btn->Area.RegionTopLeftX, btn->Area.RegionTopLeftY, btn->Area.RegionBottomRightX, btn->Area.RegionBottomRightY);
|
||||
}
|
||||
if(reason & MSYS_CALLBACK_REASON_LBUTTON_UP )
|
||||
{
|
||||
btn->uiFlags &= (~BUTTON_CLICKED_ON );
|
||||
|
||||
//gubGameOptionScreenHandler = GIO_CANCEL;
|
||||
|
||||
//// Select the game which is to be restored
|
||||
//guiPreviousOptionScreen = guiCurrentScreen;
|
||||
//guiMainMenuExitScreen = SAVE_LOAD_SCREEN;
|
||||
//gbHandledMainMenu = 0;
|
||||
//gfSaveGame = FALSE;
|
||||
//gfMainMenuScreenExit = TRUE;
|
||||
|
||||
/* guiPreviousOptionScreen = guiCurrentScreen;
|
||||
SetPendingNewScreen( SAVE_LOAD_SCREEN );
|
||||
gubGameOptionScreenHandler = GIO_EXIT;
|
||||
|
||||
gubGIOExitScreen = MAINMENU_SCREEN;
|
||||
gfGIOScreenExit = TRUE;
|
||||
fInterfacePanelDirty = DIRTYLEVEL2;*/
|
||||
|
||||
gubGameOptionScreenHandler = MP_LOAD;
|
||||
|
||||
|
||||
|
||||
InvalidateRegion(btn->Area.RegionTopLeftX, btn->Area.RegionTopLeftY, btn->Area.RegionBottomRightX, btn->Area.RegionBottomRightY);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
UINT8 GetCurrentDifficultyButtonSetting()
|
||||
{
|
||||
UINT8 cnt;
|
||||
@@ -1236,7 +1333,7 @@ UINT8 GetCurrentGunButtonSetting()
|
||||
}
|
||||
|
||||
// JA2 Gold: no timed turns
|
||||
/*
|
||||
|
||||
UINT8 GetCurrentTimedTurnsButtonSetting()
|
||||
{
|
||||
UINT8 cnt;
|
||||
@@ -1250,7 +1347,7 @@ UINT8 GetCurrentTimedTurnsButtonSetting()
|
||||
}
|
||||
return( 0 );
|
||||
}
|
||||
*/
|
||||
//hayden : re-enabled
|
||||
|
||||
UINT8 GetCurrentGameSaveButtonSetting()
|
||||
{
|
||||
@@ -1348,7 +1445,13 @@ void DoneFadeOutForExitGameInitOptionScreen( void )
|
||||
gGameOptions.ubGameStyle = GetCurrentGameStyleButtonSetting();
|
||||
gGameOptions.ubDifficultyLevel = GetCurrentDifficultyButtonSetting() + 1;
|
||||
// JA2Gold: no more timed turns setting
|
||||
//gGameOptions.fTurnTimeLimit = GetCurrentTimedTurnsButtonSetting();
|
||||
//gGameOptions.fTurnTimeLimit = GetCurrentTimedTurnsButtonSetting();//hayden : re-enabled
|
||||
|
||||
if (is_networked)
|
||||
gGameOptions.fTurnTimeLimit = TRUE;
|
||||
else
|
||||
gGameOptions.fTurnTimeLimit = FALSE;
|
||||
|
||||
// JA2Gold: iron man
|
||||
gGameOptions.fIronManMode = GetCurrentGameSaveButtonSetting();
|
||||
|
||||
|
||||
+35
-10
@@ -35,7 +35,8 @@
|
||||
#include "Game Clock.h"
|
||||
#endif
|
||||
|
||||
#include "Text.h"
|
||||
#include "Text.h"
|
||||
#include "connect.h"
|
||||
|
||||
#define GAME_SETTINGS_FILE "Ja2.set"
|
||||
|
||||
@@ -55,6 +56,7 @@ extern CHAR8 gzErrorMsg[256];
|
||||
|
||||
void InitGameSettings();
|
||||
|
||||
|
||||
BOOLEAN GetCdromLocationFromIniFile( STR pRootOfCdromDrive );
|
||||
|
||||
extern BOOLEAN DoJA2FilesExistsOnDrive( CHAR8 *zCdLocation );
|
||||
@@ -94,6 +96,7 @@ BOOLEAN IsNIVModeValid(bool checkRes)
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
|
||||
BOOLEAN LoadGameSettings()
|
||||
{
|
||||
HWFILE hFile;
|
||||
@@ -316,17 +319,31 @@ void InitGameOptions()
|
||||
memset( &gGameOptions, 0, sizeof( GAME_OPTIONS ) );
|
||||
|
||||
//Init the game options
|
||||
gGameOptions.ubBobbyRay = BR_GOOD;
|
||||
|
||||
if (is_networked)
|
||||
gGameOptions.ubBobbyRay = BR_AWESOME;// hayden, was BR_GOOD;
|
||||
else
|
||||
gGameOptions.ubBobbyRay = BR_GOOD;
|
||||
|
||||
gGameOptions.fGunNut = TRUE;
|
||||
gGameOptions.fAirStrikes = FALSE;
|
||||
gGameOptions.ubGameStyle = STYLE_SCIFI;
|
||||
|
||||
if (is_networked)
|
||||
gGameOptions.ubGameStyle = STYLE_REALISTIC;//hayden, was STYLE_SCIFI;
|
||||
else
|
||||
gGameOptions.ubGameStyle = STYLE_SCIFI;
|
||||
|
||||
gGameOptions.ubDifficultyLevel = DIF_LEVEL_MEDIUM;
|
||||
//CHRISL: override default inventory mode when in low res
|
||||
if(IsNIVModeValid() == FALSE)
|
||||
gGameOptions.ubInventorySystem = INVENTORY_OLD;
|
||||
else
|
||||
gGameOptions.ubInventorySystem = INVENTORY_NEW;
|
||||
//gGameOptions.fTurnTimeLimit = FALSE;
|
||||
|
||||
if (is_networked)
|
||||
gGameOptions.fTurnTimeLimit = TRUE;//hayden
|
||||
else
|
||||
gGameOptions.fTurnTimeLimit = FALSE;
|
||||
|
||||
gGameOptions.fIronManMode = FALSE;
|
||||
}
|
||||
@@ -545,6 +562,7 @@ void LoadGameExternalOptions()
|
||||
gGameExternalOptions.iStartingCashExpert = iniReader.ReadInteger("JA2 Gameplay Settings", "EXPERT_CASH",30000);
|
||||
gGameExternalOptions.iStartingCashInsane = iniReader.ReadInteger("JA2 Gameplay Settings", "INSANE_CASH",15000);
|
||||
|
||||
|
||||
//Lalien: Game starting time
|
||||
gGameExternalOptions.iGameStartingTime = iniReader.ReadInteger("JA2 Gameplay Settings", "GAME_STARTING_TIME", NUM_SEC_IN_HOUR);
|
||||
|
||||
@@ -558,7 +576,7 @@ void LoadGameExternalOptions()
|
||||
{
|
||||
gGameExternalOptions.iGameStartingTime += NUM_SEC_IN_DAY;
|
||||
}
|
||||
|
||||
|
||||
gGameExternalOptions.iFirstArrivalDelay = iniReader.ReadInteger("JA2 Gameplay Settings", "FIRST_ARRIVAL_DELAY", 6 * NUM_SEC_IN_HOUR);
|
||||
|
||||
//################# Settings valid on game start only end ##################
|
||||
@@ -753,6 +771,10 @@ void LoadGameExternalOptions()
|
||||
|
||||
// CHRISL: Setting to turn off the description and stack popup options from the sector inventory panel
|
||||
gGameExternalOptions.fSectorDesc = iniReader.ReadBoolean("JA2 Gameplay Settings","ALLOW_SECTOR_DESCRIPTION_WINDOW",TRUE);
|
||||
|
||||
|
||||
//afp - use bullet tracers?
|
||||
gGameExternalOptions.gbBulletTracer = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1087,14 +1109,17 @@ void DisplayGameSettings( )
|
||||
//Sci fi option
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"%s: %s", gzGIOScreenText[ GIO_GAME_STYLE_TEXT ], gzGIOScreenText[ GIO_REALISTIC_TEXT + gGameOptions.ubGameStyle ] );
|
||||
|
||||
//Timed Turns option
|
||||
// JA2Gold: no timed turns
|
||||
////Timed Turns option
|
||||
//// JA2Gold: no timed turns
|
||||
//ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"%s: %s", gzGIOScreenText[ GIO_TIMED_TURN_TITLE_TEXT ], gzGIOScreenText[ GIO_NO_TIMED_TURNS_TEXT + gGameOptions.fTurnTimeLimit ] );
|
||||
|
||||
//if( CHEATER_CHEAT_LEVEL() )
|
||||
{
|
||||
if (!is_networked)
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, gzLateLocalizedString[58], CurrentPlayerProgressPercentage(), HighestPlayerProgressPercentage() );
|
||||
}
|
||||
|
||||
////if( CHEATER_CHEAT_LEVEL() )
|
||||
//{
|
||||
// ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, gzLateLocalizedString[58], CurrentPlayerProgressPercentage(), HighestPlayerProgressPercentage() );
|
||||
//}
|
||||
}
|
||||
|
||||
BOOLEAN MeanwhileSceneSeen( UINT8 ubMeanwhile )
|
||||
|
||||
+4
-1
@@ -438,6 +438,9 @@ typedef struct
|
||||
// Lesh: slow enemy items choice progress
|
||||
BOOLEAN fSlowProgressForEnemyItemsChoice;
|
||||
|
||||
//afp - use bullet tracers
|
||||
BOOLEAN gbBulletTracer;
|
||||
|
||||
// CHRISL: option to allow Slay to remain as a hired PC
|
||||
BOOLEAN fEnableSlayForever;
|
||||
|
||||
@@ -446,7 +449,6 @@ typedef struct
|
||||
|
||||
// CHRISL: New setting to determine AP multiplier when reloading with wrong sized clip
|
||||
FLOAT ubWrongMagMult;
|
||||
|
||||
// CHRISL: Setting to turn off the description and stack popup options from the sector inventory panel
|
||||
BOOLEAN fSectorDesc;
|
||||
} GAME_EXTERNAL_OPTIONS;
|
||||
@@ -468,6 +470,7 @@ void FreeGameExternalOptions();
|
||||
|
||||
void InitGameOptions();
|
||||
|
||||
void InitGameSettings();
|
||||
|
||||
BOOLEAN GetCDLocation( );
|
||||
|
||||
|
||||
+4
-4
@@ -13,12 +13,12 @@
|
||||
#ifdef JA2EDITOR
|
||||
|
||||
//MAP EDITOR BUILD VERSION
|
||||
CHAR16 zVersionLabel[256] = { L"Map Editor v1.13.2112" };
|
||||
CHAR16 zVersionLabel[256] = { L"Map Editor v1.13.2118" };
|
||||
|
||||
#elif defined JA2BETAVERSION
|
||||
|
||||
//BETA/TEST BUILD VERSION
|
||||
CHAR16 zVersionLabel[256] = { L"Debug v1.13.2112" };
|
||||
CHAR16 zVersionLabel[256] = { L"Debug v1.13.2118" };
|
||||
|
||||
#elif defined CRIPPLED_VERSION
|
||||
|
||||
@@ -28,11 +28,11 @@ CHAR16 zVersionLabel[256] = { L"Beta v. 0.98" };
|
||||
#else
|
||||
|
||||
//RELEASE BUILD VERSION
|
||||
CHAR16 zVersionLabel[256] = { L"Release v1.13.2112" };
|
||||
CHAR16 zVersionLabel[256] = { L"Release v1.13.2118" };
|
||||
|
||||
#endif
|
||||
|
||||
CHAR8 czVersionNumber[16] = { "Build 08.05.07" }; //YY.MM.DD
|
||||
CHAR8 czVersionNumber[16] = { "Build 08.05.08" }; //YY.MM.DD
|
||||
CHAR16 zTrackingNumber[16] = { L"Z" };
|
||||
|
||||
|
||||
|
||||
@@ -55,192 +55,54 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Console", "Console\Console.
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfiguration) = preSolution
|
||||
Bounds Checker = Bounds Checker
|
||||
Debug = Debug
|
||||
Debug Demo = Debug Demo
|
||||
Demo Bounds Checker = Demo Bounds Checker
|
||||
Demo Release with Debug Info = Demo Release with Debug Info
|
||||
Release = Release
|
||||
Release Demo = Release Demo
|
||||
Release with Debug Info = Release with Debug Info
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfiguration) = postSolution
|
||||
{33CD085A-A03E-4D2C-970A-D69CD5466806}.Bounds Checker.ActiveCfg = Bounds Checker|Win32
|
||||
{33CD085A-A03E-4D2C-970A-D69CD5466806}.Bounds Checker.Build.0 = Bounds Checker|Win32
|
||||
{33CD085A-A03E-4D2C-970A-D69CD5466806}.Debug.ActiveCfg = Debug|Win32
|
||||
{33CD085A-A03E-4D2C-970A-D69CD5466806}.Debug.Build.0 = Debug|Win32
|
||||
{33CD085A-A03E-4D2C-970A-D69CD5466806}.Debug Demo.ActiveCfg = Debug Demo|Win32
|
||||
{33CD085A-A03E-4D2C-970A-D69CD5466806}.Debug Demo.Build.0 = Debug Demo|Win32
|
||||
{33CD085A-A03E-4D2C-970A-D69CD5466806}.Demo Bounds Checker.ActiveCfg = Demo Bounds Checker|Win32
|
||||
{33CD085A-A03E-4D2C-970A-D69CD5466806}.Demo Bounds Checker.Build.0 = Demo Bounds Checker|Win32
|
||||
{33CD085A-A03E-4D2C-970A-D69CD5466806}.Demo Release with Debug Info.ActiveCfg = Demo Release with Debug Info|Win32
|
||||
{33CD085A-A03E-4D2C-970A-D69CD5466806}.Demo Release with Debug Info.Build.0 = Demo Release with Debug Info|Win32
|
||||
{33CD085A-A03E-4D2C-970A-D69CD5466806}.Release.ActiveCfg = Release|Win32
|
||||
{33CD085A-A03E-4D2C-970A-D69CD5466806}.Release.Build.0 = Release|Win32
|
||||
{33CD085A-A03E-4D2C-970A-D69CD5466806}.Release Demo.ActiveCfg = Release Demo|Win32
|
||||
{33CD085A-A03E-4D2C-970A-D69CD5466806}.Release Demo.Build.0 = Release Demo|Win32
|
||||
{33CD085A-A03E-4D2C-970A-D69CD5466806}.Release with Debug Info.ActiveCfg = Release with Debug Info|Win32
|
||||
{33CD085A-A03E-4D2C-970A-D69CD5466806}.Release with Debug Info.Build.0 = Release with Debug Info|Win32
|
||||
{E0E16C88-C352-4C37-AC27-BFF3FDF18E82}.Bounds Checker.ActiveCfg = Bounds Checker|Win32
|
||||
{E0E16C88-C352-4C37-AC27-BFF3FDF18E82}.Bounds Checker.Build.0 = Bounds Checker|Win32
|
||||
{E0E16C88-C352-4C37-AC27-BFF3FDF18E82}.Debug.ActiveCfg = Debug|Win32
|
||||
{E0E16C88-C352-4C37-AC27-BFF3FDF18E82}.Debug.Build.0 = Debug|Win32
|
||||
{E0E16C88-C352-4C37-AC27-BFF3FDF18E82}.Debug Demo.ActiveCfg = Debug Demo|Win32
|
||||
{E0E16C88-C352-4C37-AC27-BFF3FDF18E82}.Debug Demo.Build.0 = Debug Demo|Win32
|
||||
{E0E16C88-C352-4C37-AC27-BFF3FDF18E82}.Demo Bounds Checker.ActiveCfg = Demo Bounds Checker|Win32
|
||||
{E0E16C88-C352-4C37-AC27-BFF3FDF18E82}.Demo Bounds Checker.Build.0 = Demo Bounds Checker|Win32
|
||||
{E0E16C88-C352-4C37-AC27-BFF3FDF18E82}.Demo Release with Debug Info.ActiveCfg = Demo Release with Debug Info|Win32
|
||||
{E0E16C88-C352-4C37-AC27-BFF3FDF18E82}.Demo Release with Debug Info.Build.0 = Demo Release with Debug Info|Win32
|
||||
{E0E16C88-C352-4C37-AC27-BFF3FDF18E82}.Release.ActiveCfg = Release|Win32
|
||||
{E0E16C88-C352-4C37-AC27-BFF3FDF18E82}.Release.Build.0 = Release|Win32
|
||||
{E0E16C88-C352-4C37-AC27-BFF3FDF18E82}.Release Demo.ActiveCfg = Release Demo|Win32
|
||||
{E0E16C88-C352-4C37-AC27-BFF3FDF18E82}.Release Demo.Build.0 = Release Demo|Win32
|
||||
{E0E16C88-C352-4C37-AC27-BFF3FDF18E82}.Release with Debug Info.ActiveCfg = Release with Debug Info|Win32
|
||||
{E0E16C88-C352-4C37-AC27-BFF3FDF18E82}.Release with Debug Info.Build.0 = Release with Debug Info|Win32
|
||||
{1D052886-AE6B-437A-BE0C-D074CA940818}.Bounds Checker.ActiveCfg = Bounds Checker|Win32
|
||||
{1D052886-AE6B-437A-BE0C-D074CA940818}.Bounds Checker.Build.0 = Bounds Checker|Win32
|
||||
{1D052886-AE6B-437A-BE0C-D074CA940818}.Debug.ActiveCfg = Debug|Win32
|
||||
{1D052886-AE6B-437A-BE0C-D074CA940818}.Debug.Build.0 = Debug|Win32
|
||||
{1D052886-AE6B-437A-BE0C-D074CA940818}.Debug Demo.ActiveCfg = Debug Demo|Win32
|
||||
{1D052886-AE6B-437A-BE0C-D074CA940818}.Debug Demo.Build.0 = Debug Demo|Win32
|
||||
{1D052886-AE6B-437A-BE0C-D074CA940818}.Demo Bounds Checker.ActiveCfg = Bounds Checker|Win32
|
||||
{1D052886-AE6B-437A-BE0C-D074CA940818}.Demo Bounds Checker.Build.0 = Bounds Checker|Win32
|
||||
{1D052886-AE6B-437A-BE0C-D074CA940818}.Demo Release with Debug Info.ActiveCfg = Demo Release with Debug Info|Win32
|
||||
{1D052886-AE6B-437A-BE0C-D074CA940818}.Demo Release with Debug Info.Build.0 = Demo Release with Debug Info|Win32
|
||||
{1D052886-AE6B-437A-BE0C-D074CA940818}.Release.ActiveCfg = Release|Win32
|
||||
{1D052886-AE6B-437A-BE0C-D074CA940818}.Release.Build.0 = Release|Win32
|
||||
{1D052886-AE6B-437A-BE0C-D074CA940818}.Release Demo.ActiveCfg = Release Demo|Win32
|
||||
{1D052886-AE6B-437A-BE0C-D074CA940818}.Release Demo.Build.0 = Release Demo|Win32
|
||||
{1D052886-AE6B-437A-BE0C-D074CA940818}.Release with Debug Info.ActiveCfg = Release with Debug Info|Win32
|
||||
{1D052886-AE6B-437A-BE0C-D074CA940818}.Release with Debug Info.Build.0 = Release with Debug Info|Win32
|
||||
{F10032C4-A6E5-44F7-A9BC-B76C46BA72D5}.Bounds Checker.ActiveCfg = Bounds Checker|Win32
|
||||
{F10032C4-A6E5-44F7-A9BC-B76C46BA72D5}.Bounds Checker.Build.0 = Bounds Checker|Win32
|
||||
{F10032C4-A6E5-44F7-A9BC-B76C46BA72D5}.Debug.ActiveCfg = Debug|Win32
|
||||
{F10032C4-A6E5-44F7-A9BC-B76C46BA72D5}.Debug.Build.0 = Debug|Win32
|
||||
{F10032C4-A6E5-44F7-A9BC-B76C46BA72D5}.Debug Demo.ActiveCfg = Debug Demo|Win32
|
||||
{F10032C4-A6E5-44F7-A9BC-B76C46BA72D5}.Debug Demo.Build.0 = Debug Demo|Win32
|
||||
{F10032C4-A6E5-44F7-A9BC-B76C46BA72D5}.Demo Bounds Checker.ActiveCfg = Demo Bounds Checker|Win32
|
||||
{F10032C4-A6E5-44F7-A9BC-B76C46BA72D5}.Demo Bounds Checker.Build.0 = Demo Bounds Checker|Win32
|
||||
{F10032C4-A6E5-44F7-A9BC-B76C46BA72D5}.Demo Release with Debug Info.ActiveCfg = Demo Release with Debug Info|Win32
|
||||
{F10032C4-A6E5-44F7-A9BC-B76C46BA72D5}.Demo Release with Debug Info.Build.0 = Demo Release with Debug Info|Win32
|
||||
{F10032C4-A6E5-44F7-A9BC-B76C46BA72D5}.Release.ActiveCfg = Release|Win32
|
||||
{F10032C4-A6E5-44F7-A9BC-B76C46BA72D5}.Release.Build.0 = Release|Win32
|
||||
{F10032C4-A6E5-44F7-A9BC-B76C46BA72D5}.Release Demo.ActiveCfg = Release Demo|Win32
|
||||
{F10032C4-A6E5-44F7-A9BC-B76C46BA72D5}.Release Demo.Build.0 = Release Demo|Win32
|
||||
{F10032C4-A6E5-44F7-A9BC-B76C46BA72D5}.Release with Debug Info.ActiveCfg = Release with Debug Info|Win32
|
||||
{F10032C4-A6E5-44F7-A9BC-B76C46BA72D5}.Release with Debug Info.Build.0 = Release with Debug Info|Win32
|
||||
{2124B612-013E-492D-911C-B5737D60EEDF}.Bounds Checker.ActiveCfg = Bounds Checker|Win32
|
||||
{2124B612-013E-492D-911C-B5737D60EEDF}.Bounds Checker.Build.0 = Bounds Checker|Win32
|
||||
{2124B612-013E-492D-911C-B5737D60EEDF}.Debug.ActiveCfg = Debug|Win32
|
||||
{2124B612-013E-492D-911C-B5737D60EEDF}.Debug.Build.0 = Debug|Win32
|
||||
{2124B612-013E-492D-911C-B5737D60EEDF}.Debug Demo.ActiveCfg = Debug Demo|Win32
|
||||
{2124B612-013E-492D-911C-B5737D60EEDF}.Debug Demo.Build.0 = Debug Demo|Win32
|
||||
{2124B612-013E-492D-911C-B5737D60EEDF}.Demo Bounds Checker.ActiveCfg = Demo Bounds Checker|Win32
|
||||
{2124B612-013E-492D-911C-B5737D60EEDF}.Demo Bounds Checker.Build.0 = Demo Bounds Checker|Win32
|
||||
{2124B612-013E-492D-911C-B5737D60EEDF}.Demo Release with Debug Info.ActiveCfg = Demo Release with Debug Info|Win32
|
||||
{2124B612-013E-492D-911C-B5737D60EEDF}.Demo Release with Debug Info.Build.0 = Demo Release with Debug Info|Win32
|
||||
{2124B612-013E-492D-911C-B5737D60EEDF}.Release.ActiveCfg = Release|Win32
|
||||
{2124B612-013E-492D-911C-B5737D60EEDF}.Release.Build.0 = Release|Win32
|
||||
{2124B612-013E-492D-911C-B5737D60EEDF}.Release Demo.ActiveCfg = Release Demo|Win32
|
||||
{2124B612-013E-492D-911C-B5737D60EEDF}.Release Demo.Build.0 = Release Demo|Win32
|
||||
{2124B612-013E-492D-911C-B5737D60EEDF}.Release with Debug Info.ActiveCfg = Release with Debug Info|Win32
|
||||
{2124B612-013E-492D-911C-B5737D60EEDF}.Release with Debug Info.Build.0 = Release with Debug Info|Win32
|
||||
{D76119D7-B5EB-4F61-BFB9-F582B06F889B}.Bounds Checker.ActiveCfg = Bounds Checker|Win32
|
||||
{D76119D7-B5EB-4F61-BFB9-F582B06F889B}.Bounds Checker.Build.0 = Bounds Checker|Win32
|
||||
{D76119D7-B5EB-4F61-BFB9-F582B06F889B}.Debug.ActiveCfg = Debug|Win32
|
||||
{D76119D7-B5EB-4F61-BFB9-F582B06F889B}.Debug.Build.0 = Debug|Win32
|
||||
{D76119D7-B5EB-4F61-BFB9-F582B06F889B}.Debug Demo.ActiveCfg = Debug Demo|Win32
|
||||
{D76119D7-B5EB-4F61-BFB9-F582B06F889B}.Debug Demo.Build.0 = Debug Demo|Win32
|
||||
{D76119D7-B5EB-4F61-BFB9-F582B06F889B}.Demo Bounds Checker.ActiveCfg = Demo Bounds Checker|Win32
|
||||
{D76119D7-B5EB-4F61-BFB9-F582B06F889B}.Demo Bounds Checker.Build.0 = Demo Bounds Checker|Win32
|
||||
{D76119D7-B5EB-4F61-BFB9-F582B06F889B}.Demo Release with Debug Info.ActiveCfg = Demo Release with Debug Info|Win32
|
||||
{D76119D7-B5EB-4F61-BFB9-F582B06F889B}.Demo Release with Debug Info.Build.0 = Demo Release with Debug Info|Win32
|
||||
{D76119D7-B5EB-4F61-BFB9-F582B06F889B}.Release.ActiveCfg = Release|Win32
|
||||
{D76119D7-B5EB-4F61-BFB9-F582B06F889B}.Release.Build.0 = Release|Win32
|
||||
{D76119D7-B5EB-4F61-BFB9-F582B06F889B}.Release Demo.ActiveCfg = Release Demo|Win32
|
||||
{D76119D7-B5EB-4F61-BFB9-F582B06F889B}.Release Demo.Build.0 = Release Demo|Win32
|
||||
{D76119D7-B5EB-4F61-BFB9-F582B06F889B}.Release with Debug Info.ActiveCfg = Release with Debug Info|Win32
|
||||
{D76119D7-B5EB-4F61-BFB9-F582B06F889B}.Release with Debug Info.Build.0 = Release with Debug Info|Win32
|
||||
{97E691B8-7A39-4E86-B69A-BD6BD5C31F32}.Bounds Checker.ActiveCfg = Bounds Checker|Win32
|
||||
{97E691B8-7A39-4E86-B69A-BD6BD5C31F32}.Bounds Checker.Build.0 = Bounds Checker|Win32
|
||||
{97E691B8-7A39-4E86-B69A-BD6BD5C31F32}.Debug.ActiveCfg = Debug|Win32
|
||||
{97E691B8-7A39-4E86-B69A-BD6BD5C31F32}.Debug.Build.0 = Debug|Win32
|
||||
{97E691B8-7A39-4E86-B69A-BD6BD5C31F32}.Debug Demo.ActiveCfg = Debug Demo|Win32
|
||||
{97E691B8-7A39-4E86-B69A-BD6BD5C31F32}.Debug Demo.Build.0 = Debug Demo|Win32
|
||||
{97E691B8-7A39-4E86-B69A-BD6BD5C31F32}.Demo Bounds Checker.ActiveCfg = Demo Bounds Checker|Win32
|
||||
{97E691B8-7A39-4E86-B69A-BD6BD5C31F32}.Demo Bounds Checker.Build.0 = Demo Bounds Checker|Win32
|
||||
{97E691B8-7A39-4E86-B69A-BD6BD5C31F32}.Demo Release with Debug Info.ActiveCfg = Demo Release with Debug Info|Win32
|
||||
{97E691B8-7A39-4E86-B69A-BD6BD5C31F32}.Demo Release with Debug Info.Build.0 = Demo Release with Debug Info|Win32
|
||||
{97E691B8-7A39-4E86-B69A-BD6BD5C31F32}.Release.ActiveCfg = Release|Win32
|
||||
{97E691B8-7A39-4E86-B69A-BD6BD5C31F32}.Release.Build.0 = Release|Win32
|
||||
{97E691B8-7A39-4E86-B69A-BD6BD5C31F32}.Release Demo.ActiveCfg = Release Demo|Win32
|
||||
{97E691B8-7A39-4E86-B69A-BD6BD5C31F32}.Release Demo.Build.0 = Release Demo|Win32
|
||||
{97E691B8-7A39-4E86-B69A-BD6BD5C31F32}.Release with Debug Info.ActiveCfg = Release with Debug Info|Win32
|
||||
{97E691B8-7A39-4E86-B69A-BD6BD5C31F32}.Release with Debug Info.Build.0 = Release with Debug Info|Win32
|
||||
{4D4A4AF3-63D1-4C4B-81B5-3EFB3BD574F2}.Bounds Checker.ActiveCfg = Bounds Checker|Win32
|
||||
{4D4A4AF3-63D1-4C4B-81B5-3EFB3BD574F2}.Bounds Checker.Build.0 = Bounds Checker|Win32
|
||||
{4D4A4AF3-63D1-4C4B-81B5-3EFB3BD574F2}.Debug.ActiveCfg = Debug|Win32
|
||||
{4D4A4AF3-63D1-4C4B-81B5-3EFB3BD574F2}.Debug.Build.0 = Debug|Win32
|
||||
{4D4A4AF3-63D1-4C4B-81B5-3EFB3BD574F2}.Debug Demo.ActiveCfg = Debug Demo|Win32
|
||||
{4D4A4AF3-63D1-4C4B-81B5-3EFB3BD574F2}.Debug Demo.Build.0 = Debug Demo|Win32
|
||||
{4D4A4AF3-63D1-4C4B-81B5-3EFB3BD574F2}.Demo Bounds Checker.ActiveCfg = Demo Bounds Checker|Win32
|
||||
{4D4A4AF3-63D1-4C4B-81B5-3EFB3BD574F2}.Demo Bounds Checker.Build.0 = Demo Bounds Checker|Win32
|
||||
{4D4A4AF3-63D1-4C4B-81B5-3EFB3BD574F2}.Demo Release with Debug Info.ActiveCfg = Demo Release with Debug Info|Win32
|
||||
{4D4A4AF3-63D1-4C4B-81B5-3EFB3BD574F2}.Demo Release with Debug Info.Build.0 = Demo Release with Debug Info|Win32
|
||||
{4D4A4AF3-63D1-4C4B-81B5-3EFB3BD574F2}.Release.ActiveCfg = Release|Win32
|
||||
{4D4A4AF3-63D1-4C4B-81B5-3EFB3BD574F2}.Release.Build.0 = Release|Win32
|
||||
{4D4A4AF3-63D1-4C4B-81B5-3EFB3BD574F2}.Release Demo.ActiveCfg = Release Demo|Win32
|
||||
{4D4A4AF3-63D1-4C4B-81B5-3EFB3BD574F2}.Release Demo.Build.0 = Release Demo|Win32
|
||||
{4D4A4AF3-63D1-4C4B-81B5-3EFB3BD574F2}.Release with Debug Info.ActiveCfg = Release with Debug Info|Win32
|
||||
{4D4A4AF3-63D1-4C4B-81B5-3EFB3BD574F2}.Release with Debug Info.Build.0 = Release with Debug Info|Win32
|
||||
{095CC13E-F2F8-4070-AC7A-70926A0ADF37}.Bounds Checker.ActiveCfg = Release|Win32
|
||||
{095CC13E-F2F8-4070-AC7A-70926A0ADF37}.Bounds Checker.Build.0 = Release|Win32
|
||||
{095CC13E-F2F8-4070-AC7A-70926A0ADF37}.Debug.ActiveCfg = Debug|Win32
|
||||
{095CC13E-F2F8-4070-AC7A-70926A0ADF37}.Debug.Build.0 = Debug|Win32
|
||||
{095CC13E-F2F8-4070-AC7A-70926A0ADF37}.Debug Demo.ActiveCfg = Debug|Win32
|
||||
{095CC13E-F2F8-4070-AC7A-70926A0ADF37}.Debug Demo.Build.0 = Debug|Win32
|
||||
{095CC13E-F2F8-4070-AC7A-70926A0ADF37}.Demo Bounds Checker.ActiveCfg = Debug|Win32
|
||||
{095CC13E-F2F8-4070-AC7A-70926A0ADF37}.Demo Bounds Checker.Build.0 = Debug|Win32
|
||||
{095CC13E-F2F8-4070-AC7A-70926A0ADF37}.Demo Release with Debug Info.ActiveCfg = Release|Win32
|
||||
{095CC13E-F2F8-4070-AC7A-70926A0ADF37}.Demo Release with Debug Info.Build.0 = Release|Win32
|
||||
{095CC13E-F2F8-4070-AC7A-70926A0ADF37}.Release.ActiveCfg = Release|Win32
|
||||
{095CC13E-F2F8-4070-AC7A-70926A0ADF37}.Release.Build.0 = Release|Win32
|
||||
{095CC13E-F2F8-4070-AC7A-70926A0ADF37}.Release Demo.ActiveCfg = Release|Win32
|
||||
{095CC13E-F2F8-4070-AC7A-70926A0ADF37}.Release Demo.Build.0 = Release|Win32
|
||||
{095CC13E-F2F8-4070-AC7A-70926A0ADF37}.Release with Debug Info.ActiveCfg = Release|Win32
|
||||
{095CC13E-F2F8-4070-AC7A-70926A0ADF37}.Release with Debug Info.Build.0 = Release|Win32
|
||||
{32A550A8-FEBD-4F8D-8D62-6F97C63F83DA}.Bounds Checker.ActiveCfg = Bounds Checker|Win32
|
||||
{32A550A8-FEBD-4F8D-8D62-6F97C63F83DA}.Bounds Checker.Build.0 = Bounds Checker|Win32
|
||||
{32A550A8-FEBD-4F8D-8D62-6F97C63F83DA}.Debug.ActiveCfg = Debug|Win32
|
||||
{32A550A8-FEBD-4F8D-8D62-6F97C63F83DA}.Debug.Build.0 = Debug|Win32
|
||||
{32A550A8-FEBD-4F8D-8D62-6F97C63F83DA}.Debug Demo.ActiveCfg = Debug Demo|Win32
|
||||
{32A550A8-FEBD-4F8D-8D62-6F97C63F83DA}.Debug Demo.Build.0 = Debug Demo|Win32
|
||||
{32A550A8-FEBD-4F8D-8D62-6F97C63F83DA}.Demo Bounds Checker.ActiveCfg = Demo Bounds Checker|Win32
|
||||
{32A550A8-FEBD-4F8D-8D62-6F97C63F83DA}.Demo Bounds Checker.Build.0 = Demo Bounds Checker|Win32
|
||||
{32A550A8-FEBD-4F8D-8D62-6F97C63F83DA}.Demo Release with Debug Info.ActiveCfg = Demo Release with Debug Info|Win32
|
||||
{32A550A8-FEBD-4F8D-8D62-6F97C63F83DA}.Demo Release with Debug Info.Build.0 = Demo Release with Debug Info|Win32
|
||||
{32A550A8-FEBD-4F8D-8D62-6F97C63F83DA}.Release.ActiveCfg = Release|Win32
|
||||
{32A550A8-FEBD-4F8D-8D62-6F97C63F83DA}.Release.Build.0 = Release|Win32
|
||||
{32A550A8-FEBD-4F8D-8D62-6F97C63F83DA}.Release Demo.ActiveCfg = Release Demo|Win32
|
||||
{32A550A8-FEBD-4F8D-8D62-6F97C63F83DA}.Release Demo.Build.0 = Release Demo|Win32
|
||||
{32A550A8-FEBD-4F8D-8D62-6F97C63F83DA}.Release with Debug Info.ActiveCfg = Release with Debug Info|Win32
|
||||
{32A550A8-FEBD-4F8D-8D62-6F97C63F83DA}.Release with Debug Info.Build.0 = Release with Debug Info|Win32
|
||||
{286FCC0E-C6E1-4E29-8642-588D7358966F}.Bounds Checker.ActiveCfg = Release|Win32
|
||||
{286FCC0E-C6E1-4E29-8642-588D7358966F}.Bounds Checker.Build.0 = Release|Win32
|
||||
{286FCC0E-C6E1-4E29-8642-588D7358966F}.Debug.ActiveCfg = Debug|Win32
|
||||
{286FCC0E-C6E1-4E29-8642-588D7358966F}.Debug.Build.0 = Debug|Win32
|
||||
{286FCC0E-C6E1-4E29-8642-588D7358966F}.Debug Demo.ActiveCfg = Debug|Win32
|
||||
{286FCC0E-C6E1-4E29-8642-588D7358966F}.Debug Demo.Build.0 = Debug|Win32
|
||||
{286FCC0E-C6E1-4E29-8642-588D7358966F}.Demo Bounds Checker.ActiveCfg = Debug|Win32
|
||||
{286FCC0E-C6E1-4E29-8642-588D7358966F}.Demo Bounds Checker.Build.0 = Debug|Win32
|
||||
{286FCC0E-C6E1-4E29-8642-588D7358966F}.Demo Release with Debug Info.ActiveCfg = Release|Win32
|
||||
{286FCC0E-C6E1-4E29-8642-588D7358966F}.Demo Release with Debug Info.Build.0 = Release|Win32
|
||||
{286FCC0E-C6E1-4E29-8642-588D7358966F}.Release.ActiveCfg = Release|Win32
|
||||
{286FCC0E-C6E1-4E29-8642-588D7358966F}.Release.Build.0 = Release|Win32
|
||||
{286FCC0E-C6E1-4E29-8642-588D7358966F}.Release Demo.ActiveCfg = Release|Win32
|
||||
{286FCC0E-C6E1-4E29-8642-588D7358966F}.Release Demo.Build.0 = Release|Win32
|
||||
{286FCC0E-C6E1-4E29-8642-588D7358966F}.Release with Debug Info.ActiveCfg = Release|Win32
|
||||
{286FCC0E-C6E1-4E29-8642-588D7358966F}.Release with Debug Info.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
EndGlobalSection
|
||||
|
||||
+37
-4
@@ -23,7 +23,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=".\Res;".\Standard Gaming Platform";.\TileEngine;.\Tactical;.\Utils;.\TacticalAI;.\Editor;.\Strategic;.\laptop;.\lua;.\"
|
||||
AdditionalIncludeDirectories=".\Multiplayer;.\Multiplayer\raknet;.\Res;".\Standard Gaming Platform";.\TileEngine;.\Tactical;.\Utils;.\TacticalAI;.\Editor;.\Strategic;.\laptop;.\lua;.\"
|
||||
PreprocessorDefinitions="CALLBACKTIMER;PRECOMPILEDHEADERS;_DEBUG;WIN32;_WINDOWS;JA2;_VTUNE_PROFILING;XML_STATIC;CINTERFACE"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="2"
|
||||
@@ -42,7 +42,7 @@
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="libexpatMT.lib mss32.lib winmm.lib smackw32.lib fmodvc.lib lua51.lib"
|
||||
AdditionalDependencies="libexpatMT.lib mss32.lib winmm.lib smackw32.lib fmodvc.lib lua51.lib .\Multiplayer\raknet\RakNetLibStaticDebug.lib ws2_32.lib"
|
||||
OutputFile="C:\Games\Jagged Alliance 2\ja2_debug_1020_en.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="TRUE"
|
||||
@@ -523,7 +523,7 @@
|
||||
FavorSizeOrSpeed="1"
|
||||
OptimizeForProcessor="3"
|
||||
OptimizeForWindowsApplication="TRUE"
|
||||
AdditionalIncludeDirectories=".\Res;".\Standard Gaming Platform";.\TileEngine;.\Tactical;.\Utils;.\TacticalAI;.\Editor;.\Strategic;.\laptop;.\Lua;.\Console;.\"
|
||||
AdditionalIncludeDirectories=".\Multiplayer;.\Multiplayer\raknet;.\Res;".\Standard Gaming Platform";.\TileEngine;.\Tactical;.\Utils;.\TacticalAI;.\Editor;.\Strategic;.\laptop;.\Lua;.\Console;.\"
|
||||
PreprocessorDefinitions="CALLBACKTIMER;PRECOMPILEDHEADERS;NDEBUG;WIN32;_WINDOWS;JA2;XML_STATIC;CINTERFACE"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="0"
|
||||
@@ -544,7 +544,7 @@
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="libexpatMT.lib winmm.lib smackw32.lib mss32.lib fmodvc.lib lua51.lib"
|
||||
AdditionalDependencies="libexpatMT.lib mss32.lib winmm.lib smackw32.lib fmodvc.lib lua51.lib .\Multiplayer\Raknet\RakNetLibStatic.lib ws2_32.lib"
|
||||
OutputFile="C:\games\Jagged Alliance 2\JA2_vs2003_release.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="TRUE"
|
||||
@@ -2393,6 +2393,39 @@
|
||||
RelativePath="Res\resource.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="multiplayer"
|
||||
Filter="">
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath=".\Multiplayer\client.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Multiplayer\server.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Multiplayer\test_space.cpp">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath=".\Multiplayer\connect.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Multiplayer\fresh_header.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Multiplayer\network.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Multiplayer\test_space.h">
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
|
||||
+21
-4
@@ -47,7 +47,7 @@
|
||||
#endif
|
||||
|
||||
#include "Strategic Town Loyalty.h"
|
||||
|
||||
#include "connect.h"
|
||||
|
||||
//
|
||||
//****** Defines ******
|
||||
@@ -1817,7 +1817,7 @@ INT8 AimMemberHireMerc()
|
||||
}
|
||||
|
||||
//add an entry in the history page for the hiring of the merc
|
||||
AddHistoryToPlayersLog(HISTORY_HIRED_MERC_FROM_AIM, ubCurrentSoldier, GetWorldTotalMin(), -1, -1 );
|
||||
if(!is_client)AddHistoryToPlayersLog(HISTORY_HIRED_MERC_FROM_AIM, ubCurrentSoldier, GetWorldTotalMin(), -1, -1 );
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
@@ -1994,7 +1994,7 @@ UINT32 DisplayMercChargeAmount()
|
||||
// if there is a medical deposit, add it in
|
||||
if( gMercProfiles[ gbCurrentSoldier ].bMedicalDeposit )
|
||||
{
|
||||
giContractAmount += gMercProfiles[gbCurrentSoldier].sMedicalDepositAmount;
|
||||
if(!is_client)giContractAmount += gMercProfiles[gbCurrentSoldier].sMedicalDepositAmount;//hayden
|
||||
}
|
||||
|
||||
//If hired with the equipment, add it in aswell
|
||||
@@ -3206,7 +3206,11 @@ BOOLEAN InitDeleteVideoConferencePopUp( )
|
||||
{
|
||||
gubVideoConferencingPreviousMode = gubVideoConferencingMode;
|
||||
gubMercAttitudeLevel = 0;
|
||||
gubContractLength = AIM_CONTRACT_LENGTH_ONE_WEEK;
|
||||
|
||||
if (is_networked)
|
||||
gubContractLength = AIM_CONTRACT_LENGTH_ONE_DAY;
|
||||
else
|
||||
gubContractLength = AIM_CONTRACT_LENGTH_ONE_WEEK;
|
||||
|
||||
if( gMercProfiles[gbCurrentSoldier].usOptionalGearCost == 0 )
|
||||
gfBuyEquipment = FALSE;
|
||||
@@ -3290,6 +3294,11 @@ BOOLEAN InitDeleteVideoConferencePopUp( )
|
||||
usPosY += AIM_MEMBER_BUY_EQUIPMENT_GAP;
|
||||
}
|
||||
|
||||
if(is_client)//hayden : only needed for 1 day...
|
||||
{
|
||||
DisableButton( giContractLengthButton[1] );
|
||||
DisableButton( giContractLengthButton[2] );
|
||||
}
|
||||
// BuyEquipment button
|
||||
usPosY = AIM_MEMBER_BUY_CONTRACT_LENGTH_Y;
|
||||
for(i=0; i<2; i++)
|
||||
@@ -3310,6 +3319,12 @@ BOOLEAN InitDeleteVideoConferencePopUp( )
|
||||
if( gMercProfiles[gbCurrentSoldier].usOptionalGearCost == 0 )
|
||||
DisableButton( giBuyEquipmentButton[1] );
|
||||
|
||||
if(!ALLOW_EQUIP && is_networked)
|
||||
{
|
||||
gfBuyEquipment = FALSE;
|
||||
DisableButton( giBuyEquipmentButton[0] );
|
||||
DisableButton( giBuyEquipmentButton[1] );
|
||||
}
|
||||
|
||||
// Authorize button
|
||||
usPosX = AIM_MEMBER_AUTHORIZE_PAY_X;
|
||||
@@ -4372,6 +4387,8 @@ void DisplayPopUpBoxExplainingMercArrivalLocationAndTime( )
|
||||
if( LaptopSaveInfo.sLastHiredMerc.fHaveDisplayedPopUpInLaptop )
|
||||
return;
|
||||
|
||||
if(is_client)
|
||||
return;
|
||||
pSoldier = FindSoldierByProfileID( (UINT8)LaptopSaveInfo.sLastHiredMerc.iIdOfMerc, TRUE );
|
||||
|
||||
if( pSoldier == NULL )
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
#include "strategicmap.h"
|
||||
#endif
|
||||
|
||||
#include "Strategic Event Handler.h"
|
||||
#include "connect.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@@ -341,7 +343,10 @@ void ShutDownBobbyRNewMailOrders();
|
||||
|
||||
void GameInitBobbyRMailOrder()
|
||||
{
|
||||
gubSelectedLight = 0;
|
||||
if (is_networked)
|
||||
gubSelectedLight = 2; //hayden
|
||||
else
|
||||
gubSelectedLight = 0;
|
||||
|
||||
gpNewBobbyrShipments = NULL;
|
||||
giNumberOfNewBobbyRShipment = 0;
|
||||
@@ -778,7 +783,7 @@ void BtnBobbyRAcceptOrderCallback(GUI_BUTTON *btn,INT32 reason)
|
||||
CHAR16 zTemp[ 128 ];
|
||||
|
||||
//if the city is Drassen, and the airport sector is player controlled
|
||||
if( gbSelectedCity == BR_DRASSEN && !StrategicMap[ SECTOR_INFO_TO_STRATEGIC_INDEX( SEC_B13 ) ].fEnemyControlled )
|
||||
if( gbSelectedCity == BR_DRASSEN && !StrategicMap[ SECTOR_INFO_TO_STRATEGIC_INDEX( SEC_B13 ) ].fEnemyControlled || is_client )
|
||||
{
|
||||
//Quick hack to bypass the confirmation box
|
||||
ConfirmBobbyRPurchaseMessageBoxCallBack( MSG_BOX_RETURN_YES );
|
||||
@@ -1393,6 +1398,7 @@ BOOLEAN CreateDestroyBobbyRDropDown( UINT8 ubDropDownAction )
|
||||
{
|
||||
UINT8 i;
|
||||
UINT16 usPosY, usPosX;
|
||||
UINT16 usFontHeight = GetFontHeight( BOBBYR_DROPDOWN_FONT );
|
||||
HVOBJECT hImageHandle;
|
||||
HVOBJECT hArrowHandle;
|
||||
|
||||
@@ -2158,9 +2164,19 @@ void ConfirmBobbyRPurchaseMessageBoxCallBack( UINT8 bExitValue )
|
||||
void EnterInitBobbyRayOrder()
|
||||
{
|
||||
memset(&BobbyRayPurchases, 0, sizeof(BobbyRayPurchaseStruct) * MAX_PURCHASE_AMOUNT);
|
||||
gubSelectedLight = 0;
|
||||
|
||||
if (is_networked)
|
||||
gubSelectedLight = 2; //hayden
|
||||
else
|
||||
gubSelectedLight = 0;
|
||||
|
||||
gfReDrawBobbyOrder = TRUE;
|
||||
gbSelectedCity = -1;
|
||||
|
||||
if (is_networked)
|
||||
gbSelectedCity = 2; //hayden , was -1
|
||||
else
|
||||
gbSelectedCity = -1;
|
||||
|
||||
gubCityAtTopOfList = 0;
|
||||
|
||||
//Get rid of the city drop dowm, if it is being displayed
|
||||
@@ -2345,7 +2361,15 @@ BOOLEAN AddNewBobbyRShipment( BobbyRayPurchaseStruct *pPurchaseStruct, UINT8 ubD
|
||||
|
||||
|
||||
//AddStrategicEvent( EVENT_BOBBYRAY_PURCHASE, uiResetTimeSec, cnt);
|
||||
if(is_client)
|
||||
{
|
||||
BobbyRayPurchaseEventCallback( iFoundSpot); //hayden - instant delivery ?
|
||||
//AddStrategicEventUsingSeconds( EVENT_BOBBYRAY_PURCHASE, GetWorldDayInSeconds() + 10, iFoundSpot );
|
||||
}
|
||||
else
|
||||
{
|
||||
AddFutureDayStrategicEvent( EVENT_BOBBYRAY_PURCHASE, (8 + Random(4) ) * 60, iFoundSpot, bDaysAhead );
|
||||
}
|
||||
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
@@ -1238,7 +1238,6 @@ BOOLEAN LoadImpCharacter( STR nickName )
|
||||
HWFILE hFile;
|
||||
UINT32 uiBytesRead = 0;
|
||||
|
||||
// WANNE: Enlarged the array from 13 characters to 32.
|
||||
char zFileName[32];
|
||||
|
||||
//ADB first try to load the new kind
|
||||
|
||||
@@ -339,7 +339,7 @@
|
||||
FavorSizeOrSpeed="1"
|
||||
OptimizeForProcessor="3"
|
||||
OptimizeForWindowsApplication="TRUE"
|
||||
AdditionalIncludeDirectories=""..\Standard Gaming Platform";..\TileEngine;..\;..\Tactical;..\Utils;..\tacticalai;..\Editor;..\strategic;.\"
|
||||
AdditionalIncludeDirectories="..\Multiplayer;"..\Standard Gaming Platform";..\TileEngine;..\;..\Tactical;..\Utils;..\tacticalai;..\Editor;..\strategic;.\"
|
||||
PreprocessorDefinitions="PRECOMPILEDHEADERS;NDEBUG;WIN32;_WINDOWS;JA2;XML_STATIC;CINTERFACE"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="0"
|
||||
@@ -390,7 +390,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""..\Standard Gaming Platform";..\TileEngine;..\;..\Tactical;..\Utils;..\tacticalai;..\Editor;..\lua;..\strategic;.\"
|
||||
AdditionalIncludeDirectories="..\Multiplayer;"..\Standard Gaming Platform";..\TileEngine;..\;..\Tactical;..\Utils;..\tacticalai;..\Editor;..\lua;..\strategic;.\"
|
||||
PreprocessorDefinitions="PRECOMPILEDHEADERS;_DEBUG;WIN32;_WINDOWS;JA2;_VTUNE_PROFILING;XML_STATIC;CINTERFACE"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="2"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8,00"
|
||||
Version="8.00"
|
||||
Name="Laptop_2005Express"
|
||||
ProjectGUID="{5234CD2E-97F1-42FF-828D-CE0A1B46805E}"
|
||||
RootNamespace="Laptop_2005Express"
|
||||
@@ -41,6 +41,7 @@
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/D "_CRT_SECURE_NO_DEPRECATE""
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\Multiplayer"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
@@ -104,6 +105,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/D "_CRT_SECURE_NO_DEPRECATE""
|
||||
AdditionalIncludeDirectories="..\Multiplayer"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;"
|
||||
RuntimeLibrary="0"
|
||||
RuntimeTypeInfo="false"
|
||||
|
||||
@@ -27,10 +27,11 @@
|
||||
#include "Assignments.h"
|
||||
#include "Input.h"
|
||||
#include "english.h"
|
||||
#include "finances.h"
|
||||
#endif
|
||||
|
||||
#include "Cheats.h"
|
||||
|
||||
#include "connect.h"
|
||||
|
||||
|
||||
#define MERCBIOFILE "BINARYDATA\\MercBios.edt"
|
||||
@@ -667,6 +668,9 @@ BOOLEAN MercFilesHireMerc(UINT8 ubMercID)
|
||||
}
|
||||
else
|
||||
{
|
||||
//take off nominal fee: hayden,
|
||||
if (is_networked)
|
||||
AddTransactionToPlayersBook( HIRED_MERC, ubMercID, GetWorldTotalMin(), gMercProfiles[ ubMercID ].sSalary * (-1) );
|
||||
//if we succesfully hired the merc
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
+17
-1
@@ -27,6 +27,10 @@
|
||||
#include "Quests.h"
|
||||
#endif
|
||||
|
||||
|
||||
UINT8 NUMBER_OF_MERCS;
|
||||
UINT8 LAST_MERC_ID;
|
||||
|
||||
#define MERC_TEXT_FONT FONT12ARIAL
|
||||
#define MERC_TEXT_COLOR FONT_MCOLOR_WHITE
|
||||
|
||||
@@ -178,7 +182,7 @@ UINT32 guiMercBackGround;
|
||||
UINT32 guiMercVideoFaceBackground;
|
||||
UINT32 guiMercVideoPopupBackground;
|
||||
|
||||
UINT8 gubMercArray[ NUMBER_OF_MERCS ];
|
||||
UINT8 gubMercArray[ MAX_NUMBER_OF_MERCS ];
|
||||
UINT8 gubCurMercIndex;
|
||||
|
||||
INT32 iMercPopUpBox = -1;
|
||||
@@ -342,6 +346,18 @@ void GameInitMercs()
|
||||
gubMercArray[ 12 ] = COUGAR;
|
||||
gubMercArray[ 13 ] = GASTON;
|
||||
gubMercArray[ 14 ] = STOGIE;
|
||||
gubMercArray[ 15 ] = 57;//hayden
|
||||
gubMercArray[ 16 ] = 58;
|
||||
gubMercArray[ 17 ] = 59;
|
||||
gubMercArray[ 18 ] = 60;
|
||||
gubMercArray[ 19 ] = 61;
|
||||
gubMercArray[ 20 ] = 63;
|
||||
gubMercArray[ 21 ] = 66;
|
||||
gubMercArray[ 22 ] = 67;
|
||||
gubMercArray[ 23 ] = 68;
|
||||
gubMercArray[ 24 ] = 69;
|
||||
gubMercArray[ 25 ] = 70;
|
||||
gubMercArray[ 26 ] = 72;
|
||||
|
||||
LaptopSaveInfo.gubPlayersMercAccountStatus = MERC_NO_ACCOUNT;
|
||||
gubCurMercIndex = 0;
|
||||
|
||||
+7
-3
@@ -5,8 +5,12 @@
|
||||
#define MERC_BUTTON_UP_COLOR FONT_MCOLOR_WHITE
|
||||
#define MERC_BUTTON_DOWN_COLOR FONT_MCOLOR_DKWHITE
|
||||
|
||||
#define NUMBER_OF_MERCS 15
|
||||
#define LAST_MERC_ID 14
|
||||
extern UINT8 NUMBER_OF_MERCS;
|
||||
extern UINT8 LAST_MERC_ID;
|
||||
|
||||
#define MAX_NUMBER_OF_MERCS 27
|
||||
//#define NUMBER_OF_MERCS 27//hayden
|
||||
//#define LAST_MERC_ID 26//hayden
|
||||
#define NUMBER_OF_BAD_MERCS 5
|
||||
#define NUMBER_MERCS_AFTER_FIRST_MERC_ARRIVES 6
|
||||
#define NUMBER_MERCS_AFTER_SECOND_MERC_ARRIVES 8
|
||||
@@ -79,7 +83,7 @@ extern UINT16 gusMercVideoSpeckSpeech;
|
||||
|
||||
extern UINT8 gubArrivedFromMercSubSite;
|
||||
|
||||
extern UINT8 gubMercArray[ NUMBER_OF_MERCS ];
|
||||
extern UINT8 gubMercArray[ MAX_NUMBER_OF_MERCS ];
|
||||
extern UINT8 gubCurMercIndex;
|
||||
//extern UINT8 gubLastMercIndex;
|
||||
|
||||
|
||||
+117
-3
@@ -35,6 +35,10 @@
|
||||
#include "GameVersion.h"
|
||||
#endif
|
||||
|
||||
#include "mercs.h"
|
||||
#include "gamesettings.h"
|
||||
#include "connect.h"
|
||||
|
||||
#define MAINMENU_TEXT_FILE "LoadScreens\\MainMenu.edt"
|
||||
#define MAINMENU_RECORD_SIZE 80 * 2
|
||||
|
||||
@@ -45,14 +49,17 @@ enum
|
||||
{
|
||||
// TITLE,
|
||||
NEW_GAME,
|
||||
NEW_MP_GAME,
|
||||
LOAD_GAME,
|
||||
//LOAD_MP_GAME,
|
||||
PREFERENCES,
|
||||
CREDITS,
|
||||
QUIT,
|
||||
NUM_MENU_ITEMS
|
||||
};
|
||||
|
||||
#define MAINMENU_Y iScreenHeightOffset + 277
|
||||
//#define MAINMENU_Y iScreenHeightOffset + 277
|
||||
#define MAINMENU_Y iScreenHeightOffset + 210
|
||||
#define MAINMENU_Y_SPACE 37
|
||||
|
||||
|
||||
@@ -225,6 +232,10 @@ void HandleMainMenuScreen()
|
||||
// SetMainMenuExitScreen( INIT_SCREEN );
|
||||
break;
|
||||
|
||||
// ROMAN: TODO??
|
||||
case NEW_MP_GAME:
|
||||
break;
|
||||
|
||||
case LOAD_GAME:
|
||||
// Select the game which is to be restored
|
||||
guiPreviousOptionScreen = guiCurrentScreen;
|
||||
@@ -235,6 +246,17 @@ void HandleMainMenuScreen()
|
||||
|
||||
break;
|
||||
|
||||
// ROMAN: TODO
|
||||
// case LOAD_MP_GAME:
|
||||
//// Select the game which is to be restored
|
||||
//guiPreviousOptionScreen = guiCurrentScreen;
|
||||
//guiMainMenuExitScreen = SAVE_LOAD_SCREEN;
|
||||
//gbHandledMainMenu = 0;
|
||||
//gfSaveGame = FALSE;
|
||||
//gfMainMenuScreenExit = TRUE;
|
||||
|
||||
//break;
|
||||
|
||||
case PREFERENCES:
|
||||
guiPreviousOptionScreen = guiCurrentScreen;
|
||||
guiMainMenuExitScreen = OPTIONS_SCREEN;
|
||||
@@ -259,6 +281,17 @@ BOOLEAN InitMainMenu( )
|
||||
|
||||
// gfDoHelpScreen = 0;
|
||||
|
||||
if(is_networked)
|
||||
{
|
||||
is_networked = FALSE;
|
||||
// Snap: UN-Init MP save game directory
|
||||
if ( !InitSaveDir() )
|
||||
{
|
||||
|
||||
//if something didnt work, dont even know how to make error code...//hayden
|
||||
}
|
||||
}
|
||||
|
||||
//Check to see whatr saved game files exist
|
||||
InitSaveGameArray();
|
||||
|
||||
@@ -350,7 +383,30 @@ void ExitMainMenu( )
|
||||
*/
|
||||
}
|
||||
|
||||
// WANNE - MP: This method initializes variables that should be initialized
|
||||
// differently for single and multiplayer
|
||||
void InitDependingGameStyleOptions(BOOLEAN isNetworked)
|
||||
{
|
||||
// Load the ja2_options.ini
|
||||
LoadGameExternalOptions();
|
||||
|
||||
ReStartingGame();
|
||||
InitGameOptions();
|
||||
|
||||
if (isNetworked)
|
||||
{
|
||||
NUMBER_OF_MERCS = 27;
|
||||
LAST_MERC_ID = 26;
|
||||
}
|
||||
else
|
||||
{
|
||||
NUMBER_OF_MERCS = 15;
|
||||
LAST_MERC_ID = 14;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// WANNE - MP: In this method we decide if we want to play a single or multiplayer game
|
||||
void MenuButtonCallback(GUI_BUTTON *btn,INT32 reason)
|
||||
{
|
||||
INT8 bID;
|
||||
@@ -368,13 +424,59 @@ void MenuButtonCallback(GUI_BUTTON *btn,INT32 reason)
|
||||
|
||||
if( gbHandledMainMenu == NEW_GAME )
|
||||
{
|
||||
if(is_networked)
|
||||
{
|
||||
is_networked = FALSE;
|
||||
// Snap: UN-Init MP save game directory
|
||||
if ( !InitSaveDir() )
|
||||
{
|
||||
|
||||
//if something didnt work, dont even know how to make error code...//hayden
|
||||
}
|
||||
}
|
||||
;
|
||||
|
||||
SetMainMenuExitScreen( GAME_INIT_OPTIONS_SCREEN );
|
||||
}
|
||||
else if (gbHandledMainMenu == NEW_MP_GAME)
|
||||
{
|
||||
is_networked = TRUE;
|
||||
|
||||
// Snap: Re-Init MP save game directory
|
||||
if ( !InitSaveDir() )
|
||||
{
|
||||
|
||||
//if something didnt work, dont even know how to make error code...//hayden
|
||||
}
|
||||
|
||||
SetMainMenuExitScreen( GAME_INIT_OPTIONS_SCREEN );
|
||||
}
|
||||
else if( gbHandledMainMenu == LOAD_GAME )
|
||||
{
|
||||
if(is_networked)
|
||||
{
|
||||
is_networked = FALSE;
|
||||
// Snap: UN-Init MP save game directory
|
||||
if ( !InitSaveDir() )
|
||||
{
|
||||
|
||||
//if something didnt work, dont even know how to make error code...//hayden
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if( gfKeyState[ ALT ] )
|
||||
gfLoadGameUponEntry = TRUE;
|
||||
}
|
||||
//else if ( gbHandledMainMenu == LOAD_MP_GAME )
|
||||
//{
|
||||
// is_networked = TRUE;
|
||||
|
||||
// if (gfKeyState[ ALT ] )
|
||||
// gfLoadGameUponEntry = TRUE;
|
||||
//}
|
||||
|
||||
InitDependingGameStyleOptions(is_networked);
|
||||
|
||||
btn->uiFlags &= (~BUTTON_CLICKED_ON );
|
||||
}
|
||||
@@ -554,6 +656,7 @@ BOOLEAN CreateDestroyMainMenuButtons( BOOLEAN fCreate )
|
||||
static BOOLEAN fButtonsCreated = FALSE;
|
||||
INT32 cnt;
|
||||
SGPFILENAME filename;
|
||||
SGPFILENAME filenameMP;
|
||||
INT16 sSlot;
|
||||
#ifndef _DEBUG
|
||||
CHAR16 zText[512];
|
||||
@@ -569,11 +672,18 @@ BOOLEAN CreateDestroyMainMenuButtons( BOOLEAN fCreate )
|
||||
gfLoadGameUponEntry = FALSE;
|
||||
|
||||
// Load button images
|
||||
GetMLGFilename( filename, MLG_TITLETEXT );
|
||||
GetMLGFilename( filename, MLG_TITLETEXT );
|
||||
GetMLGFilename( filenameMP, MLG_TITLETEXT_MP );
|
||||
|
||||
iMenuImages[ NEW_GAME ] = LoadButtonImage( filename, 0,0, 1, 2 ,-1 );
|
||||
|
||||
iMenuImages[ NEW_MP_GAME ] = LoadButtonImage( filenameMP, 0, 0, 1, 2, -1 );
|
||||
|
||||
sSlot = 0;
|
||||
iMenuImages[ LOAD_GAME ] = UseLoadedButtonImage( iMenuImages[ NEW_GAME ] ,6,3,4,5,-1 );
|
||||
|
||||
//iMenuImages[ LOAD_MP_GAME ] = UseLoadedButtonImage( iMenuImages[ NEW_MP_GAME ], 3, 3, 4, 5, -1 );
|
||||
|
||||
iMenuImages[ PREFERENCES ] = UseLoadedButtonImage( iMenuImages[ NEW_GAME ] ,7,7,8,9,-1 );
|
||||
iMenuImages[ CREDITS ] = UseLoadedButtonImage( iMenuImages[ NEW_GAME ] ,13,10,11,12,-1 );
|
||||
iMenuImages[ QUIT ] = UseLoadedButtonImage( iMenuImages[ NEW_GAME ] ,14,14,15,16,-1 );
|
||||
@@ -583,7 +693,9 @@ BOOLEAN CreateDestroyMainMenuButtons( BOOLEAN fCreate )
|
||||
switch( cnt )
|
||||
{
|
||||
case NEW_GAME: gusMainMenuButtonWidths[cnt] = GetWidthOfButtonPic( (UINT16)iMenuImages[cnt], sSlot ); break;
|
||||
case NEW_MP_GAME: gusMainMenuButtonWidths[cnt] = GetWidthOfButtonPic( (UINT16)iMenuImages[cnt], 0); break;
|
||||
case LOAD_GAME: gusMainMenuButtonWidths[cnt] = GetWidthOfButtonPic( (UINT16)iMenuImages[cnt], 3 ); break;
|
||||
// case LOAD_MP_GAME: gusMainMenuButtonWidths[cnt] = GetWidthOfButtonPic( (UINT16)iMenuImages[cnt], 3); break;
|
||||
case PREFERENCES: gusMainMenuButtonWidths[cnt] = GetWidthOfButtonPic( (UINT16)iMenuImages[cnt], 7 ); break;
|
||||
case CREDITS: gusMainMenuButtonWidths[cnt] = GetWidthOfButtonPic( (UINT16)iMenuImages[cnt], 10 ); break;
|
||||
case QUIT: gusMainMenuButtonWidths[cnt] = GetWidthOfButtonPic( (UINT16)iMenuImages[cnt], 15 ); break;
|
||||
@@ -607,6 +719,8 @@ BOOLEAN CreateDestroyMainMenuButtons( BOOLEAN fCreate )
|
||||
}
|
||||
ButtonList[ iMenuButtons[ cnt ] ]->UserData[0] = cnt;
|
||||
|
||||
// WANNE: Removed this, because in Release version it always crashes!
|
||||
/*
|
||||
#ifndef _DEBUG
|
||||
//load up some info from the 'mainmenu.edt' file. This makes sure the file is present. The file is
|
||||
// 'marked' with a code that identifies the testers
|
||||
@@ -623,7 +737,7 @@ BOOLEAN CreateDestroyMainMenuButtons( BOOLEAN fCreate )
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,95 @@
|
||||
#pragma once
|
||||
|
||||
|
||||
#include "Soldier Init List.h"
|
||||
#include "Merc Hiring.h"
|
||||
#include "event pump.h"
|
||||
|
||||
extern bool is_connected;
|
||||
extern bool is_connecting;
|
||||
extern bool is_client;
|
||||
extern bool is_server;
|
||||
extern bool is_networked;
|
||||
|
||||
extern int PLAYER_TEAM_TIMER_SEC_PER_TICKS;
|
||||
|
||||
//extern char CLIENT_NUM[30];
|
||||
extern int CLIENT_NUM;
|
||||
|
||||
extern int ENEMY_ENABLED;
|
||||
extern int CREATURE_ENABLED;
|
||||
extern int MILITIA_ENABLED;
|
||||
extern int CIV_ENABLED;
|
||||
|
||||
extern int MAX_CLIENTS;
|
||||
extern int SAME_MERC;
|
||||
|
||||
extern bool allowlaptop;
|
||||
|
||||
extern UINT8 netbTeam;
|
||||
extern UINT8 ubID_prefix;
|
||||
extern FLOAT DAMAGE_MULTIPLIER;
|
||||
|
||||
extern UINT16 crate_usMapPos;
|
||||
|
||||
//extern int INTERRUPTS;
|
||||
|
||||
extern int ALLOW_EQUIP;
|
||||
|
||||
extern INT32 MAX_MERCS;
|
||||
|
||||
void lockui (bool unlock);
|
||||
|
||||
void start_battle ( void );
|
||||
void DropOffItemsInSector( UINT8 ubOrderNum );
|
||||
|
||||
void test_func2 ( void );
|
||||
|
||||
void mp_help (void);
|
||||
void mp_help2 (void);
|
||||
void grid_display ( void);
|
||||
|
||||
void send_loaded (void);
|
||||
void send_donegui ( UINT8 ubResult );
|
||||
|
||||
|
||||
UINT8 numenemyLAN( UINT8 ubSectorX, UINT8 ubSectorY );
|
||||
|
||||
void connect_client ( void );
|
||||
void start_server (void);
|
||||
void client_packet ( void );
|
||||
void server_packet ( void );
|
||||
|
||||
void server_disconnect (void);
|
||||
void client_disconnect (void);
|
||||
|
||||
void DialogRemoved( UINT8 ubResult );
|
||||
void manual_overide(void);
|
||||
|
||||
void send_path ( SOLDIERTYPE *pSoldier, UINT16 sDestGridNo, UINT16 usMovementAnim, BOOLEAN fFromUI, BOOLEAN fForceRestartAnim );
|
||||
void send_stance ( SOLDIERTYPE *pSoldier, UINT8 ubDesiredStance );
|
||||
void send_dir ( SOLDIERTYPE *pSoldier, UINT16 usDesiredDirection );
|
||||
void send_fire( SOLDIERTYPE *pSoldier, INT16 sTargetGridNo );
|
||||
void send_hit( EV_S_WEAPONHIT *SWeaponHit );
|
||||
|
||||
void send_hire( UINT8 iNewIndex, UINT8 ubCurrentSoldier, INT16 iTotalContractLength, BOOLEAN fCopyProfileItemsOver);
|
||||
|
||||
void send_gui_pos(SOLDIERTYPE *pSoldier, FLOAT dNewXPos, FLOAT dNewYPos);
|
||||
void send_gui_dir(SOLDIERTYPE *pSoldier, UINT16 usNewDirection);
|
||||
|
||||
void send_EndTurn( UINT8 ubNextTeam );
|
||||
|
||||
void send_AI( SOLDIERCREATE_STRUCT *pCreateStruct, UINT8 *pubID );
|
||||
|
||||
void send_stop (EV_S_STOP_MERC *SStopMerc);
|
||||
|
||||
void send_interrupt(SOLDIERTYPE *pSoldier);
|
||||
|
||||
BOOLEAN CheckConditionsForBattle( GROUP *pGroup ); // this comes from strategic movement.cpp
|
||||
|
||||
extern char client_names[4][30];
|
||||
|
||||
void send_settings();
|
||||
|
||||
|
||||
void StartInterrupt( void );
|
||||
@@ -0,0 +1,57 @@
|
||||
#pragma once
|
||||
|
||||
//time for a new header :)
|
||||
|
||||
extern int readyteamreg[10];
|
||||
|
||||
typedef struct
|
||||
{
|
||||
UINT16 soldier_id;
|
||||
UINT16 attacker_id;
|
||||
}death_struct;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
UINT16 ubID;
|
||||
INT16 sGridNo;
|
||||
BOOLEAN fNoAnimations;
|
||||
}doors;
|
||||
void send_door ( SOLDIERTYPE *pSoldier, INT16 sGridNo, BOOLEAN fNoAnimations );
|
||||
|
||||
void send_changestate (EV_S_CHANGESTATE * SChangeState);
|
||||
|
||||
void send_death( SOLDIERTYPE *pSoldier);
|
||||
|
||||
void send_hitstruct(EV_S_STRUCTUREHIT * SStructureHit);
|
||||
void send_hitwindow(EV_S_WINDOWHIT * SWindowHit);
|
||||
void send_miss(EV_S_MISS * SMiss);
|
||||
|
||||
void cheat_func(void);
|
||||
//void start_tt(void);
|
||||
void unlock (void);
|
||||
|
||||
void UpdateSoldierToNetwork ( SOLDIERTYPE *pSoldier );
|
||||
|
||||
extern BOOLEAN gfUIInterfaceSetBusy;
|
||||
|
||||
void kick_player (void);
|
||||
void overide_turn (void);
|
||||
|
||||
extern bool DISABLE_MORALE;
|
||||
|
||||
void send_fireweapon ( EV_S_FIREWEAPON * SFireWeapon);
|
||||
|
||||
void end_interrupt ( BOOLEAN fMarkInterruptOccurred );
|
||||
void EndInterrupt( BOOLEAN fMarkInterruptOccurred );
|
||||
void sendRT (void);
|
||||
|
||||
extern int numreadyteams;//for realtime
|
||||
|
||||
extern bool requested;
|
||||
extern bool getReal;
|
||||
|
||||
extern UINT8 gubCheatLevel;
|
||||
|
||||
void startCombat(UINT8 ubStartingTeam);
|
||||
|
||||
extern int WEAPON_READIED_BONUS;
|
||||
@@ -0,0 +1,83 @@
|
||||
#pragma once
|
||||
|
||||
//this one just for structs, variables and functions used between the client and server scripts...
|
||||
|
||||
extern char CLIENT_NAME[30];
|
||||
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
UINT8 client_num;
|
||||
char client_name[30];
|
||||
int team;
|
||||
int cl_edge;
|
||||
}client_info;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int max_clients;
|
||||
int same_merc;
|
||||
float damage_multiplier;
|
||||
INT16 gsMercArriveSectorX;
|
||||
INT16 gsMercArriveSectorY;
|
||||
int ENEMY_ENABLED;
|
||||
int CREATURE_ENABLED;
|
||||
int MILITIA_ENABLED;
|
||||
int CIV_ENABLED;
|
||||
int gsPLAYER_BSIDE;
|
||||
INT32 secs_per_tick;
|
||||
INT32 starting_balance;
|
||||
bool soDis_Bobby;
|
||||
bool soDis_Equip;
|
||||
BOOLEAN sofGunNut;
|
||||
UINT8 soubGameStyle;
|
||||
UINT8 soubDifficultyLevel;
|
||||
BOOLEAN sofTurnTimeLimit;
|
||||
BOOLEAN sofIronManMode;
|
||||
UINT8 soubBobbyRay;
|
||||
BOOLEAN sofNewInv; // WANNE - MP: New inventory
|
||||
INT32 gsMAX_MERCS;
|
||||
UINT8 client_num;
|
||||
char client_name[30];
|
||||
char client_names[4][30];
|
||||
//int cl_ops[4];
|
||||
int team;
|
||||
int TESTING;
|
||||
char kitbag[100];
|
||||
bool emorale;
|
||||
int gsREPORT_NAME;
|
||||
int cl_edge;
|
||||
float TIME;
|
||||
int WEAPON_READIED_BONUS;
|
||||
} settings_struct;
|
||||
|
||||
//typedef struct
|
||||
//{
|
||||
// int clnum;
|
||||
// UINT8 ubid;
|
||||
//}ovh_struct;
|
||||
//
|
||||
//typedef struct
|
||||
//{
|
||||
// UINT8 ubid;
|
||||
//}adv;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
BOOLEAN fMarkInterruptOccurred;
|
||||
INT8 bteam;
|
||||
UINT8 ubid;
|
||||
|
||||
}endINT;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
INT8 bteam;
|
||||
}real_struct;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
UINT8 ubStartingTeam;
|
||||
}sc_struct;
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,6 @@
|
||||
// Fuck it, GCC won't compile with exports. Someone else can fix this if they want
|
||||
#if defined(_WIN32) && !(defined(__GNUC__) || defined(__GCCXML__)) && !defined(_RAKNET_LIB) && defined(_RAKNET_DLL)
|
||||
#define RAK_DLL_EXPORT __declspec(dllexport)
|
||||
#else
|
||||
#define RAK_DLL_EXPORT
|
||||
#endif
|
||||
@@ -0,0 +1,212 @@
|
||||
/// \file
|
||||
/// \brief All the message identifiers used by RakNet. Message identifiers comprise the first byte of any message.
|
||||
///
|
||||
/// This file is part of RakNet Copyright 2003 Kevin Jenkins.
|
||||
///
|
||||
/// Usage of RakNet is subject to the appropriate license agreement.
|
||||
/// Creative Commons Licensees are subject to the
|
||||
/// license found at
|
||||
/// http://creativecommons.org/licenses/by-nc/2.5/
|
||||
/// Single application licensees are subject to the license found at
|
||||
/// http://www.rakkarsoft.com/SingleApplicationLicense.html
|
||||
/// Custom license users are subject to the terms therein.
|
||||
/// GPL license users are subject to the GNU General Public
|
||||
/// License as published by the Free
|
||||
/// Software Foundation; either version 2 of the License, or (at your
|
||||
/// option) any later version.
|
||||
|
||||
#ifndef __MESSAGE_IDENTIFIERS_H
|
||||
#define __MESSAGE_IDENTIFIERS_H
|
||||
|
||||
/// You should not edit the file MessageIdentifiers.h as it is a part of RakNet static library
|
||||
/// To define your own message id, define an enum following the code example that follows.
|
||||
///
|
||||
/// \code
|
||||
/// enum {
|
||||
/// ID_MYPROJECT_MSG_1 = ID_USER_PACKET_ENUM,
|
||||
/// ID_MYPROJECT_MSG_2,
|
||||
/// ...
|
||||
/// };
|
||||
/// \endcode
|
||||
///
|
||||
/// \note All these enumerations should be casted to (unsigned char) before writing them to RakNet::BitStream
|
||||
enum
|
||||
{
|
||||
//
|
||||
// RESERVED TYPES - DO NOT CHANGE THESE
|
||||
// All types from RakPeer
|
||||
//
|
||||
/// These types are never returned to the user.
|
||||
/// Ping from a connected system. Update timestamps (internal use only)
|
||||
ID_INTERNAL_PING,
|
||||
/// Ping from an unconnected system. Reply but do not update timestamps. (internal use only)
|
||||
ID_PING,
|
||||
/// Ping from an unconnected system. Only reply if we have open connections. Do not update timestamps. (internal use only)
|
||||
ID_PING_OPEN_CONNECTIONS,
|
||||
/// Pong from a connected system. Update timestamps (internal use only)
|
||||
ID_CONNECTED_PONG,
|
||||
/// Asking for a new connection (internal use only)
|
||||
ID_CONNECTION_REQUEST,
|
||||
/// Connecting to a secured server/peer (internal use only)
|
||||
ID_SECURED_CONNECTION_RESPONSE,
|
||||
/// Connecting to a secured server/peer (internal use only)
|
||||
ID_SECURED_CONNECTION_CONFIRMATION,
|
||||
/// Packet that tells us the packet contains an integer ID to name mapping for the remote system (internal use only)
|
||||
ID_RPC_MAPPING,
|
||||
/// A reliable packet to detect lost connections (internal use only)
|
||||
ID_DETECT_LOST_CONNECTIONS,
|
||||
/// Offline message so we know when to reset and start a new connection (internal use only)
|
||||
ID_OPEN_CONNECTION_REQUEST,
|
||||
/// Offline message response so we know when to reset and start a new connection (internal use only)
|
||||
ID_OPEN_CONNECTION_REPLY,
|
||||
/// Remote procedure call (internal use only)
|
||||
ID_RPC,
|
||||
/// Remote procedure call reply, for RPCs that return data (internal use only)
|
||||
ID_RPC_REPLY,
|
||||
|
||||
//
|
||||
// USER TYPES - DO NOT CHANGE THESE
|
||||
//
|
||||
|
||||
/// RakPeer - In a client/server environment, our connection request to the server has been accepted.
|
||||
ID_CONNECTION_REQUEST_ACCEPTED,
|
||||
/// RakPeer - Sent to the player when a connection request cannot be completed due to inability to connect.
|
||||
ID_CONNECTION_ATTEMPT_FAILED,
|
||||
/// RakPeer - Sent a connect request to a system we are currently connected to.
|
||||
ID_ALREADY_CONNECTED,
|
||||
/// RakPeer - A remote system has successfully connected.
|
||||
ID_NEW_INCOMING_CONNECTION,
|
||||
/// RakPeer - The system we attempted to connect to is not accepting new connections.
|
||||
ID_NO_FREE_INCOMING_CONNECTIONS,
|
||||
/// RakPeer - The system specified in Packet::systemAddress has disconnected from us. For the client, this would mean the server has shutdown.
|
||||
ID_DISCONNECTION_NOTIFICATION,
|
||||
/// RakPeer - Reliable packets cannot be delivered to the system specified in Packet::systemAddress. The connection to that system has been closed.
|
||||
ID_CONNECTION_LOST,
|
||||
/// RakPeer - We preset an RSA public key which does not match what the system we connected to is using.
|
||||
ID_RSA_PUBLIC_KEY_MISMATCH,
|
||||
/// RakPeer - We are banned from the system we attempted to connect to.
|
||||
ID_CONNECTION_BANNED,
|
||||
/// RakPeer - The remote system is using a password and has refused our connection because we did not set the correct password.
|
||||
ID_INVALID_PASSWORD,
|
||||
/// RakPeer - A packet has been tampered with in transit. The sender is contained in Packet::systemAddress.
|
||||
ID_MODIFIED_PACKET,
|
||||
/// RakPeer - The four bytes following this byte represent an unsigned int which is automatically modified by the difference in system times between the sender and the recipient. Requires that you call SetOccasionalPing.
|
||||
ID_TIMESTAMP,
|
||||
/// RakPeer - Pong from an unconnected system. First byte is ID_PONG, second sizeof(RakNetTime) bytes is the ping, following bytes is system specific enumeration data.
|
||||
ID_PONG,
|
||||
/// RakPeer - Inform a remote system of our IP/Port, plus some offline data
|
||||
ID_ADVERTISE_SYSTEM,
|
||||
/// ConnectionGraph plugin - In a client/server environment, a client other than ourselves has disconnected gracefully. Packet::systemAddress is modified to reflect the systemAddress of this client.
|
||||
ID_REMOTE_DISCONNECTION_NOTIFICATION,
|
||||
/// ConnectionGraph plugin - In a client/server environment, a client other than ourselves has been forcefully dropped. Packet::systemAddress is modified to reflect the systemAddress of this client.
|
||||
ID_REMOTE_CONNECTION_LOST,
|
||||
/// ConnectionGraph plugin - In a client/server environment, a client other than ourselves has connected. Packet::systemAddress is modified to reflect the systemAddress of this client.
|
||||
ID_REMOTE_NEW_INCOMING_CONNECTION,
|
||||
// RakPeer - Downloading a large message. Format is ID_DOWNLOAD_PROGRESS (MessageID), partCount (unsigned int), partTotal (unsigned int), partLength (unsigned int), first part data (length <= MAX_MTU_SIZE)
|
||||
ID_DOWNLOAD_PROGRESS,
|
||||
|
||||
/// FileListTransfer plugin - Setup data
|
||||
ID_FILE_LIST_TRANSFER_HEADER,
|
||||
/// FileListTransfer plugin - A file
|
||||
ID_FILE_LIST_TRANSFER_FILE,
|
||||
|
||||
/// DirectoryDeltaTransfer plugin - Request from a remote system for a download of a directory
|
||||
ID_DDT_DOWNLOAD_REQUEST,
|
||||
|
||||
/// RakNetTransport plugin - Transport provider message, used for remote console
|
||||
ID_TRANSPORT_STRING,
|
||||
|
||||
/// ReplicaManager plugin - Create an object
|
||||
ID_REPLICA_MANAGER_CONSTRUCTION,
|
||||
/// ReplicaManager plugin - Destroy an object
|
||||
ID_REPLICA_MANAGER_DESTRUCTION,
|
||||
/// ReplicaManager plugin - Changed scope of an object
|
||||
ID_REPLICA_MANAGER_SCOPE_CHANGE,
|
||||
/// ReplicaManager plugin - Serialized data of an object
|
||||
ID_REPLICA_MANAGER_SERIALIZE,
|
||||
/// ReplicaManager plugin - Finished downloading all serialized objects
|
||||
ID_REPLICA_MANAGER_DOWNLOAD_COMPLETE,
|
||||
|
||||
/// ConnectionGraph plugin - Request the connection graph from another system
|
||||
ID_CONNECTION_GRAPH_REQUEST,
|
||||
/// ConnectionGraph plugin - Reply to a connection graph download request
|
||||
ID_CONNECTION_GRAPH_REPLY,
|
||||
/// ConnectionGraph plugin - Update edges / nodes for a system with a connection graph
|
||||
ID_CONNECTION_GRAPH_UPDATE,
|
||||
/// ConnectionGraph plugin - Add a new connection to a connection graph
|
||||
ID_CONNECTION_GRAPH_NEW_CONNECTION,
|
||||
/// ConnectionGraph plugin - Remove a connection from a connection graph - connection was abruptly lost
|
||||
ID_CONNECTION_GRAPH_CONNECTION_LOST,
|
||||
/// ConnectionGraph plugin - Remove a connection from a connection graph - connection was gracefully lost
|
||||
ID_CONNECTION_GRAPH_DISCONNECTION_NOTIFICATION,
|
||||
|
||||
/// Router plugin - route a message through another system
|
||||
ID_ROUTE_AND_MULTICAST,
|
||||
|
||||
/// RakVoice plugin - Open a communication channel
|
||||
ID_RAKVOICE_OPEN_CHANNEL_REQUEST,
|
||||
/// RakVoice plugin - Communication channel accepted
|
||||
ID_RAKVOICE_OPEN_CHANNEL_REPLY,
|
||||
/// RakVoice plugin - Close a communication channel
|
||||
ID_RAKVOICE_CLOSE_CHANNEL,
|
||||
/// RakVoice plugin - Voice data
|
||||
ID_RAKVOICE_DATA,
|
||||
|
||||
/// Autopatcher plugin - Get a list of files that have changed since a certain date
|
||||
ID_AUTOPATCHER_GET_CHANGELIST_SINCE_DATE,
|
||||
/// Autopatcher plugin - A list of files to create
|
||||
ID_AUTOPATCHER_CREATION_LIST,
|
||||
/// Autopatcher plugin - A list of files to delete
|
||||
ID_AUTOPATCHER_DELETION_LIST,
|
||||
/// Autopatcher plugin - A list of files to get patches for
|
||||
ID_AUTOPATCHER_GET_PATCH,
|
||||
/// Autopatcher plugin - A list of patches for a list of files
|
||||
ID_AUTOPATCHER_PATCH_LIST,
|
||||
/// Autopatcher plugin - Returned to the user: An error from the database repository for the autopatcher.
|
||||
ID_AUTOPATCHER_REPOSITORY_FATAL_ERROR,
|
||||
/// Autopatcher plugin - Finished getting all files from the autopatcher
|
||||
ID_AUTOPATCHER_FINISHED_INTERNAL,
|
||||
ID_AUTOPATCHER_FINISHED,
|
||||
/// Autopatcher plugin - Returned to the user: You must restart the application to finish patching.
|
||||
ID_AUTOPATCHER_RESTART_APPLICATION,
|
||||
|
||||
/// NATPunchthrough plugin - Intermediary got a request to help punch through a nat
|
||||
ID_NAT_PUNCHTHROUGH_REQUEST,
|
||||
/// NATPunchthrough plugin - Intermediary cannot complete the request because the target system is not connected
|
||||
ID_NAT_TARGET_NOT_CONNECTED,
|
||||
/// NATPunchthrough plugin - While attempting to connect, we lost the connection to the target system
|
||||
ID_NAT_TARGET_CONNECTION_LOST,
|
||||
/// NATPunchthrough plugin - Internal message to connect at a certain time
|
||||
ID_NAT_CONNECT_AT_TIME,
|
||||
/// NATPunchthrough plugin - Internal message to send a message (to punch through the nat) at a certain time
|
||||
ID_NAT_SEND_OFFLINE_MESSAGE_AT_TIME,
|
||||
|
||||
/// LightweightDatabase plugin - Query
|
||||
ID_DATABASE_QUERY_REQUEST,
|
||||
/// LightweightDatabase plugin - Update
|
||||
ID_DATABASE_UPDATE_ROW,
|
||||
/// LightweightDatabase plugin - Remove
|
||||
ID_DATABASE_REMOVE_ROW,
|
||||
/// LightweightDatabase plugin - A serialized table. Bytes 1+ contain the table. Pass to TableSerializer::DeserializeTable
|
||||
ID_DATABASE_QUERY_REPLY,
|
||||
/// LightweightDatabase plugin - Specified table not found
|
||||
ID_DATABASE_UNKNOWN_TABLE,
|
||||
/// LightweightDatabase plugin - Incorrect password
|
||||
ID_DATABASE_INCORRECT_PASSWORD,
|
||||
|
||||
/// ReadyEvent plugin - Set the ready state for a particular system
|
||||
ID_READY_EVENT_SET,
|
||||
/// ReadyEvent plugin - Unset the ready state for a particular system
|
||||
ID_READY_EVENT_UNSET,
|
||||
/// All systems are in state ID_READY_EVENT_SET
|
||||
ID_READY_EVENT_ALL_SET,
|
||||
/// ReadyEvent plugin - Request of ready event state - used for pulling data when newly connecting
|
||||
ID_READY_EVENT_QUERY,
|
||||
|
||||
// For the user to use. Start your first enumeration at this value.
|
||||
ID_USER_PACKET_ENUM,
|
||||
//-------------------------------------------------------------------------------------------------------------
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,42 @@
|
||||
/// \file
|
||||
/// \brief This file contains enumerations for packet priority and reliability enumerations.
|
||||
///
|
||||
/// This file is part of RakNet Copyright 2003 Kevin Jenkins.
|
||||
///
|
||||
/// Usage of RakNet is subject to the appropriate license agreement.
|
||||
/// Creative Commons Licensees are subject to the
|
||||
/// license found at
|
||||
/// http://creativecommons.org/licenses/by-nc/2.5/
|
||||
/// Single application licensees are subject to the license found at
|
||||
/// http://www.rakkarsoft.com/SingleApplicationLicense.html
|
||||
/// Custom license users are subject to the terms therein.
|
||||
/// GPL license users are subject to the GNU General Public
|
||||
/// License as published by the Free
|
||||
/// Software Foundation; either version 2 of the License, or (at your
|
||||
/// option) any later version.
|
||||
|
||||
#ifndef __PACKET_PRIORITY_H
|
||||
#define __PACKET_PRIORITY_H
|
||||
|
||||
/// These enumerations are used to describe when packets are delivered.
|
||||
enum PacketPriority
|
||||
{
|
||||
SYSTEM_PRIORITY, /// \internal Used by RakNet to send above-high priority messages.
|
||||
HIGH_PRIORITY, /// High priority messages are send before medium priority messages.
|
||||
MEDIUM_PRIORITY, /// Medium priority messages are send before low priority messages.
|
||||
LOW_PRIORITY, /// Low priority messages are only sent when no other messages are waiting.
|
||||
NUMBER_OF_PRIORITIES
|
||||
};
|
||||
|
||||
/// These enumerations are used to describe how packets are delivered.
|
||||
/// \note Note to self: I write this with 3 bits in the stream. If I add more remember to change that
|
||||
enum PacketReliability
|
||||
{
|
||||
UNRELIABLE, /// Same as regular UDP, except that it will also discard duplicate datagrams. RakNet adds (6 to 17) + 21 bits of overhead, 16 of which is used to detect duplicate packets and 6 to 17 of which is used for message length.
|
||||
UNRELIABLE_SEQUENCED, /// Regular UDP with a sequence counter. Out of order messages will be discarded. This adds an additional 13 bits on top what is used for UNRELIABLE.
|
||||
RELIABLE, /// The message is sent reliably, but not necessarily in any order. Same overhead as UNRELIABLE.
|
||||
RELIABLE_ORDERED, /// This message is reliable and will arrive in the order you sent it. Messages will be delayed while waiting for out of order messages. Same overhead as UNRELIABLE_SEQUENCED.
|
||||
RELIABLE_SEQUENCED /// This message is reliable and will arrive in the sequence you sent it. Out or order messages will be dropped. Same overhead as UNRELIABLE_SEQUENCED.
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,30 @@
|
||||
/// Define __GET_TIME_64BIT to have RakNetTime use a 64, rather than 32 bit value. A 32 bit value will overflow after about 5 weeks.
|
||||
/// However, this doubles the bandwidth use for sending times, so don't do it unless you have a reason to.
|
||||
/// Disabled by default.
|
||||
// #define __GET_TIME_64BIT
|
||||
|
||||
/// Makes RakNet threadsafe
|
||||
/// Define this if you use the same instance of RakPeer from multiple threads
|
||||
/// Otherwise leave it undefined, since it makes things an order of magnitude slower.
|
||||
/// Disabled by default
|
||||
// #define _RAKNET_THREADSAFE
|
||||
|
||||
/// Define __BITSTREAM_NATIVE_END to NOT support endian swapping in the BitStream class. This is faster and is what you should use
|
||||
/// unless you actually plan to have different endianness systems connect to each other
|
||||
/// Enabled by default.
|
||||
#define __BITSTREAM_NATIVE_END
|
||||
|
||||
#if defined(_CONSOLE_2)
|
||||
#undef __BITSTREAM_NATIVE_END
|
||||
#endif
|
||||
|
||||
/// Maximum (stack) size to use with _alloca before using new and delete instead.
|
||||
#define MAX_ALLOCA_STACK_ALLOCATION 1048576
|
||||
|
||||
// Use WaitForSingleObject instead of sleep.
|
||||
// Defining it plays nicer with other systems, and uses less CPU, but gives worse RakNet performance
|
||||
// Undefining it uses more CPU time, but is more responsive and faster.
|
||||
#define USE_WAIT_FOR_MULTIPLE_EVENTS
|
||||
|
||||
// If you need it
|
||||
#define RAKNET_VERSION "3.0 09/07/07"
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,172 @@
|
||||
/// \file
|
||||
/// \brief A structure that holds all statistical data returned by RakNet.
|
||||
///
|
||||
/// This file is part of RakNet Copyright 2003 Kevin Jenkins.
|
||||
///
|
||||
/// Usage of RakNet is subject to the appropriate license agreement.
|
||||
/// Creative Commons Licensees are subject to the
|
||||
/// license found at
|
||||
/// http://creativecommons.org/licenses/by-nc/2.5/
|
||||
/// Single application licensees are subject to the license found at
|
||||
/// http://www.rakkarsoft.com/SingleApplicationLicense.html
|
||||
/// Custom license users are subject to the terms therein.
|
||||
/// GPL license users are subject to the GNU General Public
|
||||
/// License as published by the Free
|
||||
/// Software Foundation; either version 2 of the License, or (at your
|
||||
/// option) any later version.
|
||||
|
||||
|
||||
#ifndef __RAK_NET_STATISTICS_H
|
||||
#define __RAK_NET_STATISTICS_H
|
||||
|
||||
#include "PacketPriority.h"
|
||||
#include "Export.h"
|
||||
#include "RakNetTypes.h"
|
||||
|
||||
/// \brief Network Statisics Usage
|
||||
///
|
||||
/// Store Statistics information related to network usage
|
||||
struct RAK_DLL_EXPORT RakNetStatistics
|
||||
{
|
||||
/// Number of Messages in the send Buffer (high, medium, low priority)
|
||||
unsigned messageSendBuffer[ NUMBER_OF_PRIORITIES ];
|
||||
/// Number of messages sent (high, medium, low priority)
|
||||
unsigned messagesSent[ NUMBER_OF_PRIORITIES ];
|
||||
/// Number of data bits used for user messages
|
||||
unsigned messageDataBitsSent[ NUMBER_OF_PRIORITIES ];
|
||||
/// Number of total bits used for user messages, including headers
|
||||
unsigned messageTotalBitsSent[ NUMBER_OF_PRIORITIES ];
|
||||
|
||||
/// Number of packets sent containing only acknowledgements
|
||||
unsigned packetsContainingOnlyAcknowlegements;
|
||||
/// Number of acknowledgements sent
|
||||
unsigned acknowlegementsSent;
|
||||
/// Number of acknowledgements waiting to be sent
|
||||
unsigned acknowlegementsPending;
|
||||
/// Number of acknowledgements bits sent
|
||||
unsigned acknowlegementBitsSent;
|
||||
|
||||
/// Number of packets containing only acknowledgements and resends
|
||||
unsigned packetsContainingOnlyAcknowlegementsAndResends;
|
||||
|
||||
/// Number of messages resent
|
||||
unsigned messageResends;
|
||||
/// Number of bits resent of actual data
|
||||
unsigned messageDataBitsResent;
|
||||
/// Total number of bits resent, including headers
|
||||
unsigned messagesTotalBitsResent;
|
||||
/// Number of messages waiting for ack (// TODO - rename this)
|
||||
unsigned messagesOnResendQueue;
|
||||
|
||||
/// Number of messages not split for sending
|
||||
unsigned numberOfUnsplitMessages;
|
||||
/// Number of messages split for sending
|
||||
unsigned numberOfSplitMessages;
|
||||
/// Total number of splits done for sending
|
||||
unsigned totalSplits;
|
||||
|
||||
/// Total packets sent
|
||||
unsigned packetsSent;
|
||||
|
||||
/// Number of bits added by encryption
|
||||
unsigned encryptionBitsSent;
|
||||
/// total bits sent
|
||||
unsigned totalBitsSent;
|
||||
|
||||
/// Number of sequenced messages arrived out of order
|
||||
unsigned sequencedMessagesOutOfOrder;
|
||||
/// Number of sequenced messages arrived in order
|
||||
unsigned sequencedMessagesInOrder;
|
||||
|
||||
/// Number of ordered messages arrived out of order
|
||||
unsigned orderedMessagesOutOfOrder;
|
||||
/// Number of ordered messages arrived in order
|
||||
unsigned orderedMessagesInOrder;
|
||||
|
||||
/// Packets with a good CRC received
|
||||
unsigned packetsReceived;
|
||||
/// Packets with a bad CRC received
|
||||
unsigned packetsWithBadCRCReceived;
|
||||
/// Bits with a good CRC received
|
||||
unsigned bitsReceived;
|
||||
/// Bits with a bad CRC received
|
||||
unsigned bitsWithBadCRCReceived;
|
||||
/// Number of acknowledgement messages received for packets we are resending
|
||||
unsigned acknowlegementsReceived;
|
||||
/// Number of acknowledgement messages received for packets we are not resending
|
||||
unsigned duplicateAcknowlegementsReceived;
|
||||
/// Number of data messages (anything other than an ack) received that are valid and not duplicate
|
||||
unsigned messagesReceived;
|
||||
/// Number of data messages (anything other than an ack) received that are invalid
|
||||
unsigned invalidMessagesReceived;
|
||||
/// Number of data messages (anything other than an ack) received that are duplicate
|
||||
unsigned duplicateMessagesReceived;
|
||||
/// Number of messages waiting for reassembly
|
||||
unsigned messagesWaitingForReassembly;
|
||||
/// Number of messages in reliability output queue
|
||||
unsigned internalOutputQueueSize;
|
||||
/// Current bits per second
|
||||
double bitsPerSecond;
|
||||
/// connection start time
|
||||
RakNetTime connectionStartTime;
|
||||
// If true, not all the data can go out in one frame, and RakNet is sending continuously
|
||||
// RakNet will try to increase the bandwidth, so this condition may be temporary and only last a second. However, it if
|
||||
// stays on most of the time, you are at the maximum bandwidth and should slow down your sends, because other data is now waiting.
|
||||
bool bandwidthExceeded;
|
||||
|
||||
RakNetStatistics operator +=(const RakNetStatistics& other)
|
||||
{
|
||||
unsigned i;
|
||||
for (i=0; i < NUMBER_OF_PRIORITIES; i++)
|
||||
{
|
||||
messageSendBuffer[i]+=other.messageSendBuffer[i];
|
||||
messagesSent[i]+=other.messagesSent[i];
|
||||
messageDataBitsSent[i]+=other.messageDataBitsSent[i];
|
||||
messageTotalBitsSent[i]+=other.messageTotalBitsSent[i];
|
||||
}
|
||||
|
||||
packetsContainingOnlyAcknowlegements+=other.packetsContainingOnlyAcknowlegements;
|
||||
acknowlegementsSent+=other.packetsContainingOnlyAcknowlegements;
|
||||
acknowlegementsPending+=other.acknowlegementsPending;
|
||||
acknowlegementBitsSent+=other.acknowlegementBitsSent;
|
||||
packetsContainingOnlyAcknowlegementsAndResends+=other.packetsContainingOnlyAcknowlegementsAndResends;
|
||||
messageResends+=other.messageResends;
|
||||
messageDataBitsResent+=other.messageDataBitsResent;
|
||||
messagesTotalBitsResent+=other.messagesTotalBitsResent;
|
||||
messagesOnResendQueue+=other.messagesOnResendQueue;
|
||||
numberOfUnsplitMessages+=other.numberOfUnsplitMessages;
|
||||
numberOfSplitMessages+=other.numberOfSplitMessages;
|
||||
totalSplits+=other.totalSplits;
|
||||
packetsSent+=other.packetsSent;
|
||||
encryptionBitsSent+=other.encryptionBitsSent;
|
||||
totalBitsSent+=other.totalBitsSent;
|
||||
sequencedMessagesOutOfOrder+=other.sequencedMessagesOutOfOrder;
|
||||
sequencedMessagesInOrder+=other.sequencedMessagesInOrder;
|
||||
orderedMessagesOutOfOrder+=other.orderedMessagesOutOfOrder;
|
||||
orderedMessagesInOrder+=other.orderedMessagesInOrder;
|
||||
packetsReceived+=other.packetsReceived;
|
||||
packetsWithBadCRCReceived+=other.packetsWithBadCRCReceived;
|
||||
bitsReceived+=other.bitsReceived;
|
||||
bitsWithBadCRCReceived+=other.bitsWithBadCRCReceived;
|
||||
acknowlegementsReceived+=other.acknowlegementsReceived;
|
||||
duplicateAcknowlegementsReceived+=other.duplicateAcknowlegementsReceived;
|
||||
messagesReceived+=other.messagesReceived;
|
||||
invalidMessagesReceived+=other.invalidMessagesReceived;
|
||||
duplicateMessagesReceived+=other.duplicateMessagesReceived;
|
||||
messagesWaitingForReassembly+=other.messagesWaitingForReassembly;
|
||||
internalOutputQueueSize+=other.internalOutputQueueSize;
|
||||
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
|
||||
/// Verbosity level currently supports 0 (low), 1 (medium), 2 (high)
|
||||
/// \param[in] s The Statistical information to format out
|
||||
/// \param[in] buffer The buffer containing a formated report
|
||||
/// \param[in] verbosityLevel
|
||||
/// 0 low
|
||||
/// 1 medium
|
||||
/// 2 high
|
||||
void RAK_DLL_EXPORT StatisticsToString( RakNetStatistics *s, char *buffer, int verbosityLevel );
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,273 @@
|
||||
/// \file
|
||||
/// \brief Types used by RakNet, most of which involve user code.
|
||||
///
|
||||
/// This file is part of RakNet Copyright 2003 Kevin Jenkins.
|
||||
///
|
||||
/// Usage of RakNet is subject to the appropriate license agreement.
|
||||
/// Creative Commons Licensees are subject to the
|
||||
/// license found at
|
||||
/// http://creativecommons.org/licenses/by-nc/2.5/
|
||||
/// Single application licensees are subject to the license found at
|
||||
/// http://www.rakkarsoft.com/SingleApplicationLicense.html
|
||||
/// Custom license users are subject to the terms therein.
|
||||
/// GPL license users are subject to the GNU General Public
|
||||
/// License as published by the Free
|
||||
/// Software Foundation; either version 2 of the License, or (at your
|
||||
/// option) any later version.
|
||||
|
||||
#ifndef __NETWORK_TYPES_H
|
||||
#define __NETWORK_TYPES_H
|
||||
|
||||
#include "RakNetDefines.h"
|
||||
#include "Export.h"
|
||||
|
||||
/// Forward declaration
|
||||
namespace RakNet
|
||||
{
|
||||
class BitStream;
|
||||
};
|
||||
|
||||
/// Given a number of bits, return how many bytes are needed to represent that.
|
||||
#define BITS_TO_BYTES(x) (((x)+7)>>3)
|
||||
#define BYTES_TO_BITS(x) ((x)<<3)
|
||||
|
||||
/// \sa NetworkIDObject.h
|
||||
typedef unsigned char UniqueIDType;
|
||||
typedef unsigned short SystemIndex;
|
||||
typedef unsigned char RPCIndex;
|
||||
const int MAX_RPC_MAP_SIZE=((RPCIndex)-1)-1;
|
||||
const int UNDEFINED_RPC_INDEX=((RPCIndex)-1);
|
||||
|
||||
/// First byte of a network message
|
||||
typedef unsigned char MessageID;
|
||||
|
||||
// Define __GET_TIME_64BIT if you want to use large types for GetTime (takes more bandwidth when you transmit time though!)
|
||||
// You would want to do this if your system is going to run long enough to overflow the millisecond counter (over a month)
|
||||
#ifdef __GET_TIME_64BIT
|
||||
typedef long long RakNetTime;
|
||||
typedef long long RakNetTimeNS;
|
||||
#else
|
||||
typedef unsigned int RakNetTime;
|
||||
typedef long long RakNetTimeNS;
|
||||
#endif
|
||||
|
||||
/// Describes the local socket to use for RakPeer::Startup
|
||||
struct RAK_DLL_EXPORT SocketDescriptor
|
||||
{
|
||||
SocketDescriptor();
|
||||
SocketDescriptor(unsigned short _port, const char *_hostAddress);
|
||||
|
||||
/// The local port to bind to. Pass 0 to have the OS autoassign a port.
|
||||
unsigned short port;
|
||||
|
||||
/// The local network card address to bind to, such as "127.0.0.1". Pass an empty string to use INADDR_ANY.
|
||||
char hostAddress[32];
|
||||
};
|
||||
|
||||
/// \brief Unique identifier for a system.
|
||||
/// Corresponds to a network address
|
||||
struct RAK_DLL_EXPORT SystemAddress
|
||||
{
|
||||
///The peer address from inet_addr.
|
||||
unsigned int binaryAddress;
|
||||
///The port number
|
||||
unsigned short port;
|
||||
|
||||
// Return the systemAddress as a string in the format <IP>:<Port>
|
||||
// Note - returns a static string. Not thread-safe or safe for multiple calls per line.
|
||||
char *ToString(bool writePort=true) const;
|
||||
|
||||
// Sets the binary address part from a string. Doesn't set the port
|
||||
void SetBinaryAddress(const char *str);
|
||||
|
||||
SystemAddress& operator = ( const SystemAddress& input )
|
||||
{
|
||||
binaryAddress = input.binaryAddress;
|
||||
port = input.port;
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool operator==( const SystemAddress& right ) const;
|
||||
bool operator!=( const SystemAddress& right ) const;
|
||||
bool operator > ( const SystemAddress& right ) const;
|
||||
bool operator < ( const SystemAddress& right ) const;
|
||||
};
|
||||
|
||||
struct RAK_DLL_EXPORT NetworkID
|
||||
{
|
||||
// Set this to true to use peer to peer mode for NetworkIDs.
|
||||
// Obviously the value of this must match on all systems.
|
||||
// True, and this will write the systemAddress portion with network sends. Takes more bandwidth, but NetworkIDs can be locally generated
|
||||
// False, and only localSystemAddress is used.
|
||||
static bool peerToPeerMode;
|
||||
|
||||
// In peer to peer, we use both systemAddress and localSystemAddress
|
||||
// In client / server, we only use localSystemAddress
|
||||
SystemAddress systemAddress;
|
||||
unsigned short localSystemAddress;
|
||||
|
||||
NetworkID& operator = ( const NetworkID& input );
|
||||
|
||||
static bool IsPeerToPeerMode(void);
|
||||
static void SetPeerToPeerMode(bool isPeerToPeer);
|
||||
bool operator==( const NetworkID& right ) const;
|
||||
bool operator!=( const NetworkID& right ) const;
|
||||
bool operator > ( const NetworkID& right ) const;
|
||||
bool operator < ( const NetworkID& right ) const;
|
||||
};
|
||||
|
||||
/// Size of SystemAddress data
|
||||
#define SystemAddress_Size 6
|
||||
|
||||
/// This represents a user message from another system.
|
||||
struct Packet
|
||||
{
|
||||
/// Server only - this is the index into the player array that this systemAddress maps to
|
||||
SystemIndex systemIndex;
|
||||
|
||||
/// The system that send this packet.
|
||||
SystemAddress systemAddress;
|
||||
|
||||
/// The length of the data in bytes
|
||||
/// \deprecated You should use bitSize.
|
||||
unsigned int length;
|
||||
|
||||
/// The length of the data in bits
|
||||
unsigned int bitSize;
|
||||
|
||||
/// The data from the sender
|
||||
unsigned char* data;
|
||||
|
||||
/// @internal
|
||||
/// Indicates whether to delete the data, or to simply delete the packet.
|
||||
bool deleteData;
|
||||
};
|
||||
|
||||
class RakPeerInterface;
|
||||
|
||||
/// All RPC functions have the same parameter list - this structure.
|
||||
struct RPCParameters
|
||||
{
|
||||
/// The data from the remote system
|
||||
unsigned char *input;
|
||||
|
||||
/// How many bits long \a input is
|
||||
unsigned int numberOfBitsOfData;
|
||||
|
||||
/// Which system called this RPC
|
||||
SystemAddress sender;
|
||||
|
||||
/// Which instance of RakPeer (or a derived RakPeer or RakPeer) got this call
|
||||
RakPeerInterface *recipient;
|
||||
|
||||
RakNetTime remoteTimestamp;
|
||||
|
||||
/// The name of the function that was called.
|
||||
char *functionName;
|
||||
|
||||
/// You can return values from RPC calls by writing them to this BitStream.
|
||||
/// This is only sent back if the RPC call originally passed a BitStream to receive the reply.
|
||||
/// If you do so and your send is reliable, it will block until you get a reply or you get disconnected from the system you are sending to, whichever is first.
|
||||
/// If your send is not reliable, it will block for triple the ping time, or until you are disconnected, or you get a reply, whichever is first.
|
||||
RakNet::BitStream *replyToSender;
|
||||
};
|
||||
|
||||
/// Index of an unassigned player
|
||||
const SystemIndex UNASSIGNED_PLAYER_INDEX = 65535;
|
||||
|
||||
/// Index of an invalid SystemAddress
|
||||
const SystemAddress UNASSIGNED_SYSTEM_ADDRESS =
|
||||
{
|
||||
0xFFFFFFFF, 0xFFFF
|
||||
};
|
||||
|
||||
/// Unassigned object ID
|
||||
const NetworkID UNASSIGNED_NETWORK_ID =
|
||||
{
|
||||
{0xFFFFFFFF, 0xFFFF}, 65535
|
||||
};
|
||||
|
||||
const int PING_TIMES_ARRAY_SIZE = 5;
|
||||
|
||||
/// \brief RPC Function Implementation
|
||||
///
|
||||
/// The Remote Procedure Call Subsystem provide the RPC paradigm to
|
||||
/// RakNet user. It consists in providing remote function call over the
|
||||
/// network. A call to a remote function require you to prepare the
|
||||
/// data for each parameter (using BitStream) for example.
|
||||
///
|
||||
/// Use the following C function prototype for your callbacks
|
||||
/// @code
|
||||
/// void functionName(RPCParameters *rpcParms);
|
||||
/// @endcode
|
||||
/// If you pass input data, you can parse the input data in two ways.
|
||||
/// 1.
|
||||
/// Cast input to a struct (such as if you sent a struct)
|
||||
/// i.e. MyStruct *s = (MyStruct*) input;
|
||||
/// Make sure that the sizeof(MyStruct) is equal to the number of bytes passed!
|
||||
/// 2.
|
||||
/// Create a BitStream instance with input as data and the number of bytes
|
||||
/// i.e. BitStream myBitStream(input, (numberOfBitsOfData-1)/8+1)
|
||||
/// (numberOfBitsOfData-1)/8+1 is how convert from bits to bytes
|
||||
/// Full example:
|
||||
/// @code
|
||||
/// void MyFunc(RPCParameters *rpcParms) {}
|
||||
/// RakPeer *rakClient;
|
||||
/// REGISTER_AS_REMOTE_PROCEDURE_CALL(rakClient, MyFunc);
|
||||
/// This would allow MyFunc to be called from the server using (for example)
|
||||
/// rakServer->RPC("MyFunc", 0, clientID, false);
|
||||
/// @endcode
|
||||
|
||||
|
||||
/// \def REGISTER_STATIC_RPC
|
||||
/// \ingroup RAKNET_RPC
|
||||
/// Register a C function as a Remote procedure.
|
||||
/// \param[in] networkObject Your instance of RakPeer, RakPeer, or RakPeer
|
||||
/// \param[in] functionName The name of the C function to call
|
||||
/// \attention 12/01/05 REGISTER_AS_REMOTE_PROCEDURE_CALL renamed to REGISTER_STATIC_RPC. Delete the old name sometime in the future
|
||||
//#pragma deprecated(REGISTER_AS_REMOTE_PROCEDURE_CALL)
|
||||
//#define REGISTER_AS_REMOTE_PROCEDURE_CALL(networkObject, functionName) REGISTER_STATIC_RPC(networkObject, functionName)
|
||||
#define REGISTER_STATIC_RPC(networkObject, functionName) (networkObject)->RegisterAsRemoteProcedureCall((#functionName),(functionName))
|
||||
|
||||
/// \def CLASS_MEMBER_ID
|
||||
/// \ingroup RAKNET_RPC
|
||||
/// \brief Concatenate two strings
|
||||
|
||||
/// \def REGISTER_CLASS_MEMBER_RPC
|
||||
/// \ingroup RAKNET_RPC
|
||||
/// \brief Register a member function of an instantiated object as a Remote procedure call.
|
||||
/// RPC member Functions MUST be marked __cdecl!
|
||||
/// \sa ObjectMemberRPC.cpp
|
||||
/// \b CLASS_MEMBER_ID is a utility macro to generate a unique signature for a class and function pair and can be used for the Raknet functions RegisterClassMemberRPC(...) and RPC(...)
|
||||
/// \b REGISTER_CLASS_MEMBER_RPC is a utility macro to more easily call RegisterClassMemberRPC
|
||||
/// \param[in] networkObject Your instance of RakPeer, RakPeer, or RakPeer
|
||||
/// \param[in] className The class containing the function
|
||||
/// \param[in] functionName The name of the function (not in quotes, just the name)
|
||||
#define CLASS_MEMBER_ID(className, functionName) #className "_" #functionName
|
||||
#define REGISTER_CLASS_MEMBER_RPC(networkObject, className, functionName) {union {void (__cdecl className::*cFunc)( RPCParameters *rpcParms ); void* voidFunc;}; cFunc=&className::functionName; networkObject->RegisterClassMemberRPC(CLASS_MEMBER_ID(className, functionName),voidFunc);}
|
||||
|
||||
/// \def UNREGISTER_AS_REMOTE_PROCEDURE_CALL
|
||||
/// \depreciated
|
||||
/// \brief Only calls UNREGISTER_STATIC_RPC
|
||||
|
||||
/// \def UNREGISTER_STATIC_RPC
|
||||
/// \ingroup RAKNET_RPC
|
||||
/// Unregisters a remote procedure call
|
||||
/// RPC member Functions MUST be marked __cdecl! See the ObjectMemberRPC example.
|
||||
/// \param[in] networkObject The object that manages the function
|
||||
/// \param[in] functionName The function name
|
||||
// 12/01/05 UNREGISTER_AS_REMOTE_PROCEDURE_CALL Renamed to UNREGISTER_STATIC_RPC. Delete the old name sometime in the future
|
||||
//#pragma deprecated(UNREGISTER_AS_REMOTE_PROCEDURE_CALL)
|
||||
//#define UNREGISTER_AS_REMOTE_PROCEDURE_CALL(networkObject,functionName) UNREGISTER_STATIC_RPC(networkObject,functionName)
|
||||
#define UNREGISTER_STATIC_RPC(networkObject,functionName) (networkObject)->UnregisterAsRemoteProcedureCall((#functionName))
|
||||
|
||||
/// \def UNREGISTER_CLASS_INST_RPC
|
||||
/// \ingroup RAKNET_RPC
|
||||
/// \brief Unregisters a member function of an instantiated object as a Remote procedure call.
|
||||
/// \param[in] networkObject The object that manages the function
|
||||
/// \param[in] className The className that was originally passed to REGISTER_AS_REMOTE_PROCEDURE_CALL
|
||||
/// \param[in] functionName The function name
|
||||
#define UNREGISTER_CLASS_MEMBER_RPC(networkObject, className, functionName) (networkObject)->UnregisterAsRemoteProcedureCall((#className "_" #functionName))
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
/// \file
|
||||
/// \brief Factory class for RakNet objects
|
||||
///
|
||||
/// This file is part of RakNet Copyright 2003 Kevin Jenkins.
|
||||
///
|
||||
/// Usage of RakNet is subject to the appropriate license agreement.
|
||||
/// Creative Commons Licensees are subject to the
|
||||
/// license found at
|
||||
/// http://creativecommons.org/licenses/by-nc/2.5/
|
||||
/// Single application licensees are subject to the license found at
|
||||
/// http://www.rakkarsoft.com/SingleApplicationLicense.html
|
||||
/// Custom license users are subject to the terms therein.
|
||||
/// GPL license users are subject to the GNU General Public
|
||||
/// License as published by the Free
|
||||
/// Software Foundation; either version 2 of the License, or (at your
|
||||
/// option) any later version.
|
||||
|
||||
#ifndef __RAK_NETWORK_FACTORY_H
|
||||
#define __RAK_NETWORK_FACTORY_H
|
||||
|
||||
#include "Export.h"
|
||||
|
||||
class RakPeerInterface;
|
||||
class ConsoleServer;
|
||||
class ReplicaManager;
|
||||
class LogCommandParser;
|
||||
class PacketLogger;
|
||||
class RakNetCommandParser;
|
||||
class RakNetTransport;
|
||||
class TelnetTransport;
|
||||
class PacketConsoleLogger;
|
||||
class PacketFileLogger;
|
||||
class Router;
|
||||
class ConnectionGraph;
|
||||
|
||||
class RAK_DLL_EXPORT RakNetworkFactory
|
||||
{
|
||||
public:
|
||||
// For DLL's, these are user classes that you might want to new and delete.
|
||||
// You can't instantiate exported classes directly in your program. The instantiation
|
||||
// has to take place inside the DLL. So these functions will do the news and deletes for you.
|
||||
// if you're using the source or static library you don't need these functions, but can use them if you want.
|
||||
static RakPeerInterface* GetRakPeerInterface( void );
|
||||
static ConsoleServer* GetConsoleServer( void );
|
||||
static ReplicaManager* GetReplicaManager( void );
|
||||
static LogCommandParser* GetLogCommandParser( void );
|
||||
static PacketLogger* GetPacketLogger( void );
|
||||
static RakNetCommandParser* GetRakNetCommandParser( void );
|
||||
static RakNetTransport* GetRakNetTransport( void );
|
||||
static TelnetTransport* GetTelnetTransport( void );
|
||||
static PacketConsoleLogger* GetPacketConsoleLogger( void );
|
||||
static PacketFileLogger* GetPacketFileLogger( void );
|
||||
static Router* GetRouter( void );
|
||||
static ConnectionGraph* GetConnectionGraph( void );
|
||||
|
||||
// To delete the object returned by the Get functions above.
|
||||
static void DestroyRakPeerInterface( RakPeerInterface* i );
|
||||
static void DestroyConsoleServer( ConsoleServer* i);
|
||||
static void DestroyReplicaManager( ReplicaManager* i);
|
||||
static void DestroyLogCommandParser( LogCommandParser* i);
|
||||
static void DestroyPacketLogger( PacketLogger* i);
|
||||
static void DestroyRakNetCommandParser( RakNetCommandParser* i );
|
||||
static void DestroyRakNetTransport( RakNetTransport* i );
|
||||
static void DestroyTelnetTransport( TelnetTransport* i );
|
||||
static void DestroyPacketConsoleLogger( PacketConsoleLogger* i );
|
||||
static void DestroyPacketFileLogger( PacketFileLogger* i );
|
||||
static void DestroyRouter( Router* i );
|
||||
static void DestroyConnectionGraph( ConnectionGraph* i );
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,488 @@
|
||||
/// \file
|
||||
/// \brief An interface for RakPeer. Simply contains all user functions as pure virtuals.
|
||||
///
|
||||
/// This file is part of RakNet Copyright 2003 Kevin Jenkins.
|
||||
///
|
||||
/// Usage of RakNet is subject to the appropriate license agreement.
|
||||
/// Creative Commons Licensees are subject to the
|
||||
/// license found at
|
||||
/// http://creativecommons.org/licenses/by-nc/2.5/
|
||||
/// Single application licensees are subject to the license found at
|
||||
/// http://www.rakkarsoft.com/SingleApplicationLicense.html
|
||||
/// Custom license users are subject to the terms therein.
|
||||
/// GPL license users are subject to the GNU General Public
|
||||
/// License as published by the Free
|
||||
/// Software Foundation; either version 2 of the License, or (at your
|
||||
/// option) any later version.
|
||||
|
||||
#ifndef __RAK_PEER_INTERFACE_H
|
||||
#define __RAK_PEER_INTERFACE_H
|
||||
|
||||
#include "PacketPriority.h"
|
||||
#include "RakNetTypes.h"
|
||||
#include "Export.h"
|
||||
|
||||
// Forward declarations
|
||||
namespace RakNet
|
||||
{
|
||||
class BitStream;
|
||||
}
|
||||
class PluginInterface;
|
||||
struct RPCMap;
|
||||
struct RakNetStatistics;
|
||||
class RouterInterface;
|
||||
class NetworkIDManager;
|
||||
|
||||
/// The primary interface for RakNet, RakPeer contains all major functions for the library.
|
||||
/// See the individual functions for what the class can do.
|
||||
/// \brief The main interface for network communications
|
||||
class RAK_DLL_EXPORT RakPeerInterface
|
||||
{
|
||||
public:
|
||||
///Destructor
|
||||
virtual ~RakPeerInterface() {}
|
||||
|
||||
// --------------------------------------------------------------------------------------------Major Low Level Functions - Functions needed by most users--------------------------------------------------------------------------------------------
|
||||
/// \brief Starts the network threads, opens the listen port.
|
||||
/// You must call this before calling Connect().
|
||||
/// Multiple calls while already active are ignored. To call this function again with different settings, you must first call Shutdown().
|
||||
/// \note Call SetMaximumIncomingConnections if you want to accept incoming connections
|
||||
/// \param[in] maxConnections The maximum number of connections between this instance of RakPeer and another instance of RakPeer. Required so the network can preallocate and for thread safety. A pure client would set this to 1. A pure server would set it to the number of allowed clients.- A hybrid would set it to the sum of both types of connections
|
||||
/// \param[in] localPort The port to listen for connections on.
|
||||
/// \param[in] _threadSleepTimer How many ms to Sleep each internal update cycle (30 to give the game priority, 0 for regular (recommended)
|
||||
/// \param[in] socketDescriptors An array of SocketDescriptor structures to force RakNet to listen on a particular IP address or port (or both). Each SocketDescriptor will represent one unique socket. Do not pass redundant structures. To listen on a specific port, you can pass SocketDescriptor(myPort,0); such as for a server. For a client, it is usually OK to just pass SocketDescriptor();
|
||||
/// \param[in] socketDescriptorCount The size of the \a socketDescriptors array. Pass 1 if you are not sure what to pass.
|
||||
/// \return False on failure (can't create socket or thread), true on success.
|
||||
virtual bool Startup( unsigned short maxConnections, int _threadSleepTimer, SocketDescriptor *socketDescriptors, unsigned socketDescriptorCount )=0;
|
||||
|
||||
/// Secures connections though a combination of SHA1, AES128, SYN Cookies, and RSA to prevent connection spoofing, replay attacks, data eavesdropping, packet tampering, and MitM attacks.
|
||||
/// There is a significant amount of processing and a slight amount of bandwidth overhead for this feature.
|
||||
/// If you accept connections, you must call this or else secure connections will not be enabled for incoming connections.
|
||||
/// If you are connecting to another system, you can call this with values for the (e and p,q) public keys before connecting to prevent MitM
|
||||
/// \pre Must be called while offline
|
||||
/// \param[in] pubKeyE A pointer to the public keys from the RSACrypt class.
|
||||
/// \param[in] pubKeyN A pointer to the public keys from the RSACrypt class.
|
||||
/// \param[in] privKeyP Public key generated from the RSACrypt class.
|
||||
/// \param[in] privKeyQ Public key generated from the RSACrypt class. If the private keys are 0, then a new key will be generated when this function is called@see the Encryption sample
|
||||
virtual void InitializeSecurity(const char *pubKeyE, const char *pubKeyN, const char *privKeyP, const char *privKeyQ )=0;
|
||||
|
||||
/// Disables all security.
|
||||
/// \note Must be called while offline
|
||||
virtual void DisableSecurity( void )=0;
|
||||
|
||||
/// Sets how many incoming connections are allowed. If this is less than the number of players currently connected,
|
||||
/// no more players will be allowed to connect. If this is greater than the maximum number of peers allowed,
|
||||
/// it will be reduced to the maximum number of peers allowed. Defaults to 0.
|
||||
/// \param[in] numberAllowed Maximum number of incoming connections allowed.
|
||||
virtual void SetMaximumIncomingConnections( unsigned short numberAllowed )=0;
|
||||
|
||||
/// Returns the value passed to SetMaximumIncomingConnections()
|
||||
/// \return the maximum number of incoming connections, which is always <= maxConnections
|
||||
virtual unsigned short GetMaximumIncomingConnections( void ) const=0;
|
||||
|
||||
/// Returns how many open connections there are at this time
|
||||
/// \return the number of open connections
|
||||
virtual unsigned short NumberOfConnections(void) const=0;
|
||||
|
||||
/// Sets the password incoming connections must match in the call to Connect (defaults to none). Pass 0 to passwordData to specify no password
|
||||
/// This is a way to set a low level password for all incoming connections. To selectively reject connections, implement your own scheme using CloseConnection() to remove unwanted connections
|
||||
/// \param[in] passwordData A data block that incoming connections must match. This can be just a password, or can be a stream of data. Specify 0 for no password data
|
||||
/// \param[in] passwordDataLength The length in bytes of passwordData
|
||||
virtual void SetIncomingPassword( const char* passwordData, int passwordDataLength )=0;
|
||||
|
||||
/// Gets the password passed to SetIncomingPassword
|
||||
/// \param[out] passwordData Should point to a block large enough to hold the password data you passed to SetIncomingPassword()
|
||||
/// \param[in,out] passwordDataLength Maximum size of the array passwordData. Modified to hold the number of bytes actually written
|
||||
virtual void GetIncomingPassword( char* passwordData, int *passwordDataLength )=0;
|
||||
|
||||
/// \brief Connect to the specified host (ip or domain name) and server port.
|
||||
/// Calling Connect and not calling SetMaximumIncomingConnections acts as a dedicated client.
|
||||
/// Calling both acts as a true peer. This is a non-blocking connection.
|
||||
/// You know the connection is successful when IsConnected() returns true or Receive() gets a message with the type identifier ID_CONNECTION_ACCEPTED.
|
||||
/// If the connection is not successful, such as a rejected connection or no response then neither of these things will happen.
|
||||
/// \pre Requires that you first call Initialize
|
||||
/// \param[in] host Either a dotted IP address or a domain name
|
||||
/// \param[in] remotePort Which port to connect to on the remote machine.
|
||||
/// \param[in] passwordData A data block that must match the data block on the server passed to SetIncomingPassword. This can be a string or can be a stream of data. Use 0 for no password.
|
||||
/// \param[in] passwordDataLength The length in bytes of passwordData
|
||||
/// \param[in] connectionSocketIndex Index into the array of socket descriptors passed to socketDescriptors in RakPeer::Startup() to send on.
|
||||
/// \return True on successful initiation. False on incorrect parameters, internal error, or too many existing peers. Returning true does not mean you connected!
|
||||
virtual bool Connect( const char* host, unsigned short remotePort, const char *passwordData, int passwordDataLength, unsigned connectionSocketIndex=0 )=0;
|
||||
|
||||
/// \brief Connect to the specified network ID (Platform specific console function)
|
||||
/// Does built-in NAt traversal
|
||||
/// \param[in] passwordData A data block that must match the data block on the server passed to SetIncomingPassword. This can be a string or can be a stream of data. Use 0 for no password.
|
||||
/// \param[in] passwordDataLength The length in bytes of passwordData
|
||||
virtual bool Console2Connect( void *networkServiceId, const char *passwordData, int passwordDataLength )=0;
|
||||
|
||||
/// \brief Stops the network threads and closes all connections.
|
||||
/// \param[in] blockDuration How long, in milliseconds, you should wait for all remaining messages to go out, including ID_DISCONNECTION_NOTIFICATION. If 0, it doesn't wait at all.
|
||||
/// \param[in] orderingChannel If blockDuration > 0, ID_DISCONNECTION_NOTIFICATION will be sent on this channel
|
||||
/// If you set it to 0 then the disconnection notification won't be sent
|
||||
virtual void Shutdown( unsigned int blockDuration, unsigned char orderingChannel=0 )=0;
|
||||
|
||||
/// Returns if the network thread is running
|
||||
/// \return true if the network thread is running, false otherwise
|
||||
virtual bool IsActive( void ) const=0;
|
||||
|
||||
/// Fills the array remoteSystems with the SystemAddress of all the systems we are connected to
|
||||
/// \param[out] remoteSystems An array of SystemAddress structures to be filled with the SystemAddresss of the systems we are connected to. Pass 0 to remoteSystems to only get the number of systems we are connected to
|
||||
/// \param[in, out] numberOfSystems As input, the size of remoteSystems array. As output, the number of elements put into the array
|
||||
virtual bool GetConnectionList( SystemAddress *remoteSystems, unsigned short *numberOfSystems ) const=0;
|
||||
|
||||
/// Sends a block of data to the specified system that you are connected to.
|
||||
/// This function only works while the connected
|
||||
/// \param[in] data The block of data to send
|
||||
/// \param[in] length The size in bytes of the data to send
|
||||
/// \param[in] priority What priority level to send on. See PacketPriority.h
|
||||
/// \param[in] reliability How reliability to send this data. See PacketPriority.h
|
||||
/// \param[in] orderingChannel When using ordered or sequenced messages, what channel to order these on. Messages are only ordered relative to other messages on the same stream
|
||||
/// \param[in] systemAddress Who to send this packet to, or in the case of broadcasting who not to send it to. Use UNASSIGNED_SYSTEM_ADDRESS to specify none
|
||||
/// \param[in] broadcast True to send this packet to all connected systems. If true, then systemAddress specifies who not to send the packet to.
|
||||
/// \return False if we are not connected to the specified recipient. True otherwise
|
||||
virtual bool Send( const char *data, const int length, PacketPriority priority, PacketReliability reliability, char orderingChannel, SystemAddress systemAddress, bool broadcast )=0;
|
||||
|
||||
/// Sends a block of data to the specified system that you are connected to. Same as the above version, but takes a BitStream as input.
|
||||
/// \param[in] bitStream The bitstream to send
|
||||
/// \param[in] priority What priority level to send on. See PacketPriority.h
|
||||
/// \param[in] reliability How reliability to send this data. See PacketPriority.h
|
||||
/// \param[in] orderingChannel When using ordered or sequenced messages, what channel to order these on. Messages are only ordered relative to other messages on the same stream
|
||||
/// \param[in] systemAddress Who to send this packet to, or in the case of broadcasting who not to send it to. Use UNASSIGNED_SYSTEM_ADDRESS to specify none
|
||||
/// \param[in] broadcast True to send this packet to all connected systems. If true, then systemAddress specifies who not to send the packet to.
|
||||
/// \return False if we are not connected to the specified recipient. True otherwise
|
||||
virtual bool Send( const RakNet::BitStream * bitStream, PacketPriority priority, PacketReliability reliability, char orderingChannel, SystemAddress systemAddress, bool broadcast )=0;
|
||||
|
||||
/// Gets a message from the incoming message queue.
|
||||
/// Use DeallocatePacket() to deallocate the message after you are done with it.
|
||||
/// User-thread functions, such as RPC calls and the plugin function PluginInterface::Update occur here.
|
||||
/// \return 0 if no packets are waiting to be handled, otherwise a pointer to a packet.
|
||||
/// sa RakNetTypes.h contains struct Packet
|
||||
virtual Packet* Receive( void )=0;
|
||||
|
||||
/// Call this to deallocate a message returned by Receive() when you are done handling it.
|
||||
/// \param[in] packet The message to deallocate.
|
||||
virtual void DeallocatePacket( Packet *packet )=0;
|
||||
|
||||
/// Return the total number of connections we are allowed
|
||||
// TODO - rename for RakNet 3.0
|
||||
virtual unsigned short GetMaximumNumberOfPeers( void ) const=0;
|
||||
|
||||
// --------------------------------------------------------------------------------------------Remote Procedure Call Functions - Functions to initialize and perform RPC--------------------------------------------------------------------------------------------
|
||||
/// \ingroup RAKNET_RPC
|
||||
/// Register a C or static member function as available for calling as a remote procedure call
|
||||
/// \param[in] uniqueID A null-terminated unique string to identify this procedure. See RegisterClassMemberRPC() for class member functions.
|
||||
/// \param[in] functionPointer(...) The name of the function to be used as a function pointer. This can be called whether active or not, and registered functions stay registered unless unregistered
|
||||
virtual void RegisterAsRemoteProcedureCall( const char* uniqueID, void ( *functionPointer ) ( RPCParameters *rpcParms ) )=0;
|
||||
|
||||
/// \ingroup RAKNET_RPC
|
||||
/// Register a C++ member function as available for calling as a remote procedure call.
|
||||
/// \param[in] uniqueID A null terminated string to identify this procedure. Recommended you use the macro REGISTER_CLASS_MEMBER_RPC to create the string. Use RegisterAsRemoteProcedureCall() for static functions.
|
||||
/// \param[in] functionPointer The name of the function to be used as a function pointer. This can be called whether active or not, and registered functions stay registered unless unregistered with UnregisterAsRemoteProcedureCall
|
||||
/// \sa The sample ObjectMemberRPC.cpp
|
||||
virtual void RegisterClassMemberRPC( const char* uniqueID, void *functionPointer )=0;
|
||||
|
||||
/// \ingroup RAKNET_RPC
|
||||
/// Unregisters a C function as available for calling as a remote procedure call that was formerly registered with RegisterAsRemoteProcedureCall. Only call offline.
|
||||
/// \param[in] uniqueID A string of only letters to identify this procedure. Recommended you use the macro CLASS_MEMBER_ID for class member functions.
|
||||
virtual void UnregisterAsRemoteProcedureCall( const char* uniqueID )=0;
|
||||
|
||||
/// \ingroup RAKNET_RPC
|
||||
/// Used by Object member RPC to lookup objects given that object's ID
|
||||
/// Also used by the ReplicaManager plugin
|
||||
/// \param[in] An instance of NetworkIDManager to use for the lookup.
|
||||
virtual void SetNetworkIDManager( NetworkIDManager *manager )=0;
|
||||
|
||||
/// \return Returns the value passed to SetNetworkIDManager or 0 if never called.
|
||||
virtual NetworkIDManager *GetNetworkIDManager(void) const=0;
|
||||
|
||||
/// \ingroup RAKNET_RPC
|
||||
/// Calls a C function on the remote system that was already registered using RegisterAsRemoteProcedureCall().
|
||||
/// \param[in] uniqueID A NULL terminated string identifying the function to call. Recommended you use the macro CLASS_MEMBER_ID for class member functions.
|
||||
/// \param[in] data The data to send
|
||||
/// \param[in] bitLength The number of bits of \a data
|
||||
/// \param[in] priority What priority level to send on. See PacketPriority.h.
|
||||
/// \param[in] reliability How reliability to send this data. See PacketPriority.h.
|
||||
/// \param[in] orderingChannel When using ordered or sequenced message, what channel to order these on.
|
||||
/// \param[in] systemAddress Who to send this message to, or in the case of broadcasting who not to send it to. Use UNASSIGNED_SYSTEM_ADDRESS to specify none
|
||||
/// \param[in] broadcast True to send this packet to all connected systems. If true, then systemAddress specifies who not to send the packet to.
|
||||
/// \param[in] includedTimestamp Pass a timestamp if you wish, to be adjusted in the usual fashion as per ID_TIMESTAMP. Pass 0 to not include a timestamp.
|
||||
/// \param[in] networkID For static functions, pass UNASSIGNED_NETWORK_ID. For member functions, you must derive from NetworkIDObject and pass the value returned by NetworkIDObject::GetNetworkID for that object.
|
||||
/// \param[in] replyFromTarget If 0, this function is non-blocking. Otherwise it will block while waiting for a reply from the target procedure, which should be remotely written to RPCParameters::replyToSender and copied to replyFromTarget. The block will return early on disconnect or if the sent packet is unreliable and more than 3X the ping has elapsed.
|
||||
/// \return True on a successful packet send (this does not indicate the recipient performed the call), false on failure
|
||||
virtual bool RPC( const char* uniqueID, const char *data, unsigned int bitLength, PacketPriority priority, PacketReliability reliability, char orderingChannel, SystemAddress systemAddress, bool broadcast, RakNetTime *includedTimestamp, NetworkID networkID, RakNet::BitStream *replyFromTarget )=0;
|
||||
|
||||
/// \ingroup RAKNET_RPC
|
||||
/// Calls a C function on the remote system that was already registered using RegisterAsRemoteProcedureCall.
|
||||
/// If you want that function to return data you should call RPC from that system in the same wayReturns true on a successful packet
|
||||
/// send (this does not indicate the recipient performed the call), false on failure
|
||||
/// \param[in] uniqueID A NULL terminated string identifying the function to call. Recommended you use the macro CLASS_MEMBER_ID for class member functions.
|
||||
/// \param[in] data The data to send
|
||||
/// \param[in] bitLength The number of bits of \a data
|
||||
/// \param[in] priority What priority level to send on. See PacketPriority.h.
|
||||
/// \param[in] reliability How reliability to send this data. See PacketPriority.h.
|
||||
/// \param[in] orderingChannel When using ordered or sequenced message, what channel to order these on.
|
||||
/// \param[in] systemAddress Who to send this message to, or in the case of broadcasting who not to send it to. Use UNASSIGNED_SYSTEM_ADDRESS to specify none
|
||||
/// \param[in] broadcast True to send this packet to all connected systems. If true, then systemAddress specifies who not to send the packet to.
|
||||
/// \param[in] includedTimestamp Pass a timestamp if you wish, to be adjusted in the usual fashion as per ID_TIMESTAMP. Pass 0 to not include a timestamp.
|
||||
/// \param[in] networkID For static functions, pass UNASSIGNED_NETWORK_ID. For member functions, you must derive from NetworkIDObject and pass the value returned by NetworkIDObject::GetNetworkID for that object.
|
||||
/// \param[in] replyFromTarget If 0, this function is non-blocking. Otherwise it will block while waiting for a reply from the target procedure, which should be remotely written to RPCParameters::replyToSender and copied to replyFromTarget. The block will return early on disconnect or if the sent packet is unreliable and more than 3X the ping has elapsed.
|
||||
/// \return True on a successful packet send (this does not indicate the recipient performed the call), false on failure
|
||||
virtual bool RPC( const char* uniqueID, const RakNet::BitStream *bitStream, PacketPriority priority, PacketReliability reliability, char orderingChannel, SystemAddress systemAddress, bool broadcast, RakNetTime *includedTimestamp, NetworkID networkID, RakNet::BitStream *replyFromTarget )=0;
|
||||
|
||||
// -------------------------------------------------------------------------------------------- Connection Management Functions--------------------------------------------------------------------------------------------
|
||||
/// Close the connection to another host (if we initiated the connection it will disconnect, if they did it will kick them out).
|
||||
/// \param[in] target Which system to close the connection to.
|
||||
/// \param[in] sendDisconnectionNotification True to send ID_DISCONNECTION_NOTIFICATION to the recipient. False to close it silently.
|
||||
/// \param[in] channel Which ordering channel to send the disconnection notification on, if any
|
||||
virtual void CloseConnection( const SystemAddress target, bool sendDisconnectionNotification, unsigned char orderingChannel=0 )=0;
|
||||
|
||||
/// Returns if a particular systemAddress is connected to us
|
||||
/// \param[in] systemAddress The SystemAddress we are referring to
|
||||
/// \return True if this system is connected and active, false otherwise.
|
||||
virtual bool IsConnected(const SystemAddress systemAddress)=0;
|
||||
|
||||
/// Given a systemAddress, returns an index from 0 to the maximum number of players allowed - 1.
|
||||
/// \param[in] systemAddress The SystemAddress we are referring to
|
||||
/// \return The index of this SystemAddress or -1 on system not found.
|
||||
virtual int GetIndexFromSystemAddress( const SystemAddress systemAddress )=0;
|
||||
|
||||
/// This function is only useful for looping through all systems
|
||||
/// Given an index, will return a SystemAddress.
|
||||
/// \param[in] index Index should range between 0 and the maximum number of players allowed - 1.
|
||||
/// \return The SystemAddress
|
||||
virtual SystemAddress GetSystemAddressFromIndex( int index )=0;
|
||||
|
||||
/// Bans an IP from connecting. Banned IPs persist between connections but are not saved on shutdown nor loaded on startup.
|
||||
/// param[in] IP Dotted IP address. Can use * as a wildcard, such as 128.0.0.* will ban all IP addresses starting with 128.0.0
|
||||
/// \param[in] milliseconds how many ms for a temporary ban. Use 0 for a permanent ban
|
||||
virtual void AddToBanList( const char *IP, RakNetTime milliseconds=0 )=0;
|
||||
|
||||
/// Allows a previously banned IP to connect.
|
||||
/// param[in] Dotted IP address. Can use * as a wildcard, such as 128.0.0.* will banAll IP addresses starting with 128.0.0
|
||||
virtual void RemoveFromBanList( const char *IP )=0;
|
||||
|
||||
/// Allows all previously banned IPs to connect.
|
||||
virtual void ClearBanList( void )=0;
|
||||
|
||||
/// Returns true or false indicating if a particular IP is banned.
|
||||
/// \param[in] IP - Dotted IP address.
|
||||
/// \return true if IP matches any IPs in the ban list, accounting for any wildcards. False otherwise.
|
||||
virtual bool IsBanned( const char *IP )=0;
|
||||
|
||||
// --------------------------------------------------------------------------------------------Pinging Functions - Functions dealing with the automatic ping mechanism--------------------------------------------------------------------------------------------
|
||||
/// Send a ping to the specified connected system.
|
||||
/// \pre The sender and recipient must already be started via a successful call to Startup()
|
||||
/// \param[in] target Which system to ping
|
||||
virtual void Ping( const SystemAddress target )=0;
|
||||
|
||||
/// Send a ping to the specified unconnected system. The remote system, if it is Initialized, will respond with ID_PONG followed by sizeof(RakNetTime) containing the system time the ping was sent.(Default is 4 bytes - See __GET_TIME_64BIT in RakNetTypes.h
|
||||
/// \param[in] host Either a dotted IP address or a domain name. Can be 255.255.255.255 for LAN broadcast.
|
||||
/// \param[in] remotePort Which port to connect to on the remote machine.
|
||||
/// \param[in] onlyReplyOnAcceptingConnections Only request a reply if the remote system is accepting connections
|
||||
/// \param[in] connectionSocketIndex Index into the array of socket descriptors passed to socketDescriptors in RakPeer::Startup() to send on.
|
||||
virtual void Ping( const char* host, unsigned short remotePort, bool onlyReplyOnAcceptingConnections, unsigned connectionSocketIndex=0 )=0;
|
||||
|
||||
/// Returns the average of all ping times read for the specific system or -1 if none read yet
|
||||
/// \param[in] systemAddress Which system we are referring to
|
||||
/// \return The ping time for this system, or -1
|
||||
virtual int GetAveragePing( const SystemAddress systemAddress )=0;
|
||||
|
||||
/// Returns the last ping time read for the specific system or -1 if none read yet
|
||||
/// \param[in] systemAddress Which system we are referring to
|
||||
/// \return The last ping time for this system, or -1
|
||||
virtual int GetLastPing( const SystemAddress systemAddress ) const=0;
|
||||
|
||||
/// Returns the lowest ping time read or -1 if none read yet
|
||||
/// \param[in] systemAddress Which system we are referring to
|
||||
/// \return The lowest ping time for this system, or -1
|
||||
virtual int GetLowestPing( const SystemAddress systemAddress ) const=0;
|
||||
|
||||
/// Ping the remote systems every so often, or not. This is off by default. Can be called anytime.
|
||||
/// \param[in] doPing True to start occasional pings. False to stop them.
|
||||
virtual void SetOccasionalPing( bool doPing )=0;
|
||||
|
||||
// --------------------------------------------------------------------------------------------Static Data Functions - Functions dealing with API defined synchronized memory--------------------------------------------------------------------------------------------
|
||||
/// Sets the data to send along with a LAN server discovery or offline ping reply.
|
||||
/// \a length should be under 400 bytes, as a security measure against flood attacks
|
||||
/// \param[in] data a block of data to store, or 0 for none
|
||||
/// \param[in] length The length of data in bytes, or 0 for none
|
||||
/// \sa Ping.cpp
|
||||
virtual void SetOfflinePingResponse( const char *data, const unsigned int length )=0;
|
||||
|
||||
//--------------------------------------------------------------------------------------------Network Functions - Functions dealing with the network in general--------------------------------------------------------------------------------------------
|
||||
/// Return the unique address identifier that represents you on the the network and is based on your local IP / port.
|
||||
/// \return the identifier of your system internally, which may not be how other systems see if you if you are behind a NAT or proxy
|
||||
virtual SystemAddress GetInternalID( const SystemAddress systemAddress=UNASSIGNED_SYSTEM_ADDRESS ) const=0;
|
||||
|
||||
/// Return the unique address identifier that represents you on the the network and is based on your externalIP / port
|
||||
/// (the IP / port the specified player uses to communicate with you)
|
||||
/// \param[in] target Which remote system you are referring to for your external ID. Usually the same for all systems, unless you have two or more network cards.
|
||||
virtual SystemAddress GetExternalID( const SystemAddress target ) const=0;
|
||||
|
||||
/// Set the time, in MS, to use before considering ourselves disconnected after not being able to deliver a reliable message.
|
||||
/// Default time is 10,000 or 10 seconds in release and 30,000 or 30 seconds in debug.
|
||||
/// \param[in] timeMS Time, in MS
|
||||
/// \param[in] target Which system to do this for
|
||||
virtual void SetTimeoutTime( RakNetTime timeMS, const SystemAddress target )=0;
|
||||
|
||||
/// Set the MTU per datagram. It's important to set this correctly - otherwise packets will be needlessly split, decreasing performance and throughput.
|
||||
/// Maximum allowed size is MAXIMUM_MTU_SIZE.
|
||||
/// Too high of a value will cause packets not to arrive at worst and be fragmented at best.
|
||||
/// Too low of a value will split packets unnecessarily.
|
||||
/// Recommended size is 1500
|
||||
/// sa MTUSize.h
|
||||
/// \param[in] size The MTU size
|
||||
/// \pre Can only be called when not connected.
|
||||
/// \return false on failure (we are connected), else true
|
||||
virtual bool SetMTUSize( int size )=0;
|
||||
|
||||
/// Returns the current MTU size
|
||||
/// \param[in] target Which system to get this for. UNASSIGNED_SYSTEM_ADDRESS to get the default
|
||||
/// \return The current MTU size
|
||||
virtual int GetMTUSize( const SystemAddress target ) const=0;
|
||||
|
||||
/// Returns the number of IP addresses this system has internally. Get the actual addresses from GetLocalIP()
|
||||
virtual unsigned GetNumberOfAddresses( void )=0;
|
||||
|
||||
/// Returns an IP address at index 0 to GetNumberOfAddresses-1
|
||||
virtual const char* GetLocalIP( unsigned int index )=0;
|
||||
|
||||
/// Allow or disallow connection responses from any IP. Normally this should be false, but may be necessary
|
||||
/// when connecting to servers with multiple IP addresses.
|
||||
/// \param[in] allow - True to allow this behavior, false to not allow. Defaults to false. Value persists between connections
|
||||
virtual void AllowConnectionResponseIPMigration( bool allow )=0;
|
||||
|
||||
/// Sends a one byte message ID_ADVERTISE_SYSTEM to the remote unconnected system.
|
||||
/// This will tell the remote system our external IP outside the LAN along with some user data.
|
||||
/// \pre The sender and recipient must already be started via a successful call to Initialize
|
||||
/// \param[in] host Either a dotted IP address or a domain name
|
||||
/// \param[in] remotePort Which port to connect to on the remote machine.
|
||||
/// \param[in] data Optional data to append to the packet.
|
||||
/// \param[in] dataLength length of data in bytes. Use 0 if no data.
|
||||
/// \param[in] connectionSocketIndex Index into the array of socket descriptors passed to socketDescriptors in RakPeer::Startup() to send on.
|
||||
virtual void AdvertiseSystem( const char *host, unsigned short remotePort, const char *data, int dataLength, unsigned connectionSocketIndex=0 )=0;
|
||||
|
||||
/// Controls how often to return ID_DOWNLOAD_PROGRESS for large message downloads.
|
||||
/// ID_DOWNLOAD_PROGRESS is returned to indicate a new partial message chunk, roughly the MTU size, has arrived
|
||||
/// As it can be slow or cumbersome to get this notification for every chunk, you can set the interval at which it is returned.
|
||||
/// Defaults to 0 (never return this notification)
|
||||
/// \param[in] interval How many messages to use as an interval
|
||||
virtual void SetSplitMessageProgressInterval(int interval)=0;
|
||||
|
||||
/// Set how long to wait before giving up on sending an unreliable message
|
||||
/// Useful if the network is clogged up.
|
||||
/// Set to 0 or less to never timeout. Defaults to 0.
|
||||
/// \param[in] timeoutMS How many ms to wait before simply not sending an unreliable message.
|
||||
virtual void SetUnreliableTimeout(RakNetTime timeoutMS)=0;
|
||||
|
||||
/// Send a message to host, with the IP socket option TTL set to 1
|
||||
/// This message will not reach the host, but will open the router.
|
||||
/// Used for NAT-Punchthrough
|
||||
virtual void SendTTL1( const char* host, unsigned short remotePort, unsigned connectionSocketIndex=0 )=0;
|
||||
|
||||
// --------------------------------------------------------------------------------------------Compression Functions - Functions related to the compression layer--------------------------------------------------------------------------------------------
|
||||
/// Enables or disables frequency table tracking. This is required to get a frequency table, which is used in GenerateCompressionLayer()
|
||||
/// This value persists between connect calls and defaults to false (no frequency tracking)
|
||||
/// \pre You can call this at any time - however you SHOULD only call it when disconnected. Otherwise you will only trackpart of the values sent over the network.
|
||||
/// \param[in] doCompile True to enable tracking
|
||||
virtual void SetCompileFrequencyTable( bool doCompile )=0;
|
||||
|
||||
/// Returns the frequency of outgoing bytes into output frequency table
|
||||
/// The purpose is to save to file as either a master frequency table from a sample game session for passing to
|
||||
/// GenerateCompressionLayer()
|
||||
/// \pre You should only call this when disconnected. Requires that you first enable data frequency tracking by calling SetCompileFrequencyTable(true)
|
||||
/// \param[out] outputFrequencyTable The frequency of each corresponding byte
|
||||
/// \return False (failure) if connected or if frequency table tracking is not enabled. Otherwise true (success)
|
||||
virtual bool GetOutgoingFrequencyTable( unsigned int outputFrequencyTable[ 256 ] )=0;
|
||||
|
||||
/// This is an optional function to generate the compression layer based on the input frequency table.
|
||||
/// If you want to use it you should call this twice - once with inputLayer as true and once as false.
|
||||
/// The frequency table passed here with inputLayer=true should match the frequency table on the recipient with inputLayer=false.
|
||||
/// Likewise, the frequency table passed here with inputLayer=false should match the frequency table on the recipient with inputLayer=true.
|
||||
/// Calling this function when there is an existing layer will overwrite the old layer.
|
||||
/// \pre You should only call this when disconnected
|
||||
/// \param[in] inputFrequencyTable A frequency table for your data
|
||||
/// \param[in] inputLayer Is this the input layer?
|
||||
/// \return false (failure) if connected. Otherwise true (success)
|
||||
/// \sa Compression.cpp
|
||||
virtual bool GenerateCompressionLayer( unsigned int inputFrequencyTable[ 256 ], bool inputLayer )=0;
|
||||
|
||||
/// Delete the output or input layer as specified. This is not necessary to call and is only valuable for freeing memory.
|
||||
/// \pre You should only call this when disconnected
|
||||
/// \param[in] inputLayer True to mean the inputLayer, false to mean the output layer
|
||||
/// \return false (failure) if connected. Otherwise true (success)
|
||||
virtual bool DeleteCompressionLayer( bool inputLayer )=0;
|
||||
|
||||
/// Returns the compression ratio. A low compression ratio is good. Compression is for outgoing data
|
||||
/// \return The compression ratio
|
||||
virtual float GetCompressionRatio( void ) const=0;
|
||||
|
||||
///Returns the decompression ratio. A high decompression ratio is good. Decompression is for incoming data
|
||||
/// \return The decompression ratio
|
||||
virtual float GetDecompressionRatio( void ) const=0;
|
||||
|
||||
// -------------------------------------------------------------------------------------------- Plugin Functions--------------------------------------------------------------------------------------------
|
||||
/// Attatches a Plugin interface to run code automatically on message receipt in the Receive call
|
||||
/// \note If plugins have dependencies on each other then the order does matter - for example the router plugin should go first because it might route messages for other plugins
|
||||
/// \param[in] messageHandler Pointer to a plugin to attach
|
||||
virtual void AttachPlugin( PluginInterface *plugin )=0;
|
||||
|
||||
/// Detaches a Plugin interface to run code automatically on message receipt
|
||||
/// \param[in] messageHandler Pointer to a plugin to detach
|
||||
virtual void DetachPlugin( PluginInterface *messageHandler )=0;
|
||||
|
||||
// --------------------------------------------------------------------------------------------Miscellaneous Functions--------------------------------------------------------------------------------------------
|
||||
/// Put a message back at the end of the receive queue in case you don't want to deal with it immediately
|
||||
/// \param[in] packet The packet you want to push back.
|
||||
/// \param[in] pushAtHead True to push the packet so that the next receive call returns it. False to push it at the end of the queue (obviously pushing it at the end makes the packets out of order)
|
||||
virtual void PushBackPacket( Packet *packet, bool pushAtHead )=0;
|
||||
|
||||
/// \Internal
|
||||
// \param[in] routerInterface The router to use to route messages to systems not directly connected to this system.
|
||||
virtual void SetRouterInterface( RouterInterface *routerInterface )=0;
|
||||
|
||||
/// \Internal
|
||||
// \param[in] routerInterface The router to use to route messages to systems not directly connected to this system.
|
||||
virtual void RemoveRouterInterface( RouterInterface *routerInterface )=0;
|
||||
|
||||
/// \Returns a packet for you to write to if you want to create a Packet for some reason.
|
||||
/// You can add it to the receive buffer with PushBackPacket
|
||||
/// \param[in] dataSize How many bytes to allocate for the buffer
|
||||
/// \return A packet you can write to
|
||||
virtual Packet* AllocatePacket(unsigned dataSize)=0;
|
||||
|
||||
// --------------------------------------------------------------------------------------------Network Simulator Functions--------------------------------------------------------------------------------------------
|
||||
/// Adds simulated ping and packet loss to the outgoing data flow.
|
||||
/// To simulate bi-directional ping and packet loss, you should call this on both the sender and the recipient, with half the total ping and maxSendBPS value on each.
|
||||
/// You can exclude network simulator code with the _RELEASE #define to decrease code size
|
||||
/// \param[in] maxSendBPS Maximum bits per second to send. Packetloss grows linearly. 0 to disable. (CURRENTLY BROKEN - ALWAYS DISABLED)
|
||||
/// \param[in] minExtraPing The minimum time to delay sends.
|
||||
virtual void ApplyNetworkSimulator( double maxSendBPS, unsigned short minExtraPing, unsigned short extraPingVariance)=0;
|
||||
|
||||
/// Limits how much outgoing bandwidth can be sent per-connection.
|
||||
/// This limit does not apply to the sum of all connections!
|
||||
/// Exceeding the limit queues up outgoing traffic
|
||||
/// \param[in] maxBitsPerSecond Maximum bits per second to send. Use 0 for unlimited (default). Once set, it takes effect immedately and persists until called again.
|
||||
virtual void SetPerConnectionOutgoingBandwidthLimit( unsigned maxBitsPerSecond )=0;
|
||||
|
||||
/// Returns if you previously called ApplyNetworkSimulator
|
||||
/// \return If you previously called ApplyNetworkSimulator
|
||||
virtual bool IsNetworkSimulatorActive( void )=0;
|
||||
|
||||
// --------------------------------------------------------------------------------------------Statistical Functions - Functions dealing with API performance--------------------------------------------------------------------------------------------
|
||||
|
||||
/// Returns a structure containing a large set of network statistics for the specified system.
|
||||
/// You can map this data to a string using the C style StatisticsToString() function
|
||||
/// \param[in] systemAddress: Which connected system to get statistics for
|
||||
/// \return 0 on can't find the specified system. A pointer to a set of data otherwise.
|
||||
/// \sa RakNetStatistics.h
|
||||
virtual RakNetStatistics * const GetStatistics( const SystemAddress systemAddress )=0;
|
||||
|
||||
// --------------------------------------------------------------------------------------------EVERYTHING AFTER THIS COMMENT IS FOR INTERNAL USE ONLY--------------------------------------------------------------------------------------------
|
||||
/// \internal
|
||||
virtual char *GetRPCString( const char *data, const unsigned int bitSize, const SystemAddress systemAddress)=0;
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,6 @@
|
||||
#ifndef __RAK_SLEEP_H
|
||||
#define __RAK_SLEEP_H
|
||||
|
||||
void RakSleep(unsigned int ms);
|
||||
|
||||
#endif
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,677 @@
|
||||
|
||||
#include "MessageIdentifiers.h"
|
||||
#include "RakNetworkFactory.h"
|
||||
#include "RakPeerInterface.h"
|
||||
#include "RakNetStatistics.h"
|
||||
#include "RakNetTypes.h"
|
||||
|
||||
#include "BitStream.h"
|
||||
#include "RakSleep.h"
|
||||
#include <assert.h>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "types.h"
|
||||
#include "gamesettings.h"
|
||||
|
||||
char kbag[100];
|
||||
char net_div[30];
|
||||
INT32 gsMAX_MERCS;
|
||||
bool gsMORALE;
|
||||
int gsREPORT_NAME;
|
||||
|
||||
#include "text.h"
|
||||
#include "connect.h"
|
||||
#include "message.h"
|
||||
#include "network.h"
|
||||
#include "overhead.h"
|
||||
|
||||
UINT16 nc; //number of open connection
|
||||
UINT16 ncr; //number of ready confirmed connections
|
||||
//something keep record of ready connections ..
|
||||
int mercs_ready[255];
|
||||
|
||||
bool gsDis_Bobby;
|
||||
bool gsDis_Equip;
|
||||
|
||||
int gsSAME_MERC;
|
||||
float gsDAMAGE_MULTIPLIER;
|
||||
int gsINTERRUPTS ;
|
||||
int gsMAX_CLIENTS ;
|
||||
int gsPLAYER_BSIDE;
|
||||
int gsTESTING;
|
||||
|
||||
INT32 gssecs_per_tick;
|
||||
INT32 gsstarting_balance;
|
||||
float TIME;
|
||||
int sWEAPON_READIED_BONUS;
|
||||
|
||||
unsigned char SGetPacketIdentifier(Packet *p);
|
||||
unsigned char SpacketIdentifier;
|
||||
|
||||
RakPeerInterface *server;
|
||||
|
||||
int numreadyteams;
|
||||
int readyteamreg[10];
|
||||
|
||||
SystemAddress blank;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
SystemAddress address;
|
||||
int cl_number;
|
||||
|
||||
}client_data;
|
||||
|
||||
client_data client_d[4];
|
||||
|
||||
// use UNASSIGNED_SYSTEM_ADDRESS instead of rpcParameters->sender to send it back to yourself (the sender)
|
||||
// there is very little in here dependant on the game engine and originally started out as an independant dedicated server .exe, and could if go ther again ... hayden.
|
||||
//********* RPC SECTION ************
|
||||
|
||||
void sendPATH(RPCParameters *rpcParameters)
|
||||
{
|
||||
server->RPC("recievePATH",(const char*)rpcParameters->input, (*rpcParameters).numberOfBitsOfData, HIGH_PRIORITY, RELIABLE, 0, rpcParameters->sender, true, 0, UNASSIGNED_NETWORK_ID,0);
|
||||
}
|
||||
|
||||
void sendSTANCE(RPCParameters *rpcParameters)
|
||||
{
|
||||
server->RPC("recieveSTANCE",(const char*)rpcParameters->input, (*rpcParameters).numberOfBitsOfData, HIGH_PRIORITY, RELIABLE, 0, rpcParameters->sender, true, 0, UNASSIGNED_NETWORK_ID,0);
|
||||
}
|
||||
|
||||
void sendDIR(RPCParameters *rpcParameters)
|
||||
{
|
||||
server->RPC("recieveDIR",(const char*)rpcParameters->input, (*rpcParameters).numberOfBitsOfData, HIGH_PRIORITY, RELIABLE, 0, rpcParameters->sender, true, 0, UNASSIGNED_NETWORK_ID,0);
|
||||
}
|
||||
|
||||
void sendFIRE(RPCParameters *rpcParameters)
|
||||
{
|
||||
server->RPC("recieveFIRE",(const char*)rpcParameters->input, (*rpcParameters).numberOfBitsOfData, HIGH_PRIORITY, RELIABLE, 0, rpcParameters->sender, true, 0, UNASSIGNED_NETWORK_ID,0);
|
||||
}
|
||||
|
||||
void sendHIT(RPCParameters *rpcParameters)
|
||||
{
|
||||
server->RPC("recieveHIT",(const char*)rpcParameters->input, (*rpcParameters).numberOfBitsOfData, HIGH_PRIORITY, RELIABLE, 0, rpcParameters->sender, true, 0, UNASSIGNED_NETWORK_ID,0);
|
||||
}
|
||||
|
||||
void sendHIRE(RPCParameters *rpcParameters)
|
||||
{
|
||||
server->RPC("recieveHIRE",(const char*)rpcParameters->input, (*rpcParameters).numberOfBitsOfData, HIGH_PRIORITY, RELIABLE, 0, rpcParameters->sender, true, 0, UNASSIGNED_NETWORK_ID,0);
|
||||
}
|
||||
|
||||
void sendguiPOS(RPCParameters *rpcParameters)
|
||||
{
|
||||
server->RPC("recieveguiPOS",(const char*)rpcParameters->input, (*rpcParameters).numberOfBitsOfData, HIGH_PRIORITY, RELIABLE, 0, rpcParameters->sender, true, 0, UNASSIGNED_NETWORK_ID,0);
|
||||
}
|
||||
|
||||
void sendguiDIR(RPCParameters *rpcParameters)
|
||||
{
|
||||
server->RPC("recieveguiDIR",(const char*)rpcParameters->input, (*rpcParameters).numberOfBitsOfData, HIGH_PRIORITY, RELIABLE, 0, rpcParameters->sender, true, 0, UNASSIGNED_NETWORK_ID,0);
|
||||
}
|
||||
|
||||
void sendEndTurn(RPCParameters *rpcParameters)
|
||||
{
|
||||
server->RPC("recieveEndTurn",(const char*)rpcParameters->input, (*rpcParameters).numberOfBitsOfData, HIGH_PRIORITY, RELIABLE, 0, rpcParameters->sender, true, 0, UNASSIGNED_NETWORK_ID,0);
|
||||
}
|
||||
|
||||
void sendAI(RPCParameters *rpcParameters)
|
||||
{
|
||||
server->RPC("recieveAI",(const char*)rpcParameters->input, (*rpcParameters).numberOfBitsOfData, HIGH_PRIORITY, RELIABLE, 0, rpcParameters->sender, true, 0, UNASSIGNED_NETWORK_ID,0);
|
||||
}
|
||||
|
||||
void sendSTOP(RPCParameters *rpcParameters)
|
||||
{
|
||||
server->RPC("recieveSTOP",(const char*)rpcParameters->input, (*rpcParameters).numberOfBitsOfData, HIGH_PRIORITY, RELIABLE, 0, rpcParameters->sender, true, 0, UNASSIGNED_NETWORK_ID,0);
|
||||
}
|
||||
void sendINTERRUPT(RPCParameters *rpcParameters)
|
||||
{
|
||||
server->RPC("recieveINTERRUPT",(const char*)rpcParameters->input, (*rpcParameters).numberOfBitsOfData, HIGH_PRIORITY, RELIABLE, 0, rpcParameters->sender, true, 0, UNASSIGNED_NETWORK_ID,0);
|
||||
}
|
||||
void sendREADY(RPCParameters *rpcParameters)
|
||||
{
|
||||
server->RPC("recieveREADY",(const char*)rpcParameters->input, (*rpcParameters).numberOfBitsOfData, HIGH_PRIORITY, RELIABLE, 0, rpcParameters->sender, true, 0, UNASSIGNED_NETWORK_ID,0);
|
||||
}
|
||||
|
||||
void sendGUI(RPCParameters *rpcParameters)
|
||||
{
|
||||
server->RPC("recieveGUI",(const char*)rpcParameters->input, (*rpcParameters).numberOfBitsOfData, HIGH_PRIORITY, RELIABLE, 0, rpcParameters->sender, true, 0, UNASSIGNED_NETWORK_ID,0);
|
||||
}
|
||||
|
||||
void sendBULLET(RPCParameters *rpcParameters)
|
||||
{
|
||||
server->RPC("recieveBULLET",(const char*)rpcParameters->input, (*rpcParameters).numberOfBitsOfData, HIGH_PRIORITY, RELIABLE, 0, rpcParameters->sender, true, 0, UNASSIGNED_NETWORK_ID,0);
|
||||
}
|
||||
|
||||
void sendSTATE(RPCParameters *rpcParameters)
|
||||
{
|
||||
server->RPC("recieveSTATE",(const char*)rpcParameters->input, (*rpcParameters).numberOfBitsOfData, HIGH_PRIORITY, RELIABLE, 0, rpcParameters->sender, true, 0, UNASSIGNED_NETWORK_ID,0);
|
||||
}
|
||||
void sendDEATH(RPCParameters *rpcParameters)
|
||||
{
|
||||
server->RPC("recieveDEATH",(const char*)rpcParameters->input, (*rpcParameters).numberOfBitsOfData, HIGH_PRIORITY, RELIABLE, 0, rpcParameters->sender, true, 0, UNASSIGNED_NETWORK_ID,0);
|
||||
}
|
||||
void sendhitSTRUCT(RPCParameters *rpcParameters)
|
||||
{
|
||||
server->RPC("recievehitSTRUCT",(const char*)rpcParameters->input, (*rpcParameters).numberOfBitsOfData, HIGH_PRIORITY, RELIABLE, 0, rpcParameters->sender, true, 0, UNASSIGNED_NETWORK_ID,0);
|
||||
}
|
||||
void sendhitWINDOW(RPCParameters *rpcParameters)
|
||||
{
|
||||
server->RPC("recievehitWINDOW",(const char*)rpcParameters->input, (*rpcParameters).numberOfBitsOfData, HIGH_PRIORITY, RELIABLE, 0, rpcParameters->sender, true, 0, UNASSIGNED_NETWORK_ID,0);
|
||||
}
|
||||
void sendMISS(RPCParameters *rpcParameters)
|
||||
{
|
||||
server->RPC("recieveMISS",(const char*)rpcParameters->input, (*rpcParameters).numberOfBitsOfData, HIGH_PRIORITY, RELIABLE, 0, rpcParameters->sender, true, 0, UNASSIGNED_NETWORK_ID,0);
|
||||
}
|
||||
void updatenetworksoldier(RPCParameters *rpcParameters)
|
||||
{
|
||||
server->RPC("UpdateSoldierFromNetwork",(const char*)rpcParameters->input, (*rpcParameters).numberOfBitsOfData, HIGH_PRIORITY, RELIABLE, 0, rpcParameters->sender, true, 0, UNASSIGNED_NETWORK_ID,0);
|
||||
}
|
||||
|
||||
void Snull_team(RPCParameters *rpcParameters)
|
||||
{
|
||||
server->RPC("null_team",(const char*)rpcParameters->input, (*rpcParameters).numberOfBitsOfData, HIGH_PRIORITY, RELIABLE, 0, UNASSIGNED_SYSTEM_ADDRESS, true, 0, UNASSIGNED_NETWORK_ID,0);
|
||||
}
|
||||
|
||||
void sendFIREW(RPCParameters *rpcParameters)
|
||||
{
|
||||
server->RPC("recieve_fireweapon",(const char*)rpcParameters->input, (*rpcParameters).numberOfBitsOfData, HIGH_PRIORITY, RELIABLE, 0, rpcParameters->sender, true, 0, UNASSIGNED_NETWORK_ID,0);
|
||||
}
|
||||
|
||||
void sendDOOR(RPCParameters *rpcParameters)
|
||||
{
|
||||
server->RPC("recieve_door",(const char*)rpcParameters->input, (*rpcParameters).numberOfBitsOfData, HIGH_PRIORITY, RELIABLE, 0, rpcParameters->sender, true, 0, UNASSIGNED_NETWORK_ID,0);
|
||||
}
|
||||
|
||||
void endINTERRUPT(RPCParameters *rpcParameters)
|
||||
{
|
||||
server->RPC("resume_turn",(const char*)rpcParameters->input, (*rpcParameters).numberOfBitsOfData, HIGH_PRIORITY, RELIABLE, 0, rpcParameters->sender, true, 0, UNASSIGNED_NETWORK_ID,0);
|
||||
}
|
||||
|
||||
void startCOMBAT(RPCParameters *rpcParameters)
|
||||
{
|
||||
if(!( gTacticalStatus.uiFlags & INCOMBAT ))
|
||||
|
||||
{
|
||||
|
||||
gTacticalStatus.uiFlags |= INCOMBAT;
|
||||
|
||||
sc_struct* data = (sc_struct*)rpcParameters->input;
|
||||
EndTurn( data->ubStartingTeam );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void sendREAL(RPCParameters *rpcParameters)
|
||||
{
|
||||
real_struct* rData = (real_struct*)rpcParameters->input;
|
||||
|
||||
|
||||
|
||||
//ScreenMsg( FONT_LTBLUE, MSG_CHAT, L"netbTeam %d is ready for realtime",rData->bteam );//diabled unless testing as cheats
|
||||
if(readyteamreg[rData->bteam]==0)
|
||||
{
|
||||
readyteamreg[rData->bteam]=1;//register vote, to prevent double voting ;p~ //hayden
|
||||
numreadyteams++;
|
||||
|
||||
int numactiveteams=0;
|
||||
int b;
|
||||
for(int i=6;i<=LAST_TEAM;i++)
|
||||
{
|
||||
if(i==6)b=0;
|
||||
else b=i;
|
||||
|
||||
if(gTacticalStatus.Team[ b ].bTeamActive)numactiveteams++;
|
||||
|
||||
}//same
|
||||
//ScreenMsg( FONT_LTBLUE, MSG_CHAT, MPServerMessage[5], numreadyteams, numactiveteams );
|
||||
//check # clients ready for realtime
|
||||
if (numreadyteams >= numactiveteams)
|
||||
{
|
||||
//if all send notification for realtime changeover
|
||||
//ScreenMsg( FONT_LTBLUE, MSG_CHAT, L"Switching to realtime..." );
|
||||
numreadyteams=0;
|
||||
memset( &readyteamreg , 0 , sizeof (int) * 10);
|
||||
|
||||
server->RPC("gotoRT",(const char*)rpcParameters->input, (*rpcParameters).numberOfBitsOfData, HIGH_PRIORITY, RELIABLE, 0, UNASSIGNED_SYSTEM_ADDRESS, true, 0, UNASSIGNED_NETWORK_ID,0);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
int f_rec_num(int mode, SystemAddress sender)//from client data
|
||||
{
|
||||
int x;
|
||||
client_data cl_record;
|
||||
for ( x=0; x<4;x++)
|
||||
{
|
||||
cl_record = client_d[x];
|
||||
|
||||
if(mode==0)//find empty slot for new record
|
||||
{
|
||||
if(cl_record.address.binaryAddress==0)
|
||||
return(x);
|
||||
}
|
||||
if(mode==1)//wipe clean all
|
||||
{
|
||||
client_d[x].address.binaryAddress=0;
|
||||
client_d[x].address.port=0;
|
||||
client_d[x].cl_number=0;
|
||||
}
|
||||
if(mode==2)//clear one record
|
||||
{
|
||||
if(cl_record.address.binaryAddress==sender.binaryAddress && cl_record.address.port==sender.port)
|
||||
{
|
||||
client_d[x].address.port=0;
|
||||
client_d[x].cl_number=0;
|
||||
client_d[x].address.binaryAddress=0;
|
||||
return(254);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if(mode == 0)//'no free slots'
|
||||
{
|
||||
ScreenMsg( FONT_RED, MSG_CHAT, L"Client Record Error, Restart Server, and Report Error." );
|
||||
return (255);
|
||||
}
|
||||
return(254);
|
||||
}
|
||||
|
||||
//************************* //UNASSIGNED_SYSTEM_ADDRESS
|
||||
//START INTERNAL SERVER
|
||||
//*************************
|
||||
//void send_settings (void)//send server settings to client
|
||||
void requestSETTINGS(RPCParameters *rpcParameters )
|
||||
{
|
||||
|
||||
client_info* clinf = (client_info*)rpcParameters->input;
|
||||
|
||||
//server assigned client numbers - hayden.
|
||||
SystemAddress sender = rpcParameters->sender;//get senders address
|
||||
int bslot = f_rec_num(0,blank);//get empty record slot
|
||||
client_d[bslot].address=sender; //record clients address
|
||||
int new_cl_num = bslot+1;//client number to assign
|
||||
client_d[bslot].cl_number=new_cl_num; //record clients number
|
||||
|
||||
|
||||
settings_struct lan;
|
||||
|
||||
//lan.client_num = clinf->client_num;//old client assigned number
|
||||
lan.client_num = new_cl_num; //new server assigned number
|
||||
strcpy(lan.client_name , clinf->client_name);
|
||||
|
||||
lan.max_clients = gsMAX_CLIENTS;
|
||||
memcpy(lan.kitbag , kbag,sizeof (char)*100);
|
||||
lan.damage_multiplier = gsDAMAGE_MULTIPLIER;
|
||||
|
||||
lan.same_merc = gsSAME_MERC;
|
||||
lan.gsMercArriveSectorX=gsMercArriveSectorX;
|
||||
lan.gsMercArriveSectorY=gsMercArriveSectorY;
|
||||
|
||||
lan.ENEMY_ENABLED=ENEMY_ENABLED;
|
||||
lan.CREATURE_ENABLED=CREATURE_ENABLED;
|
||||
lan.MILITIA_ENABLED=MILITIA_ENABLED;
|
||||
lan.CIV_ENABLED=CIV_ENABLED;
|
||||
|
||||
lan.gsPLAYER_BSIDE=gsPLAYER_BSIDE;
|
||||
|
||||
lan.emorale=gsMORALE;
|
||||
lan.gsREPORT_NAME=gsREPORT_NAME;
|
||||
//something new
|
||||
lan.secs_per_tick=gssecs_per_tick;
|
||||
lan.soubBobbyRay=gGameOptions.ubBobbyRay;
|
||||
lan.sofGunNut=gGameOptions.fGunNut;
|
||||
lan.soubGameStyle=gGameOptions.ubGameStyle;
|
||||
lan.soubDifficultyLevel=gGameOptions.ubDifficultyLevel;
|
||||
lan.sofTurnTimeLimit=gGameOptions.fTurnTimeLimit;
|
||||
lan.sofIronManMode=gGameOptions.fIronManMode;
|
||||
lan.starting_balance=gsstarting_balance;
|
||||
|
||||
lan.sofNewInv=gGameOptions.ubInventorySystem;
|
||||
|
||||
lan.soDis_Bobby=gsDis_Bobby;
|
||||
lan.soDis_Equip=gsDis_Equip;
|
||||
|
||||
lan.gsMAX_MERCS=gsMAX_MERCS;
|
||||
|
||||
memcpy( lan.client_names , client_names, sizeof( char ) * 4 * 30 );
|
||||
lan.team=clinf->team;
|
||||
//lan.cl_ops[0]=clinf->cl_ops[0];
|
||||
//lan.cl_ops[1]=clinf->cl_ops[1];
|
||||
//lan.cl_ops[2]=clinf->cl_ops[2];
|
||||
//lan.cl_ops[3]=clinf->cl_ops[3];
|
||||
//memcpy(lan.cl_ops,clinf->cl_ops,sizeof(int)*4);
|
||||
////
|
||||
lan.TESTING=gsTESTING;
|
||||
|
||||
lan.cl_edge=clinf->cl_edge;
|
||||
lan.TIME=TIME;
|
||||
lan.WEAPON_READIED_BONUS=sWEAPON_READIED_BONUS;
|
||||
|
||||
server->RPC("recieveSETTINGS",(const char*)&lan, (int)sizeof(settings_struct)*8, HIGH_PRIORITY, RELIABLE, 0, UNASSIGNED_SYSTEM_ADDRESS, true, 0, UNASSIGNED_NETWORK_ID,0);
|
||||
|
||||
}
|
||||
|
||||
//void rOVH (RPCParameters *rpcParameters)
|
||||
//{
|
||||
// ovh_struct* rovhs = (ovh_struct*)rpcParameters->input;
|
||||
//
|
||||
//
|
||||
//
|
||||
// ++mercs_ready[rovhs->ubid];
|
||||
// //ncr++;
|
||||
// nc = server->NumberOfConnections();
|
||||
//
|
||||
// if(mercs_ready[rovhs->ubid] >= nc)
|
||||
// {
|
||||
// mercs_ready[rovhs->ubid]=0;
|
||||
// ScreenMsg( FONT_LTBLUE, MSG_CHAT, L"advance %d",rovhs->ubid );
|
||||
//
|
||||
// adv aoh;
|
||||
// aoh.ubid=rovhs->ubid;
|
||||
//
|
||||
// server->RPC("advance_ovh_frame",(const char*)&aoh, (int)sizeof(adv)*8, HIGH_PRIORITY, RELIABLE, 0, UNASSIGNED_SYSTEM_ADDRESS, true, 0, UNASSIGNED_NETWORK_ID,0);
|
||||
//
|
||||
// }
|
||||
//
|
||||
//}
|
||||
|
||||
|
||||
void start_server (void)
|
||||
{
|
||||
if(!is_server)
|
||||
{
|
||||
|
||||
|
||||
|
||||
//retrieve settings from .ini
|
||||
|
||||
f_rec_num(1,blank);//wipe clean
|
||||
//char maxclients[30];
|
||||
char port[30];
|
||||
char SERVER_PORT[30];
|
||||
//char MAX_CLIENTS[30] ;
|
||||
|
||||
// GetPrivateProfileString( "Ja2_mp Settings","MAX_CLIENTS", "", maxclients, MAX_PATH, "..\\Ja2_mp.ini" );
|
||||
GetPrivateProfileString( "Ja2_mp Settings","SERVER_PORT", "", port, MAX_PATH, "..\\Ja2_mp.ini" );
|
||||
// strcpy( MAX_CLIENTS , maxclients );
|
||||
strcpy( SERVER_PORT, port );
|
||||
|
||||
|
||||
char ints[30];
|
||||
char maxclients[30];
|
||||
|
||||
char hire_same_merc[30];
|
||||
char bteam1_enabled[30];
|
||||
char bteam2_enabled[30];
|
||||
char bteam3_enabled[30];
|
||||
char bteam4_enabled[30];
|
||||
|
||||
char player_bside[30];
|
||||
|
||||
char sBalance[30];
|
||||
char time_div[30];
|
||||
char mor[30];
|
||||
|
||||
GetPrivateProfileString( "Ja2_mp Settings","SAME_MERC", "", hire_same_merc, MAX_PATH, "..\\Ja2_mp.ini" );
|
||||
GetPrivateProfileString( "Ja2_mp Settings","DISABLE_MORALE", "", mor, MAX_PATH, "..\\Ja2_mp.ini" );
|
||||
GetPrivateProfileString( "Ja2_mp Settings","MAX_CLIENTS", "", maxclients, MAX_PATH, "..\\Ja2_mp.ini" );
|
||||
GetPrivateProfileString( "Ja2_mp Settings","DAMAGE_MULTIPLIER", "", net_div, MAX_PATH, "..\\Ja2_mp.ini" );
|
||||
|
||||
GetPrivateProfileString( "Ja2_mp Settings","ENEMY_ENABLED", "", bteam1_enabled, MAX_PATH, "..\\Ja2_mp.ini" );
|
||||
GetPrivateProfileString( "Ja2_mp Settings","CREATURE_ENABLED", "", bteam2_enabled, MAX_PATH, "..\\Ja2_mp.ini" );
|
||||
GetPrivateProfileString( "Ja2_mp Settings","MILITIA_ENABLED", "", bteam3_enabled, MAX_PATH, "..\\Ja2_mp.ini" );
|
||||
GetPrivateProfileString( "Ja2_mp Settings","CIV_ENABLED", "", bteam4_enabled, MAX_PATH, "..\\Ja2_mp.ini" );
|
||||
|
||||
GetPrivateProfileString( "Ja2_mp Settings","GAME_MODE", "", player_bside, MAX_PATH, "..\\Ja2_mp.ini" );
|
||||
|
||||
|
||||
//something new
|
||||
gsMORALE=0;
|
||||
if(atoi(mor)==1)gsMORALE=1;
|
||||
|
||||
|
||||
GetPrivateProfileString( "Ja2_mp Settings","KIT_BAG", "", kbag, MAX_PATH, "..\\Ja2_mp.ini" );
|
||||
|
||||
char rpn[30];
|
||||
GetPrivateProfileString( "Ja2_mp Settings","REPORT_NAME", "", rpn, MAX_PATH, "..\\Ja2_mp.ini" );
|
||||
gsREPORT_NAME=atoi(rpn);
|
||||
|
||||
GetPrivateProfileString( "Ja2_mp Settings","STARTING_BALANCE", "", sBalance, MAX_PATH, "..\\Ja2_mp.ini" );
|
||||
GetPrivateProfileString( "Ja2_mp Settings","TIMED_TURN_SECS_PER_TICK", "", time_div, MAX_PATH, "..\\Ja2_mp.ini" );
|
||||
|
||||
char dis_bob[30];
|
||||
char dis_equip[30];
|
||||
char max_merc[30];
|
||||
char test[30];
|
||||
GetPrivateProfileString( "Ja2_mp Settings","DISABLE_BOBBY_RAYS", "", dis_bob, MAX_PATH, "..\\Ja2_mp.ini" );
|
||||
GetPrivateProfileString( "Ja2_mp Settings","DISABLE_AIM_AND_MERC_EQUIP", "", dis_equip, MAX_PATH, "..\\Ja2_mp.ini" );
|
||||
GetPrivateProfileString( "Ja2_mp Settings","MAX_MERCS", "", max_merc, MAX_PATH, "..\\Ja2_mp.ini" );
|
||||
GetPrivateProfileString( "Ja2_mp Settings","TESTING", "", test, MAX_PATH, "..\\Ja2_mp.ini" );
|
||||
gsDis_Bobby=false;
|
||||
gsDis_Equip=false;
|
||||
|
||||
if(atoi(dis_bob)==1)gsDis_Bobby=true;
|
||||
if(atoi(dis_equip)==1)gsDis_Equip=true;
|
||||
|
||||
gsMAX_MERCS=atoi(max_merc);
|
||||
gsTESTING = atoi(test);
|
||||
////
|
||||
ENEMY_ENABLED =atoi(bteam1_enabled);
|
||||
CREATURE_ENABLED =atoi(bteam2_enabled);
|
||||
MILITIA_ENABLED =atoi(bteam3_enabled);
|
||||
CIV_ENABLED =atoi(bteam4_enabled);
|
||||
|
||||
gsPLAYER_BSIDE = atoi(player_bside);
|
||||
|
||||
gsSAME_MERC = atoi(hire_same_merc);
|
||||
gsDAMAGE_MULTIPLIER =(FLOAT)atof(net_div);
|
||||
gsINTERRUPTS = atoi(ints);
|
||||
gsMAX_CLIENTS = atoi(maxclients);
|
||||
|
||||
gssecs_per_tick=atoi(time_div) ;
|
||||
gsstarting_balance=atoi(sBalance);
|
||||
|
||||
char time[30];
|
||||
GetPrivateProfileString( "Ja2_mp Settings","TIME", "", time, MAX_PATH, "..\\Ja2_mp.ini" );
|
||||
TIME=(FLOAT)atof(time);
|
||||
|
||||
char wpr[30];
|
||||
GetPrivateProfileString( "Ja2_mp Settings","WEAPON_READIED_BONUS", "", wpr, MAX_PATH, "..\\Ja2_mp.ini" );
|
||||
sWEAPON_READIED_BONUS=atoi(wpr);
|
||||
|
||||
//**********************
|
||||
|
||||
|
||||
|
||||
|
||||
ScreenMsg( FONT_LTBLUE, MSG_CHAT, MPServerMessage[0] );
|
||||
|
||||
server=RakNetworkFactory::GetRakPeerInterface();
|
||||
bool b = server->Startup(gsMAX_CLIENTS, 30, &SocketDescriptor(atoi(SERVER_PORT),0), 1);
|
||||
|
||||
server->SetMaximumIncomingConnections((gsMAX_CLIENTS));
|
||||
|
||||
|
||||
|
||||
|
||||
//RPC's
|
||||
REGISTER_STATIC_RPC(server, sendPATH);
|
||||
REGISTER_STATIC_RPC(server, sendSTANCE);
|
||||
REGISTER_STATIC_RPC(server, sendDIR);
|
||||
REGISTER_STATIC_RPC(server, sendFIRE);
|
||||
REGISTER_STATIC_RPC(server, sendHIT);
|
||||
REGISTER_STATIC_RPC(server, sendHIRE);
|
||||
REGISTER_STATIC_RPC(server, sendguiPOS);
|
||||
REGISTER_STATIC_RPC(server, sendguiDIR);
|
||||
REGISTER_STATIC_RPC(server, sendEndTurn);
|
||||
REGISTER_STATIC_RPC(server, sendAI);
|
||||
REGISTER_STATIC_RPC(server, sendSTOP);
|
||||
REGISTER_STATIC_RPC(server, sendINTERRUPT);
|
||||
REGISTER_STATIC_RPC(server, sendREADY);
|
||||
REGISTER_STATIC_RPC(server, sendGUI);
|
||||
REGISTER_STATIC_RPC(server, sendBULLET);
|
||||
REGISTER_STATIC_RPC(server, requestSETTINGS);
|
||||
REGISTER_STATIC_RPC(server, sendSTATE);
|
||||
REGISTER_STATIC_RPC(server, sendDEATH);
|
||||
REGISTER_STATIC_RPC(server, sendhitSTRUCT);
|
||||
REGISTER_STATIC_RPC(server, sendhitWINDOW);
|
||||
REGISTER_STATIC_RPC(server, sendMISS);
|
||||
//REGISTER_STATIC_RPC(server, rOVH);
|
||||
|
||||
REGISTER_STATIC_RPC(server, updatenetworksoldier);
|
||||
REGISTER_STATIC_RPC(server, Snull_team);
|
||||
REGISTER_STATIC_RPC(server, sendFIREW);
|
||||
REGISTER_STATIC_RPC(server, sendDOOR);
|
||||
REGISTER_STATIC_RPC(server, endINTERRUPT);
|
||||
REGISTER_STATIC_RPC(server, sendREAL);
|
||||
REGISTER_STATIC_RPC(server, startCOMBAT);
|
||||
//
|
||||
|
||||
|
||||
if (b)
|
||||
{
|
||||
ScreenMsg( FONT_LTBLUE, MSG_CHAT, MPServerMessage[1]);
|
||||
ScreenMsg( FONT_LTBLUE, MSG_CHAT, MPServerMessage[2]);
|
||||
is_server = true;
|
||||
connect_client();//connect client to server
|
||||
}
|
||||
else
|
||||
{
|
||||
ScreenMsg( FONT_LTBLUE, MSG_CHAT, MPServerMessage[4]);
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ScreenMsg( FONT_LTBLUE, MSG_CHAT, MPServerMessage[3]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
// recieve and process server info packets
|
||||
|
||||
void server_packet ( void )
|
||||
{
|
||||
|
||||
Packet* p;
|
||||
|
||||
|
||||
if (is_server)
|
||||
{
|
||||
|
||||
p = server->Receive();
|
||||
|
||||
while(p)
|
||||
{
|
||||
//continue; // Didn't get any packets
|
||||
|
||||
// We got a packet, get the identifier with our handy function
|
||||
SpacketIdentifier = SGetPacketIdentifier(p);
|
||||
//ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"packet recieved");
|
||||
// Check if this is a network message packet
|
||||
switch (SpacketIdentifier)
|
||||
{
|
||||
case ID_DISCONNECTION_NOTIFICATION://client disconnected purposefullly
|
||||
// Connection lost normally
|
||||
ScreenMsg( FONT_LTBLUE, MSG_CHAT, L"ID_DISCONNECTION_NOTIFICATION");
|
||||
f_rec_num(2, p->systemAddress);//clear record
|
||||
break;
|
||||
case ID_ALREADY_CONNECTED:
|
||||
// Connection lost normally
|
||||
ScreenMsg( FONT_LTBLUE, MSG_CHAT, L"ID_ALREADY_CONNECTED");
|
||||
break;
|
||||
case ID_REMOTE_DISCONNECTION_NOTIFICATION: // Server telling the clients of another client disconnecting gracefully. You can manually broadcast this in a peer to peer enviroment if you want.
|
||||
ScreenMsg( FONT_LTBLUE, MSG_CHAT, L"ID_REMOTE_DISCONNECTION_NOTIFICATION");
|
||||
break;
|
||||
case ID_REMOTE_CONNECTION_LOST: // Server telling the clients of another client disconnecting forcefully. You can manually broadcast this in a peer to peer enviroment if you want.
|
||||
ScreenMsg( FONT_LTBLUE, MSG_CHAT, L"ID_REMOTE_CONNECTION_LOST");
|
||||
break;
|
||||
case ID_REMOTE_NEW_INCOMING_CONNECTION: // Server telling the clients of another client connecting. You can manually broadcast this in a peer to peer enviroment if you want.
|
||||
ScreenMsg( FONT_LTBLUE, MSG_CHAT, L"ID_REMOT/MING_CONNECTION");
|
||||
break;
|
||||
case ID_CONNECTION_ATTEMPT_FAILED:
|
||||
ScreenMsg( FONT_LTBLUE, MSG_CHAT, L"ID_CONNECTION_ATTEMPT_FAILED");
|
||||
break;
|
||||
case ID_NO_FREE_INCOMING_CONNECTIONS:
|
||||
// Sorry, the server is full. I don't do anything here but
|
||||
// A real app should tell the user
|
||||
ScreenMsg( FONT_LTBLUE, MSG_CHAT, L"ID_NO_FREE_INCOMING_CONNECTIONS");
|
||||
break;
|
||||
case ID_CONNECTION_LOST:
|
||||
// Couldn't deliver a reliable packet - i.e. the other system was abnormally
|
||||
// terminated
|
||||
ScreenMsg( FONT_LTBLUE, MSG_CHAT, L"ID_CONNECTION_LOST");//client dropped
|
||||
f_rec_num(2, p->systemAddress);//clear record
|
||||
break;
|
||||
case ID_CONNECTION_REQUEST_ACCEPTED:
|
||||
// This tells the client they have connected
|
||||
ScreenMsg( FONT_LTBLUE, MSG_CHAT, L"ID_CONNECTION_REQUEST_ACCEPTED");
|
||||
break;
|
||||
case ID_NEW_INCOMING_CONNECTION:
|
||||
//tells server client has connected
|
||||
ScreenMsg( FONT_LTBLUE, MSG_CHAT, L"ID_NEW_INCOMING_CONNECTION");
|
||||
//send_settings();//send off server set settings
|
||||
break;
|
||||
case ID_MODIFIED_PACKET:
|
||||
// Cheater!
|
||||
ScreenMsg( FONT_LTBLUE, MSG_CHAT, L"ID_MODIFIED_PACKET");
|
||||
break;
|
||||
default:
|
||||
|
||||
ScreenMsg( FONT_LTBLUE, MSG_CHAT, L"** a packet has been recieved for which i dont know what to do... **");
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// We're done with the packet, get more :)
|
||||
server->DeallocatePacket(p);
|
||||
p = server->Receive();
|
||||
}
|
||||
}
|
||||
}
|
||||
// Copied from Multiplayer.cpp
|
||||
// If the first byte is ID_TIMESTAMP, then we want the 5th byte
|
||||
// Otherwise we want the 1st byte
|
||||
unsigned char SGetPacketIdentifier(Packet *p)
|
||||
{
|
||||
if (p==0)
|
||||
return 255;
|
||||
|
||||
if ((unsigned char)p->data[0] == ID_TIMESTAMP)
|
||||
{
|
||||
assert(p->length > sizeof(unsigned char) + sizeof(unsigned long));
|
||||
return (unsigned char) p->data[sizeof(unsigned char) + sizeof(unsigned long)];
|
||||
}
|
||||
else
|
||||
return (unsigned char) p->data[0];
|
||||
}
|
||||
|
||||
void server_disconnect (void)
|
||||
{
|
||||
if(is_server)
|
||||
{
|
||||
server->Shutdown(300);
|
||||
is_server = false;
|
||||
// We're done with the network
|
||||
RakNetworkFactory::DestroyRakPeerInterface(server);
|
||||
ScreenMsg( FONT_LTBLUE, MSG_CHAT, MPServerMessage[6]);
|
||||
}
|
||||
else
|
||||
{
|
||||
ScreenMsg( FONT_LTBLUE, MSG_CHAT, MPServerMessage[7]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,399 @@
|
||||
#ifdef PRECOMPILEDHEADERS
|
||||
#include "Tactical All.h"
|
||||
#include "strategic.h"
|
||||
#else
|
||||
#include "builddefines.h"
|
||||
#include "Bullets.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "wcheck.h"
|
||||
#include "stdlib.h"
|
||||
#include "debug.h"
|
||||
#include "math.h"
|
||||
#include "worlddef.h"
|
||||
#include "worldman.h"
|
||||
#include "renderworld.h"
|
||||
#include "Assignments.h"
|
||||
#include "Soldier Control.h"
|
||||
#include "Animation Control.h"
|
||||
#include "Animation Data.h"
|
||||
#include "Isometric Utils.h"
|
||||
#include "Event Pump.h"
|
||||
#include "Timer Control.h"
|
||||
#include "Render Fun.h"
|
||||
#include "Render Dirty.h"
|
||||
#include "mousesystem.h"
|
||||
#include "interface.h"
|
||||
#include "sysutil.h"
|
||||
#include "FileMan.h"
|
||||
#include "points.h"
|
||||
#include "Random.h"
|
||||
#include "ai.h"
|
||||
#include "Interactive Tiles.h"
|
||||
#include "soldier ani.h"
|
||||
#include "english.h"
|
||||
#include "overhead.h"
|
||||
#include "Soldier Profile.h"
|
||||
#include "Game Clock.h"
|
||||
#include "soldier create.h"
|
||||
#include "Merc Hiring.h"
|
||||
#include "Game Event Hook.h"
|
||||
#include "message.h"
|
||||
#include "strategicmap.h"
|
||||
#include "strategic.h"
|
||||
#include "items.h"
|
||||
#include "Soldier Add.h"
|
||||
#include "History.h"
|
||||
#include "Squads.h"
|
||||
#include "Strategic Merc Handler.h"
|
||||
#include "Dialogue Control.h"
|
||||
#include "Map Screen Interface.h"
|
||||
#include "Map Screen Interface Map.h"
|
||||
#include "screenids.h"
|
||||
#include "jascreens.h"
|
||||
#include "text.h"
|
||||
#include "Merc Contract.h"
|
||||
#include "LaptopSave.h"
|
||||
#include "personnel.h"
|
||||
#include "Auto Resolve.h"
|
||||
#include "Map Screen Interface Bottom.h"
|
||||
#include "Quests.h"
|
||||
#include "GameSettings.h"
|
||||
#endif
|
||||
|
||||
#include "MessageIdentifiers.h"
|
||||
#include "RakNetworkFactory.h"
|
||||
#include "RakPeerInterface.h"
|
||||
#include "RakNetStatistics.h"
|
||||
#include "RakNetTypes.h"
|
||||
#include "BitStream.h"
|
||||
#include <assert.h>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "tactical placement gui.h"
|
||||
#include "connect.h"
|
||||
#include "network.h"
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
#include "text.h"
|
||||
#include "Types.h"
|
||||
#include "connect.h"
|
||||
#include "message.h"
|
||||
#include "Event pump.h"
|
||||
#include "Soldier Init List.h"
|
||||
#include "Overhead.h"
|
||||
#include "weapons.h"
|
||||
#include "Merc Hiring.h"
|
||||
#include "soldier profile.h"
|
||||
|
||||
#include"laptop.h"
|
||||
#include "florist Order Form.h"
|
||||
#include "prebattle interface.h"
|
||||
#include "teamturns.h"
|
||||
extern INT8 SquadMovementGroups[ ];
|
||||
|
||||
#include "test_space.h"
|
||||
#include "soldier control.h"
|
||||
|
||||
bool ovh_advance;
|
||||
bool ovh_ready;
|
||||
|
||||
#include "opplist.h"
|
||||
|
||||
//int cnt = 40;
|
||||
|
||||
|
||||
void test_func2 (void)//now bound to "0" //currently displays coordinates of the mouse
|
||||
{
|
||||
ScreenMsg( FONT_LTGREEN, MSG_CHAT, L"test_func2 - function testing ground:" );
|
||||
|
||||
|
||||
SOLDIERTYPE * pSoldier=MercPtrs[ 0 ];
|
||||
//SOLDIERTYPE * pSoldier2=MercPtrs[ 127 ];
|
||||
//
|
||||
////pSoldier->AdjustNoAPToFinishMove( TRUE );
|
||||
//
|
||||
////pSoldier2->bVisible = 1;
|
||||
//ManSeesMan(pSoldier,pSoldier2,pSoldier2->sGridNo,pSoldier2->pathing.bLevel,0,1);
|
||||
|
||||
|
||||
/*
|
||||
INT16 sCellX, sCellY;
|
||||
sCellX = CenterX( 22163 );
|
||||
sCellY = CenterY( 22163 );
|
||||
|
||||
pSoldier->EVENT_InternalSetSoldierPosition( sCellX, sCellY ,FALSE, FALSE, FALSE );*/
|
||||
|
||||
|
||||
|
||||
|
||||
//SOLDIERTYPE * pSoldier=MercPtrs[ 0 ];
|
||||
//pSoldier->bLife=0;
|
||||
//SoldierCollapse( pSoldier );
|
||||
//SoldierTakeDamage( pFirer, ANIM_CROUCH, 1, 100, TAKE_DAMAGE_BLOODLOSS, NOBODY, NOWHERE, 0, TRUE );
|
||||
//TurnSoldierIntoCorpse( pFirer, FALSE, FALSE );
|
||||
|
||||
//SOLDIERTYPE * pSoldier=MercPtrs[ 0 ];
|
||||
////
|
||||
//pSoldier->fNoAPToFinishMove = TRUE;
|
||||
//
|
||||
//
|
||||
//fInterfacePanelDirty = DIRTYLEVEL2;
|
||||
|
||||
|
||||
|
||||
////EVENT_InitNewSoldierAnim(pSoldier,3,0,0);
|
||||
//pSoldier->ubDesiredHeight = ANIM_CROUCH;
|
||||
|
||||
//SOLDIERTYPE * pSoldier=MercPtrs[ 0 ];
|
||||
//pSoldier->usAnimState=50;
|
||||
//TurnSoldierIntoCorpse( pSoldier, TRUE, TRUE );
|
||||
|
||||
//gTacticalStatus.uiFlags |= SHOW_ALL_MERCS;
|
||||
//BeginTeamTurn (0);
|
||||
|
||||
|
||||
|
||||
;
|
||||
|
||||
//gTacticalStatus.ubCurrentTeam = OUR_TEAM;
|
||||
//guiPendingOverrideEvent = LA_ENDUIOUTURNLOCK;
|
||||
//ExitCombatMode();
|
||||
//fInterfacePanelDirty = DIRTYLEVEL2;
|
||||
|
||||
|
||||
//InitPlayerUIBar( FALSE );
|
||||
|
||||
|
||||
//UIHandleLUIEndLock( NULL );
|
||||
//if( (gTacticalStatus.uiFlags & TURNBASED) && (gTacticalStatus.uiFlags & INCOMBAT) )
|
||||
// ScreenMsg( FONT_LTGREEN, MSG_CHAT, L"combat turn based" );
|
||||
//else
|
||||
// ScreenMsg( FONT_LTGREEN, MSG_CHAT, L"not" );
|
||||
|
||||
|
||||
//SOLDIERTYPE * pSoldier=MercPtrs[ 0 ];
|
||||
//
|
||||
// if ( ( gAnimControl[ pSoldier->usAnimState ].uiFlags &( ANIM_FIREREADY | ANIM_FIRE ) ) )
|
||||
// {
|
||||
// ScreenMsg( FONT_LTGREEN, MSG_CHAT, L"Ready" );
|
||||
// }
|
||||
// else
|
||||
// ScreenMsg( FONT_LTGREEN, MSG_CHAT, L"Not" );
|
||||
|
||||
////fInterfacePanelDirty = DIRTYLEVEL2;
|
||||
////guiPendingOverrideEvent = LU_ENDUILOCK;
|
||||
////guiPendingOverrideEvent = LA_ENDUIOUTURNLOCK;
|
||||
//
|
||||
//
|
||||
//
|
||||
// ClearIntList();
|
||||
// //guiPendingOverrideEvent = LU_ENDUILOCK;
|
||||
// guiPendingOverrideEvent = LA_ENDUIOUTURNLOCK;
|
||||
// fInterfacePanelDirty = DIRTYLEVEL2;
|
||||
//
|
||||
// if ( gusSelectedSoldier != NOBODY )
|
||||
// {
|
||||
// SlideTo( NOWHERE, gusSelectedSoldier, NOBODY ,SETLOCATOR);
|
||||
// MercPtrs[ gusSelectedSoldier ]->DoMercBattleSound( BATTLE_SOUND_ATTN1 );
|
||||
// }
|
||||
// InitPlayerUIBar( 0 );
|
||||
//HandleTacticalUI( );
|
||||
//guiPendingOverrideEvent = LA_BEGINUIOURTURNLOCK;
|
||||
//int n = 0;
|
||||
//for(cnt=40+n ; cnt < 40+5+n ; cnt++)
|
||||
//{
|
||||
//
|
||||
//QuickCreateProfileMerc( CIV_TEAM, cnt );jk
|
||||
//
|
||||
//RecruitRPC( cnt );
|
||||
//Sleep(3000);
|
||||
//}
|
||||
//QuickCreateProfileMerc( CIV_TEAM, cnt );
|
||||
//RecruitRPC( cnt );
|
||||
//cnt++;
|
||||
|
||||
|
||||
//HandleDoorChangeFromGridNo( pSoldier, 18451, FALSE );
|
||||
|
||||
//OBJECTTYPE Object;
|
||||
//for (cnt=0; cnt<20;cnt++)
|
||||
//{
|
||||
//CreateItem( 201, 100, &Object );
|
||||
//
|
||||
//AutoPlaceObject( pSoldier, &Object, TRUE );
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
|
||||
|
||||
//INT16 sCellX, sCellY;
|
||||
////ConvertGridNoToCellXY( 13576, &sCellX, &sCellY );
|
||||
//
|
||||
// sCellX = CenterX( 13576 );
|
||||
// sCellY = CenterY( 13576 );
|
||||
//
|
||||
// //pSoldier->dXPos = sCellX;
|
||||
// //pSoldier->dYPos = sCellY;
|
||||
//
|
||||
// //pSoldier->sX = (INT16)sCellX;
|
||||
// //pSoldier->sY = (INT16)sCellY;
|
||||
// EVENT_InitNewSoldierAnim( pSoldier, 6, 0, FALSE );
|
||||
|
||||
//EVENT_SetSoldierPositionForceDelete( pSoldier, (FLOAT)sCellX, (FLOAT)sCellY );
|
||||
|
||||
//HaultSoldierFromSighting( pSoldier, 1 );
|
||||
//pSoldier->sScheduledStop=7961;
|
||||
////
|
||||
////EVENT_SetSoldierPosition( pSoldier, 1140, 1170 );
|
||||
//AdjustNoAPToFinishMove( pSoldier, TRUE );
|
||||
//pSoldier->fTurningFromPronePosition = FALSE;
|
||||
//
|
||||
////HaultSoldierFromSighting( pSoldier, 1 );
|
||||
|
||||
|
||||
|
||||
|
||||
//UINT16 usPathData[30];
|
||||
//usPathData[0]=3;
|
||||
//usPathData[1]=5;
|
||||
//usPathData[2]=7;
|
||||
//
|
||||
//pSoldier->sFinalDestination = 8446;
|
||||
//
|
||||
//pSoldier->usPathDataSize=3;
|
||||
//pSoldier->usPathIndex=0;
|
||||
//
|
||||
//memcpy(pSoldier->usPathingData,usPathData,sizeof(UINT16)*30);
|
||||
|
||||
|
||||
//INT16 sNewGridNo;
|
||||
|
||||
//sNewGridNo = NewGridNo( (UINT16)pSoldier->sGridNo, DirectionInc( (UINT8)pSoldier->usPathingData[ pSoldier->usPathDataSize ] ) );
|
||||
|
||||
//pSoldier->sFinalDestination = sNewGridNo;
|
||||
|
||||
//EVENT_InitNewSoldierAnim( pSoldier, 0, 0, FALSE );
|
||||
|
||||
|
||||
|
||||
//ovh_advance=true;
|
||||
//
|
||||
//
|
||||
// CHAR16 string[255];
|
||||
// memcpy(string,TeamTurnString[ 7 ], sizeof( CHAR16) * 255 );
|
||||
//
|
||||
// CHAR16 name[255];
|
||||
// mbstowcs( name, CLIENT_NAME, sizeof (char)*30 );
|
||||
//
|
||||
// CHAR16 full[255];
|
||||
// swprintf(full, L"%s - '%s'",string,name);
|
||||
////
|
||||
////
|
||||
// memcpy( TeamTurnString[ 7 ] , full, sizeof( CHAR16) * 255 );
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
//BOOLEAN fMadeCorpse;
|
||||
// SOLDIERTYPE * pSoldier=MercPtrs[ 0 ];
|
||||
//pSoldier->bLife = 0;
|
||||
// HandleSoldierDeath( pSoldier, &fMadeCorpse );
|
||||
|
||||
//guiPendingOverrideEvent = LA_BEGINUIOURTURNLOCK;
|
||||
//
|
||||
//guiPendingOverrideEvent = CA_MERC_SHOOT;
|
||||
//
|
||||
//guiPendingOverrideEvent = G_GETTINGITEM;
|
||||
//
|
||||
//guiPendingOverrideEvent = LU_ON_TERRAIN;
|
||||
//
|
||||
//guiPendingOverrideEvent = ET_ON_TERRAIN;
|
||||
//
|
||||
//guiPendingOverrideEvent = A_CHANGE_TO_MOVE;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//HandleTacticalUI( );
|
||||
|
||||
|
||||
|
||||
//CHAR8 string[60];
|
||||
// wcscpy( string, "GetVideoObject" );
|
||||
//sprintf( string, "hello");
|
||||
/* char szDefault[255];
|
||||
sprintf(szDefault, "%s","hello");
|
||||
|
||||
|
||||
ScreenMsg( FONT_LTGREEN, MSG_CHAT, L"%S has connected.",szDefault );*/
|
||||
|
||||
//manual overide
|
||||
//manual_overide();
|
||||
//allow_bullet=1;
|
||||
//
|
||||
|
||||
//if(1)
|
||||
//{
|
||||
// stage=0;
|
||||
// ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"1" );
|
||||
// //FireBulletGivenTarget( MercPtrs[0], 875, 995, 1, 11, -74, 0, 0 );
|
||||
//
|
||||
//
|
||||
// INT32 iBullet;
|
||||
// BULLET * pBullet;
|
||||
|
||||
// iBullet = CreateBullet( 0, 0, 0,11 );
|
||||
// if (iBullet == -1)
|
||||
// {
|
||||
// ScreenMsg( FONT_YELLOW, MSG_CHAT, L"Failed to create bullet");
|
||||
// }
|
||||
// pBullet = GetBulletPtr( iBullet );
|
||||
|
||||
// //ScreenMsg( FONT_YELLOW, MSG_CHAT, L"Created Bullet");
|
||||
|
||||
// pBullet->fCheckForRoof=0;
|
||||
// pBullet->qIncrX=-917769;
|
||||
// pBullet->qIncrY=-507159;
|
||||
// pBullet->qIncrZ=-537679;
|
||||
// pBullet->sHitBy=-30;
|
||||
// pBullet->ddHorizAngle=-2.5959375990628013;
|
||||
// pBullet->fAimed=1;
|
||||
// pBullet->ubItemStatus=0;
|
||||
// pBullet->qCurrX=1231159031;
|
||||
// pBullet->qCurrY=1221083881;
|
||||
// pBullet->qCurrZ=182963121;
|
||||
// pBullet->iImpact=28;
|
||||
// pBullet->iRange=200;
|
||||
// pBullet->sTargetGridNo=15929;
|
||||
// pBullet->bStartCubesAboveLevelZ=2;
|
||||
// pBullet->bEndCubesAboveLevelZ=0;
|
||||
// pBullet->iDistanceLimit=328;
|
||||
|
||||
|
||||
// SOLDIERTYPE * pFirer=MercPtrs[ 0 ];
|
||||
|
||||
// //FireBullet( pFirer, pBullet, FALSE );
|
||||
// if(is_client)send_bullet( pBullet, 11 );//hayden
|
||||
|
||||
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// stage=1;
|
||||
// ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"0" );
|
||||
// FireBulletGivenTarget( MercPtrs[0], 875, 995, 1, 11, -74, 0, 0 );
|
||||
//}
|
||||
@@ -0,0 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#define ENABLE_COLLISION (is_server && pBullet->pFirer->ubID<120) || (!is_server && is_client && pBullet->pFirer->ubID<20) || (!is_server && !is_client)
|
||||
|
||||
void send_bullet( BULLET * pBullet, UINT16 usHandItem);
|
||||
|
||||
INT8 FireBullet( SOLDIERTYPE * pFirer, BULLET * pBullet, BOOLEAN fFake );
|
||||
|
||||
#define NOCDCHECK
|
||||
|
||||
extern bool ovh_advance;
|
||||
extern bool ovh_ready;
|
||||
void request_ovh(UINT8 ubID);
|
||||
@@ -39,6 +39,7 @@
|
||||
#include "SmokeEffects.h"
|
||||
#endif
|
||||
|
||||
#include "connect.h"
|
||||
#include "WorldMan.h"
|
||||
|
||||
/////////////////////////////////
|
||||
@@ -1173,6 +1174,14 @@ void ConfirmQuitToMainMenuMessageBoxCallBack( UINT8 bExitValue )
|
||||
gfExitOptionsAfterMessageBox = TRUE;
|
||||
SetOptionsExitScreen( MAINMENU_SCREEN );
|
||||
|
||||
if (is_networked)
|
||||
{
|
||||
// haydent
|
||||
server_disconnect();
|
||||
client_disconnect();
|
||||
|
||||
}
|
||||
|
||||
//We want to reinitialize the game
|
||||
ReStartingGame();
|
||||
}
|
||||
|
||||
+14
-1
@@ -122,6 +122,8 @@
|
||||
#include "Rain.h"
|
||||
//end rain
|
||||
|
||||
#include "connect.h"
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//
|
||||
// Local Defines
|
||||
@@ -1791,7 +1793,12 @@ BOOLEAN InitSaveDir()
|
||||
|
||||
// The locale-specific save dir location is of the form L"..\\SavedGames"
|
||||
// This has not changed; instead, we strip the ".." at the beginning
|
||||
sprintf( gSaveDir, "%s%S", dataDir.c_str(), pMessageStrings[ MSG_SAVEDIRECTORY ] + 2 );
|
||||
if(is_networked)
|
||||
{
|
||||
sprintf( gSaveDir, "%s%S", dataDir.c_str(), pMessageStrings[ MSG_MPSAVEDIRECTORY ] + 2 );
|
||||
}
|
||||
else
|
||||
sprintf( gSaveDir, "%s%S", dataDir.c_str(), pMessageStrings[ MSG_SAVEDIRECTORY ] + 2 );
|
||||
|
||||
// This was moved here from SaveGame
|
||||
//Check to see if the save directory exists
|
||||
@@ -1919,6 +1926,12 @@ BOOLEAN SaveGame( UINT8 ubSaveGameID, STR16 pGameDesc )
|
||||
SaveGameHeader.uiDay = GetWorldDay();
|
||||
SaveGameHeader.ubHour = (UINT8)GetWorldHour();
|
||||
SaveGameHeader.ubMin = (UINT8)guiMin;
|
||||
if(is_networked)
|
||||
{
|
||||
SaveGameHeader.uiDay = CLIENT_NUM;
|
||||
SaveGameHeader.ubHour = MAX_CLIENTS;
|
||||
SaveGameHeader.ubMin = MAX_MERCS;
|
||||
}
|
||||
|
||||
//copy over the initial game options
|
||||
memcpy( &SaveGameHeader.sInitialGameOptions, &gGameOptions, sizeof( GAME_OPTIONS ) );
|
||||
|
||||
@@ -58,6 +58,8 @@ typedef struct
|
||||
|
||||
UINT8 ubFiller[109];
|
||||
|
||||
|
||||
|
||||
} SAVED_GAME_HEADER;
|
||||
|
||||
|
||||
|
||||
+40
-3
@@ -39,6 +39,7 @@
|
||||
#endif
|
||||
|
||||
#include "Campaign Init.h"
|
||||
#include "connect.h"
|
||||
|
||||
BOOLEAN gfSchedulesHosed = FALSE;
|
||||
extern UINT32 guiBrokenSaveGameVersion;
|
||||
@@ -525,6 +526,17 @@ BOOLEAN EnterSaveLoadScreen()
|
||||
usPosX, SLG_CANCEL_POS_Y, BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
|
||||
DEFAULT_MOVE_CALLBACK, BtnSlgCancelCallback );
|
||||
|
||||
//load mp game
|
||||
/*UINT16 MPusPosX = SLG_LOAD_CANCEL_POS_X-39;
|
||||
|
||||
UINT32 MPguiSlgCancelBtn = CreateIconAndTextButton( guiSlgButtonImage, zSaveLoadText[SLG_CANCEL], OPT_BUTTON_FONT,
|
||||
OPT_BUTTON_ON_COLOR, DEFAULT_SHADOW,
|
||||
OPT_BUTTON_OFF_COLOR, DEFAULT_SHADOW,
|
||||
TEXT_CJUSTIFIED,
|
||||
usPosX, SLG_CANCEL_POS_Y, BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
|
||||
DEFAULT_MOVE_CALLBACK, BtnSlgCancelCallback );*/
|
||||
|
||||
|
||||
|
||||
//Either the save or load button
|
||||
if( gfSaveGame )
|
||||
@@ -1361,7 +1373,10 @@ BOOLEAN DisplaySaveGameEntry( INT8 bEntryID )//, UINT16 usPosY )
|
||||
else
|
||||
{
|
||||
//Create the string for the Data
|
||||
swprintf( zDateString, L"%s %d, %02d:%02d", pMessageStrings[ MSG_DAY ], SaveGameHeader.uiDay, SaveGameHeader.ubHour, SaveGameHeader.ubMin );
|
||||
if(is_networked)
|
||||
swprintf( zDateString, L"%s %d / %d", pMessageStrings[ MSG_CLIENT ], SaveGameHeader.uiDay, SaveGameHeader.ubHour );
|
||||
else
|
||||
swprintf( zDateString, L"%s %d, %02d:%02d", pMessageStrings[ MSG_DAY ], SaveGameHeader.uiDay, SaveGameHeader.ubHour, SaveGameHeader.ubMin );
|
||||
|
||||
//Create the string for the current location
|
||||
if( SaveGameHeader.sSectorX == -1 && SaveGameHeader.sSectorY == -1 || SaveGameHeader.bSectorZ < 0 )
|
||||
@@ -1383,7 +1398,8 @@ BOOLEAN DisplaySaveGameEntry( INT8 bEntryID )//, UINT16 usPosY )
|
||||
//
|
||||
// Number of mercs on the team
|
||||
//
|
||||
|
||||
if(!is_networked)
|
||||
{
|
||||
//if only 1 merc is on the team
|
||||
if( SaveGameHeader.ubNumOfMercsOnPlayersTeam == 1 )
|
||||
{
|
||||
@@ -1395,7 +1411,25 @@ BOOLEAN DisplaySaveGameEntry( INT8 bEntryID )//, UINT16 usPosY )
|
||||
//use "mercs"
|
||||
swprintf( zNumMercsString, L"%d %s", SaveGameHeader.ubNumOfMercsOnPlayersTeam, pMessageStrings[ MSG_MERCS ] );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//
|
||||
// Number of mercs on the team
|
||||
//
|
||||
|
||||
//if only 1 merc is on the team
|
||||
if( SaveGameHeader.ubMin == 1 )
|
||||
{
|
||||
//use "merc"
|
||||
swprintf( zNumMercsString, L"%d / %d %s", SaveGameHeader.ubNumOfMercsOnPlayersTeam,SaveGameHeader.ubMin, MercAccountText[ MERC_ACCOUNT_MERC ] );
|
||||
}
|
||||
else
|
||||
{
|
||||
//use "mercs"
|
||||
swprintf( zNumMercsString, L"%d / %d %s", SaveGameHeader.ubNumOfMercsOnPlayersTeam,SaveGameHeader.ubMin, pMessageStrings[ MSG_MERCS ] );
|
||||
}
|
||||
}
|
||||
//Get the current balance
|
||||
swprintf( zBalanceString, L"%d", SaveGameHeader.iCurrentBalance);
|
||||
InsertCommasForDollarFigure( zBalanceString );
|
||||
@@ -1418,7 +1452,7 @@ BOOLEAN DisplaySaveGameEntry( INT8 bEntryID )//, UINT16 usPosY )
|
||||
DrawTextToScreen( zNumMercsString, (UINT16)(usPosX+SLG_NUM_MERCS_OFFSET_X), (UINT16)(usPosY+SLG_NUM_MERCS_OFFSET_Y), 0, uiFont, ubFontColor, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
|
||||
|
||||
//The balance
|
||||
DrawTextToScreen( zBalanceString, (UINT16)(usPosX+SLG_BALANCE_OFFSET_X), (UINT16)(usPosY+SLG_BALANCE_OFFSET_Y), 0, uiFont, ubFontColor, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
|
||||
if(!is_networked)DrawTextToScreen( zBalanceString, (UINT16)(usPosX+SLG_BALANCE_OFFSET_X), (UINT16)(usPosY+SLG_BALANCE_OFFSET_Y), 0, uiFont, ubFontColor, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
|
||||
|
||||
if( gbSaveGameArray[ bEntryID ] || ( gfSaveGame && !gfUserInTextInputMode && ( gbSelectedSaveLocation == bEntryID ) ) )
|
||||
{
|
||||
@@ -1544,6 +1578,9 @@ void BtnSlgCancelCallback(GUI_BUTTON *btn,INT32 reason)
|
||||
else if( guiPreviousOptionScreen == MAINMENU_SCREEN )
|
||||
SetSaveLoadExitScreen( MAINMENU_SCREEN );
|
||||
|
||||
else if( guiPreviousOptionScreen == GAME_INIT_OPTIONS_SCREEN )//hayden
|
||||
SetSaveLoadExitScreen( GAME_INIT_OPTIONS_SCREEN );
|
||||
|
||||
else
|
||||
SetSaveLoadExitScreen( OPTIONS_SCREEN );
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8,00"
|
||||
Version="8.00"
|
||||
Name="SGP_2005Express"
|
||||
ProjectGUID="{6283CE93-2960-4596-8E74-7A6FBA8716FF}"
|
||||
RootNamespace="SGP_2005Express"
|
||||
@@ -41,6 +41,7 @@
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/D "_CRT_SECURE_NO_DEPRECATE""
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\Multiplayer"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;NO_ZLIB_COMPRESSION"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
@@ -104,6 +105,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/D "_CRT_SECURE_NO_DEPRECATE""
|
||||
AdditionalIncludeDirectories="..\Multiplayer"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;NO_ZLIB_COMPRESSION"
|
||||
RuntimeLibrary="0"
|
||||
RuntimeTypeInfo="false"
|
||||
|
||||
@@ -330,7 +330,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\Res;..\Build;..\TileEngine;..\Tactical;..\Utils;..\lua;..\strategic;..\Console;..\;.\"
|
||||
AdditionalIncludeDirectories="..\Multiplayer;..\Res;..\Build;..\TileEngine;..\Tactical;..\Utils;..\lua;..\strategic;..\Console;..\;.\"
|
||||
PreprocessorDefinitions="JA2_PRECOMPILED_HEADERS;NO_ZLIB_COMPRESSION;_DEBUG;WIN32;_WINDOWS;JA2;_VTUNE_PROFILING;XML_STATIC;CINTERFACE"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="2"
|
||||
|
||||
@@ -386,25 +386,25 @@ INT32 FAR PASCAL WindowProcedure(HWND hWindow, UINT16 Message, WPARAM wParam, LP
|
||||
}
|
||||
break;
|
||||
case FALSE: // We are suspending direct draw
|
||||
#ifdef JA2
|
||||
// pause the JA2 Global clock
|
||||
PauseTime( TRUE );
|
||||
SuspendVideoManager();
|
||||
#else
|
||||
#ifndef UTIL
|
||||
if(!VideoInspectorIsEnabled())
|
||||
SuspendVideoManager();
|
||||
#endif
|
||||
#endif
|
||||
// suspend movement timer, to prevent timer crash if delay becomes long
|
||||
// * it doesn't matter whether the 3-D engine is actually running or not, or if it's even been initialized
|
||||
// * restore is automatic, no need to do anything on reactivation
|
||||
#if !defined( JA2 ) && !defined( UTIL )
|
||||
MoveTimer(TIMER_SUSPEND);
|
||||
#endif
|
||||
|
||||
gfApplicationActive = FALSE;
|
||||
fRestore = TRUE;
|
||||
//#ifdef JA2
|
||||
// // pause the JA2 Global clock
|
||||
// PauseTime( TRUE );
|
||||
// SuspendVideoManager();
|
||||
//#else
|
||||
//#ifndef UTIL
|
||||
// if(!VideoInspectorIsEnabled())
|
||||
// SuspendVideoManager();
|
||||
//#endif
|
||||
//#endif
|
||||
// // suspend movement timer, to prevent timer crash if delay becomes long
|
||||
// // * it doesn't matter whether the 3-D engine is actually running or not, or if it's even been initialized
|
||||
// // * restore is automatic, no need to do anything on reactivation
|
||||
//#if !defined( JA2 ) && !defined( UTIL )
|
||||
// MoveTimer(TIMER_SUSPEND);
|
||||
//#endif
|
||||
//
|
||||
// gfApplicationActive = FALSE;
|
||||
// fRestore = TRUE;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
@@ -419,27 +419,27 @@ INT32 FAR PASCAL WindowProcedure(HWND hWindow, UINT16 Message, WPARAM wParam, LP
|
||||
break;
|
||||
|
||||
case WM_SETFOCUS:
|
||||
#if !defined( JA2 ) && !defined( UTIL )
|
||||
if(!VideoInspectorIsEnabled())
|
||||
RestoreVideoManager();
|
||||
gfApplicationActive=TRUE;
|
||||
// RestrictMouseToXYXY(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
|
||||
#else
|
||||
RestoreCursorClipRect( );
|
||||
#endif
|
||||
//#if !defined( JA2 ) && !defined( UTIL )
|
||||
// if(!VideoInspectorIsEnabled())
|
||||
// RestoreVideoManager();
|
||||
// gfApplicationActive=TRUE;
|
||||
//// RestrictMouseToXYXY(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
|
||||
//#else
|
||||
// RestoreCursorClipRect( );
|
||||
//#endif
|
||||
|
||||
break;
|
||||
|
||||
case WM_KILLFOCUS:
|
||||
#if !defined( JA2 ) && !defined( UTIL )
|
||||
if(!VideoInspectorIsEnabled())
|
||||
SuspendVideoManager();
|
||||
|
||||
gfApplicationActive=FALSE;
|
||||
FreeMouseCursor();
|
||||
#endif
|
||||
// Set a flag to restore surfaces once a WM_ACTIVEATEAPP is received
|
||||
fRestore = TRUE;
|
||||
//#if !defined( JA2 ) && !defined( UTIL )
|
||||
// if(!VideoInspectorIsEnabled())
|
||||
// SuspendVideoManager();
|
||||
//
|
||||
// gfApplicationActive=FALSE;
|
||||
// FreeMouseCursor();
|
||||
//#endif
|
||||
// // Set a flag to restore surfaces once a WM_ACTIVEATEAPP is received
|
||||
// fRestore = TRUE;
|
||||
break;
|
||||
|
||||
|
||||
|
||||
@@ -4153,14 +4153,12 @@ void AttackTarget( SOLDIERCELL *pAttacker, SOLDIERCELL *pTarget )
|
||||
{
|
||||
iImpact = HTHImpact( pAttacker->pSoldier, pTarget->pSoldier, ubAccuracy, (BOOLEAN)(fKnife || fClaw) );
|
||||
}
|
||||
|
||||
// WANNE: Why is impact here always set to 0? The impact was calculated a few lines before!
|
||||
//iImpact = 0;
|
||||
|
||||
// WANNE: Just for safty.
|
||||
if (iImpact < 0)
|
||||
iImpact = 0;
|
||||
|
||||
iNewLife = pTarget->pSoldier->stats.bLife - iImpact;
|
||||
|
||||
if( pAttacker->uiFlags & CELL_MERC )
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
#include "Tactical Save.h"
|
||||
#endif
|
||||
|
||||
#include "connect.h"
|
||||
|
||||
extern BOOLEAN InitStrategicMovementCosts();
|
||||
void InitKnowFacilitiesFlags( );
|
||||
|
||||
@@ -386,6 +388,7 @@ void TrashUndergroundSectorInfo()
|
||||
void BuildUndergroundSectorInfoList()
|
||||
{
|
||||
UNDERGROUND_SECTORINFO *curr;
|
||||
SECTORINFO *pSector = NULL;
|
||||
|
||||
TrashUndergroundSectorInfo();
|
||||
|
||||
@@ -582,8 +585,9 @@ void InitNewCampaign()
|
||||
|
||||
BuildUndergroundSectorInfoList();
|
||||
|
||||
// allow overhead view of omerta A9 on game onset
|
||||
SetSectorFlag( 9, 1, 0, SF_ALREADY_VISITED );
|
||||
if (!is_networked)
|
||||
// allow overhead view of omerta A9 on game onset
|
||||
SetSectorFlag( 9, 1, 0, SF_ALREADY_VISITED ); //hayden
|
||||
|
||||
//Generates the initial forces in a new campaign. The idea is to randomize numbers and sectors
|
||||
//so that no two games are the same.
|
||||
|
||||
@@ -33,6 +33,9 @@
|
||||
#include "Map Information.h"
|
||||
#endif
|
||||
|
||||
#include "connect.h"
|
||||
|
||||
|
||||
#ifdef JA2BETAVERSION
|
||||
BOOLEAN gfClearCreatureQuest = FALSE;
|
||||
extern UINT32 uiMeanWhileFlags;
|
||||
@@ -933,7 +936,13 @@ void CreatureAttackTown( UINT8 ubSectorID, BOOLEAN fOverrideTest )
|
||||
InitPreBattleInterface( NULL, TRUE );
|
||||
break;
|
||||
case CREATURE_BATTLE_CODE_TACTICALLYADD:
|
||||
PrepareCreaturesForBattle();
|
||||
if (is_networked)
|
||||
{
|
||||
if(is_server && CREATURE_ENABLED)
|
||||
PrepareCreaturesForBattle();
|
||||
}
|
||||
else
|
||||
PrepareCreaturesForBattle();
|
||||
break;
|
||||
}
|
||||
InterruptTime();
|
||||
|
||||
+19
-2
@@ -63,7 +63,8 @@
|
||||
#include "Interface Panels.h"
|
||||
#endif
|
||||
|
||||
//forward declarations of common classes to eliminate includes
|
||||
#include "text.h"
|
||||
#include "connect.h"
|
||||
class OBJECTTYPE;
|
||||
class SOLDIERTYPE;
|
||||
|
||||
@@ -418,7 +419,7 @@ BOOLEAN InitNewGame( BOOLEAN fReset )
|
||||
ClearTacticalMessageQueue( );
|
||||
|
||||
// clear mapscreen messages
|
||||
FreeGlobalMessageList();
|
||||
if(!is_networked)FreeGlobalMessageList(); //hayden
|
||||
|
||||
// IF our first time, go into laptop!
|
||||
if ( gubScreenCount == 0 )
|
||||
@@ -435,6 +436,8 @@ BOOLEAN InitNewGame( BOOLEAN fReset )
|
||||
// this is for the "mercs climbing down from a rope" animation, NOT Skyrider!!
|
||||
ResetHeliSeats( );
|
||||
|
||||
if(!is_networked)
|
||||
{
|
||||
// Setup two new messages!
|
||||
AddPreReadEmail(OLD_ENRICO_1,OLD_ENRICO_1_LENGTH,MAIL_ENRICO, GetWorldTotalMin() );
|
||||
AddPreReadEmail(OLD_ENRICO_2,OLD_ENRICO_2_LENGTH,MAIL_ENRICO, GetWorldTotalMin() );
|
||||
@@ -446,6 +449,7 @@ BOOLEAN InitNewGame( BOOLEAN fReset )
|
||||
{
|
||||
AddEmail(MERC_INTRO, MERC_INTRO_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin( ), -1 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -509,8 +513,21 @@ BOOLEAN InitNewGame( BOOLEAN fReset )
|
||||
#endif
|
||||
|
||||
|
||||
if(is_networked)
|
||||
{
|
||||
SetLaptopExitScreen( MAP_SCREEN ); //hayden
|
||||
SetPendingNewScreen( MAP_SCREEN );
|
||||
ScreenMsg( MSG_FONT_WHITE, MSG_CHAT, L"------------------------------------------------------");
|
||||
ScreenMsg( MSG_FONT_WHITE, MSG_CHAT, MPHelp[0]);
|
||||
ScreenMsg( MSG_FONT_WHITE, MSG_CHAT, L"------------------------------------------------------");
|
||||
ScreenMsg( MSG_FONT_WHITE, MSG_CHAT, MPHelp[1]);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
SetLaptopExitScreen( INIT_SCREEN );
|
||||
SetPendingNewScreen(LAPTOP_SCREEN);
|
||||
}
|
||||
gubScreenCount = 1;
|
||||
|
||||
//Set the fact the game is in progress
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "Dialogue Control.h"
|
||||
#endif
|
||||
|
||||
#include "connect.h"
|
||||
void HourlyQuestUpdate( void );
|
||||
void HourlyLarryUpdate( void );
|
||||
|
||||
@@ -42,6 +43,8 @@ void HandleHourlyUpdate()
|
||||
//if the game hasnt even started yet ( we havent arrived in the sector ) dont process this
|
||||
if ( DidGameJustStart() )
|
||||
return;
|
||||
if(is_networked)
|
||||
return;
|
||||
|
||||
// hourly update of town loyalty
|
||||
HandleTownLoyalty();
|
||||
|
||||
@@ -51,6 +51,8 @@
|
||||
#include "SaveLoadScreen.h"
|
||||
#endif
|
||||
|
||||
#include "connect.h"
|
||||
|
||||
/* CHRISL: Adjusted settings to allow new Map_Screen_Bottom_800x600.sti to work. This is needed if we
|
||||
want to have the new inventory panel not overlap the message text area. */
|
||||
#define MAP_BOTTOM_X 0
|
||||
@@ -292,13 +294,15 @@ void RenderMapScreenInterfaceBottom( BOOLEAN fForceMapscreenFullRender )
|
||||
|
||||
// render whole panel
|
||||
// HEADROCK Changed this line to accept outside influence through the new boolean:
|
||||
if ( fForceMapscreenFullRender == TRUE || fMapScreenBottomDirty == TRUE )
|
||||
if ( fForceMapscreenFullRender == TRUE || fMapScreenBottomDirty == TRUE)
|
||||
{
|
||||
// get and blt panel
|
||||
GetVideoObject(&hHandle, guiMAPBOTTOMPANEL );
|
||||
BltVideoObject( guiSAVEBUFFER , hHandle, 0, MAP_BOTTOM_X, MAP_BOTTOM_Y, VO_BLT_SRCTRANSPARENCY,NULL );
|
||||
GetVideoObject(&hHandle, guiMAPBOTTOMPANEL );
|
||||
BltVideoObject( guiSAVEBUFFER , hHandle, 0, MAP_BOTTOM_X, MAP_BOTTOM_Y, VO_BLT_SRCTRANSPARENCY,NULL );
|
||||
|
||||
if( GetSectorFlagStatus( sSelMapX, sSelMapY, ( UINT8 )iCurrentMapSectorZ, SF_ALREADY_VISITED ) == TRUE )
|
||||
// WANNE - MP: Radarmap image should be displayed on every sector in multiplayer game
|
||||
if( GetSectorFlagStatus( sSelMapX, sSelMapY, ( UINT8 )iCurrentMapSectorZ, SF_ALREADY_VISITED ) == TRUE
|
||||
|| is_networked)
|
||||
{
|
||||
GetMapFileName( sSelMapX, sSelMapY, ( UINT8 )iCurrentMapSectorZ, bFilename, TRUE, TRUE );
|
||||
LoadRadarScreenBitmap( bFilename );
|
||||
@@ -1286,6 +1290,12 @@ void EnableDisAbleMapScreenOptionsButton( BOOLEAN fEnable )
|
||||
|
||||
BOOLEAN AllowedToTimeCompress( void )
|
||||
{
|
||||
// WANNE - MP: In multiplayer mode we do not allow compress time, for now.
|
||||
if (is_networked)
|
||||
{
|
||||
return ( FALSE );
|
||||
}
|
||||
|
||||
// if already leaving, disallow any other attempts to exit
|
||||
if ( fLeavingMapScreen )
|
||||
{
|
||||
@@ -1759,6 +1769,10 @@ BOOLEAN AllowedToExitFromMapscreenTo( INT8 bExitToWhere )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
if ( (( sSelMapX != gWorldSectorX ) || ( sSelMapY != gWorldSectorY ) || (( UINT8 )iCurrentMapSectorZ ) != gbWorldSectorZ ) && is_client) //hayden (PBI only)
|
||||
{
|
||||
return (FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
//if we are map screen sector inventory
|
||||
@@ -1768,6 +1782,13 @@ BOOLEAN AllowedToExitFromMapscreenTo( INT8 bExitToWhere )
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
//hayden
|
||||
if( bExitToWhere == MAP_EXIT_TO_LAPTOP && !allowlaptop && is_networked /*&& (is_client || is_server)*/)
|
||||
{
|
||||
//dont allow it
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
// OK to go there, passed all the checks
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
@@ -589,7 +589,6 @@ void CreateDestroyMapInventoryPoolButtons( BOOLEAN fExitFromMapScreen )
|
||||
{
|
||||
DeleteItemDescriptionBox();
|
||||
}
|
||||
|
||||
//DEF: added to remove the 'item blip' from staying on the radar map
|
||||
iCurrentlyHighLightedItem = -1;
|
||||
|
||||
@@ -840,16 +839,16 @@ void MapInvenPoolSlots(MOUSE_REGION * pRegion, INT32 iReason )
|
||||
{
|
||||
if(OK_CONTROLLABLE_MERC( MercPtrs[gCharactersList[bSelectedInfoChar].usSolID] ))
|
||||
{
|
||||
if(ItemSlotLimit( &twItem->object, STACK_SIZE_LIMIT ) == 1)
|
||||
{
|
||||
fShowInventoryFlag = TRUE;
|
||||
MAPInternalInitItemDescriptionBox( &twItem->object, 0, MercPtrs[gCharactersList[bSelectedInfoChar].usSolID] );
|
||||
}
|
||||
else if(gpItemPointer == NULL || gpItemPointer->usItem == twItem->object.usItem || ValidAttachment(gpItemPointer->usItem, twItem->object.usItem) == TRUE || ValidAmmoType(twItem->object.usItem, gpItemPointer->usItem) == TRUE)
|
||||
{
|
||||
InitSectorStackPopup( MercPtrs[gCharactersList[bSelectedInfoChar].usSolID], twItem, iCounter, 0, INV_REGION_Y, 261, ( SCREEN_HEIGHT - PLAYER_INFO_Y ) );
|
||||
fTeamPanelDirty=TRUE;
|
||||
fInterfacePanelDirty = DIRTYLEVEL2;
|
||||
if(ItemSlotLimit( &twItem->object, STACK_SIZE_LIMIT ) == 1)
|
||||
{
|
||||
fShowInventoryFlag = TRUE;
|
||||
MAPInternalInitItemDescriptionBox( &twItem->object, 0, MercPtrs[gCharactersList[bSelectedInfoChar].usSolID] );
|
||||
}
|
||||
else if(gpItemPointer == NULL || gpItemPointer->usItem == twItem->object.usItem || ValidAttachment(gpItemPointer->usItem, twItem->object.usItem) == TRUE || ValidAmmoType(twItem->object.usItem, gpItemPointer->usItem) == TRUE)
|
||||
{
|
||||
InitSectorStackPopup( MercPtrs[gCharactersList[bSelectedInfoChar].usSolID], twItem, iCounter, 0, INV_REGION_Y, 261, ( SCREEN_HEIGHT - PLAYER_INFO_Y ) );
|
||||
fTeamPanelDirty=TRUE;
|
||||
fInterfacePanelDirty = DIRTYLEVEL2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,6 +45,8 @@
|
||||
#include "Air Raid.h"
|
||||
#endif
|
||||
|
||||
#include "connect.h"
|
||||
|
||||
// zoom x and y coords for map scrolling
|
||||
INT32 iZoomX = 0;
|
||||
INT32 iZoomY = 0;
|
||||
@@ -756,41 +758,44 @@ UINT32 DrawMap( void )
|
||||
for ( cnt2 = 1; cnt2 < MAP_WORLD_Y - 1; cnt2++ )
|
||||
{
|
||||
// LATE DESIGN CHANGE: darken sectors not yet visited, instead of those under known enemy control
|
||||
if( GetSectorFlagStatus( cnt, cnt2, ( UINT8 ) iCurrentMapSectorZ, SF_ALREADY_VISITED ) == FALSE )
|
||||
// if ( IsTheSectorPerceivedToBeUnderEnemyControl( cnt, cnt2, ( INT8 )( iCurrentMapSectorZ ) ) )
|
||||
if(!is_networked) //hayden - dont darken anything
|
||||
{
|
||||
if( fShowAircraftFlag && !iCurrentMapSectorZ )
|
||||
if( GetSectorFlagStatus( cnt, cnt2, ( UINT8 ) iCurrentMapSectorZ, SF_ALREADY_VISITED ) == FALSE )
|
||||
// if ( IsTheSectorPerceivedToBeUnderEnemyControl( cnt, cnt2, ( INT8 )( iCurrentMapSectorZ ) ) )
|
||||
{
|
||||
if( !StrategicMap[ cnt + cnt2 * WORLD_MAP_X ].fEnemyAirControlled )
|
||||
if( fShowAircraftFlag && !iCurrentMapSectorZ )
|
||||
{
|
||||
// sector not visited, not air controlled
|
||||
ShadeMapElem( cnt, cnt2, MAP_SHADE_DK_GREEN );
|
||||
if( !StrategicMap[ cnt + cnt2 * WORLD_MAP_X ].fEnemyAirControlled )
|
||||
{
|
||||
// sector not visited, not air controlled
|
||||
ShadeMapElem( cnt, cnt2, MAP_SHADE_DK_GREEN );
|
||||
}
|
||||
else
|
||||
{
|
||||
// sector not visited, controlled and air not
|
||||
ShadeMapElem( cnt, cnt2, MAP_SHADE_DK_RED );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// sector not visited, controlled and air not
|
||||
ShadeMapElem( cnt, cnt2, MAP_SHADE_DK_RED );
|
||||
// not visited
|
||||
ShadeMapElem( cnt, cnt2, MAP_SHADE_BLACK );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// not visited
|
||||
ShadeMapElem( cnt, cnt2, MAP_SHADE_BLACK );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if( fShowAircraftFlag && !iCurrentMapSectorZ )
|
||||
{
|
||||
if( !StrategicMap[ cnt + cnt2 * WORLD_MAP_X ].fEnemyAirControlled )
|
||||
if( fShowAircraftFlag && !iCurrentMapSectorZ )
|
||||
{
|
||||
// sector visited and air controlled
|
||||
ShadeMapElem( cnt, cnt2, MAP_SHADE_LT_GREEN);
|
||||
}
|
||||
else
|
||||
{
|
||||
// sector visited but not air controlled
|
||||
ShadeMapElem( cnt, cnt2, MAP_SHADE_LT_RED );
|
||||
if( !StrategicMap[ cnt + cnt2 * WORLD_MAP_X ].fEnemyAirControlled )
|
||||
{
|
||||
// sector visited and air controlled
|
||||
ShadeMapElem( cnt, cnt2, MAP_SHADE_LT_GREEN);
|
||||
}
|
||||
else
|
||||
{
|
||||
// sector visited but not air controlled
|
||||
ShadeMapElem( cnt, cnt2, MAP_SHADE_LT_RED );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include "Render Dirty.h"
|
||||
#include "Font Control.h"
|
||||
#include "Assignments.h"
|
||||
|
||||
#include "Soldier Control.h"
|
||||
#include "Overhead.h"
|
||||
#include "Squads.h"
|
||||
#include "Sound Control.h"
|
||||
@@ -55,6 +55,8 @@
|
||||
#include "Render Fun.h"
|
||||
#endif
|
||||
|
||||
#include "connect.h"
|
||||
|
||||
//forward declarations of common classes to eliminate includes
|
||||
class OBJECTTYPE;
|
||||
class SOLDIERTYPE;
|
||||
@@ -5593,20 +5595,38 @@ BOOLEAN HandleTimeCompressWithTeamJackedInAndGearedToGo( void )
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
// select starting sector (A9 - Omerta)
|
||||
ChangeSelectedMapSector( 9, 1, 0 );
|
||||
|
||||
// load starting sector
|
||||
if ( !SetCurrentWorldSector( 9, 1, 0 ) )
|
||||
if (!is_networked)
|
||||
// select starting sector (A9 - Omerta)
|
||||
ChangeSelectedMapSector( 9, 1, 0 );
|
||||
|
||||
if (is_networked)
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
// load starting sector
|
||||
if ( !SetCurrentWorldSector( gsMercArriveSectorX, gsMercArriveSectorY, 0 ) )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
//Setup variables in the PBI for this first battle. We need to support the
|
||||
gubPBSectorX = (UINT8)gsMercArriveSectorX;
|
||||
gubPBSectorY = (UINT8)gsMercArriveSectorY;
|
||||
}
|
||||
else
|
||||
{
|
||||
// load starting sector
|
||||
if ( !SetCurrentWorldSector( 9, 1, 0 ) )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
gubPBSectorX = 9;
|
||||
gubPBSectorY = 1;
|
||||
}
|
||||
|
||||
|
||||
//Setup variables in the PBI for this first battle. We need to support the
|
||||
//non-persistant PBI in case the user goes to mapscreen.
|
||||
gfBlitBattleSectorLocator = TRUE;
|
||||
gubPBSectorX = 9;
|
||||
gubPBSectorY = 1;
|
||||
|
||||
gubPBSectorZ = 0;
|
||||
gubEnemyEncounterCode = ENTERING_ENEMY_SECTOR_CODE;
|
||||
|
||||
|
||||
@@ -41,6 +41,8 @@
|
||||
#include "email.h"
|
||||
#endif
|
||||
|
||||
#include "GameSettings.h"
|
||||
#include "connect.h"
|
||||
|
||||
void CalculateMedicalDepositRefund( SOLDIERTYPE *pSoldier );
|
||||
void NotifyPlayerOfMercDepartureAndPromptEquipmentPlacement( SOLDIERTYPE *pSoldier, BOOLEAN fAddRehireButton );
|
||||
@@ -1488,7 +1490,16 @@ UINT32 GetHourWhenContractDone( SOLDIERTYPE *pSoldier )
|
||||
UINT32 uiArriveHour;
|
||||
|
||||
// Get the arrival hour - that will give us when they arrived....
|
||||
uiArriveHour = ( ( pSoldier->uiTimeSoldierWillArrive ) - ( ( ( pSoldier->uiTimeSoldierWillArrive ) / 1440 ) * 1440 ) ) / 60;
|
||||
if (!is_networked)
|
||||
{
|
||||
uiArriveHour = ( ( pSoldier->uiTimeSoldierWillArrive ) - ( ( ( pSoldier->uiTimeSoldierWillArrive ) / 1440 ) * 1440 ) ) / 60;
|
||||
}
|
||||
else
|
||||
{
|
||||
// WANNE - MP: For multiplayer game, the merc arrive hour is always the game starting time which is now in multiplayer = GameStartingTime + FirstArrivalDelay
|
||||
// Default value: 07:00
|
||||
uiArriveHour = (gGameExternalOptions.iGameStartingTime + gGameExternalOptions.iFirstArrivalDelay - NUM_SEC_IN_DAY) / 3600;
|
||||
}
|
||||
|
||||
return( uiArriveHour );
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "Tactical Save.h"
|
||||
#endif
|
||||
|
||||
#include "connect.h"
|
||||
#include "MilitiaSquads.h"
|
||||
#include "Reinforcement.h"
|
||||
|
||||
@@ -765,10 +766,18 @@ void DoMilitiaHelpFromAdjacentSectors( INT16 sMapX, INT16 sMapY )
|
||||
}
|
||||
}
|
||||
|
||||
// If militia have been moved here, no reason to reset--just add them. If militia have not moved, then no strategic
|
||||
// changes were made. Either case, this flag should be false.
|
||||
gfStrategicMilitiaChangesMade = FALSE;
|
||||
if (is_networked)
|
||||
{
|
||||
if (gfStrategicMilitiaChangesMade)
|
||||
{
|
||||
RemoveMilitiaFromTactical();
|
||||
if(is_server && MILITIA_ENABLED)
|
||||
PrepareMilitiaForTactical(FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
gfStrategicMilitiaChangesMade = FALSE;
|
||||
}
|
||||
|
||||
void MSCallBack( UINT8 ubResult )
|
||||
{
|
||||
|
||||
@@ -58,6 +58,7 @@ extern BOOLEAN gfExitViewer;
|
||||
extern BOOLEAN fZoomFlag;
|
||||
extern BOOLEAN fMapScreenBottomDirty;
|
||||
|
||||
#include "connect.h"
|
||||
|
||||
BOOLEAN gfTacticalTraversal = FALSE;
|
||||
GROUP *gpTacticalTraversalGroup = NULL;
|
||||
@@ -696,7 +697,7 @@ void InitPreBattleInterface( GROUP *pBattleGroup, BOOLEAN fPersistantPBI )
|
||||
if( gfAutomaticallyStartAutoResolve || !fRetreatAnOption ||
|
||||
gubEnemyEncounterCode == ENEMY_AMBUSH_CODE ||
|
||||
gubEnemyEncounterCode == BLOODCAT_AMBUSH_CODE ||
|
||||
gubEnemyEncounterCode == CREATURE_ATTACK_CODE )
|
||||
gubEnemyEncounterCode == CREATURE_ATTACK_CODE || is_client)
|
||||
{
|
||||
DisableButton( iPBButton[ 2 ] );
|
||||
SetButtonFastHelpText( iPBButton[ 2 ], gzNonPersistantPBIText[ 9 ] );
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
extern BOOLEAN gfClearCreatureQuest;
|
||||
#endif
|
||||
|
||||
#include "connect.h"
|
||||
#include "Reinforcement.h"
|
||||
#include "MilitiaSquads.h"
|
||||
|
||||
@@ -200,6 +201,9 @@ UINT8 NumEnemiesInSector( INT16 sSectorX, INT16 sSectorY )
|
||||
|
||||
pSector = &SectorInfo[ SECTOR( sSectorX, sSectorY ) ];
|
||||
ubNumTroops = (UINT8)(pSector->ubNumAdmins + pSector->ubNumTroops + pSector->ubNumElites);
|
||||
|
||||
if (is_networked)
|
||||
ubNumTroops += numenemyLAN((UINT8)sSectorX,(UINT8)sSectorY ); //hayden
|
||||
|
||||
pGroup = gpGroupList;
|
||||
while( pGroup )
|
||||
@@ -885,7 +889,12 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"QueenCommand");
|
||||
if( pGroup->ubGroupSize <= iMaxEnemyGroupSize && pGroup->pEnemyGroup->ubNumTroops != pGroup->pEnemyGroup->ubTroopsInBattle && !gfPendingEnemies ||
|
||||
pGroup->ubGroupSize > iMaxEnemyGroupSize || pGroup->pEnemyGroup->ubNumTroops > 50 || pGroup->pEnemyGroup->ubTroopsInBattle > 50 )
|
||||
{
|
||||
DoScreenIndependantMessageBox( L"Group troop counters are bad. What were the last 2-3 things to die, and how? Save game and send to KM with info!!!", MSG_BOX_FLAG_OK, NULL );
|
||||
// haydent
|
||||
if (!is_client)
|
||||
{
|
||||
DoScreenIndependantMessageBox( L"Group troop counters are bad. What were the last 2-3 things to die, and how? Save game and send to KM with info!!!", MSG_BOX_FLAG_OK, NULL );
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -986,7 +995,8 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"QueenCommand");
|
||||
!pSector->ubNumTroops || !pSector->ubTroopsInBattle ||
|
||||
pSector->ubNumTroops > 100 || pSector->ubTroopsInBattle > 32 )
|
||||
{
|
||||
DoScreenIndependantMessageBox( L"Sector troop counters are bad. What were the last 2-3 things to die, and how? Save game and send to KM with info!!!", MSG_BOX_FLAG_OK, NULL );
|
||||
if(!is_client)DoScreenIndependantMessageBox( L"Sector troop counters are bad. What were the last 2-3 things to die, and how? Save game and send to KM with info!!!", MSG_BOX_FLAG_OK, NULL );
|
||||
//disabled: hayden.
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -1195,6 +1205,12 @@ void AddPossiblePendingEnemiesToBattle()
|
||||
GROUP **pGroupInSectorList;
|
||||
static UINT8 ubPredefinedInsertionCode = 255;
|
||||
|
||||
// haydent
|
||||
if ((is_client && !is_server) || !ENEMY_ENABLED)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// check if no world is loaded
|
||||
if ( !gWorldSectorX && !gWorldSectorY && (gbWorldSectorZ == -1) )
|
||||
return;
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "Inventory Choosing.h"
|
||||
#endif
|
||||
|
||||
#include "connect.h"
|
||||
#include "Reinforcement.h"
|
||||
#include "MilitiaSquads.h"
|
||||
|
||||
@@ -391,6 +392,12 @@ void AddPossiblePendingMilitiaToBattle()
|
||||
static UINT8 ubPredefinedInsertionCode = 255;
|
||||
static UINT8 ubPredefinedRank = 255;
|
||||
|
||||
// Haydent
|
||||
if ((is_client && !is_server) || !MILITIA_ENABLED)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// if( !PlayerMercsInSector( (UINT8)gWorldSectorX, (UINT8)gWorldSectorY, 0 ) || !CountAllMilitiaInSector( gWorldSectorX, gWorldSectorY )
|
||||
// || !NumEnemiesInSector( gWorldSectorX, gWorldSectorY ) ) return;
|
||||
if( !PlayerMercsInSector( (UINT8)gWorldSectorX, (UINT8)gWorldSectorY, 0 )
|
||||
|
||||
@@ -33,6 +33,8 @@
|
||||
#endif
|
||||
#include "BobbyRMailOrder.h"
|
||||
|
||||
#include "connect.h"
|
||||
|
||||
//forward declarations of common classes to eliminate includes
|
||||
class OBJECTTYPE;
|
||||
class SOLDIERTYPE;
|
||||
@@ -75,6 +77,14 @@ void BobbyRayPurchaseEventCallback( UINT8 ubOrderID )
|
||||
|
||||
sStandardMapPos = BOBBYR_SHIPPING_DEST_GRIDNO;
|
||||
|
||||
// Haydent
|
||||
if(gpNewBobbyrShipments[ ubOrderID ].fActive && is_client)
|
||||
{
|
||||
DropOffItemsInSector( ubOrderID );//hayden
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// if the delivery is for meduna, drop the items off there instead
|
||||
if( gpNewBobbyrShipments[ ubOrderID ].fActive && gpNewBobbyrShipments[ ubOrderID ].ubDeliveryLoc == BR_MEDUNA )
|
||||
{
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
#endif
|
||||
|
||||
#include "MilitiaSquads.h"
|
||||
|
||||
#include "connect.h"
|
||||
//forward declarations of common classes to eliminate includes
|
||||
class OBJECTTYPE;
|
||||
class SOLDIERTYPE;
|
||||
@@ -922,7 +922,7 @@ void PrepareForPreBattleInterface( GROUP *pPlayerDialogGroup, GROUP *pInitiating
|
||||
pSoldier = pPlayer->pSoldier;
|
||||
|
||||
if ( pSoldier->stats.bLife >= OKLIFE && !( pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE ) &&
|
||||
!AM_A_ROBOT( pSoldier ) && !AM_AN_EPC( pSoldier ) )
|
||||
!AM_A_ROBOT( pSoldier ) && !AM_AN_EPC( pSoldier ) && !is_client )
|
||||
{
|
||||
ubMercsInGroup[ ubNumMercs ] = pSoldier->ubID;
|
||||
ubNumMercs++;
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""..\Standard Gaming Platform";..\TileEngine;..\;..\Tactical;..\Utils;..\tacticalai;..\Editor;..\lua;..\Laptop;.\"
|
||||
AdditionalIncludeDirectories="..\Multiplayer;"..\Standard Gaming Platform";..\TileEngine;..\;..\Tactical;..\Utils;..\tacticalai;..\Editor;..\lua;..\Laptop;.\"
|
||||
PreprocessorDefinitions="PRECOMPILEDHEADERS;_DEBUG;WIN32;_WINDOWS;JA2;_VTUNE_PROFILING;XML_STATIC;CINTERFACE"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="2"
|
||||
@@ -390,7 +390,7 @@
|
||||
FavorSizeOrSpeed="1"
|
||||
OptimizeForProcessor="3"
|
||||
OptimizeForWindowsApplication="TRUE"
|
||||
AdditionalIncludeDirectories=""..\Standard Gaming Platform";..\TileEngine;..\;..\Tactical;..\Utils;..\tacticalai;..\Editor;..\Laptop;.\"
|
||||
AdditionalIncludeDirectories="..\Multiplayer;"..\Standard Gaming Platform";..\TileEngine;..\;..\Tactical;..\Utils;..\tacticalai;..\Editor;..\Laptop;.\"
|
||||
PreprocessorDefinitions="PRECOMPILEDHEADERS;NDEBUG;WIN32;_WINDOWS;JA2;XML_STATIC;CINTERFACE"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="0"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8,00"
|
||||
Version="8.00"
|
||||
Name="Strategic_2005Express"
|
||||
ProjectGUID="{AB8837DB-0435-40C7-916A-0AACF5CFF1C4}"
|
||||
RootNamespace="Strategic_2005Express"
|
||||
@@ -41,6 +41,7 @@
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/D "_CRT_SECURE_NO_DEPRECATE""
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\Multiplayer"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
@@ -104,6 +105,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/D "_CRT_SECURE_NO_DEPRECATE""
|
||||
AdditionalIncludeDirectories="..\Multiplayer"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;"
|
||||
RuntimeLibrary="0"
|
||||
RuntimeTypeInfo="false"
|
||||
|
||||
+185
-73
@@ -113,8 +113,8 @@
|
||||
#include "Animation Control.h"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#include "connect.h" //hayden
|
||||
#include "fresh_header.h"
|
||||
// DEFINES
|
||||
|
||||
|
||||
@@ -1078,22 +1078,22 @@ void BeginSellAllCallBack( UINT8 bExitValue )
|
||||
if(pInventoryPoolList[wItem].object.exists() == true && (pInventoryPoolList[wItem].usFlags & WORLD_ITEM_REACHABLE))
|
||||
{
|
||||
if(0 == pInventoryPoolList[wItem].object.MoveThisObjectTo(gItemPointer,-1,0,NUM_INV_SLOTS,MAX_OBJECTS_PER_SLOT))
|
||||
{
|
||||
if (pInventoryPoolList[wItem].object.exists() == false) {
|
||||
pInventoryPoolList[wItem].object.initialize();
|
||||
}
|
||||
// Dirty interface
|
||||
fMapPanelDirty = TRUE;
|
||||
gpItemPointer = &gItemPointer;
|
||||
// Sell Item
|
||||
iPrice += SellItem( gItemPointer );
|
||||
gpItemPointer = NULL;
|
||||
fMapInventoryItem = FALSE;
|
||||
if (iPrice == 0) {
|
||||
iPrice = 1;
|
||||
}
|
||||
anythingSold = true;
|
||||
HandleButtonStatesWhileMapInventoryActive();
|
||||
{
|
||||
if (pInventoryPoolList[wItem].object.exists() == false) {
|
||||
pInventoryPoolList[wItem].object.initialize();
|
||||
}
|
||||
// Dirty interface
|
||||
fMapPanelDirty = TRUE;
|
||||
gpItemPointer = &gItemPointer;
|
||||
// Sell Item
|
||||
iPrice += SellItem( gItemPointer );
|
||||
gpItemPointer = NULL;
|
||||
fMapInventoryItem = FALSE;
|
||||
if (iPrice == 0) {
|
||||
iPrice = 1;
|
||||
}
|
||||
anythingSold = true;
|
||||
HandleButtonStatesWhileMapInventoryActive();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5495,6 +5495,10 @@ UINT32 HandleMapUI( )
|
||||
|
||||
// update destination column for any mercs in transit
|
||||
fTeamPanelDirty = TRUE;
|
||||
|
||||
// added by haydent
|
||||
if (is_networked)
|
||||
ChangeSelectedMapSector( sMapX, sMapY, ( INT8 )iCurrentMapSectorZ );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -5902,8 +5906,19 @@ void GetMapKeyboardInput( UINT32 *puiNewEvent )
|
||||
StopAnyCurrentlyTalkingSpeech( );
|
||||
break;
|
||||
|
||||
// multiplayer: Roman: Should be changed, because the keys are already bount to another feature
|
||||
case F1:
|
||||
if (is_networked)
|
||||
{
|
||||
mp_help();
|
||||
break;
|
||||
}
|
||||
case F2:
|
||||
if (is_networked)
|
||||
{
|
||||
mp_help2();
|
||||
break;
|
||||
}
|
||||
case F3:
|
||||
case F4:
|
||||
case F5:
|
||||
@@ -6030,6 +6045,11 @@ void GetMapKeyboardInput( UINT32 *puiNewEvent )
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (fAlt)
|
||||
{
|
||||
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case '\\':
|
||||
@@ -6075,13 +6095,53 @@ void GetMapKeyboardInput( UINT32 *puiNewEvent )
|
||||
break;
|
||||
|
||||
|
||||
// ROMAN:0 multiplayer: Maybe we need to change the keys, because they are bound to other functions
|
||||
case '1':
|
||||
{
|
||||
if (is_networked)
|
||||
{
|
||||
// haydent
|
||||
start_server();
|
||||
break;
|
||||
}
|
||||
}
|
||||
case '2':
|
||||
{
|
||||
if (is_networked)
|
||||
{
|
||||
// haydent
|
||||
connect_client();
|
||||
break;
|
||||
}
|
||||
}
|
||||
case '3':
|
||||
{
|
||||
if (is_networked)
|
||||
{
|
||||
// haydent
|
||||
start_battle();
|
||||
break;
|
||||
}
|
||||
}
|
||||
case '4':
|
||||
{
|
||||
if (is_networked)
|
||||
{
|
||||
// haydent
|
||||
server_disconnect();
|
||||
client_disconnect();
|
||||
break;
|
||||
}
|
||||
}
|
||||
case '5':
|
||||
case '6':
|
||||
case '7':
|
||||
if (is_networked)
|
||||
{
|
||||
// haydent
|
||||
manual_overide();
|
||||
break;
|
||||
}
|
||||
case '8':
|
||||
case '9':
|
||||
// multi-selects all characters in that squad. SHIFT key and 1-0 for squads 11-20
|
||||
@@ -6223,7 +6283,6 @@ void GetMapKeyboardInput( UINT32 *puiNewEvent )
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 'e':
|
||||
if( gfPreBattleInterfaceActive )
|
||||
{ //activate enter sector in prebattle interface.
|
||||
@@ -6236,65 +6295,65 @@ void GetMapKeyboardInput( UINT32 *puiNewEvent )
|
||||
SOLDIERTYPE *pSoldier = MercPtrs[ gCharactersList[ bSelectedInfoChar ].usSolID ];
|
||||
if(OK_CONTROLLABLE_MERC( pSoldier ))
|
||||
{
|
||||
if(!fShowMapInventoryPool)
|
||||
if(!fShowMapInventoryPool)
|
||||
{
|
||||
fShowMapInventoryPool = TRUE;
|
||||
CreateDestroyMapInventoryPoolButtons( TRUE );
|
||||
}
|
||||
if(!fShowInventoryFlag)
|
||||
{
|
||||
fShowInventoryFlag = TRUE;
|
||||
}
|
||||
if( fCtrl )
|
||||
{
|
||||
//CHRISL: pickup all items to vehicle
|
||||
if ( UsingNewInventorySystem() == true && fShowInventoryFlag && fShowMapInventoryPool && !(gTacticalStatus.fEnemyInSector) && gGameExternalOptions.fVehicleInventory && (pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE))
|
||||
{
|
||||
fShowMapInventoryPool = TRUE;
|
||||
CreateDestroyMapInventoryPoolButtons( TRUE );
|
||||
}
|
||||
if(!fShowInventoryFlag)
|
||||
{
|
||||
fShowInventoryFlag = TRUE;
|
||||
}
|
||||
if( fCtrl )
|
||||
{
|
||||
//CHRISL: pickup all items to vehicle
|
||||
if ( UsingNewInventorySystem() == true && fShowInventoryFlag && fShowMapInventoryPool && !(gTacticalStatus.fEnemyInSector) && gGameExternalOptions.fVehicleInventory && (pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE))
|
||||
for(unsigned int i = 0; i<pInventoryPoolList.size(); i++)
|
||||
{
|
||||
for(unsigned int i = 0; i<pInventoryPoolList.size(); i++)
|
||||
if(pInventoryPoolList[i].fExists == TRUE && (pInventoryPoolList[i].usFlags & WORLD_ITEM_REACHABLE))
|
||||
{
|
||||
if(pInventoryPoolList[i].fExists == TRUE && (pInventoryPoolList[i].usFlags & WORLD_ITEM_REACHABLE))
|
||||
for(int x = 0; x<NUM_INV_SLOTS; x++)
|
||||
{
|
||||
for(int x = 0; x<NUM_INV_SLOTS; x++)
|
||||
if(vehicleInv[x] == FALSE)
|
||||
continue;
|
||||
if(pSoldier->inv[x].exists() == true)
|
||||
{
|
||||
if(vehicleInv[x] == FALSE)
|
||||
if(pSoldier->inv[x].usItem != pInventoryPoolList[i].object.usItem)
|
||||
continue;
|
||||
if(pSoldier->inv[x].exists() == true)
|
||||
{
|
||||
if(pSoldier->inv[x].usItem != pInventoryPoolList[i].object.usItem)
|
||||
continue;
|
||||
else
|
||||
pInventoryPoolList[i].object.AddObjectsToStack(pSoldier->inv[x], -1, pSoldier, x);
|
||||
}
|
||||
else
|
||||
pInventoryPoolList[i].object.MoveThisObjectTo(pSoldier->inv[x], -1, pSoldier, x);
|
||||
if(pInventoryPoolList[i].object.ubNumberOfObjects < 0)
|
||||
{
|
||||
//RemoveItemFromWorld(i);
|
||||
break;
|
||||
}
|
||||
pInventoryPoolList[i].object.AddObjectsToStack(pSoldier->inv[x], -1, pSoldier, x);
|
||||
}
|
||||
else
|
||||
pInventoryPoolList[i].object.MoveThisObjectTo(pSoldier->inv[x], -1, pSoldier, x);
|
||||
if(pInventoryPoolList[i].object.ubNumberOfObjects < 0)
|
||||
{
|
||||
//RemoveItemFromWorld(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
fTeamPanelDirty = TRUE;
|
||||
fMapPanelDirty = TRUE;
|
||||
fInterfacePanelDirty = DIRTYLEVEL2;
|
||||
}
|
||||
fTeamPanelDirty = TRUE;
|
||||
fMapPanelDirty = TRUE;
|
||||
fInterfacePanelDirty = DIRTYLEVEL2;
|
||||
}
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
//CHRISL: drop all items
|
||||
if ( bSelectedInfoChar != -1 && fShowInventoryFlag && fShowMapInventoryPool && !(gTacticalStatus.fEnemyInSector) )
|
||||
{
|
||||
//CHRISL: drop all items
|
||||
if ( bSelectedInfoChar != -1 && fShowInventoryFlag && fShowMapInventoryPool && !(gTacticalStatus.fEnemyInSector) )
|
||||
for(int i = BODYPOSFINAL; i<NUM_INV_SLOTS; i++)
|
||||
{
|
||||
for(int i = BODYPOSFINAL; i<NUM_INV_SLOTS; i++)
|
||||
if(pSoldier->inv[i].exists() == true)
|
||||
{
|
||||
if(pSoldier->inv[i].exists() == true)
|
||||
{
|
||||
AutoPlaceObjectInInventoryStash(&pSoldier->inv[i], pSoldier->sGridNo);
|
||||
DeleteObj(&pSoldier->inv[i]);
|
||||
}
|
||||
fTeamPanelDirty = TRUE;
|
||||
fMapPanelDirty = TRUE;
|
||||
fInterfacePanelDirty = DIRTYLEVEL2;
|
||||
AutoPlaceObjectInInventoryStash(&pSoldier->inv[i], pSoldier->sGridNo);
|
||||
DeleteObj(&pSoldier->inv[i]);
|
||||
}
|
||||
fTeamPanelDirty = TRUE;
|
||||
fMapPanelDirty = TRUE;
|
||||
fInterfacePanelDirty = DIRTYLEVEL2;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6406,6 +6465,15 @@ void GetMapKeyboardInput( UINT32 *puiNewEvent )
|
||||
}
|
||||
break;
|
||||
|
||||
// haydent
|
||||
case 'k':
|
||||
if (fAlt)
|
||||
{
|
||||
if (is_networked)
|
||||
kick_player();
|
||||
}
|
||||
break;
|
||||
|
||||
case 'l':
|
||||
if( fAlt )
|
||||
{
|
||||
@@ -7281,11 +7349,26 @@ void PollLeftButtonInMapView( UINT32 *puiNewEvent )
|
||||
|
||||
// ignore left clicks in the map screen if:
|
||||
// game just started or we're in the prebattle interface or if we are about to hit pre-battle
|
||||
if ( ( gTacticalStatus.fDidGameJustStart == TRUE ) ||
|
||||
( gfPreBattleInterfaceActive == TRUE ) ||
|
||||
( fDisableMapInterfaceDueToBattle == TRUE ) )
|
||||
|
||||
|
||||
if (is_networked)
|
||||
{
|
||||
return;
|
||||
if ( /*( gTacticalStatus.fDidGameJustStart == TRUE ) || */
|
||||
// commented out to allow heli drop off change @/b4 start ;)
|
||||
( gfPreBattleInterfaceActive == TRUE ) ||
|
||||
( fDisableMapInterfaceDueToBattle == TRUE ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( ( gTacticalStatus.fDidGameJustStart == TRUE ) ||
|
||||
( gfPreBattleInterfaceActive == TRUE ) ||
|
||||
( fDisableMapInterfaceDueToBattle == TRUE ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7642,9 +7725,10 @@ void BltCharInvPanel()
|
||||
}
|
||||
else
|
||||
{
|
||||
InitInventorySoldier(gMapScreenInvPocketXY, MAPInvMoveCallback, MAPInvClickCallback, FALSE, FALSE);
|
||||
//InitializeInvPanelCoordsOld();
|
||||
InitInventorySoldier(gMapScreenInvPocketXY, MAPInvMoveCallback, MAPInvClickCallback, FALSE, FALSE);
|
||||
}
|
||||
|
||||
Blt8BPPDataTo16BPPBufferTransparent( pDestBuf, uiDestPitchBYTES, hCharListHandle, PLAYER_INFO_X, PLAYER_INFO_Y, disOpt);
|
||||
UnLockVideoSurface( guiSAVEBUFFER );
|
||||
|
||||
@@ -11813,6 +11897,11 @@ void TellPlayerWhyHeCantCompressTime( void )
|
||||
// no mercs hired, ever
|
||||
DoMapMessageBox( MSG_BOX_BASIC_STYLE, pMapScreenJustStartedHelpText[ 0 ], MAP_SCREEN, MSG_BOX_FLAG_OK, MapScreenDefaultOkBoxCallback );
|
||||
}
|
||||
// WANNE - MP: It is forbidden to compress time in multiplayer
|
||||
else if (is_networked)
|
||||
{
|
||||
ScreenMsg( FONT_LTGREEN, MSG_CHAT, L"You cannot compress time in multiplayer game. Press '3' to start the battle.");
|
||||
}
|
||||
else if ( !AnyUsableRealMercenariesOnTeam() )
|
||||
{
|
||||
// no usable mercs left on team
|
||||
@@ -13515,13 +13604,36 @@ BOOLEAN CanMoveBullseyeAndClickedOnIt( INT16 sMapX, INT16 sMapY )
|
||||
// if in airspace mode, and not plotting paths
|
||||
if( ( fShowAircraftFlag == TRUE ) && ( bSelectedDestChar == -1 ) && ( fPlotForHelicopter == FALSE ) )
|
||||
{
|
||||
// don't allow moving bullseye until after initial arrival
|
||||
if ( gTacticalStatus.fDidGameJustStart == FALSE )
|
||||
if (is_networked)
|
||||
{
|
||||
// if he clicked on the bullseye, and we're on the surface level
|
||||
if ( ( sMapX == gsMercArriveSectorX ) && ( sMapY == gsMercArriveSectorY ) && ( iCurrentMapSectorZ == 0 ) )
|
||||
// haydent
|
||||
if (!is_server && !is_client)
|
||||
{
|
||||
return( TRUE );
|
||||
// if he clicked on the bullseye, and we're on the surface level
|
||||
if ( ( sMapX == gsMercArriveSectorX ) && ( sMapY == gsMercArriveSectorY ) && ( iCurrentMapSectorZ == 0 ) )
|
||||
{
|
||||
return( TRUE );
|
||||
}
|
||||
}
|
||||
|
||||
// haydent
|
||||
else if(is_server)
|
||||
{
|
||||
ScreenMsg( FONT_LTGREEN, MSG_CHAT, MPServerMessage[9] );
|
||||
}
|
||||
else if(is_client)
|
||||
ScreenMsg( FONT_LTGREEN, MSG_CHAT, MPClientMessage[38] );
|
||||
}
|
||||
else
|
||||
{
|
||||
// don't allow moving bullseye until after initial arrival
|
||||
if ( gTacticalStatus.fDidGameJustStart == FALSE )
|
||||
{
|
||||
// if he clicked on the bullseye, and we're on the surface level
|
||||
if ( ( sMapX == gsMercArriveSectorX ) && ( sMapY == gsMercArriveSectorY ) && ( iCurrentMapSectorZ == 0 ) )
|
||||
{
|
||||
return( TRUE );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+81
-11
@@ -17,7 +17,7 @@
|
||||
#include <time.h>
|
||||
#include "jascreens.h"
|
||||
#include "worlddef.h"
|
||||
|
||||
#include "Soldier Control.h"
|
||||
#include "overhead.h"
|
||||
#include "interface panels.h"
|
||||
#include "isometric utils.h"
|
||||
@@ -106,6 +106,7 @@
|
||||
#include "cursors.h"
|
||||
#endif
|
||||
|
||||
#include "connect.h" //hayden added alot ""'s to get around client spawing random/different placed AI
|
||||
#include "SaveLoadGame.h"
|
||||
|
||||
//forward declarations of common classes to eliminate includes
|
||||
@@ -1746,7 +1747,15 @@ BOOLEAN SetCurrentWorldSector( INT16 sMapX, INT16 sMapY, INT8 bMapZ )
|
||||
SetPendingNewScreen(GAME_SCREEN);
|
||||
if( !NumEnemyInSector( ) )
|
||||
{
|
||||
PrepareEnemyForSectorBattle();
|
||||
if (is_networked)
|
||||
{
|
||||
if(is_server && ENEMY_ENABLED)
|
||||
PrepareEnemyForSectorBattle();
|
||||
}
|
||||
else
|
||||
{
|
||||
PrepareEnemyForSectorBattle();
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=0; i<TOTAL_SOLDIERS; i++)
|
||||
@@ -1757,7 +1766,15 @@ BOOLEAN SetCurrentWorldSector( INT16 sMapX, INT16 sMapY, INT8 bMapZ )
|
||||
if( gubNumCreaturesAttackingTown && !gbWorldSectorZ &&
|
||||
gubSectorIDOfCreatureAttack == SECTOR( gWorldSectorX, gWorldSectorY ) )
|
||||
{
|
||||
PrepareCreaturesForBattle();
|
||||
if (is_networked)
|
||||
{
|
||||
if(is_server && CREATURE_ENABLED)
|
||||
PrepareCreaturesForBattle();
|
||||
}
|
||||
else
|
||||
{
|
||||
PrepareCreaturesForBattle();
|
||||
}
|
||||
}
|
||||
if( gfGotoSectorTransition )
|
||||
{
|
||||
@@ -2054,13 +2071,25 @@ void PrepareLoadedSector()
|
||||
}
|
||||
}
|
||||
}
|
||||
if( fAddCivs )
|
||||
|
||||
if (is_networked)
|
||||
{
|
||||
if( is_server && fAddCivs && CIV_ENABLED)//hayden its around here we apply .ini choices for Ai
|
||||
{
|
||||
AddSoldierInitListTeamToWorld( CIV_TEAM, 255 );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
AddSoldierInitListTeamToWorld( CIV_TEAM, 255 );
|
||||
}
|
||||
|
||||
AddSoldierInitListTeamToWorld( MILITIA_TEAM, 255 );
|
||||
AddSoldierInitListBloodcats();
|
||||
if(is_server && MILITIA_ENABLED)
|
||||
AddSoldierInitListTeamToWorld( MILITIA_TEAM, 255 );
|
||||
|
||||
if(is_server && CREATURE_ENABLED)
|
||||
AddSoldierInitListBloodcats();
|
||||
|
||||
//Creatures are only added if there are actually some of them. It has to go through some
|
||||
//additional checking.
|
||||
|
||||
@@ -2089,9 +2118,21 @@ void PrepareLoadedSector()
|
||||
}
|
||||
#endif
|
||||
|
||||
PrepareCreaturesForBattle();
|
||||
// Haydent
|
||||
if (is_networked)
|
||||
{
|
||||
if(is_server && CREATURE_ENABLED)
|
||||
PrepareCreaturesForBattle();
|
||||
|
||||
PrepareMilitiaForTactical(TRUE);
|
||||
// Haydent
|
||||
if(is_server && MILITIA_ENABLED)
|
||||
PrepareMilitiaForTactical(FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
PrepareCreaturesForBattle();
|
||||
PrepareMilitiaForTactical(TRUE);
|
||||
}
|
||||
|
||||
// OK, set varibles for entring this new sector...
|
||||
gTacticalStatus.fVirginSector = TRUE;
|
||||
@@ -2104,11 +2145,28 @@ void PrepareLoadedSector()
|
||||
//AddSoldierInitListTeamToWorld( CIV_TEAM, 255 );
|
||||
// fEnemyPresenceInThisSector = PrepareEnemyForSectorBattle();
|
||||
}
|
||||
AddProfilesNotUsingProfileInsertionData();
|
||||
|
||||
if (is_networked)
|
||||
{
|
||||
if(is_server && CIV_ENABLED)
|
||||
AddProfilesNotUsingProfileInsertionData(); //hayden: is just for civ's
|
||||
}
|
||||
else
|
||||
{
|
||||
AddProfilesNotUsingProfileInsertionData();
|
||||
}
|
||||
|
||||
if( !AreInMeanwhile() || GetMeanwhileID() == INTERROGATION )
|
||||
{
|
||||
fEnemyPresenceInThisSector = PrepareEnemyForSectorBattle();
|
||||
if (is_networked)
|
||||
{
|
||||
if(is_server && ENEMY_ENABLED)
|
||||
fEnemyPresenceInThisSector = PrepareEnemyForSectorBattle();
|
||||
}
|
||||
else
|
||||
{
|
||||
fEnemyPresenceInThisSector = PrepareEnemyForSectorBattle();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4402,7 +4460,14 @@ void UpdateAirspaceControl( void )
|
||||
// if the enemies own the controlling SAM site, and it's in working condition
|
||||
if( ( pSAMStrategicMap->fEnemyControlled ) && ( pSAMStrategicMap->bSAMCondition >= MIN_CONDITION_FOR_SAM_SITE_TO_WORK ) )
|
||||
{
|
||||
fEnemyControlsAir = TRUE;
|
||||
if (is_networked)
|
||||
{
|
||||
fEnemyControlsAir = FALSE; // disable SAM airspace restrictions...
|
||||
}
|
||||
else
|
||||
{
|
||||
fEnemyControlsAir = TRUE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -5481,6 +5546,11 @@ BOOLEAN CheckAndHandleUnloadingOfCurrentWorld()
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if(is_client)//hayden - if multiplayer dont kick from level, allow spectate.
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if( gTacticalStatus.fDidGameJustStart && gWorldSectorX == 9 && gWorldSectorY == 1 && !gbWorldSectorZ )
|
||||
{
|
||||
return FALSE;
|
||||
|
||||
@@ -17,8 +17,15 @@
|
||||
#define BULLET_FLAG_FLAME 0x0080
|
||||
#define BULLET_FLAG_TRACER 0x0100
|
||||
|
||||
//afp-start calculate line points between two point
|
||||
#define BULLET_TRACER_MAX_LENGTH 60
|
||||
void PointsPath(int sx1, int sy1, int ex2, int ey2) ;
|
||||
//afp-end
|
||||
typedef struct
|
||||
{
|
||||
//afp-start this structure keeps tracers points
|
||||
LEVELNODE* pNodes[BULLET_TRACER_MAX_LENGTH];
|
||||
//afp-end
|
||||
INT32 iBullet;
|
||||
UINT8 ubFirerID;
|
||||
UINT8 ubTargetID;
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#include "Strategic Mines.h"
|
||||
#include "Random.h"
|
||||
#endif
|
||||
|
||||
#include "connect.h"
|
||||
|
||||
#define DIALOGUE_DEFAULT_WIDTH 200
|
||||
#define EXTREAMLY_LOW_TOWN_LOYALTY 20
|
||||
@@ -242,7 +242,9 @@ void ShutDownQuoteBox( BOOLEAN fForce )
|
||||
// do we need to do anything at the end of the civ quote?
|
||||
if ( gCivQuoteData.pCiv && gCivQuoteData.pCiv->aiData.bAction == AI_ACTION_OFFER_SURRENDER )
|
||||
{
|
||||
DoMessageBox( MSG_BOX_BASIC_STYLE, Message[ STR_SURRENDER ], GAME_SCREEN, ( UINT8 )MSG_BOX_FLAG_YESNO, SurrenderMessageBoxCallBack, NULL );
|
||||
// Haydent
|
||||
if(!is_client)DoMessageBox( MSG_BOX_BASIC_STYLE, Message[ STR_SURRENDER ], GAME_SCREEN, ( UINT8 )MSG_BOX_FLAG_YESNO, SurrenderMessageBoxCallBack, NULL );
|
||||
else ScreenMsg( FONT_LTGREEN, MSG_CHAT, MPClientMessage[39] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,6 +57,8 @@
|
||||
#include "qarray.h"
|
||||
#endif
|
||||
|
||||
#include "connect.h"
|
||||
|
||||
//forward declarations of common classes to eliminate includes
|
||||
class OBJECTTYPE;
|
||||
class SOLDIERTYPE;
|
||||
@@ -1288,6 +1290,11 @@ BOOLEAN TacticalCharacterDialogueWithSpecialEventEx( SOLDIERTYPE *pSoldier, UINT
|
||||
|
||||
BOOLEAN TacticalCharacterDialogue( SOLDIERTYPE *pSoldier, UINT16 usQuoteNum )
|
||||
{
|
||||
// Haydent
|
||||
if(is_client)
|
||||
{
|
||||
return(FALSE); //somewhere amongst all this it causes a puase of merc movement while making the quote which throws out the movement sync between clients... : hayden.
|
||||
}
|
||||
if ( pSoldier->ubProfile == NO_PROFILE )
|
||||
{
|
||||
return( FALSE );
|
||||
|
||||
@@ -34,7 +34,10 @@
|
||||
#include "Isometric Utils.h"
|
||||
#include "ai.h"
|
||||
#include "Soldier macros.h"
|
||||
#include "Event Pump.h"
|
||||
#endif
|
||||
#include "fresh_header.h"
|
||||
#include "connect.h"
|
||||
|
||||
BOOLEAN gfSetPerceivedDoorState = FALSE;
|
||||
|
||||
@@ -942,6 +945,7 @@ BOOLEAN HandleOpenableStruct( SOLDIERTYPE *pSoldier, INT16 sGridNo, STRUCTURE *p
|
||||
if ( fDoor )
|
||||
{
|
||||
HandleDoorChangeFromGridNo( pSoldier, sGridNo, FALSE );
|
||||
if(is_client)send_door( pSoldier, sGridNo, FALSE );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "connect.h"
|
||||
#ifdef PRECOMPILEDHEADERS
|
||||
#include "Tactical All.h"
|
||||
#else
|
||||
@@ -555,15 +556,21 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT16 sGridNo, INT8 bLevel, UINT16 usHa
|
||||
if ( pSoldier->sSpreadLocations[ 0 ] != 0 )
|
||||
{
|
||||
SendBeginFireWeaponEvent( pSoldier, pSoldier->sSpreadLocations[ 0 ] );
|
||||
if(is_server || (is_client && pSoldier->ubID <20) ) send_fire( pSoldier, pSoldier->sSpreadLocations[ 0 ] );
|
||||
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"Handle Items.cpp: SendBeginFireWeaponEvent" );
|
||||
}
|
||||
else
|
||||
{
|
||||
SendBeginFireWeaponEvent( pSoldier, sTargetGridNo );
|
||||
if(is_server || (is_client && pSoldier->ubID <20) ) send_fire( pSoldier, sTargetGridNo );
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"Handle Items.cpp: SendBeginFireWeaponEvent" );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SendBeginFireWeaponEvent( pSoldier, sTargetGridNo );
|
||||
if(is_server || (is_client && pSoldier->ubID <20) ) send_fire( pSoldier, sTargetGridNo );
|
||||
}
|
||||
|
||||
// ATE: Here to make cursor go back to move after LAW shot...
|
||||
@@ -1367,6 +1374,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT16 sGridNo, INT8 bLevel, UINT16 usHa
|
||||
{
|
||||
|
||||
SendBeginFireWeaponEvent( pSoldier, sTargetGridNo );
|
||||
if(is_server || (is_client && pSoldier->ubID <20) ) send_fire( pSoldier, sTargetGridNo );
|
||||
|
||||
}
|
||||
|
||||
|
||||
+27
-8
@@ -1,3 +1,4 @@
|
||||
#include "connect.h"
|
||||
#ifdef PRECOMPILEDHEADERS
|
||||
#include "Tactical All.h"
|
||||
#include "BuildDefines.h"
|
||||
@@ -88,6 +89,7 @@
|
||||
#include "Soldier Control.h"
|
||||
#endif
|
||||
|
||||
#include "teamturns.h"
|
||||
|
||||
//extern BOOLEAN gfDisplayFullCountRingBurst;
|
||||
extern UINT16 PickSoldierReadyAnimation( SOLDIERTYPE *pSoldier, BOOLEAN fEndReady );
|
||||
@@ -1196,7 +1198,22 @@ UINT32 UIHandleEndTurn( UI_EVENT *pUIEvent )
|
||||
}
|
||||
|
||||
// End our turn!
|
||||
EndTurn( gbPlayerNum + 1 );
|
||||
if (is_server || !is_client)
|
||||
{
|
||||
EndTurn( gbPlayerNum + 1 );
|
||||
}
|
||||
if(!is_server && is_client)
|
||||
{
|
||||
|
||||
if (INTERRUPT_QUEUED)
|
||||
{
|
||||
EndTurn( gbPlayerNum + 1 );//is ending interrupt instead
|
||||
}
|
||||
else
|
||||
{
|
||||
send_EndTurn( netbTeam+1 );//for sending next netbteam rather than next local team
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return( GAME_SCREEN );
|
||||
@@ -5842,18 +5859,20 @@ void UnSetUIBusy( UINT8 ubID )
|
||||
{
|
||||
if ( gfUserTurnRegionActive && (gTacticalStatus.uiFlags & INCOMBAT ) && ( gTacticalStatus.uiFlags & TURNBASED ) && ( gTacticalStatus.ubCurrentTeam == gbPlayerNum ) )
|
||||
{
|
||||
if ( !gTacticalStatus.fUnLockUIAfterHiddenInterrupt )
|
||||
{
|
||||
if ( gusSelectedSoldier == ubID )
|
||||
if ( !gTacticalStatus.fUnLockUIAfterHiddenInterrupt )
|
||||
{
|
||||
guiPendingOverrideEvent = LA_ENDUIOUTURNLOCK;
|
||||
HandleTacticalUI( );
|
||||
if ( gusSelectedSoldier == ubID && (gTacticalStatus.ubCurrentTeam == OUR_TEAM || !is_networked))// now that mp
|
||||
{
|
||||
guiPendingOverrideEvent = LA_ENDUIOUTURNLOCK;
|
||||
HandleTacticalUI( );
|
||||
|
||||
// Set grace period...
|
||||
gTacticalStatus.uiTactialTurnLimitClock = GetJA2Clock( );
|
||||
// Set grace period...
|
||||
gTacticalStatus.uiTactialTurnLimitClock = GetJA2Clock( );
|
||||
}
|
||||
}
|
||||
// player getting control back so reset all muzzle flashes
|
||||
}
|
||||
// player getting control back so reset all muzzle flashes
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6572,7 +6572,6 @@ void DeleteItemStackPopup( )
|
||||
//CHRISL: if neither item or sector stack popups are open, just return.
|
||||
if(!gfInItemStackPopup && !gfInSectorStackPopup)
|
||||
return;
|
||||
|
||||
//Remove
|
||||
DeleteVideoObjectFromIndex( guiItemPopupBoxes );
|
||||
|
||||
|
||||
@@ -7019,4 +7019,3 @@ void GoToMapScreenFromTactical( void )
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+11
-3
@@ -58,6 +58,7 @@
|
||||
#include "message.h"
|
||||
#endif
|
||||
|
||||
#include "connect.h"
|
||||
//const UINT32 INTERFACE_START_X = 0;
|
||||
//const UINT32 INTERFACE_START_Y = ( SCREEN_HEIGHT - INTERFACE_HEIGHT );
|
||||
//const UINT32 INV_INTERFACE_START_Y = ( SCREEN_HEIGHT - INV_INTERFACE_HEIGHT );
|
||||
@@ -2928,10 +2929,11 @@ void EndUIMessage( )
|
||||
|
||||
#define PLAYER_TEAM_TIMER_INTTERUPT_GRACE ( 15000 / PLAYER_TEAM_TIMER_SEC_PER_TICKS )
|
||||
#define PLAYER_TEAM_TIMER_GRACE_PERIOD 1000
|
||||
#define PLAYER_TEAM_TIMER_SEC_PER_TICKS 100
|
||||
//#define PLAYER_TEAM_TIMER_SEC_PER_TICKS 100
|
||||
int PLAYER_TEAM_TIMER_SEC_PER_TICKS = 100;//hayden
|
||||
#define PLAYER_TEAM_TIMER_TICKS_PER_OK_MERC ( 15000 / PLAYER_TEAM_TIMER_SEC_PER_TICKS )
|
||||
#define PLAYER_TEAM_TIMER_TICKS_PER_NOTOK_MERC ( 5000 / PLAYER_TEAM_TIMER_SEC_PER_TICKS )
|
||||
#define PLAYER_TEAM_TIMER_TICKS_FROM_END_TO_START_BEEP ( 5000 / PLAYER_TEAM_TIMER_SEC_PER_TICKS )
|
||||
#define PLAYER_TEAM_TIMER_TICKS_FROM_END_TO_START_BEEP ( (5000 / PLAYER_TEAM_TIMER_SEC_PER_TICKS)*1.15 )
|
||||
#define PLAYER_TEAM_TIMER_TIME_BETWEEN_BEEPS ( 500 )
|
||||
#define PLAYER_TEAM_TIMER_TICKS_PER_ENEMY ( 2000 / PLAYER_TEAM_TIMER_SEC_PER_TICKS )
|
||||
|
||||
@@ -3289,7 +3291,8 @@ void HandleTopMessages( )
|
||||
if ( TIMECOUNTERDONE( giTimerTeamTurnUpdate, PLAYER_TEAM_TIMER_SEC_PER_TICKS ) )
|
||||
{
|
||||
RESETTIMECOUNTER( giTimerTeamTurnUpdate, PLAYER_TEAM_TIMER_SEC_PER_TICKS );
|
||||
|
||||
if(!is_networked)//hayden - stop clients from updating enemy progress bar... //could have another param in here when get coop going
|
||||
{
|
||||
// Update counter....
|
||||
if ( gTacticalStatus.usTactialTurnLimitCounter < gTacticalStatus.usTactialTurnLimitMax )
|
||||
{
|
||||
@@ -3301,6 +3304,8 @@ void HandleTopMessages( )
|
||||
{
|
||||
gTacticalStatus.usTactialTurnLimitCounter = ( ( gubProgCurEnemy ) * PLAYER_TEAM_TIMER_TICKS_PER_ENEMY );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
CreateTopMessage( gTopMessage.uiSurface, gTacticalStatus.ubTopMessageType, gTacticalStatus.zTopMessageString );
|
||||
}
|
||||
@@ -3544,6 +3549,9 @@ void InitPlayerUIBar( BOOLEAN fInterrupt )
|
||||
return;
|
||||
}
|
||||
|
||||
if (is_networked)
|
||||
gTacticalStatus.usTactialTurnLimitMax = 0;//hayden , cheap hack, always calc time...
|
||||
|
||||
// OK, calculate time....
|
||||
if ( !fInterrupt || gTacticalStatus.usTactialTurnLimitMax == 0 )
|
||||
{
|
||||
|
||||
@@ -223,6 +223,7 @@ bool IsSlotASmallPocket(int slot);
|
||||
|
||||
extern std::list<LBENODE> LBEArray;
|
||||
|
||||
|
||||
//do not alter or saves will break, create new defines if the size changes
|
||||
#define OLD_MAX_ATTACHMENTS_101 4
|
||||
#define OLD_MAX_OBJECTS_PER_SLOT_101 8
|
||||
|
||||
+82
-7
@@ -1,3 +1,4 @@
|
||||
#include "connect.h"
|
||||
#ifdef PRECOMPILEDHEADERS
|
||||
#include "Tactical All.h"
|
||||
#else
|
||||
@@ -41,7 +42,8 @@
|
||||
#include "Quests.h"
|
||||
#include "items.h"
|
||||
#endif
|
||||
|
||||
#include "fresh_header.h"
|
||||
#include "test_space.h"
|
||||
//forward declarations of common classes to eliminate includes
|
||||
class OBJECTTYPE;
|
||||
class SOLDIERTYPE;
|
||||
@@ -2325,7 +2327,23 @@ BOOLEAN BulletHitMerc( BULLET * pBullet, STRUCTURE * pStructure, BOOLEAN fIntend
|
||||
}
|
||||
|
||||
// handle hit! Handle damage before deleting the bullet though
|
||||
WeaponHit( SWeaponHit.usSoldierID, SWeaponHit.usWeaponIndex, SWeaponHit.sDamage, SWeaponHit.sBreathLoss, SWeaponHit.usDirection, SWeaponHit.sXPos, SWeaponHit.sYPos, SWeaponHit.sZPos, SWeaponHit.sRange, SWeaponHit.ubAttackerID, SWeaponHit.fHit, SWeaponHit.ubSpecial, SWeaponHit.ubLocation );
|
||||
//hayden
|
||||
if(SWeaponHit.ubAttackerID < 20 ||(is_server && SWeaponHit.ubAttackerID < 120)|| !is_client ) // 124 last possible ai
|
||||
{
|
||||
if(is_client)
|
||||
SWeaponHit.sDamage=(INT16)(SWeaponHit.sDamage * DAMAGE_MULTIPLIER); // adjust damage from external variable //hayden
|
||||
|
||||
WeaponHit( SWeaponHit.usSoldierID, SWeaponHit.usWeaponIndex, SWeaponHit.sDamage, SWeaponHit.sBreathLoss, SWeaponHit.usDirection, SWeaponHit.sXPos, SWeaponHit.sYPos, SWeaponHit.sZPos, SWeaponHit.sRange, SWeaponHit.ubAttackerID, SWeaponHit.fHit, SWeaponHit.ubSpecial, SWeaponHit.ubLocation );
|
||||
|
||||
|
||||
if(is_server || (is_client && SWeaponHit.ubAttackerID <20) )
|
||||
{
|
||||
SWeaponHit.fStopped=fStopped;
|
||||
SWeaponHit.iBullet=pBullet->iBullet;
|
||||
|
||||
send_hit( &SWeaponHit );
|
||||
}
|
||||
}
|
||||
|
||||
if (fStopped)
|
||||
{
|
||||
@@ -2384,17 +2402,48 @@ void BulletHitStructure( BULLET * pBullet, UINT16 usStructureID, INT32 iImpact,
|
||||
SStructureHit.usStructureID = usStructureID;
|
||||
SStructureHit.iImpact = iImpact;
|
||||
SStructureHit.iBullet = pBullet->iBullet;
|
||||
|
||||
if (is_networked)
|
||||
SStructureHit.fStopped = fStopped;
|
||||
|
||||
//hayden
|
||||
if(is_client)
|
||||
send_hitstruct(&SStructureHit);
|
||||
|
||||
StructureHit( SStructureHit.iBullet, SStructureHit.usWeaponIndex, SStructureHit.bWeaponStatus, SStructureHit.ubAttackerID, SStructureHit.sXPos, SStructureHit.sYPos, SStructureHit.sZPos, SStructureHit.usStructureID, SStructureHit.iImpact, fStopped );
|
||||
}
|
||||
|
||||
void BulletHitWindow( BULLET *pBullet, INT16 sGridNo, UINT16 usStructureID, BOOLEAN fBlowWindowSouth )
|
||||
{
|
||||
if (is_networked)
|
||||
{
|
||||
EV_S_WINDOWHIT SWindowHit;
|
||||
SWindowHit.sGridNo = sGridNo;
|
||||
SWindowHit.usStructureID = usStructureID;
|
||||
SWindowHit.fBlowWindowSouth = fBlowWindowSouth;
|
||||
SWindowHit.fLargeForce = FALSE;
|
||||
SWindowHit.iBullet = pBullet->iBullet;
|
||||
SWindowHit.ubAttackerID=pBullet->pFirer->ubID;
|
||||
//hayden
|
||||
if(is_client)
|
||||
send_hitwindow(&SWindowHit);
|
||||
}
|
||||
|
||||
WindowHit( sGridNo, usStructureID, fBlowWindowSouth, FALSE );
|
||||
}
|
||||
|
||||
void BulletMissed( BULLET *pBullet, SOLDIERTYPE * pFirer )
|
||||
{
|
||||
if (is_networked)
|
||||
{
|
||||
EV_S_MISS SMiss;
|
||||
SMiss.iBullet=pBullet->iBullet;
|
||||
SMiss.ubAttackerID=pFirer->ubID;
|
||||
//hayden
|
||||
if(is_client)
|
||||
send_miss(&SMiss);
|
||||
}
|
||||
|
||||
ShotMiss( pFirer->ubID, pBullet->iBullet );
|
||||
}
|
||||
|
||||
@@ -3482,7 +3531,15 @@ INT8 FireBullet( SOLDIERTYPE * pFirer, BULLET * pBullet, BOOLEAN fFake )
|
||||
}
|
||||
else
|
||||
{
|
||||
pBullet->usClockTicksPerUpdate = (Weapon[ pFirer->usAttackingWeapon ].ubBulletSpeed + GetBulletSpeedBonus(&pFirer->inv[pFirer->ubAttackingHand]) ) / 10;
|
||||
//afp-start //always a fast bullet
|
||||
if ( pBullet->usFlags & ( BULLET_FLAG_CREATURE_SPIT | BULLET_FLAG_KNIFE | BULLET_FLAG_MISSILE | BULLET_FLAG_SMALL_MISSILE | BULLET_FLAG_TANK_CANNON | BULLET_FLAG_FLAME /*| BULLET_FLAG_TRACER*/ ) )
|
||||
pBullet->usClockTicksPerUpdate = (Weapon[ pFirer->usAttackingWeapon ].ubBulletSpeed + GetBulletSpeedBonus(&pFirer->inv[pFirer->ubAttackingHand]) ) / 10;
|
||||
else
|
||||
if (gGameExternalOptions.gbBulletTracer)
|
||||
pBullet->usClockTicksPerUpdate = (Weapon[ pFirer->usAttackingWeapon ].ubBulletSpeed + GetBulletSpeedBonus(&pFirer->inv[pFirer->ubAttackingHand]) ) / 10;
|
||||
else
|
||||
pBullet->usClockTicksPerUpdate = 1;
|
||||
//afp-end
|
||||
}
|
||||
|
||||
//DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("FireBullet: handle flags"));
|
||||
@@ -3773,6 +3830,8 @@ INT8 FireBulletGivenTarget( SOLDIERTYPE * pFirer, FLOAT dEndX, FLOAT dEndY, FLOA
|
||||
// // this is an error!!
|
||||
// ubLoop = ubLoop;
|
||||
// }
|
||||
//hayden
|
||||
if(is_client)send_bullet( pBullet, usHandItem );
|
||||
FireBullet( pFirer, pBullet, FALSE );
|
||||
}
|
||||
}
|
||||
@@ -3896,7 +3955,10 @@ void MoveBullet( INT32 iBullet )
|
||||
// NB remove bullet only flags a bullet for deletion; we still have access to the
|
||||
// information in the structure
|
||||
RemoveBullet( pBullet->iBullet );
|
||||
BulletMissed( pBullet, pBullet->pFirer );
|
||||
|
||||
if(ENABLE_COLLISION)
|
||||
BulletMissed( pBullet, pBullet->pFirer );//only if local origin
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3940,7 +4002,10 @@ void MoveBullet( INT32 iBullet )
|
||||
{
|
||||
fIntended = FALSE;
|
||||
}
|
||||
|
||||
//check for structures at target, and calc chance to hit
|
||||
//hayden, disable any structure t avoid collision
|
||||
if(ENABLE_COLLISION)
|
||||
{
|
||||
while( pStructure )
|
||||
{
|
||||
if (pStructure->fFlags & ALWAYS_CONSIDER_HIT)
|
||||
@@ -4140,6 +4205,7 @@ void MoveBullet( INT32 iBullet )
|
||||
pStructure = pStructure->pNext;
|
||||
}
|
||||
|
||||
}
|
||||
// check to see if any soldiers are nearby; those soldiers
|
||||
// have their near-miss value incremented
|
||||
if (pMapElement->ubAdjacentSoldierCnt > 0)
|
||||
@@ -4226,6 +4292,9 @@ void MoveBullet( INT32 iBullet )
|
||||
|
||||
// check for collision with the ground
|
||||
iCurrAboveLevelZ = FIXEDPT_TO_INT32( pBullet->qCurrZ - qLandHeight );
|
||||
//hayden not hit ground
|
||||
if(ENABLE_COLLISION)
|
||||
{
|
||||
if (iCurrAboveLevelZ < 0)
|
||||
{
|
||||
// ground is in the way!
|
||||
@@ -4233,6 +4302,7 @@ void MoveBullet( INT32 iBullet )
|
||||
BulletHitStructure( pBullet, INVALID_STRUCTURE_ID, 0, pBullet->pFirer, pBullet->qCurrX, pBullet->qCurrY, pBullet->qCurrZ, TRUE );
|
||||
return;
|
||||
}
|
||||
}
|
||||
// check for the existence of structures
|
||||
if (iNumLocalStructures == 0 && !pRoofStructure)
|
||||
{ // no structures in this tile, AND THAT INCLUDES ROOFS! :-)
|
||||
@@ -4280,6 +4350,9 @@ void MoveBullet( INT32 iBullet )
|
||||
|
||||
// special coding (compared with other versions above) to deal with
|
||||
// bullets hitting the ground
|
||||
//hayden, stop hit ground
|
||||
if(ENABLE_COLLISION)
|
||||
{
|
||||
if (pBullet->qCurrZ + pBullet->qIncrZ * iStepsToTravel < qLandHeight)
|
||||
{
|
||||
iStepsToTravel = __min( iStepsToTravel, abs( (pBullet->qCurrZ - qLandHeight) / pBullet->qIncrZ ) );
|
||||
@@ -4291,6 +4364,7 @@ void MoveBullet( INT32 iBullet )
|
||||
BulletHitStructure( pBullet, INVALID_STRUCTURE_ID, 0, pBullet->pFirer, pBullet->qCurrX, pBullet->qCurrY, pBullet->qCurrZ, TRUE );
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (( pBullet->usFlags & ( BULLET_FLAG_MISSILE | BULLET_FLAG_SMALL_MISSILE | BULLET_FLAG_TANK_CANNON | BULLET_FLAG_FLAME | BULLET_FLAG_CREATURE_SPIT /*| BULLET_FLAG_TRACER*/ ) ) || fTracer == TRUE)
|
||||
{
|
||||
@@ -4544,7 +4618,8 @@ void MoveBullet( INT32 iBullet )
|
||||
{
|
||||
pBullet->qCurrX += pBullet->qIncrX;
|
||||
pBullet->qCurrY += pBullet->qIncrY;
|
||||
if (pRoofStructure)
|
||||
//no hit on lan//pRoofStructure//hayden
|
||||
if (is_networked && pRoofStructure)
|
||||
{
|
||||
qLastZ = pBullet->qCurrZ;
|
||||
pBullet->qCurrZ += pBullet->qIncrZ;
|
||||
@@ -4609,7 +4684,7 @@ void MoveBullet( INT32 iBullet )
|
||||
{
|
||||
// bullet outside of world!
|
||||
RemoveBullet( pBullet->iBullet );
|
||||
BulletMissed( pBullet, pBullet->pFirer );
|
||||
if(ENABLE_COLLISION)BulletMissed( pBullet, pBullet->pFirer );//hayden: only play event if local
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+49
-26
@@ -59,7 +59,7 @@
|
||||
#include "Quests.h"
|
||||
#include "GameSettings.h"
|
||||
#endif
|
||||
|
||||
#include "connect.h"
|
||||
//forward declarations of common classes to eliminate includes
|
||||
class OBJECTTYPE;
|
||||
class SOLDIERTYPE;
|
||||
@@ -102,7 +102,7 @@ INT8 HireMerc( MERC_HIRE_STRUCT *pHireMerc)
|
||||
if( ( pMerc->bMercStatus != 0 ) && (pMerc->bMercStatus != MERC_ANNOYED_BUT_CAN_STILL_CONTACT ) && ( pMerc->bMercStatus != MERC_HIRED_BUT_NOT_ARRIVED_YET ) )
|
||||
return( MERC_HIRE_FAILED );
|
||||
|
||||
if( NumberOfMercsOnPlayerTeam() >= 18 )
|
||||
if( NumberOfMercsOnPlayerTeam() >= 18 || (is_client && NumberOfMercsOnPlayerTeam() >= MAX_MERCS)) //hayden, 7 member team limit setable in ini
|
||||
return( MERC_HIRE_OVER_18_MERCS_HIRED );
|
||||
|
||||
// ATE: if we are to use landing zone, update to latest value
|
||||
@@ -123,6 +123,9 @@ INT8 HireMerc( MERC_HIRE_STRUCT *pHireMerc)
|
||||
MercCreateStruct.bSectorZ = pHireMerc->bSectorZ;
|
||||
MercCreateStruct.bTeam = SOLDIER_CREATE_AUTO_TEAM;
|
||||
MercCreateStruct.fCopyProfileItemsOver= pHireMerc->fCopyProfileItemsOver;
|
||||
|
||||
if(!ALLOW_EQUIP && is_networked)
|
||||
MercCreateStruct.fCopyProfileItemsOver=0;//hayden : server overide
|
||||
|
||||
if ( !TacticalCreateSoldier( &MercCreateStruct, &iNewIndex ) )
|
||||
{
|
||||
@@ -192,36 +195,50 @@ INT8 HireMerc( MERC_HIRE_STRUCT *pHireMerc)
|
||||
|
||||
//Set the type of merc
|
||||
|
||||
if( DidGameJustStart() )
|
||||
if (!is_networked)
|
||||
{
|
||||
// Set time of initial merc arrival in minutes
|
||||
pHireMerc->uiTimeTillMercArrives = ( gGameExternalOptions.iGameStartingTime + gGameExternalOptions.iFirstArrivalDelay ) / NUM_SEC_IN_MIN;
|
||||
if( DidGameJustStart() )
|
||||
{
|
||||
pHireMerc->uiTimeTillMercArrives = ( gGameExternalOptions.iGameStartingTime + gGameExternalOptions.iFirstArrivalDelay ) / NUM_SEC_IN_MIN;
|
||||
|
||||
// Set insertion for first time in chopper
|
||||
pHireMerc->ubInsertionCode = INSERTION_CODE_CHOPPER;
|
||||
// Set insertion for first time in chopper
|
||||
pHireMerc->ubInsertionCode = INSERTION_CODE_CHOPPER;
|
||||
|
||||
//set when the merc's contract is finished
|
||||
pSoldier->iEndofContractTime = GetMidnightOfFutureDayInMinutes( pSoldier->iTotalContractLength ) + ( GetHourWhenContractDone( pSoldier ) * 60 );
|
||||
//set when the merc's contract is finished
|
||||
pSoldier->iEndofContractTime = GetMidnightOfFutureDayInMinutes( pSoldier->iTotalContractLength ) + ( GetHourWhenContractDone( pSoldier ) * 60 );
|
||||
}
|
||||
else
|
||||
{
|
||||
//set when the merc's contract is finished ( + 1 cause it takes a day for the merc to arrive )
|
||||
pSoldier->iEndofContractTime = GetMidnightOfFutureDayInMinutes( 1 + pSoldier->iTotalContractLength ) + ( GetHourWhenContractDone( pSoldier ) * 60 );
|
||||
}
|
||||
}
|
||||
// WANNE - MP: We need this, so the merc contract is correct!
|
||||
else
|
||||
{
|
||||
//set when the merc's contract is finished ( + 1 cause it takes a day for the merc to arrive )
|
||||
pSoldier->iEndofContractTime = GetMidnightOfFutureDayInMinutes( 1 + pSoldier->iTotalContractLength ) + ( GetHourWhenContractDone( pSoldier ) * 60 );
|
||||
pSoldier->iEndofContractTime = GetMidnightOfFutureDayInMinutes( pSoldier->iTotalContractLength ) + ( GetHourWhenContractDone( pSoldier ) * 60 );
|
||||
}
|
||||
|
||||
//Set the time and ID of the last hired merc will arrive
|
||||
LaptopSaveInfo.sLastHiredMerc.iIdOfMerc = pHireMerc->ubProfileID;
|
||||
LaptopSaveInfo.sLastHiredMerc.uiArrivalTime = pHireMerc->uiTimeTillMercArrives;
|
||||
|
||||
|
||||
//if we are trying to hire a merc that should arrive later, put the merc in the queue
|
||||
if( pHireMerc->uiTimeTillMercArrives != 0 )
|
||||
if (!is_client)
|
||||
{
|
||||
AddStrategicEvent( EVENT_DELAYED_HIRING_OF_MERC, pHireMerc->uiTimeTillMercArrives, pSoldier->ubID );
|
||||
|
||||
//specify that the merc is hired but hasnt arrived yet
|
||||
pMerc->bMercStatus = MERC_HIRED_BUT_NOT_ARRIVED_YET;
|
||||
//if we are trying to hire a merc that should arrive later, put the merc in the queue
|
||||
if( pHireMerc->uiTimeTillMercArrives != 0 )
|
||||
{
|
||||
AddStrategicEvent( EVENT_DELAYED_HIRING_OF_MERC, pHireMerc->uiTimeTillMercArrives, pSoldier->ubID );
|
||||
|
||||
//specify that the merc is hired but hasnt arrived yet
|
||||
pMerc->bMercStatus = MERC_HIRED_BUT_NOT_ARRIVED_YET;
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(is_client)send_hire( iNewIndex, ubCurrentSoldier, pHireMerc->iTotalContractLength, MercCreateStruct.fCopyProfileItemsOver );
|
||||
//send off hire info to network, also avail possibility for net-game exclusive hired pSoldier changes...
|
||||
}
|
||||
|
||||
|
||||
@@ -265,7 +282,7 @@ INT8 HireMerc( MERC_HIRE_STRUCT *pHireMerc)
|
||||
//Set starting conditions for the merc
|
||||
pSoldier->iStartContractTime = GetWorldDay( );
|
||||
|
||||
AddHistoryToPlayersLog(HISTORY_HIRED_MERC_FROM_MERC, ubCurrentSoldier, GetWorldTotalMin(), -1, -1 );
|
||||
if(!is_client)AddHistoryToPlayersLog(HISTORY_HIRED_MERC_FROM_MERC, ubCurrentSoldier, GetWorldTotalMin(), -1, -1 );
|
||||
}
|
||||
//If the merc is from IMP, (ie a player character)
|
||||
else if( ( ubCurrentSoldier >= 51 ) && ( ubCurrentSoldier < 57 ) )
|
||||
@@ -294,13 +311,19 @@ void MercArrivesCallback( UINT8 ubSoldierID )
|
||||
SOLDIERTYPE *pSoldier;
|
||||
UINT32 uiTimeOfPost;
|
||||
|
||||
if( !DidGameJustStart() && gsMercArriveSectorX == 9 && gsMercArriveSectorY == 1 )
|
||||
{ //Mercs arriving in A9. This sector has been deemed as the always safe sector.
|
||||
//Seeing we don't support entry into a hostile sector (except for the beginning),
|
||||
//we will nuke any enemies in this sector first.
|
||||
if( gWorldSectorX != 9 || gWorldSectorY != 1 || gbWorldSectorZ )
|
||||
{
|
||||
EliminateAllEnemies( (UINT8)gsMercArriveSectorX, (UINT8)gsMercArriveSectorY );
|
||||
|
||||
if (!is_networked)
|
||||
{
|
||||
// hayden - maybe you want to duke it out in omerta ;)
|
||||
if( !DidGameJustStart() && gsMercArriveSectorX == 9 && gsMercArriveSectorY == 1 )
|
||||
{
|
||||
//Mercs arriving in A9. This sector has been deemed as the always safe sector.
|
||||
//Seeing we don't support entry into a hostile sector (except for the beginning),
|
||||
//we will nuke any enemies in this sector first.
|
||||
if( gWorldSectorX != 9 || gWorldSectorY != 1 || gbWorldSectorZ )
|
||||
{
|
||||
EliminateAllEnemies( (UINT8)gsMercArriveSectorX, (UINT8)gsMercArriveSectorY );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -20,8 +20,11 @@
|
||||
#include "Campaign.h"
|
||||
#include "mapscreen.h"
|
||||
#include "Soldier macros.h"
|
||||
#include "Event Pump.h"
|
||||
#endif
|
||||
|
||||
#include "connect.h"
|
||||
#include "fresh_header.h"
|
||||
#define MORALE_MOD_MAX 50 // morale *mod* range is -50 to 50, if you change this, check the decay formulas!
|
||||
|
||||
#define DRUG_EFFECT_MORALE_MOD 150
|
||||
@@ -322,6 +325,11 @@ void UpdateSoldierMorale( SOLDIERTYPE * pSoldier, UINT8 ubType, INT8 bMoraleMod
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if(DISABLE_MORALE && is_networked)
|
||||
{
|
||||
return;
|
||||
}//hayden
|
||||
|
||||
pProfile = &(gMercProfiles[ pSoldier->ubProfile ]);
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#define MIN_AMB_LEVEL_FOR_MERC_LIGHTS 9
|
||||
|
||||
|
||||
#define MAXTEAMS 6
|
||||
#define MAXTEAMS 11 //hayden
|
||||
#define MAXMERCS MAX_NUM_SOLDIERS
|
||||
|
||||
//TACTICAL OVERHEAD STUFF
|
||||
@@ -274,9 +274,14 @@ enum WorldDirections
|
||||
#define CREATURE_TEAM 2
|
||||
#define MILITIA_TEAM 3
|
||||
#define CIV_TEAM 4
|
||||
#define LAST_TEAM CIV_TEAM
|
||||
#define LAST_TEAM LAN_TEAM_FOUR
|
||||
#define PLAYER_PLAN 5
|
||||
|
||||
#define LAN_TEAM_ONE 6
|
||||
#define LAN_TEAM_TWO 7
|
||||
#define LAN_TEAM_THREE 8
|
||||
#define LAN_TEAM_FOUR 9
|
||||
//hayden
|
||||
|
||||
//-----------------------------------------------
|
||||
//
|
||||
|
||||
+131
-17
@@ -112,8 +112,10 @@
|
||||
#include "PreBattle Interface.h"
|
||||
#include "Militia Control.h"
|
||||
#include "Lua Interpreter.h"
|
||||
#include "bullets.h"
|
||||
#endif
|
||||
|
||||
#include "test_space.h"
|
||||
#include "connect.h"
|
||||
|
||||
//forward declarations of common classes to eliminate includes
|
||||
class OBJECTTYPE;
|
||||
@@ -123,6 +125,7 @@ extern void HandleBestSightingPositionInRealtime();
|
||||
|
||||
extern UINT8 gubAICounter;
|
||||
|
||||
#include "fresh_header.h"
|
||||
#define RT_DELAY_BETWEEN_AI_HANDLING 50
|
||||
#define RT_AI_TIMESLICE 10
|
||||
|
||||
@@ -324,24 +327,44 @@ CHAR8 gzDirectionStr[][ 30 ] =
|
||||
};
|
||||
|
||||
// TEMP VALUES FOR TEAM DEAFULT POSITIONS
|
||||
UINT8 bDefaultTeamRanges[ MAXTEAMS ][ 2 ] =
|
||||
UINT8 bDefaultTeamRanges[ MAXTEAMS ][ 2 ] =
|
||||
|
||||
{
|
||||
0, 19, //20 US
|
||||
20, 51, //32 ENEMY
|
||||
52, 83, //32 CREATURE
|
||||
84, 115, //32 REBELS ( OUR GUYS )
|
||||
116, MAX_NUM_SOLDIERS - 1, //32 CIVILIANS
|
||||
MAX_NUM_SOLDIERS, TOTAL_SOLDIERS - 1 // PLANNING SOLDIERS
|
||||
0, 19, //20 US
|
||||
20, 51, //32 ENEMY
|
||||
52, 52, //kulled off to make room ;) //32 CREATURE
|
||||
53, 84, //32 REBELS ( OUR GUYS )
|
||||
85, 116, //32 CIVILIANS
|
||||
117, 119, // PLANNING SOLDIERS (reduced)
|
||||
120, 126, //1 //new sides //hayden // 7 each
|
||||
127, 133, //2
|
||||
134, 140, //3
|
||||
141, MAX_NUM_SOLDIERS - 1, //4
|
||||
MAX_NUM_SOLDIERS, TOTAL_SOLDIERS - 1 // PLANNING SOLDIERS
|
||||
};
|
||||
|
||||
COLORVAL bDefaultTeamColors[ MAXTEAMS ] =
|
||||
//{
|
||||
// 0, 19, //20 US
|
||||
// 20, 51, //32 ENEMY
|
||||
// 52, 83, //32 CREATURE
|
||||
// 84, 115, //32 REBELS ( OUR GUYS )
|
||||
// 116, MAX_NUM_SOLDIERS - 1, //32 CIVILIANS
|
||||
//MAX_NUM_SOLDIERS, TOTAL_SOLDIERS - 1 // PLANNING SOLDIERS
|
||||
//};
|
||||
|
||||
COLORVAL bDefaultTeamColors[ MAXTEAMS ] =
|
||||
{
|
||||
FROMRGB( 255, 255, 0 ),
|
||||
FROMRGB( 255, 0, 0 ),
|
||||
FROMRGB( 255, 0, 255 ),
|
||||
FROMRGB( 0, 255, 0 ),
|
||||
FROMRGB( 255, 255, 255 ),
|
||||
FROMRGB( 0, 0, 255 )
|
||||
FROMRGB( 0, 0, 255 ),
|
||||
FROMRGB( 255, 156, 49 ), //hayden //team 1 (radar colours)
|
||||
FROMRGB( 49, 255, 207 ), //2
|
||||
FROMRGB( 193, 85, 255 ), //3
|
||||
FROMRGB( 0, 255, 115 ) //4
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -684,7 +707,12 @@ BOOLEAN InitOverhead( )
|
||||
gTacticalStatus.uiCountdownToRestart = GetJA2Clock();
|
||||
gTacticalStatus.fGoingToEnterDemo = FALSE;
|
||||
gTacticalStatus.fNOTDOLASTDEMO = FALSE;
|
||||
gTacticalStatus.fDidGameJustStart = TRUE;
|
||||
|
||||
if (is_networked)
|
||||
gTacticalStatus.fDidGameJustStart = FALSE; //hayden
|
||||
else
|
||||
gTacticalStatus.fDidGameJustStart = TRUE;
|
||||
|
||||
gTacticalStatus.ubLastRequesterTargetID = NO_PROFILE;
|
||||
|
||||
for ( cnt = 0; cnt < NUM_PANIC_TRIGGERS; cnt++ )
|
||||
@@ -1124,6 +1152,7 @@ BOOLEAN ExecuteOverhead( )
|
||||
|
||||
// Handle animation update counters
|
||||
// ATE: Added additional check here for special value of anispeed that pauses all updates
|
||||
{
|
||||
#ifndef BOUNDS_CHECKER
|
||||
if ( TIMECOUNTERDONE( pSoldier->timeCounters.UpdateCounter, pSoldier->sAniDelay ) && pSoldier->sAniDelay != 10000 )
|
||||
#endif
|
||||
@@ -1169,6 +1198,16 @@ BOOLEAN ExecuteOverhead( )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
//hayden - holt at scheduled grid
|
||||
|
||||
if (is_networked)
|
||||
{
|
||||
if(pSoldier->sGridNo==pSoldier->sScheduledStop)
|
||||
{
|
||||
pSoldier->HaultSoldierFromSighting( 1 );
|
||||
pSoldier->sScheduledStop=NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if ( !( gAnimControl[ pSoldier->usAnimState ].uiFlags & ANIM_SPECIALMOVE ) )
|
||||
{
|
||||
@@ -1594,6 +1633,19 @@ BOOLEAN ExecuteOverhead( )
|
||||
}
|
||||
}
|
||||
}
|
||||
//if(is_client)//hayden
|
||||
//{
|
||||
// if(pSoldier->flags.fIsSoldierDelayed==TRUE)
|
||||
// {
|
||||
// continue;//in position but waiting on other clients
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// //ovh_advance=false;
|
||||
// pSoldier->flags.fIsSoldierDelayed=TRUE;
|
||||
// request_ovh(pSoldier->ubID);
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
||||
if ( ( pSoldier->flags.uiStatusFlags & SOLDIER_PAUSEANIMOVE ) )
|
||||
@@ -1601,8 +1653,21 @@ BOOLEAN ExecuteOverhead( )
|
||||
fKeepMoving = FALSE;
|
||||
}
|
||||
|
||||
BOOLEAN executeCondition = FALSE;
|
||||
|
||||
if (is_networked)
|
||||
{
|
||||
if ( !pSoldier->flags.fPausedMove && fKeepMoving && !pSoldier->flags.fNoAPToFinishMove )
|
||||
executeCondition = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( !pSoldier->flags.fPausedMove && fKeepMoving )
|
||||
executeCondition = TRUE;
|
||||
}
|
||||
|
||||
// DO WALKING
|
||||
if ( !pSoldier->flags.fPausedMove && fKeepMoving )
|
||||
if ( executeCondition )
|
||||
{
|
||||
// Determine deltas
|
||||
// dDeltaX = pSoldier->pathing.sDestXPos - pSoldier->dXPos;
|
||||
@@ -1642,8 +1707,12 @@ BOOLEAN ExecuteOverhead( )
|
||||
if (pSoldier->flags.fSoldierUpdatedFromNetwork)
|
||||
UpdateSoldierFromNetwork(pSoldier);
|
||||
#endif
|
||||
//haydens network soldier update ->>
|
||||
if(is_client)UpdateSoldierToNetwork ( pSoldier );
|
||||
//
|
||||
}
|
||||
|
||||
}
|
||||
if ( !gfPauseAllAI &&
|
||||
( ((gTacticalStatus.uiFlags & TURNBASED) && (gTacticalStatus.uiFlags & INCOMBAT)) || (fHandleAI && guiAISlotToHandle == cnt) || (pSoldier->aiData.fAIFlags & AI_HANDLE_EVERY_FRAME) || gTacticalStatus.fAutoBandageMode ) )
|
||||
{
|
||||
@@ -5564,7 +5633,16 @@ void EnterCombatMode( UINT8 ubStartingTeam )
|
||||
}
|
||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"EnterCombatMode continuing... calling startplayerteamturn");
|
||||
|
||||
StartPlayerTeamTurn( FALSE, TRUE );
|
||||
if (!is_client || is_server) //hayden
|
||||
{
|
||||
StartPlayerTeamTurn( FALSE, TRUE );
|
||||
if(is_client)send_EndTurn( ubStartingTeam ); //hayden
|
||||
}
|
||||
else
|
||||
{
|
||||
//ScreenMsg( FONT_YELLOW, MSG_CHAT, L"client skipped EnterCombatMode");
|
||||
if(is_client)startCombat(ubStartingTeam);//clients other than server meet and send request for combat for server
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -5856,6 +5934,10 @@ BOOLEAN CheckForEndOfCombatMode( BOOLEAN fIncrementTurnsNotSeen )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
//if (is_server || is_client)
|
||||
//{
|
||||
// return(FALSE); // cheap band-aid to prevent return from turn based action in multiplayer, atleast until further dev... : hayden.
|
||||
//}
|
||||
|
||||
// if we're boxing NEVER end combat mode
|
||||
if ( gTacticalStatus.bBoxingState == BOXING )
|
||||
@@ -5927,8 +6009,17 @@ BOOLEAN CheckForEndOfCombatMode( BOOLEAN fIncrementTurnsNotSeen )
|
||||
// If we have reach a point where a cons. number of turns gone by....
|
||||
if ( gTacticalStatus.bConsNumTurnsNotSeen > 1 )
|
||||
{
|
||||
gTacticalStatus.bConsNumTurnsNotSeen = 0;
|
||||
|
||||
if(is_networked && !getReal)//hayden
|
||||
{
|
||||
//ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, MPClientMessage[32] );
|
||||
|
||||
sendRT();
|
||||
|
||||
return(FALSE);
|
||||
}
|
||||
gTacticalStatus.bConsNumTurnsNotSeen = 0;
|
||||
|
||||
// Exit mode!
|
||||
ExitCombatMode();
|
||||
|
||||
@@ -5993,7 +6084,14 @@ BOOLEAN CheckForEndOfCombatMode( BOOLEAN fIncrementTurnsNotSeen )
|
||||
|
||||
void DeathNoMessageTimerCallback( void )
|
||||
{
|
||||
CheckAndHandleUnloadingOfCurrentWorld();
|
||||
//CheckAndHandleUnloadingOfCurrentWorld();
|
||||
if(!is_client)CheckAndHandleUnloadingOfCurrentWorld();
|
||||
else
|
||||
{
|
||||
ScreenMsg( FONT_LTGREEN, MSG_CHAT, MPClientMessage[40] );
|
||||
gTacticalStatus.uiFlags |= SHOW_ALL_MERCS;//hayden
|
||||
ScreenMsg( FONT_YELLOW, MSG_CHAT, MPClientMessage[41] );
|
||||
}
|
||||
}
|
||||
|
||||
void RemoveStaticEnemiesFromSectorInfo( INT16 sMapX, INT16 sMapY )
|
||||
@@ -6103,6 +6201,9 @@ BOOLEAN CheckForEndOfBattle( BOOLEAN fAnEnemyRetreated )
|
||||
// Play death music
|
||||
SetMusicMode( MUSIC_TACTICAL_DEATH );
|
||||
SetCustomizableTimerCallbackAndDelay( 10000, DeathNoMessageTimerCallback, FALSE );
|
||||
|
||||
if (is_networked)
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, MPClientMessage[42] );
|
||||
|
||||
if ( CheckFact( FACT_FIRST_BATTLE_BEING_FOUGHT, 0 ) )
|
||||
{
|
||||
@@ -7404,8 +7505,9 @@ SOLDIERTYPE *InternalReduceAttackBusyCount( )
|
||||
{
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("!!!!!!! &&&&&&& Problem with attacker busy count decrementing past 0.... preventing wrap-around." ) );
|
||||
#ifdef JA2BETAVERSION
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_BETAVERSION, L"Attack busy problem. Save, exit and send debug.txt + save file to Sir-Tech." );
|
||||
if(!is_networked)ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_BETAVERSION, L"Attack busy problem. Save, exit and send debug.txt + save file to Sir-Tech." );
|
||||
DebugAttackBusy( "Attack Busy Problem\n");
|
||||
//cheap hack to suppress message in MP - hayden.
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -7454,6 +7556,12 @@ SOLDIERTYPE *InternalReduceAttackBusyCount( )
|
||||
// would work quite well. If only I could close all the holes that the UI opens so that one routine could handle everything.
|
||||
if (!pSoldier)
|
||||
{
|
||||
if (is_networked)
|
||||
{
|
||||
if(gusSelectedSoldier==156)
|
||||
return( NULL );
|
||||
}
|
||||
|
||||
pSoldier = MercPtrs[ gusSelectedSoldier ];
|
||||
}
|
||||
|
||||
@@ -8046,7 +8154,13 @@ void DoneFadeOutDueToDeath( void )
|
||||
void EndBattleWithUnconsciousGuysCallback( UINT8 bExitValue )
|
||||
{
|
||||
// Enter mapscreen.....
|
||||
CheckAndHandleUnloadingOfCurrentWorld();
|
||||
if(!is_client)CheckAndHandleUnloadingOfCurrentWorld();
|
||||
else
|
||||
{
|
||||
ScreenMsg( FONT_LTGREEN, MSG_CHAT, MPClientMessage[40] );
|
||||
gTacticalStatus.uiFlags |= SHOW_ALL_MERCS;//hayden
|
||||
ScreenMsg( FONT_YELLOW, MSG_CHAT, MPClientMessage[41] );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
+3
-3
@@ -42,7 +42,7 @@
|
||||
#include "gamesettings.h"
|
||||
#include "Buildings.h"
|
||||
#endif
|
||||
|
||||
#include "connect.h"
|
||||
#include "PathAIDebug.h"
|
||||
//forward declarations of common classes to eliminate includes
|
||||
class OBJECTTYPE;
|
||||
@@ -581,7 +581,7 @@ int AStarPathfinder::GetPath(SOLDIERTYPE *s ,
|
||||
else if (!GridNoOnVisibleWorldTile( StartNode ) )
|
||||
{
|
||||
#ifdef JA2BETAVERSION
|
||||
ScreenMsg( FONT_MCOLOR_RED, MSG_TESTVERSION, L"ERROR! Trying to calculate path from non-visible gridno %d to %d", StartNode, DestNode );
|
||||
if(!is_networked)ScreenMsg( FONT_MCOLOR_RED, MSG_TESTVERSION, L"ERROR! Trying to calculate path from non-visible gridno %d to %d", StartNode, DestNode );
|
||||
#endif
|
||||
return( 0 );
|
||||
}
|
||||
@@ -2411,7 +2411,7 @@ INT32 FindBestPath(SOLDIERTYPE *s , INT16 sDestination, INT8 ubLevel, INT16 usMo
|
||||
else if (!GridNoOnVisibleWorldTile( (INT16) iOrigination ) )
|
||||
{
|
||||
#ifdef JA2BETAVERSION
|
||||
ScreenMsg( FONT_MCOLOR_RED, MSG_TESTVERSION, L"ERROR! Trying to calculate path from non-visible gridno %d to %d", iOrigination, sDestination );
|
||||
if(!is_networked)ScreenMsg( FONT_MCOLOR_RED, MSG_TESTVERSION, L"ERROR! Trying to calculate path from non-visible gridno %d to %d", iOrigination, sDestination );
|
||||
#endif
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
+24
-4
@@ -34,7 +34,7 @@
|
||||
#include "Map Information.h"
|
||||
#include "Interface Items.h"
|
||||
#endif
|
||||
|
||||
#include "connect.h"
|
||||
//rain
|
||||
//#define BREATH_GAIN_REDUCTION_PER_RAIN_INTENSITY 25
|
||||
//end rain
|
||||
@@ -537,7 +537,6 @@ BOOLEAN EnoughPoints( SOLDIERTYPE *pSoldier, INT16 sAPCost, INT32 iBPCost, BOOLE
|
||||
//CHRISL: if we don't have soldier information, assume we have enough points.
|
||||
if(pSoldier == NULL)
|
||||
return( TRUE );
|
||||
|
||||
// If this guy is on a special move... don't care about APS, OR BPSs!
|
||||
if ( pSoldier->ubWaitActionToDo )
|
||||
{
|
||||
@@ -563,6 +562,14 @@ BOOLEAN EnoughPoints( SOLDIERTYPE *pSoldier, INT16 sAPCost, INT32 iBPCost, BOOLE
|
||||
}
|
||||
#endif
|
||||
|
||||
if (is_networked)
|
||||
{
|
||||
if(pSoldier->ubID > 119 || (!is_server && pSoldier->ubID > 20))
|
||||
{
|
||||
return(TRUE);
|
||||
}//hayden , if soldier replication, allow.
|
||||
}
|
||||
|
||||
// Get New points
|
||||
sNewAP = pSoldier->bActionPoints - sAPCost;
|
||||
|
||||
@@ -623,8 +630,21 @@ void DeductPoints( SOLDIERTYPE *pSoldier, INT16 sAPCost, INT32 iBPCost,BOOLEAN f
|
||||
// NB: iBPCost > 0 - breath loss, iBPCost < 0 - breath gain
|
||||
if (iBPCost)
|
||||
{
|
||||
// Adjust breath changes due to spending or regaining of energy
|
||||
iBPCost = AdjustBreathPts(pSoldier, iBPCost);
|
||||
if (is_networked)
|
||||
{
|
||||
// Adjust breath changes due to spending or regaining of energy
|
||||
if(!pSoldier->bActive)
|
||||
{
|
||||
//ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"test_func2" );
|
||||
}
|
||||
else
|
||||
iBPCost = AdjustBreathPts(pSoldier, iBPCost);
|
||||
}
|
||||
else
|
||||
{
|
||||
iBPCost = AdjustBreathPts(pSoldier, iBPCost);
|
||||
}
|
||||
|
||||
|
||||
// Snap: award some health and strength for exertion
|
||||
// Do 4 StatChange rolls for health (2 for strength) per 10 breath points spent?
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "Exit Grids.h"
|
||||
#endif
|
||||
|
||||
|
||||
#include "connect.h"
|
||||
//forward declarations of common classes to eliminate includes
|
||||
class OBJECTTYPE;
|
||||
class SOLDIERTYPE;
|
||||
@@ -1162,8 +1162,13 @@ BOOLEAN InternalAddSoldierToSector( UINT8 ubID, BOOLEAN fCalculateDirection, BOO
|
||||
}
|
||||
else
|
||||
{
|
||||
sGridNo = FindGridNoFromSweetSpot( pSoldier, pSoldier->sInsertionGridNo, 7, &ubCalculatedDirection );
|
||||
|
||||
if(is_client && (pSoldier->ubStrategicInsertionCode == INSERTION_CODE_GRIDNO))
|
||||
{
|
||||
sGridNo = pSoldier->sInsertionGridNo;
|
||||
ubCalculatedDirection = pSoldier->ubDirection;
|
||||
}
|
||||
else sGridNo = FindGridNoFromSweetSpot( pSoldier, pSoldier->sInsertionGridNo, 7, &ubCalculatedDirection );
|
||||
//hayden
|
||||
// ATE: Error condition - if nowhere use insertion gridno!
|
||||
if ( sGridNo == NOWHERE )
|
||||
{
|
||||
|
||||
@@ -66,8 +66,8 @@
|
||||
//forward declarations of common classes to eliminate includes
|
||||
class OBJECTTYPE;
|
||||
class SOLDIERTYPE;
|
||||
|
||||
|
||||
#include "connect.h"
|
||||
#include "fresh_header.h"
|
||||
#define NO_JUMP 0
|
||||
#define MAX_ANIFRAMES_PER_FLASH 2
|
||||
//#define TIME_FOR_RANDOM_ANIM_CHECK 10
|
||||
@@ -367,8 +367,13 @@ BOOLEAN AdjustToNextAnimationFrame( SOLDIERTYPE *pSoldier )
|
||||
SFireWeapon.sTargetGridNo = pSoldier->sTargetGridNo;
|
||||
SFireWeapon.bTargetLevel = pSoldier->bTargetLevel;
|
||||
SFireWeapon.bTargetCubeLevel= pSoldier->bTargetCubeLevel;
|
||||
if((is_server && pSoldier->ubID<120) || (!is_server && is_client && pSoldier->ubID<20) || (!is_server && !is_client) )
|
||||
{//only carry on if own werc
|
||||
AddGameEvent( S_FIREWEAPON, 0, &SFireWeapon );
|
||||
|
||||
|
||||
//hayden
|
||||
if(is_server || (is_client && pSoldier->ubID <20) ) send_fireweapon( &SFireWeapon );
|
||||
}
|
||||
//DIGICRAB: Burst UnCap
|
||||
//Loop around in the animation if we still have burst rounds to fire
|
||||
if (pSoldier->bDoBurst && (pSoldier->bDoBurst <= ((pSoldier->bDoAutofire)?(pSoldier->bDoAutofire):(GetShotsPerBurst(&pSoldier->inv[HANDPOS]))) || (( pSoldier->bWeaponMode == WM_ATTACHED_GL_BURST && pSoldier->bDoBurst <= Weapon[GetAttachedGrenadeLauncher(&pSoldier->inv[HANDPOS])].ubShotsPerBurst)) ))
|
||||
@@ -3209,6 +3214,12 @@ BOOLEAN HandleSoldierDeath( SOLDIERTYPE *pSoldier , BOOLEAN *pfMadeCorpse )
|
||||
|
||||
if ( pSoldier->stats.bLife == 0 && !( pSoldier->flags.uiStatusFlags & SOLDIER_DEAD ) )
|
||||
{
|
||||
// Haydent
|
||||
if (is_networked)
|
||||
//send death info
|
||||
send_death(pSoldier);//quickfix
|
||||
|
||||
|
||||
// Cancel services here...
|
||||
pSoldier->ReceivingSoldierCancelServices( );
|
||||
pSoldier->GivingSoldierCancelServices( );
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
#include "Strategic Pathing.h"
|
||||
#endif
|
||||
|
||||
|
||||
#include "fresh_header.h"
|
||||
|
||||
//forward declarations of common classes to eliminate includes
|
||||
class OBJECTTYPE;
|
||||
@@ -122,6 +122,7 @@ extern INT16 DirIncrementer[8];
|
||||
|
||||
|
||||
#define MIN_SUBSEQUENT_SNDS_DELAY 2000
|
||||
#include "connect.h"
|
||||
|
||||
// Enumerate extended directions
|
||||
enum
|
||||
@@ -1649,6 +1650,34 @@ void SOLDIERTYPE::AdjustNoAPToFinishMove( BOOLEAN fSet )
|
||||
// this->DeleteSoldierLight( );
|
||||
}
|
||||
|
||||
|
||||
//send it on
|
||||
if (is_networked && this->ubID < 120)
|
||||
{
|
||||
//if(this->ubID>=120)
|
||||
// return;//hayden
|
||||
EV_S_STOP_MERC SStopMerc;
|
||||
|
||||
SStopMerc.sGridNo = this->sGridNo;
|
||||
SStopMerc.ubDirection = this->ubDirection;
|
||||
SStopMerc.usSoldierID = this->ubID;
|
||||
SStopMerc.fset=fSet;
|
||||
SStopMerc.sXPos=this->sX;
|
||||
SStopMerc.sYPos=this->sY;
|
||||
|
||||
//AddGameEvent( S_STOP_MERC, 0, &SStopMerc ); //hayden.
|
||||
|
||||
|
||||
if(is_client)
|
||||
send_stop(&SStopMerc);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
this->flags.fNoAPToFinishMove = fSet;
|
||||
|
||||
if ( !fSet )
|
||||
@@ -2484,9 +2513,20 @@ BOOLEAN SOLDIERTYPE::ChangeSoldierState( UINT16 usNewState, UINT16 usStartingAni
|
||||
SChangeState.uiUniqueId = this->uiUniqueSoldierIdValue;
|
||||
|
||||
//AddGameEvent( S_CHANGESTATE, 0, &SChangeState );
|
||||
if(is_server && this->ubID < 120)
|
||||
{
|
||||
this->EVENT_InitNewSoldierAnim( SChangeState.usNewState, SChangeState.usStartingAniCode, SChangeState.fForce );
|
||||
|
||||
|
||||
send_changestate(&SChangeState);
|
||||
}
|
||||
else if(is_client && !is_server && this->ubID < 20)
|
||||
{
|
||||
this->EVENT_InitNewSoldierAnim( SChangeState.usNewState, SChangeState.usStartingAniCode, SChangeState.fForce );
|
||||
send_changestate(&SChangeState);
|
||||
}
|
||||
else if (!is_client)
|
||||
{
|
||||
this->EVENT_InitNewSoldierAnim( SChangeState.usNewState, SChangeState.usStartingAniCode, SChangeState.fForce );
|
||||
}
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
@@ -4649,8 +4689,16 @@ BOOLEAN SOLDIERTYPE::InternalSoldierReadyWeapon( UINT8 sFacingDir, BOOLEAN fEndR
|
||||
|
||||
if ( usAnimState != INVALID_ANIMATION )
|
||||
{
|
||||
if(is_networked)
|
||||
{
|
||||
ChangeSoldierState( usAnimState, 0 , FALSE );//this passes it to an area where it gets sent over the network.
|
||||
}
|
||||
else
|
||||
{
|
||||
this->EVENT_InitNewSoldierAnim( usAnimState, 0 , FALSE );
|
||||
}
|
||||
fReturnVal = TRUE;
|
||||
|
||||
}
|
||||
|
||||
if ( !fEndReady )
|
||||
@@ -5906,7 +5954,11 @@ BOOLEAN SOLDIERTYPE::EVENT_InternalGetNewSoldierPath( INT16 sDestGridNo, UINT16
|
||||
this->usDontUpdateNewGridNoOnMoveAnimChange = TRUE;
|
||||
|
||||
this->EVENT_InitNewSoldierAnim( usMoveAnimState, 0, FALSE );
|
||||
if(is_server || (is_client && this->ubID <20) ) send_path( this, sDestGridNo, usMoveAnimState , 0 , FALSE );
|
||||
|
||||
return( TRUE );
|
||||
}
|
||||
if(is_server || (is_client && this->ubID <20) ) send_path( this, sDestGridNo, this->usAnimState , 255 , FALSE );
|
||||
|
||||
return( TRUE );
|
||||
}
|
||||
@@ -5964,11 +6016,13 @@ BOOLEAN SOLDIERTYPE::EVENT_InternalGetNewSoldierPath( INT16 sDestGridNo, UINT16
|
||||
{
|
||||
this->EVENT_InitNewSoldierAnim( usAnimState, 0, FALSE );
|
||||
this->usPendingAnimation = usMoveAnimState;
|
||||
if(is_server || (is_client && this->ubID <20) ) send_path( this, sDestGridNo, usAnimState , 0 , FALSE );
|
||||
}
|
||||
else
|
||||
{
|
||||
// Call local copy for change soldier state!
|
||||
this->EVENT_InitNewSoldierAnim( usMoveAnimState, 0, fForceRestartAnim );
|
||||
if(is_server || (is_client && this->ubID <20) ) send_path( this, sDestGridNo, usMovementAnim , 0 , fForceRestartAnim );
|
||||
|
||||
}
|
||||
|
||||
@@ -7539,6 +7593,8 @@ void SetSoldierAniSpeed( SOLDIERTYPE *pSoldier )
|
||||
|
||||
// ATE: If we are an enemy and are not visible......
|
||||
// Set speed to 0
|
||||
if(!is_client)
|
||||
{
|
||||
if ( ( gTacticalStatus.uiFlags & TURNBASED && ( gTacticalStatus.uiFlags & INCOMBAT ) ) || gTacticalStatus.fAutoBandageMode )
|
||||
{
|
||||
if ( ( ( pSoldier->bVisible == -1 && pSoldier->bVisible == pSoldier->bLastRenderVisibleValue ) || gTacticalStatus.fAutoBandageMode ) && pSoldier->usAnimState != MONSTER_UP )
|
||||
@@ -7555,6 +7611,7 @@ void SetSoldierAniSpeed( SOLDIERTYPE *pSoldier )
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Default stats soldier to same as normal soldier.....
|
||||
pStatsSoldier = pSoldier;
|
||||
@@ -7882,7 +7939,11 @@ void SOLDIERTYPE::BeginSoldierClimbUpRoof( void )
|
||||
}
|
||||
INT8 bNewDirection;
|
||||
UINT8 ubWhoIsThere;
|
||||
|
||||
if(is_client)
|
||||
{
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, MPClientMessage[43] );
|
||||
return;//hayden disable climbing roof
|
||||
}
|
||||
if ( FindHeigherLevel( this, this->sGridNo, this->ubDirection, &bNewDirection ) && ( this->pathing.bLevel == 0 ) )
|
||||
{
|
||||
if ( EnoughPoints( this, GetAPsToClimbRoof( this, FALSE ), 0, TRUE ) )
|
||||
@@ -9749,6 +9810,7 @@ void SendSoldierSetDesiredDirectionEvent( SOLDIERTYPE *pSoldier, UINT16 usDesire
|
||||
SSetDesiredDirection.uiUniqueId = pSoldier->uiUniqueSoldierIdValue;
|
||||
|
||||
AddGameEvent( S_SETDESIREDDIRECTION, 0, &SSetDesiredDirection );
|
||||
if(is_server || (is_client && pSoldier->ubID <20) ) send_dir( pSoldier, usDesiredDirection );
|
||||
|
||||
}
|
||||
|
||||
@@ -9783,8 +9845,10 @@ void SendChangeSoldierStanceEvent( SOLDIERTYPE *pSoldier, UINT8 ubNewStance )
|
||||
|
||||
AddGameEvent( S_CHANGESTANCE, 0, &SChangeStance );
|
||||
#endif
|
||||
|
||||
if((pSoldier->ubID > 19) && is_networked)
|
||||
return;
|
||||
pSoldier->ChangeSoldierStance( ubNewStance );
|
||||
if(is_server || (is_client && pSoldier->ubID <20) ) send_stance( pSoldier, ubNewStance );
|
||||
}
|
||||
|
||||
|
||||
@@ -10905,12 +10969,17 @@ void SOLDIERTYPE::HaultSoldierFromSighting( BOOLEAN fFromSightingEnemy )
|
||||
{
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("HaultSoldierFromSighting") );
|
||||
// SEND HUALT EVENT!
|
||||
//EV_S_STOP_MERC SStopMerc;
|
||||
EV_S_STOP_MERC SStopMerc;
|
||||
|
||||
//SStopMerc.sGridNo = this->sGridNo;
|
||||
//SStopMerc.bDirection = this->ubDirection;
|
||||
//SStopMerc.usSoldierID = this->ubID;
|
||||
//AddGameEvent( S_STOP_MERC, 0, &SStopMerc );
|
||||
SStopMerc.sGridNo = this->sGridNo;
|
||||
SStopMerc.ubDirection = this->ubDirection;
|
||||
SStopMerc.usSoldierID = this->ubID;
|
||||
SStopMerc.fset=TRUE;
|
||||
SStopMerc.sXPos=this->sX;
|
||||
SStopMerc.sYPos=this->sY;
|
||||
//AddGameEvent( S_STOP_MERC, 0, &SStopMerc ); //hayden.
|
||||
if(this->ubID>=120) return;//hayden
|
||||
if(is_client)send_stop(&SStopMerc);
|
||||
|
||||
// If we are a 'specialmove... ignore...
|
||||
if ( ( gAnimControl[ this->usAnimState ].uiFlags & ANIM_SPECIALMOVE ) )
|
||||
|
||||
@@ -907,6 +907,7 @@ public:
|
||||
|
||||
UINT32 uiSoldierUpdateNumber;
|
||||
BYTE ubSoldierUpdateType;
|
||||
UINT16 sScheduledStop; //hayden, used for scheduling a grid to stop
|
||||
//END
|
||||
|
||||
INT32 iStartOfInsuranceContract;
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
#include "math.h"
|
||||
#endif
|
||||
|
||||
#include "connect.h"
|
||||
|
||||
// THESE 3 DIFFICULTY FACTORS MUST ALWAYS ADD UP TO 100% EXACTLY!!!
|
||||
#define DIFF_FACTOR_PLAYER_PROGRESS 50
|
||||
@@ -428,6 +429,42 @@ SOLDIERTYPE* TacticalCreateSoldier( SOLDIERCREATE_STRUCT *pCreateStruct, UINT8 *
|
||||
*pubID = NOBODY;
|
||||
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("TacticalCreateSoldier"));
|
||||
|
||||
INT8 tbTeam;
|
||||
BOOLEAN tfPP;
|
||||
tbTeam=pCreateStruct->bTeam;
|
||||
tfPP=pCreateStruct->fPlayerPlan; //used as temp indicator of struct sent from the server //hayden.
|
||||
|
||||
if(is_client && !is_server && (tbTeam >0 && tbTeam < 5) && tfPP==0)
|
||||
{
|
||||
return NULL; // pure client to not spawn AI unless from server, Hayden.
|
||||
//gTacticalStatus.Team[ tbTeam ].bTeamActive=0;
|
||||
}
|
||||
//if(is_server && tbTeam>0 && tbTeam<5)
|
||||
if(is_server && tbTeam>0 && tbTeam<5)
|
||||
{
|
||||
//if(tbTeam==1 && !ENEMY_ENABLED)
|
||||
//{
|
||||
// return NULL;
|
||||
//}
|
||||
//if(tbTeam==2 && !CREATURE_ENABLED)
|
||||
//{
|
||||
// return NULL;
|
||||
//}
|
||||
//if(tbTeam==3 && !MILITIA_ENABLED)
|
||||
//{
|
||||
// return NULL;
|
||||
//}
|
||||
//if(tbTeam==4 && !CIV_ENABLED)
|
||||
//{
|
||||
// return NULL;
|
||||
//}
|
||||
send_AI(pCreateStruct,pubID);
|
||||
}
|
||||
if(is_client && !is_server && tfPP==1)
|
||||
{
|
||||
pCreateStruct->fPlayerPlan = 0;
|
||||
}
|
||||
//hayden
|
||||
//Kris:
|
||||
//Huge no no! See the header file for description of static detailed placements.
|
||||
//If this expression ever evaluates to true, then it will expose serious problems.
|
||||
|
||||
@@ -272,6 +272,7 @@ public:
|
||||
BOOLEAN fUseGivenVehicle;
|
||||
INT8 bUseGivenVehicleID;
|
||||
BOOLEAN fHasKeys;
|
||||
INT8 PADDINGSLOTS[ 14 ];
|
||||
|
||||
//
|
||||
// New and OO stuff goes after here. Above this point any changes will goof up reading from files.
|
||||
|
||||
@@ -56,6 +56,7 @@
|
||||
#include "strategic.h"
|
||||
#endif
|
||||
|
||||
#include "connect.h"
|
||||
#ifdef JA2EDITOR
|
||||
extern BOOLEAN gfProfileDataLoaded;
|
||||
#endif
|
||||
@@ -447,7 +448,7 @@ BOOLEAN LoadMercProfiles(void)
|
||||
DecideActiveTerrorists();
|
||||
|
||||
// initialize mercs' status
|
||||
StartSomeMercsOnAssignment( );
|
||||
if(!is_networked)StartSomeMercsOnAssignment( );
|
||||
|
||||
// initial recruitable mercs' reputation in each town
|
||||
InitializeProfilesForTownReputation( );
|
||||
@@ -988,11 +989,22 @@ SOLDIERTYPE *ChangeSoldierTeam( SOLDIERTYPE *pSoldier, UINT8 ubTeam )
|
||||
pNewSoldier->bLastRenderVisibleValue = pSoldier->bLastRenderVisibleValue;
|
||||
pNewSoldier->bVisible = pSoldier->bVisible;
|
||||
// 0verhaul: Need to pass certain flags over. COWERING is one of them. Others to be determined.
|
||||
pNewSoldier->flags.uiStatusFlags |= pSoldier->flags.uiStatusFlags & (SOLDIER_COWERING | SOLDIER_MUTE | SOLDIER_GASSED);
|
||||
|
||||
// copy uiStatusFlags, etc. - hayden :)
|
||||
if (is_networked)
|
||||
{
|
||||
pNewSoldier->flags.uiStatusFlags = pSoldier->flags.uiStatusFlags;
|
||||
pNewSoldier->ubProfile = pSoldier->ubProfile;
|
||||
}
|
||||
else
|
||||
{
|
||||
pNewSoldier->flags.uiStatusFlags |= pSoldier->flags.uiStatusFlags & (SOLDIER_COWERING | SOLDIER_MUTE | SOLDIER_GASSED);
|
||||
}
|
||||
|
||||
|
||||
if ( ubTeam == gbPlayerNum )
|
||||
{
|
||||
pNewSoldier->bVisible = 1;
|
||||
pNewSoldier->bVisible= 1;
|
||||
}
|
||||
|
||||
//CHRISL: Rather then resorting the profile, which recreates all the items, what if we simply try and sort the
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#define AM_A_ROBOT( p ) ( ( p->ubProfile == NO_PROFILE ) ? FALSE : ( gMercProfiles[ p->ubProfile ].ubBodyType == ROBOTNOWEAPON ) )
|
||||
|
||||
|
||||
#define OK_ENEMY_MERC( p ) ( !p->aiData.bNeutral && (p->bSide != gbPlayerNum ) && p->stats.bLife >= OKLIFE )
|
||||
#define OK_ENEMY_MERC( p ) ( !p->aiData.bNeutral && (p->bSide != gbPlayerNum ) && p->stats.bLife >= OKLIFE && (p->bTeam < 5 ))
|
||||
|
||||
// Checks if our guy can be controllable .... checks bInSector, team, on duty, etc...
|
||||
#define OK_CONTROLLABLE_MERC( p ) ( p->stats.bLife >= OKLIFE && p->bActive && p->bInSector && p->bTeam == gbPlayerNum && p->bAssignment < ON_DUTY )
|
||||
|
||||
@@ -333,7 +333,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""..\Standard Gaming Platform";..\TileEngine;..\;..\Utils;..\tacticalai;..\Editor;..\strategic;..\lua;..\Laptop;.\"
|
||||
AdditionalIncludeDirectories="..\Multiplayer;"..\Standard Gaming Platform";..\TileEngine;..\;..\Utils;..\tacticalai;..\Editor;..\strategic;..\lua;..\Laptop;.\"
|
||||
PreprocessorDefinitions="CALLBACKTIMER;PRECOMPILEDHEADERS;_DEBUG;WIN32;_WINDOWS;JA2;_VTUNE_PROFILING;XML_STATIC;CINTERFACE"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="2"
|
||||
@@ -390,7 +390,7 @@
|
||||
FavorSizeOrSpeed="1"
|
||||
OptimizeForProcessor="3"
|
||||
OptimizeForWindowsApplication="TRUE"
|
||||
AdditionalIncludeDirectories=""..\Standard Gaming Platform";..\TileEngine;..\;..\Utils;..\tacticalai;..\Editor;..\strategic;..\Laptop;.\"
|
||||
AdditionalIncludeDirectories="..\Multiplayer;..\lua;"..\Standard Gaming Platform";..\TileEngine;..\;..\Utils;..\tacticalai;..\Editor;..\strategic;..\Laptop;.\"
|
||||
PreprocessorDefinitions="CALLBACKTIMER;PRECOMPILEDHEADERS;NDEBUG;WIN32;_WINDOWS;JA2;XML_STATIC;CINTERFACE"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="0"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8,00"
|
||||
Version="8.00"
|
||||
Name="Tactical_2005Express"
|
||||
ProjectGUID="{D4BDA6AD-9B61-4953-892D-DA3F8CC7E096}"
|
||||
RootNamespace="Tactical_2005Express"
|
||||
@@ -41,6 +41,7 @@
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/D "_CRT_SECURE_NO_DEPRECATE""
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\Multiplayer"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
@@ -104,6 +105,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/D "_CRT_SECURE_NO_DEPRECATE""
|
||||
AdditionalIncludeDirectories="..\Multiplayer"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;"
|
||||
RuntimeLibrary="0"
|
||||
RuntimeTypeInfo="false"
|
||||
|
||||
+231
-20
@@ -49,12 +49,12 @@
|
||||
#endif
|
||||
|
||||
#include "Reinforcement.h"
|
||||
|
||||
#include "fresh_header.h"
|
||||
//forward declarations of common classes to eliminate includes
|
||||
class OBJECTTYPE;
|
||||
class SOLDIERTYPE;
|
||||
|
||||
|
||||
#include "connect.h"
|
||||
//#include "test_space.h"
|
||||
|
||||
extern INT8 STRAIGHT;
|
||||
//extern UINT8 gubSpeedUpAnimationFactor;
|
||||
@@ -248,6 +248,9 @@ void StartPlayerTeamTurn( BOOLEAN fDoBattleSnd, BOOLEAN fEnteringCombatMode )
|
||||
}
|
||||
// Signal UI done enemy's turn
|
||||
guiPendingOverrideEvent = LU_ENDUILOCK;
|
||||
|
||||
if (is_networked)
|
||||
guiPendingOverrideEvent = LA_ENDUIOUTURNLOCK;
|
||||
|
||||
// ATE: Reset killed on attack variable.. this is because sometimes timing is such
|
||||
/// that a baddie can die and still maintain it's attacker ID
|
||||
@@ -266,7 +269,14 @@ void FreezeInterfaceForEnemyTurn( void )
|
||||
ErasePath( TRUE );
|
||||
|
||||
// Setup locked UI
|
||||
guiPendingOverrideEvent = LU_BEGINUILOCK;
|
||||
if(is_client)
|
||||
{
|
||||
guiPendingOverrideEvent = LA_BEGINUIOURTURNLOCK;
|
||||
}
|
||||
else
|
||||
{
|
||||
guiPendingOverrideEvent = LU_BEGINUILOCK;
|
||||
}
|
||||
|
||||
// Remove any UI messages!
|
||||
if ( giUIMessageOverlay != -1 )
|
||||
@@ -296,7 +306,12 @@ void EndTurn( UINT8 ubNextTeam )
|
||||
|
||||
if (INTERRUPT_QUEUED)
|
||||
{
|
||||
EndInterrupt( FALSE );
|
||||
if(is_networked)
|
||||
{
|
||||
end_interrupt( FALSE );//this tells other client to go on from where he was
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"ending interrupt" );
|
||||
}
|
||||
EndInterrupt( FALSE );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -320,7 +335,7 @@ void EndTurn( UINT8 ubNextTeam )
|
||||
|
||||
gTacticalStatus.ubCurrentTeam = ubNextTeam;
|
||||
|
||||
BeginTeamTurn( gTacticalStatus.ubCurrentTeam );
|
||||
if(is_server || !is_client) BeginTeamTurn( gTacticalStatus.ubCurrentTeam );
|
||||
|
||||
BetweenTurnsVisibilityAdjustments();
|
||||
}
|
||||
@@ -435,6 +450,11 @@ void BeginTeamTurn( UINT8 ubTeam )
|
||||
ubTeam = gbPlayerNum;
|
||||
gTacticalStatus.ubCurrentTeam = gbPlayerNum;
|
||||
EndTurnEvents();
|
||||
if(is_server)
|
||||
{
|
||||
numreadyteams =0;//beginning round
|
||||
memset( &readyteamreg , 0 , sizeof (int) * 10);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -486,18 +506,45 @@ void BeginTeamTurn( UINT8 ubTeam )
|
||||
if ( ( gTacticalStatus.uiFlags & INCOMBAT ) )
|
||||
{
|
||||
StartPlayerTeamTurn( TRUE, FALSE );
|
||||
/* if(is_server && !net_turn) send_EndTurn(ubTeam);
|
||||
if(net_turn == true) net_turn = false;*/
|
||||
if(is_server)
|
||||
{
|
||||
numreadyteams =0;//beginning round
|
||||
memset( &readyteamreg , 0 , sizeof (int) * 10);
|
||||
send_EndTurn(netbTeam);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
else
|
||||
if (ubTeam > 4 || (is_client && !is_server )) //hayden
|
||||
{
|
||||
|
||||
InitEnemyUIBar( 0, 0 );
|
||||
fInterfacePanelDirty = DIRTYLEVEL2;
|
||||
AddTopMessage( COMPUTER_TURN_MESSAGE, TeamTurnString[ ubTeam ] );
|
||||
/*if(is_server && !net_turn) send_EndTurn(ubTeam);
|
||||
if(net_turn == true) net_turn = false;*/
|
||||
if(is_server) send_EndTurn(ubTeam);
|
||||
|
||||
|
||||
|
||||
//return;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef NETWORKED
|
||||
// Only the host should do this
|
||||
if(!gfAmIHost)
|
||||
break;
|
||||
#endif
|
||||
if( is_client && !is_server ) //hayden //disable independant client AI
|
||||
break;
|
||||
|
||||
// Set First enemy merc to AI control
|
||||
|
||||
// Set First enemy merc to AI control
|
||||
if ( BuildAIListForTeam( ubTeam ) )
|
||||
{
|
||||
|
||||
@@ -515,6 +562,10 @@ void BeginTeamTurn( UINT8 ubTeam )
|
||||
AddTopMessage( COMPUTER_TURN_MESSAGE, TeamTurnString[ ubTeam ] );
|
||||
}
|
||||
StartNPCAI( MercPtrs[ ubID ] );
|
||||
/*if(is_server && !net_turn) send_EndTurn(ubTeam);
|
||||
if(net_turn == true) net_turn = false;*/
|
||||
if(is_server) send_EndTurn(ubTeam);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -544,7 +595,14 @@ void DisplayHiddenInterrupt( SOLDIERTYPE * pSoldier )
|
||||
SlideTo( NOWHERE, pSoldier->ubID, NOBODY ,SETLOCATOR);
|
||||
}
|
||||
|
||||
guiPendingOverrideEvent = LU_BEGINUILOCK;
|
||||
if(is_client)
|
||||
{
|
||||
guiPendingOverrideEvent = LA_BEGINUIOURTURNLOCK;
|
||||
}
|
||||
else
|
||||
{
|
||||
guiPendingOverrideEvent = LU_BEGINUILOCK;
|
||||
}
|
||||
|
||||
// Dirty panel interface!
|
||||
fInterfacePanelDirty = DIRTYLEVEL2;
|
||||
@@ -765,6 +823,10 @@ void StartInterrupt( void )
|
||||
|
||||
// Signal UI done enemy's turn
|
||||
guiPendingOverrideEvent = LU_ENDUILOCK;
|
||||
|
||||
if (is_networked)
|
||||
guiPendingOverrideEvent = LA_ENDUIOUTURNLOCK;
|
||||
|
||||
HandleTacticalUI( );
|
||||
|
||||
InitPlayerUIBar( TRUE );
|
||||
@@ -831,7 +893,7 @@ void StartInterrupt( void )
|
||||
ubFirstInterrupter = ubInterrupter;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
// here we have to rebuilt the AI list!
|
||||
BuildAIListForTeam( bTeam );
|
||||
@@ -855,11 +917,16 @@ void StartInterrupt( void )
|
||||
|
||||
gTacticalStatus.ubCurrentTeam = pSoldier->bTeam;
|
||||
|
||||
#ifdef JA2BETAVERSION
|
||||
//#ifdef JA2BETAVERSION
|
||||
|
||||
if (is_networked)
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_TESTVERSION, L"Interrupt ( could be hidden )" );
|
||||
#endif
|
||||
|
||||
|
||||
//#endif
|
||||
//send_interrupt( pSoldier );//hayden
|
||||
StartNPCAI( pSoldier );
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if ( !gfHiddenInterrupt )
|
||||
@@ -919,7 +986,46 @@ void EndInterrupt( BOOLEAN fMarkInterruptOccurred )
|
||||
gfHiddenInterrupt = FALSE;
|
||||
|
||||
// resume interrupted interrupt
|
||||
StartInterrupt();
|
||||
//hayden
|
||||
if (is_networked)
|
||||
{
|
||||
UINT8 nubFirstInterrupter;
|
||||
INT8 nbTeam;
|
||||
SOLDIERTYPE * npSoldier;
|
||||
|
||||
nubFirstInterrupter = LATEST_INTERRUPT_GUY;
|
||||
npSoldier = MercPtrs[nubFirstInterrupter];
|
||||
nbTeam = npSoldier->bTeam;
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"unchecked interrupt call area:(resume interrupted interrupt)...");
|
||||
|
||||
if ((nbTeam > 0) && (nbTeam <6 ) && is_server) //is AI and are server
|
||||
{
|
||||
send_interrupt( npSoldier );
|
||||
StartInterrupt();
|
||||
|
||||
}
|
||||
else if(nbTeam == 0) //its an interrupt for own merc team
|
||||
{
|
||||
//ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"interrupt for our team");
|
||||
//hayden
|
||||
StartInterrupt();
|
||||
send_interrupt( npSoldier ); //
|
||||
}
|
||||
else
|
||||
{
|
||||
//ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"interrupt for another team"); //may need more work.
|
||||
//ClearIntList();
|
||||
//hayden
|
||||
StartInterrupt();
|
||||
send_interrupt( npSoldier ); //
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
StartInterrupt();
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1020,6 +1126,10 @@ void EndInterrupt( BOOLEAN fMarkInterruptOccurred )
|
||||
// both hidden interrupts as well - NOT good because
|
||||
// hidden interrupts should leave it locked if it was already...
|
||||
guiPendingOverrideEvent = LU_ENDUILOCK;
|
||||
|
||||
if (is_networked)
|
||||
guiPendingOverrideEvent = LA_ENDUIOUTURNLOCK;
|
||||
|
||||
HandleTacticalUI( );
|
||||
|
||||
if ( gusSelectedSoldier != NOBODY )
|
||||
@@ -1044,7 +1154,7 @@ void EndInterrupt( BOOLEAN fMarkInterruptOccurred )
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
else if(pSoldier->bTeam < 6)//hayden : is Ai or LAN ?
|
||||
{
|
||||
// this could be set to true for AI-vs-AI interrupts
|
||||
gfHiddenInterrupt = FALSE;
|
||||
@@ -1109,7 +1219,14 @@ void EndInterrupt( BOOLEAN fMarkInterruptOccurred )
|
||||
}
|
||||
|
||||
// Signal UI done enemy's turn
|
||||
guiPendingOverrideEvent = LU_BEGINUILOCK;
|
||||
if(is_client)
|
||||
{
|
||||
guiPendingOverrideEvent = LA_BEGINUIOURTURNLOCK;
|
||||
}
|
||||
else
|
||||
{
|
||||
guiPendingOverrideEvent = LU_BEGINUILOCK;
|
||||
}
|
||||
|
||||
ClearIntList();
|
||||
}
|
||||
@@ -1126,7 +1243,14 @@ void EndInterrupt( BOOLEAN fMarkInterruptOccurred )
|
||||
}
|
||||
|
||||
// Signal UI done enemy's turn
|
||||
guiPendingOverrideEvent = LU_BEGINUILOCK;
|
||||
if(is_client)
|
||||
{
|
||||
guiPendingOverrideEvent = LA_BEGINUIOURTURNLOCK;
|
||||
}
|
||||
else
|
||||
{
|
||||
guiPendingOverrideEvent = LU_BEGINUILOCK;
|
||||
}
|
||||
|
||||
// must clear int list before ending turn
|
||||
ClearIntList();
|
||||
@@ -1134,6 +1258,24 @@ void EndInterrupt( BOOLEAN fMarkInterruptOccurred )
|
||||
}
|
||||
}
|
||||
|
||||
else //its going to another Lan client..//hayden
|
||||
{
|
||||
|
||||
gTacticalStatus.ubCurrentTeam = pSoldier->bTeam;
|
||||
AddTopMessage( COMPUTER_TURN_MESSAGE, TeamTurnString[ gTacticalStatus.ubCurrentTeam ] );
|
||||
if(is_client)
|
||||
{
|
||||
guiPendingOverrideEvent = LA_BEGINUIOURTURNLOCK;
|
||||
}
|
||||
else
|
||||
{
|
||||
guiPendingOverrideEvent = LU_BEGINUILOCK;
|
||||
}
|
||||
|
||||
// must clear int list before ending turn
|
||||
ClearIntList();
|
||||
|
||||
}
|
||||
// Reset our interface!
|
||||
fInterfacePanelDirty = DIRTYLEVEL2;
|
||||
|
||||
@@ -1336,7 +1478,7 @@ BOOLEAN StandardInterruptConditionsMet( SOLDIERTYPE * pSoldier, UINT8 ubOpponent
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( !(pOpponent->flags.uiStatusFlags & SOLDIER_UNDERAICONTROL) && (pSoldier->bSide != pOpponent->bSide))
|
||||
if ( !(is_client || (pOpponent->flags.uiStatusFlags & SOLDIER_UNDERAICONTROL)) && (pSoldier->bSide != pOpponent->bSide))
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
@@ -1494,6 +1636,16 @@ INT8 CalcInterruptDuelPts( SOLDIERTYPE * pSoldier, UINT8 ubOpponentID, BOOLEAN f
|
||||
iPoints--;
|
||||
}
|
||||
|
||||
//hayden, multiplayer add advantage for a ready'd reapon
|
||||
if(is_networked)
|
||||
{
|
||||
if ( ( gAnimControl[ pSoldier->usAnimState ].uiFlags &( ANIM_FIREREADY | ANIM_FIRE ) ))
|
||||
{
|
||||
iPoints=(iPoints+WEAPON_READIED_BONUS);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// if soldier is still in shock from recent injuries, that penalizes him
|
||||
iPoints -= pSoldier->aiData.bShock;
|
||||
|
||||
@@ -1599,8 +1751,11 @@ INT8 CalcInterruptDuelPts( SOLDIERTYPE * pSoldier, UINT8 ubOpponentID, BOOLEAN f
|
||||
#ifdef DEBUG_INTERRUPTS
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("Calculating int pts for %d vs %d, number is %d", pSoldier->ubID, ubOpponentID, iPoints ) );
|
||||
#endif
|
||||
|
||||
|
||||
if(is_networked)
|
||||
{
|
||||
SOLDIERTYPE *pOpp = &Menptr[ubOpponentID];
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_CHAT, L"Interrupt: '%s' vs '%s' = %d points.",pSoldier->name,pOpp->name, iPoints );
|
||||
}
|
||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"CalcInterruptDuelPts done");
|
||||
return( (INT8)iPoints );
|
||||
}
|
||||
@@ -1858,7 +2013,63 @@ void DoneAddingToIntList( SOLDIERTYPE * pSoldier, BOOLEAN fChange, UINT8 ubInter
|
||||
}
|
||||
else
|
||||
{
|
||||
StartInterrupt();
|
||||
if (is_networked)
|
||||
{
|
||||
UINT8 nubFirstInterrupter;
|
||||
INT8 nbTeam;
|
||||
SOLDIERTYPE * npSoldier;
|
||||
|
||||
nubFirstInterrupter = LATEST_INTERRUPT_GUY;
|
||||
npSoldier = MercPtrs[nubFirstInterrupter];
|
||||
nbTeam = npSoldier->bTeam;
|
||||
|
||||
|
||||
if ((nbTeam > 0) && (nbTeam <6 ) && is_server) //is AI and are server
|
||||
{
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"interrupt for AI team");
|
||||
send_interrupt( npSoldier );
|
||||
StartInterrupt();
|
||||
|
||||
}
|
||||
else if(nbTeam == 0 && gTacticalStatus.ubCurrentTeam == 0) //its an interrupt for own merc team && its our turn
|
||||
{
|
||||
|
||||
//hayden
|
||||
StartInterrupt();
|
||||
send_interrupt( npSoldier ); //
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"interrupt for my team");
|
||||
}
|
||||
else if(gTacticalStatus.ubCurrentTeam == 0)//its our turn (we are moving)
|
||||
{
|
||||
//StartInterrupt();
|
||||
send_interrupt( npSoldier ); //
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"interrupt for another team");
|
||||
{
|
||||
// ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"Interrupted" );
|
||||
//stop moving merc who was interrupted and init UI bar
|
||||
SOLDIERTYPE* pMerc = MercPtrs[ gusSelectedSoldier ];
|
||||
//AdjustNoAPToFinishMove( pMerc, TRUE );
|
||||
pMerc->HaultSoldierFromSighting(TRUE);
|
||||
//pMerc->fTurningFromPronePosition = FALSE;// hmmm ??
|
||||
FreezeInterfaceForEnemyTurn();
|
||||
InitEnemyUIBar( 0, 0 );
|
||||
fInterfacePanelDirty = DIRTYLEVEL2;
|
||||
AddTopMessage( COMPUTER_TURN_MESSAGE, TeamTurnString[ nbTeam ] );
|
||||
gTacticalStatus.fInterruptOccurred = TRUE;
|
||||
|
||||
}
|
||||
//ClearIntList();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
ClearIntList();//no interrupt to be awarded, clear generated list.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
StartInterrupt();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "Soldier Control.h"
|
||||
|
||||
extern UINT8 gubOutOfTurnPersons;
|
||||
extern UINT8 gubOutOfTurnOrder[MAXMERCS] ;
|
||||
extern BOOLEAN gfHiddenInterrupt;
|
||||
extern BOOLEAN gfHiddenTurnbased;
|
||||
|
||||
@@ -17,6 +18,7 @@ extern BOOLEAN InterruptDuel( SOLDIERTYPE * pSoldier, SOLDIERTYPE * pOpponent);
|
||||
extern void AddToIntList( UINT8 ubID, BOOLEAN fGainControl, BOOLEAN fCommunicate );
|
||||
extern void DoneAddingToIntList( SOLDIERTYPE * pSoldier, BOOLEAN fChange, UINT8 ubInterruptType);
|
||||
|
||||
void FreezeInterfaceForEnemyTurn( void );
|
||||
void ClearIntList( void );
|
||||
|
||||
BOOLEAN SaveTeamTurnsToTheSaveGameFile( HWFILE hFile );
|
||||
@@ -24,6 +26,7 @@ BOOLEAN SaveTeamTurnsToTheSaveGameFile( HWFILE hFile );
|
||||
BOOLEAN LoadTeamTurnsFromTheSavedGameFile( HWFILE hFile );
|
||||
|
||||
void EndAllAITurns( void );
|
||||
void EndTurnEvents( void );
|
||||
|
||||
BOOLEAN NPCFirstDraw( SOLDIERTYPE * pSoldier, SOLDIERTYPE * pTargetSoldier );
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@
|
||||
#endif
|
||||
|
||||
#include "Quest Debug System.h"
|
||||
|
||||
#include "connect.h"
|
||||
//forward declarations of common classes to eliminate includes
|
||||
class OBJECTTYPE;
|
||||
class SOLDIERTYPE;
|
||||
@@ -188,7 +188,7 @@ BOOLEAN gfNextFireJam = FALSE;
|
||||
|
||||
extern INT16 ITEMDESC_START_X;
|
||||
extern INT16 ITEMDESC_START_Y;
|
||||
|
||||
#include "fresh_header.h"
|
||||
|
||||
//Little functions called by keyboard input
|
||||
void SwapGoggles(SOLDIERTYPE *pTeamSoldier);
|
||||
@@ -1530,7 +1530,7 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
|
||||
}
|
||||
|
||||
|
||||
/// Allow to save everywhere
|
||||
/// Allow to load everywhere
|
||||
if ((InputEvent.usEvent == KEY_DOWN )&& ( InputEvent.usParam == 'l') )
|
||||
{
|
||||
if( InputEvent.usKeyState & ALT_DOWN )
|
||||
@@ -1557,6 +1557,91 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
|
||||
}
|
||||
}
|
||||
}
|
||||
if (is_networked)
|
||||
{
|
||||
|
||||
if ((InputEvent.usEvent == KEY_DOWN )&& ( InputEvent.usParam == 's') )//allow saving 'always'//hayden
|
||||
{
|
||||
if( InputEvent.usKeyState & ALT_DOWN )
|
||||
{
|
||||
if( !fDisableMapInterfaceDueToBattle && !( gTacticalStatus.uiFlags & ENGAGED_IN_CONV ) )
|
||||
{
|
||||
//if the game CAN be saved
|
||||
if( CanGameBeSaved() )
|
||||
{
|
||||
guiPreviousOptionScreen = GAME_SCREEN;
|
||||
//guiPreviousOptionScreen = guiCurrentScreen;
|
||||
DoQuickSave();
|
||||
}
|
||||
else
|
||||
{
|
||||
//Display a message saying the player cant save now
|
||||
DoMessageBox( MSG_BOX_BASIC_STYLE, zNewTacticalMessages[ TCTL_MSG__IRON_MAN_CANT_SAVE_NOW ], GAME_SCREEN, ( UINT8 )MSG_BOX_FLAG_OK, NULL, NULL );
|
||||
}
|
||||
}
|
||||
}
|
||||
else if( InputEvent.usKeyState & CTRL_DOWN )
|
||||
{
|
||||
if( !fDisableMapInterfaceDueToBattle && !( gTacticalStatus.uiFlags & ENGAGED_IN_CONV ) )
|
||||
{
|
||||
//if the game CAN be saved
|
||||
if( CanGameBeSaved() )
|
||||
{
|
||||
gfSaveGame = TRUE;
|
||||
gfCameDirectlyFromGame = TRUE;
|
||||
|
||||
guiPreviousOptionScreen = GAME_SCREEN;
|
||||
LeaveTacticalScreen( SAVE_LOAD_SCREEN );
|
||||
}
|
||||
else
|
||||
{
|
||||
//Display a message saying the player cant save now
|
||||
DoMessageBox( MSG_BOX_BASIC_STYLE, zNewTacticalMessages[ TCTL_MSG__IRON_MAN_CANT_SAVE_NOW ], GAME_SCREEN, ( UINT8 )MSG_BOX_FLAG_OK, NULL, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ((InputEvent.usEvent == KEY_DOWN )&& ( InputEvent.usParam == '0') )
|
||||
{
|
||||
//if( InputEvent.usKeyState & ALT_DOWN )
|
||||
{
|
||||
if ( !( gTacticalStatus.uiFlags & ENGAGED_IN_CONV ) )
|
||||
{
|
||||
test_func2();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if ((InputEvent.usEvent == KEY_DOWN )&& ( InputEvent.usParam == 'e') )
|
||||
{
|
||||
if( InputEvent.usKeyState & ALT_DOWN )
|
||||
{
|
||||
if ( !( gTacticalStatus.uiFlags & ENGAGED_IN_CONV ) )
|
||||
{
|
||||
overide_turn();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ((InputEvent.usEvent == KEY_DOWN )&& ( InputEvent.usParam == 'k') )
|
||||
{
|
||||
if( InputEvent.usKeyState & ALT_DOWN )
|
||||
{
|
||||
if ( !( gTacticalStatus.uiFlags & ENGAGED_IN_CONV ) )
|
||||
{
|
||||
kick_player();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Break of out IN CONV...
|
||||
@@ -2186,7 +2271,12 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ChangeCurrentSquad( 4 );
|
||||
|
||||
if (is_networked)
|
||||
grid_display();//hayden
|
||||
}
|
||||
break;
|
||||
|
||||
case '6':
|
||||
@@ -2203,10 +2293,16 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
|
||||
|
||||
case '9':
|
||||
ChangeCurrentSquad( 8 );
|
||||
|
||||
if (is_networked)
|
||||
cheat_func();
|
||||
break;
|
||||
|
||||
case '0':
|
||||
ChangeCurrentSquad( 9 );
|
||||
|
||||
if (is_networked)
|
||||
//test_func2();
|
||||
break;
|
||||
|
||||
case 'x':
|
||||
@@ -3474,7 +3570,7 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
|
||||
if ( fAlt )
|
||||
RemoveCharacterFromSquads(MercPtrs[gusSelectedSoldier]);
|
||||
|
||||
else if( !fDisableMapInterfaceDueToBattle && !( gTacticalStatus.uiFlags & ENGAGED_IN_CONV ) )
|
||||
else if( !fDisableMapInterfaceDueToBattle && !( gTacticalStatus.uiFlags & ENGAGED_IN_CONV ) && !is_networked)
|
||||
{
|
||||
//if the game CAN be saved
|
||||
if( CanGameBeSaved() )
|
||||
@@ -3495,7 +3591,7 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
|
||||
else
|
||||
if( fAlt )
|
||||
{
|
||||
if( !fDisableMapInterfaceDueToBattle && !( gTacticalStatus.uiFlags & ENGAGED_IN_CONV ) )
|
||||
if( !fDisableMapInterfaceDueToBattle && !( gTacticalStatus.uiFlags & ENGAGED_IN_CONV )&& !is_networked )
|
||||
{
|
||||
//if the game CAN be saved
|
||||
if( CanGameBeSaved() )
|
||||
|
||||
+11
-6
@@ -51,7 +51,7 @@
|
||||
//forward declarations of common classes to eliminate includes
|
||||
class OBJECTTYPE;
|
||||
class SOLDIERTYPE;
|
||||
|
||||
#include "connect.h"
|
||||
|
||||
//rain
|
||||
//#define WEAPON_RELIABILITY_REDUCTION_PER_RAIN_INTENSITY 0
|
||||
@@ -1924,9 +1924,16 @@ BOOLEAN UseGun( SOLDIERTYPE *pSoldier , INT16 sTargetGridNo )
|
||||
return( FALSE );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
FireBulletGivenTarget( pSoldier, dTargetX, dTargetY, dTargetZ, pSoldier->usAttackingWeapon, (UINT16) (uiHitChance - uiDiceRoll), fBuckshot, FALSE );
|
||||
//hayden
|
||||
if((is_server && pSoldier->ubID<120) || (!is_server && is_client && pSoldier->ubID<20) || (!is_server && !is_client) )
|
||||
{
|
||||
FireBulletGivenTarget( pSoldier, dTargetX, dTargetY, dTargetZ, pSoldier->usAttackingWeapon, (UINT16) (uiHitChance - uiDiceRoll), fBuckshot, FALSE );
|
||||
}
|
||||
else
|
||||
{
|
||||
FireBulletGivenTarget( pSoldier, dTargetX, dTargetY, dTargetZ, pSoldier->usAttackingWeapon, (UINT16) (uiHitChance - uiDiceRoll), fBuckshot, TRUE );
|
||||
}
|
||||
//bottom one is fake (ie not in my control)
|
||||
|
||||
ubVolume = Weapon[ pSoldier->usAttackingWeapon ].ubAttackVolume;
|
||||
|
||||
@@ -5962,5 +5969,3 @@ INT8 GetAPsToReload( OBJECTTYPE *pObj )
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user