Skip to content

Commit

Permalink
Merge pull request #30 from FreeAllegiance/master
Browse files Browse the repository at this point in the history
Update Branch
  • Loading branch information
Xynth22 authored Nov 8, 2017
2 parents ab59b84 + 389804e commit 11868f4
Show file tree
Hide file tree
Showing 44 changed files with 1,924 additions and 1,600 deletions.
240 changes: 240 additions & 0 deletions VS2017/Allegiance.sln

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion VS2017/Server.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
<OutDir Condition="'$(Configuration)|$(Platform)'=='FZDebug|Win32'">..\objs$(PlatformToolset)\$(Configuration)\FedSrv\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='FZDebug|Win32'">..\objs$(PlatformToolset)\$(Configuration)\FedSrv\</IntDir>
<TargetName Condition="'$(Configuration)|$(Platform)'=='FZDebug|Win32'">AllSrv</TargetName>
<TargetExt Condition="'$(Configuration)|$(Platform)'=='FZDebug|Win32'">.exe</TargetExt>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='FZDebug|Win32'">false</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='FZRetail|Win32'">..\objs$(PlatformToolset)\$(Configuration)\FedSrv\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='FZRetail|Win32'">..\objs$(PlatformToolset)\$(Configuration)\FedSrv\</IntDir>
Expand Down
4 changes: 2 additions & 2 deletions VS2017/ZLibrary.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,10 @@
</Lib>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\src\zlib\base.cpp" />
<ClCompile Include="..\src\zlib\base_win.cpp" />
<ClCompile Include="..\src\zlib\color.cpp" />
<ClCompile Include="..\src\zlib\event.cpp" />
<ClCompile Include="..\src\zlib\FTPSession.cpp" />
<ClCompile Include="..\src\zlib\FTPSession_win.cpp" />
<ClCompile Include="..\src\zlib\input.cpp" />
<ClCompile Include="..\src\zlib\matrix.cpp" />
<ClCompile Include="..\src\zlib\matrix2.cpp" />
Expand Down
6 changes: 5 additions & 1 deletion src/AllSrvUI/AllSrvUISheet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ CAllSrvUISheet::CAllSrvUISheet(CWnd* pParentWnd, UINT iSelectPage) :
CPropertySheet(AFX_IDS_APP_TITLE, pParentWnd, iSelectPage),
m_dwConnectionCookie(0),
m_bInitDone(false),
m_bMultiMode(false)
m_bMultiMode(false),
m_PageConnect(this),
m_PagePlayers(this),
m_PageChat(this),
m_PageGameCreate(this)
{
// Add a single page
AddPage(&m_PageConnect);
Expand Down
17 changes: 9 additions & 8 deletions src/AllSrvUI/DlgGameSelect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ END_MESSAGE_MAP()
// Construction

CDlgGameSelect::CDlgGameSelect(CAllSrvUISheet* pSheet)
: CDialog(CDlgGameSelect::IDD, pSheet)
: CDialog(CDlgGameSelect::IDD, pSheet),
m_mpSheet(pSheet)
{
//{{AFX_DATA_INIT(CDlgGameSelect)
//}}AFX_DATA_INIT
Expand Down Expand Up @@ -69,10 +70,10 @@ void CDlgGameSelect::PopulateGamesList()

// Get the collection of games on the server
IAdminGamesPtr spGames;
HRESULT hr = GetSheet()->GetServer()->get_Games(&spGames);
HRESULT hr = m_mpSheet->GetServer()->get_Games(&spGames);
if (FAILED(hr))
{
GetSheet()->HandleError(hr, pszContext, false);
m_mpSheet->HandleError(hr, pszContext, false);
EndDialog(IDCANCEL);
return;
}
Expand All @@ -81,14 +82,14 @@ void CDlgGameSelect::PopulateGamesList()
IUnknownPtr spEnumUnk;
if (FAILED(hr = spGames->get__NewEnum(&spEnumUnk)))
{
GetSheet()->HandleError(hr, pszContext, false);
m_mpSheet->HandleError(hr, pszContext, false);
EndDialog(IDCANCEL);
return;
}
IEnumVARIANTPtr spEnum(spEnumUnk);
if (NULL == spEnum)
{
GetSheet()->HandleError(E_NOINTERFACE, pszContext, false);
m_mpSheet->HandleError(E_NOINTERFACE, pszContext, false);
EndDialog(IDCANCEL);
return;
}
Expand All @@ -102,7 +103,7 @@ void CDlgGameSelect::PopulateGamesList()
ULONG cFetched;
if (FAILED(hr = spEnum->Next(sizeofArray(games), games, &cFetched)))
{
GetSheet()->HandleError(hr, pszContext, false);
m_mpSheet->HandleError(hr, pszContext, false);
EndDialog(IDCANCEL);
return;
}
Expand All @@ -114,7 +115,7 @@ void CDlgGameSelect::PopulateGamesList()
VARTYPE vt = V_VT(&games[i]);
if (VT_DISPATCH != vt && VT_UNKNOWN != vt)
{
GetSheet()->HandleError(DISP_E_TYPEMISMATCH, pszContext, false);
m_mpSheet->HandleError(DISP_E_TYPEMISMATCH, pszContext, false);
EndDialog(IDCANCEL);
return;
}
Expand All @@ -123,7 +124,7 @@ void CDlgGameSelect::PopulateGamesList()
IAdminGamePtr spGame(V_DISPATCH(&games[i]));
if (NULL == spGame)
{
GetSheet()->HandleError(E_NOINTERFACE, pszContext, false);
m_mpSheet->HandleError(E_NOINTERFACE, pszContext, false);
EndDialog(IDCANCEL);
return;
}
Expand Down
7 changes: 5 additions & 2 deletions src/AllSrvUI/DlgGameSelect.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ class CAllSrvUISheet;

class CDlgGameSelect : public CDialog
{
private:
CAllSrvUISheet *m_mpSheet;

// Declarations
public:
DECLARE_MESSAGE_MAP()
Expand All @@ -43,10 +46,10 @@ class CDlgGameSelect : public CDialog

// Implementation
protected:
CAllSrvUISheet* GetSheet()
/*CAllSrvUISheet* GetSheet()
{
return reinterpret_cast<CAllSrvUISheet*>(GetParent());
}
}*/
void PopulateGamesList();

// Message Handlers
Expand Down
31 changes: 16 additions & 15 deletions src/AllSrvUI/PageChat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,16 @@ END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// Construction

CPageChat::CPageChat() :
CPageChat::CPageChat(CAllSrvUISheet *pSheet) :
CPropertyPage(CPageChat::IDD),
m_Prefs(this),
m_bAdminPageActivated(false),
m_bChatActivated(false),
m_pthAdminPageMsg(NULL),
m_pthAdminPageRun(NULL),
m_pWndAdminPageMsgThread(NULL),
m_pWndAdminPageRunThread(NULL)
m_pWndAdminPageRunThread(NULL),
m_mpSheet(pSheet)
{
//{{AFX_DATA_INIT(CPageChat)
m_strSendChat = _T("");
Expand All @@ -76,7 +77,7 @@ CPageChat::CPageChat() :
// Create a TCObj.Strings object
HRESULT hr = m_spStrings.CreateInstance("TCObj.Strings");
if (FAILED(hr))
GetSheet()->HandleError(hr, "creating TCObj.Strings helper object", true);
m_mpSheet->HandleError(hr, "creating TCObj.Strings helper object", true);
}


Expand Down Expand Up @@ -116,10 +117,10 @@ void CPageChat::OnEvent(IAGCEvent* pEvent)
varGameID.ChangeType(VT_I4);

// Get the current GameID
if (!GetSheet()->GetGame())
if (!m_mpSheet->GetGame())
return;
AGCGameID idGame = 0;
if (FAILED(GetSheet()->GetGame()->get_GameID(&idGame)))
if (FAILED(m_mpSheet->GetGame()->get_GameID(&idGame)))
return;

// Ignore chats not for this game
Expand Down Expand Up @@ -446,9 +447,9 @@ void CPageChat::UpdateActivateAdminPage()
{
// Activate/deactivate the event notification
if (bAdminPageMonitored)
GetSheet()->GetSession()->ActivateEvents(EventID_AdminPage, -1);
m_mpSheet->GetSession()->ActivateEvents(EventID_AdminPage, -1);
else
GetSheet()->GetSession()->DeactivateEvents(EventID_AdminPage, -1);
m_mpSheet->GetSession()->DeactivateEvents(EventID_AdminPage, -1);
m_bAdminPageActivated = bAdminPageMonitored;
}
}
Expand All @@ -460,9 +461,9 @@ void CPageChat::UpdateActivateChatMessage()
{
// Activate/deactivate the event notification
if (bChatMonitored)
GetSheet()->GetSession()->ActivateEvents(EventID_ChatMessage, -1);
m_mpSheet->GetSession()->ActivateEvents(EventID_ChatMessage, -1);
else
GetSheet()->GetSession()->DeactivateEvents(EventID_ChatMessage, -1);
m_mpSheet->GetSession()->DeactivateEvents(EventID_ChatMessage, -1);
m_bChatActivated = bChatMonitored;
}
}
Expand All @@ -474,7 +475,7 @@ void CPageChat::UpdateUI(bool bUpdateData)
UpdateData();

// Determine if a game is in progress or not
bool bGameInProgress = NULL != GetSheet()->GetGame();
bool bGameInProgress = NULL != m_mpSheet->GetGame();

// Enable/disable the controls as needed
m_staticSendChat.EnableWindow(bGameInProgress);
Expand Down Expand Up @@ -513,10 +514,10 @@ void CPageChat::SendChat()

// Send the chat to current game or all games, as specified
CComBSTR bstrText(m_strSendChat);
if (m_bSendChatAllGames && GetSheet()->IsServerInMultiMode())
GetSheet()->GetServer()->SendMsg(bstrText);
if (m_bSendChatAllGames && m_mpSheet->IsServerInMultiMode())
m_mpSheet->GetServer()->SendMsg(bstrText);
else
GetSheet()->GetGame()->SendChat(bstrText, -1);
m_mpSheet->GetGame()->SendChat(bstrText, -1);

// Clear the string
m_strSendChat.Empty();
Expand Down Expand Up @@ -620,7 +621,7 @@ void CPageChat::AdminPageRunThreadProc()
BOOL CPageChat::OnInitDialog()
{
// Register for events of interest
GetSheet()->GetSession()->ActivateEvents(EventID_GameDestroyed, -1);
m_mpSheet->GetSession()->ActivateEvents(EventID_GameDestroyed, -1);

// Perform default processing
CPropertyPage::OnInitDialog();
Expand All @@ -629,7 +630,7 @@ BOOL CPageChat::OnInitDialog()
m_AutoSizer.SetWindowAndRules(*this, _AutoSizerMap);

// Show/hide buttons depending on server mode
bool bMultiMode = GetSheet()->IsServerInMultiMode();
bool bMultiMode = m_mpSheet->IsServerInMultiMode();
m_btnSendChatAllGames.ShowWindow(bMultiMode ? SW_SHOW : SW_HIDE);
m_btnSendChatAllGames.EnableWindow(bMultiMode);

Expand Down
11 changes: 8 additions & 3 deletions src/AllSrvUI/PageChat.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,17 @@ class CAdminPageThreadWnd;

class CPageChat : public CPropertyPage
{
private:
CAllSrvUISheet *m_mpSheet;

// Declarations
public:
DECLARE_DYNAMIC(CPageChat)
DECLARE_MESSAGE_MAP()

// Construction
public:
CPageChat();
CPageChat(CAllSrvUISheet *pSheet);

// Attributes
public:
Expand All @@ -45,17 +48,19 @@ class CPageChat : public CPropertyPage
public:
virtual BOOL OnSetActive();
virtual BOOL PreTranslateMessage(MSG* pMsg);


protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
//}}AFX_VIRTUAL

// Implementation
protected:
CAllSrvUISheet* GetSheet()
/* CAllSrvUISheet* GetSheet()
{
return reinterpret_cast<CAllSrvUISheet*>(GetParent());
}
}*/
void LoadFromRegistry();
void SaveToRegistry();
void SaveChatListColumnOrderToRegistry();
Expand Down
21 changes: 16 additions & 5 deletions src/AllSrvUI/PageConnect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#endif

//mdvalley: defines good
//#define _WIN32_DCOM //Imago removed
#define _WIN32_DCOM //Imago removed


/////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -55,8 +55,9 @@ END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// Construction

CPageConnect::CPageConnect() :
CPropertyPage(CPageConnect::IDD)
CPageConnect::CPageConnect(CAllSrvUISheet *pSheet) :
CPropertyPage(CPageConnect::IDD),
m_mpSheet(pSheet)
{
//{{AFX_DATA_INIT(CPageConnect)
//}}AFX_DATA_INIT
Expand Down Expand Up @@ -118,6 +119,16 @@ void CPageConnect::CreateSessionThreadProc()
{
// Create the AdminSession class object
IAdminSessionClassPtr spClass;

LPOLESTR lpolestr;
StringFromCLSID(__uuidof(AdminSession), &lpolestr);
debugf("one: %s\n", lpolestr);

StringFromCLSID(__uuidof(spClass), &lpolestr);
debugf("two: %s\n", lpolestr);

CoTaskMemFree(lpolestr);

HRESULT hr = CoGetClassObject(__uuidof(AdminSession), CLSCTX_LOCAL_SERVER,
NULL, __uuidof(spClass), (void**)&spClass);
if (FAILED(hr))
Expand Down Expand Up @@ -203,15 +214,15 @@ void CPageConnect::OnTimer(UINT_PTR nIDEvent)
LRESULT CPageConnect::OnSessionSucceeded(WPARAM wParam, LPARAM lParam)
{
KillTimer(1);
GetSheet()->PostConnect((DWORD)wParam);
m_mpSheet->PostConnect((DWORD)wParam);
SetEvent((HANDLE)lParam);
return 0;
}

LRESULT CPageConnect::OnSessionFailed(WPARAM wParam, LPARAM)
{
KillTimer(1);
GetSheet()->HandleError(HRESULT(wParam), "connecting to Game Server", true);
m_mpSheet->HandleError(HRESULT(wParam), "connecting to Game Server", true);
return 0;
}

Expand Down
9 changes: 6 additions & 3 deletions src/AllSrvUI/PageConnect.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,17 @@ class CAllSrvUISheet;

class CPageConnect : public CPropertyPage
{
private:
CAllSrvUISheet *m_mpSheet;

// Declarations
public:
DECLARE_DYNAMIC(CPageConnect)
DECLARE_MESSAGE_MAP()

// Construction
public:
CPageConnect();
CPageConnect(CAllSrvUISheet *pSheet);

// Attributes
public:
Expand All @@ -48,10 +51,10 @@ class CPageConnect : public CPropertyPage

// Implementation
protected:
CAllSrvUISheet* GetSheet()
/*CAllSrvUISheet* GetSheet()
{
return reinterpret_cast<CAllSrvUISheet*>(GetParent());
}
}*/
static UINT CreateSessionThreadThunk(void* pvParam);
void CreateSessionThreadProc();

Expand Down
4 changes: 2 additions & 2 deletions src/AllSrvUI/PageDummy.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ class CPageDummy : public CPropertyPage

// Implementation
protected:
CAllSrvUISheet* GetSheet()
/*CAllSrvUISheet* GetSheet()
{
return reinterpret_cast<CAllSrvUISheet*>(GetParent());
}
}*/

// Message Handlers
protected:
Expand Down
Loading

0 comments on commit 11868f4

Please sign in to comment.