Skip to content

Commit

Permalink
Merge pull request #36 from bog-dan-ro/upstream
Browse files Browse the repository at this point in the history
More work to upstream
  • Loading branch information
pvandommelen authored Nov 15, 2017
2 parents 70e3c40 + 501abdd commit 11b2f71
Show file tree
Hide file tree
Showing 28 changed files with 1,246 additions and 739 deletions.
15 changes: 14 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
cmake_minimum_required(VERSION 3.1)
CMAKE_MINIMUM_REQUIRED(VERSION 3.1)

PROJECT(Allegiance)

OPTION(USE_STEAM "Use steam" OFF)

MACRO(SET_MODULE MODULE_NAME)
ADD_DEFINITIONS(-D__MODULE__="${MODULE_NAME}")
INCLUDE_DIRECTORIES(../Inc)
IF (USE_STEAM)
INCLUDE_DIRECTORIES(../Lib/steam)
ELSE()
ADD_DEFINITIONS(-DNO_STEAM)
ENDIF()
ENDMACRO()


ADD_SUBDIRECTORY(src)
2 changes: 1 addition & 1 deletion VS2017/ZLibrary.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
<ClCompile Include="..\src\zlib\tlist.cpp" />
<ClCompile Include="..\src\zlib\token.cpp" />
<ClCompile Include="..\src\zlib\vector.cpp" />
<ClCompile Include="..\src\zlib\VersionInfo.cpp" />
<ClCompile Include="..\src\zlib\VersionInfo_msvc.cpp" />
<ClCompile Include="..\src\zlib\Win32app.cpp" />
<ClCompile Include="..\src\zlib\window.cpp" />
<ClCompile Include="..\src\zlib\zmath.cpp" />
Expand Down
2 changes: 1 addition & 1 deletion src/AGC/AGCVersionInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class CAGCVersionInfo :
CAGCVersionInfo()
{
// Initialize with the AGC module
m_vi.Load(_Module.GetModuleInstance());
m_vi.Load(uintptr_t(_Module.GetModuleInstance()));
}
};

Expand Down
5 changes: 3 additions & 2 deletions src/Igc/igc.h
Original file line number Diff line number Diff line change
Expand Up @@ -986,7 +986,7 @@ const float c_fMissionBriefingCountdown = 15.0f; // seconds
const int c_cUnlimitedLives = 0x7fff;

//Forward definitions of interfaces
struct MissionParams;
class MissionParams;
class ThingSite;
class ClusterSite;

Expand Down Expand Up @@ -1079,8 +1079,9 @@ class ImapMakerIGC
};


struct MissionParams
class MissionParams
{
public:
//------------------------------------------------------------------------------
// If you add or remove properties, please update
// AGCGameParameters.cpp, AGCGameParameters.h, and AGCIDL.h.
Expand Down
5 changes: 4 additions & 1 deletion src/Igc/missionigc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@
#include "bucketigc.h"
#include "mapmakerigc.h"
#include "zlib.h"
#include "AllegianceSecurity.h"

#ifdef STEAMSECURE
# include "AllegianceSecurity.h"
#endif


static void DoDecrypt(int size, char* pdata)
Expand Down
14 changes: 10 additions & 4 deletions src/Inc/Messages.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
#ifndef _MESSAGES_
#define _MESSAGES_

#include "MessageCore.h"
#include <igc.h>

#include "messagecore.h"

// KGJV - MSGVER has its own include file now
#include "MessageVersion.h"
Expand Down Expand Up @@ -40,10 +42,12 @@ DEFINE_FEDMSG(C, LOGONREQ, 1) // First message the client sends to the server.
Time time;
DWORD dwCookie;
int crcFileList;
int8 steamAuthTicket[1024]; // BT - STEAM
uint32 steamAuthTicketLength; // BT - STEAM
uint64 steamID; // BT - STEAM
#ifndef NO_STEAM
int8_t steamAuthTicket[1024]; // BT - STEAM
uint32_t steamAuthTicketLength; // BT - STEAM
uint64_t steamID; // BT - STEAM
char drmHash[50]; // BT - STEAM
#endif
END_FEDMSG

DEFINE_FEDMSG(S, LOGONACK, 2) // sent when the server recives FM_C_LOGONREQ
Expand Down Expand Up @@ -131,13 +135,15 @@ DEFINE_FEDMSG(CS, PROJECTILE_INSTANCE, 12)
END_FEDMSG

// keep in sync copy in ClubMessages.h
#ifndef _MESSAGES_ALLCLUB_H_
struct RankInfo
{
int requiredRanking;
CivID civ;
RankID rank;
char RankName[c_cbName];
};
#endif

DEFINE_FEDMSG(S, RANK_INFO, 13)
FM_VAR_ITEM(ranks); // an array of RankInfo sorted by civ, then rank
Expand Down
4 changes: 3 additions & 1 deletion src/Inc/allegdb.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
#include <oledb.h>
#include <sqloledb.h>
#include <atldbcli.h>
#include <..\test\TCLib\TCThread.h>
#include <../test/TCLib/TCThread.h>
#include <mutex>

#include "Utility.h"

class CSQLCore;
class CSQLQuery;
class CSQLThread;
Expand Down
7 changes: 4 additions & 3 deletions src/Inc/messagecore.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <map>
#include <tlist.h>
#include <ztime.h>
#include <windowsx.h>

#define OBLIVION_CLIENT_REG_KEY "Allegiance"

Expand Down Expand Up @@ -85,8 +86,8 @@ friend class CFMGroup;
virtual int GetCountConnections() = 0;

// BT - STEAM
void SetSteamID(uint64 steamID) { m_steamID = steamID; }
uint64 GetSteamID() { return m_steamID; }
void SetSteamID(uint64_t steamID) { m_steamID = steamID; }
uint64_t GetSteamID() { return m_steamID; }

protected:
CFMRecipient(const char * szName, DPID dpid) :
Expand All @@ -103,7 +104,7 @@ friend class CFMGroup;

private:
char * m_szName;
uint64 m_steamID; // BT - STEAM
uint64_t m_steamID; // BT - STEAM

protected: // groups set their own dpid since they're not pre-created.
void SetDPID(DPID dpid) {m_dpid = dpid;}
Expand Down
2 changes: 1 addition & 1 deletion src/Lib/steam/isteamclient.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ typedef int32 HSteamPipe;
// handle to single instance of a steam user
typedef int32 HSteamUser;
// function prototype
#if defined( POSIX )
#if defined( POSIX ) && !defined(__cdecl)
#define __cdecl
#endif
extern "C" typedef void (__cdecl *SteamAPIWarningMessageHook_t)(int, const char *);
Expand Down
2 changes: 1 addition & 1 deletion src/Lib/steam/isteamutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ enum EGamepadTextInputLineMode


// function prototype for warning message hook
#if defined( POSIX )
#if defined( POSIX ) && !defined (__cdecl)
#define __cdecl
#endif
extern "C" typedef void (__cdecl *SteamAPIWarningMessageHook_t)(int, const char *);
Expand Down
2 changes: 1 addition & 1 deletion src/engine/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ADD_DEFINITIONS(-D__MODULE__="Engine")
ADD_DEFINITIONS(-D__MODULE__="Engine" -D_ALLEGIANCE_PROD_)

IF(WIN32)
ADD_DEFINITIONS(-DDIRECT3D_VERSION=0x0900 -DEnablePerformanceCounters)
Expand Down
11 changes: 8 additions & 3 deletions src/engine/modeler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
#include <base.h>
#include <quaternion.h>
#include <tmap.h>
#include "steam_api.h"
#include <AllegianceSecurity.h>

#include "controls.h"
#include "D3DDevice9.h"
Expand All @@ -20,6 +18,11 @@
#include "valuetransform.h"
#include "DX9PackFile.h"

#ifdef STEAMSECURE
# include "steam_api.h"
# include <AllegianceSecurity.h>
#endif

//////////////////////////////////////////////////////////////////////////////
//
// Function defined in xfile.cpp
Expand Down Expand Up @@ -2205,8 +2208,10 @@ class ModelerImpl : public Modeler {
PathString m_pathStr;
ImportImageFactory * m_pImageFactory; // This allows us to pass extra parameters into the image factory.

// BT - STEAM
#ifdef STEAMSECURE
// BT - STEAM
FileHashTable m_fileHashTable;
#endif

TMap<ZString, TRef<INameSpace> > m_mapNameSpace;

Expand Down
2 changes: 2 additions & 0 deletions src/lobby/lobqueries.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ BEGIN_QUERY(CQLobbyLogon, true,
char fCanCheat; // out

// BT - STEAM
#ifndef NO_STEAM
int8 steamAuthTicket[1024];
int32 steamAuthTicketLength;
uint64 steamID;
#endif

//squad stuff
char szSquadName[31]; // constant??? Please???
Expand Down
2 changes: 2 additions & 0 deletions src/lobby/messageslc.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,11 @@ DEFINE_FEDMSG(C, LOGON_LOBBY, 265) // if the lobby is in club mode, everyone has
int crcFileList;
DWORD dwTime;
char szName[c_cbName];
#ifndef NO_STEAM
int8_t steamAuthTicket[1024]; // BT - STEAM
uint32_t steamAuthTicketLength; // BT - STEAM
uint64_t steamID; // BT - STEAM
#endif
END_FEDMSG

// KGJV #114
Expand Down
2 changes: 1 addition & 1 deletion src/soundengine/redbooksound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
//
// SoundEngine support for redbook audio.
//
#include "redbooksound.h"

#include <algorithm>
#include <list>
#include <mutex>

#include "soundbase.h"
#include "redbooksound.h"
#include "ds3dutil.h"

using std::list;
Expand Down
5 changes: 4 additions & 1 deletion src/soundengine/redbooksound.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
#pragma once
//
// redbooksound.h
//
// SoundEngine support for redbook audio
//

#include "soundbase.h"

namespace SoundEngine {

//
Expand Down Expand Up @@ -44,4 +47,4 @@ HRESULT CreateDummyDiskPlayer(TRef<IDiskPlayer>& pdiskplayer);
// creates a sound template representing a redbook audio track
HRESULT CreateRedbookSoundTemplate(TRef<ISoundTemplate>& pstDest, TRef<IDiskPlayer> diskPlayer, int nTrack);

};
};
2 changes: 2 additions & 0 deletions src/test/TCLib/TCThread.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#ifndef __TCThread_h__
#define __TCThread_h__

#include <zassert.h>
#include "AutoHandle.h"


/////////////////////////////////////////////////////////////////////////////
// TCThread.h | Declaration of the TCThread class
//
Expand Down
14 changes: 10 additions & 4 deletions src/zlib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
ADD_DEFINITIONS(-D__MODULE__="zlib")
SET_MODULE("zlib")

INCLUDE_DIRECTORIES(../Inc ../Lib/steam)
INCLUDE_DIRECTORIES(../Inc)

SET(Zlib_SRC
StackTracer.cpp
VersionInfo.cpp
Win32app.cpp
color.cpp
event.cpp
Expand All @@ -17,10 +16,17 @@ SET(Zlib_SRC
token.cpp
vector.cpp
window.cpp
zmath.cpp
zstring.cpp
ztime.cpp
)

IF (MSVC)
SET(Zlib_SRC ${Zlib_SRC} VersionInfo_msvc.cpp)
ELSE()
SET(Zlib_SRC ${Zlib_SRC} VersionInfo_dummy.cpp)
ENDIF()

IF(UNIX)
SET(PLATFORM_SRC
base_unix.cpp
Expand All @@ -32,7 +38,7 @@ ELSEIF(WIN32)
FTPSession_win.cpp
)
ELSE()
MESSAGE(FATAL_ERROR "Unhandled platfor")
MESSAGE(FATAL_ERROR "Unhandled platform")
ENDIF()

ADD_LIBRARY(Zlib ${Zlib_SRC} ${PLATFORM_SRC})
Expand Down
Loading

0 comments on commit 11b2f71

Please sign in to comment.