123
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
[MSClient]
|
||||
ConnectURL=http://gsconnect.ubisoft.com/gsinit.php?user=%s&dp=%s
|
||||
Username=user10
|
||||
Password=testtest
|
||||
Version=RSPC1.0
|
||||
Gamename=RAVENSHIELD
|
||||
GamePassword=
|
||||
ServerIP=srv-gstest
|
||||
ServerPort=41000
|
||||
1094
Ubisoft.com/GSServices/tools-gui/gs-masterserverclient/Registry.cpp
Normal file
1094
Ubisoft.com/GSServices/tools-gui/gs-masterserverclient/Registry.cpp
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,66 @@
|
||||
// Registry.h: interface for the CRegistry class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_REGISTRY_H__E7B8045A_B6E3_11D2_AF1A_00105A9F8688__INCLUDED_)
|
||||
#define AFX_REGISTRY_H__E7B8045A_B6E3_11D2_AF1A_00105A9F8688__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#ifndef UBI_CREGISTRY_NAMEBUFFERSIZE
|
||||
#define UBI_CREGISTRY_NAMEBUFFERSIZE _MAX_PATH+1
|
||||
#endif // UBI_CREGISTRY_NAMEBUFFERSIZE
|
||||
|
||||
#include "StdAfx.h"
|
||||
#include "GSTypes.h"
|
||||
|
||||
|
||||
/*#ifdef WITHIN_THE_GLOBJECTLIB_PROJECT
|
||||
class __declspec(dllexport) CRegistry
|
||||
#else // WITHIN_THE_GLOBJECTLIB_PROJECT
|
||||
class __declspec(dllimport) CRegistry : public CObject
|
||||
#endif // WITHIN_THE_GLOBJECTLIB_PROJECT
|
||||
*/
|
||||
class CRegistry : public CObject
|
||||
{
|
||||
public:
|
||||
CRegistry();
|
||||
CRegistry(HKEY hKey, LPCTSTR lpszPath, GSbool bShouldCreateKeyIfNotExist = GS_TRUE, REGSAM samSecurity = KEY_ALL_ACCESS);
|
||||
virtual ~CRegistry();
|
||||
|
||||
GSbool CreateKey(DWORD dwOptions = REG_OPTION_NON_VOLATILE);
|
||||
GSbool DeleteKey();
|
||||
GSbool OpenKey();
|
||||
GSbool CloseKey();
|
||||
GSbool DoesKeyExist();
|
||||
|
||||
HKEY SetRootKey(HKEY hRootKey = HKEY_LOCAL_MACHINE);
|
||||
CString SetPath(LPCTSTR lpszPath = "");
|
||||
REGSAM SetSecurity(REGSAM samSecurity = KEY_ALL_ACCESS);
|
||||
GSvoid SetShouldCreateKeyIfNotExist(GSbool bShouldCreateKeyIfNotExist = GS_TRUE);
|
||||
|
||||
GSbool ReadBinary(LPCTSTR lpszValueName, LPVOID lpBuffer, GSuint uiBufferSize);
|
||||
GSbool ReadDWord (LPCTSTR lpszValueName, LPDWORD lpBuffer);
|
||||
GSbool ReadString(LPCTSTR lpszValueName, CString* pcsBuffer);
|
||||
GSbool EnumKeys(CStringList* pcslKeys);
|
||||
|
||||
GSbool WriteBinary(LPCTSTR lpszValueName, LPVOID lpBuffer, GSuint uiBufferSize);
|
||||
GSbool WriteDWord (LPCTSTR lpszValueName, DWORD dwBuffer);
|
||||
GSbool WriteString(LPCTSTR lpszValueName, LPCTSTR lpszBuffer);
|
||||
|
||||
GSbool DeleteValue(LPCTSTR lpszValueName);
|
||||
GSbool DeleteKeyValues();
|
||||
|
||||
protected:
|
||||
CString m_csPath; // Subpath within the root key
|
||||
HKEY m_hRootKey; // Root registry key
|
||||
HKEY m_hKey; // Handle to current key
|
||||
REGSAM m_samSecurity; // Security descriptor (access-rights specifier)
|
||||
|
||||
GSbool m_bShouldCreateKeyIfNotExist; // Flag indicating if key should be created if don't exist when it is to be opened
|
||||
GSbool m_bKeyOpen; // Flag indicating wether or not the current key is open
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_REGISTRY_H__E7B8045A_B6E3_11D2_AF1A_00105A9F8688__INCLUDED_)
|
||||
@@ -0,0 +1,8 @@
|
||||
// stdafx.cpp : source file that includes just the standard includes
|
||||
// gsMasterServerClient.pch will be the pre-compiled header
|
||||
// stdafx.obj will contain the pre-compiled type information
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
// stdafx.h : include file for standard system include files,
|
||||
// or project specific include files that are used frequently, but
|
||||
// are changed infrequently
|
||||
//
|
||||
|
||||
#if !defined(AFX_STDAFX_H__57EDECC9_FB36_43F9_AC7F_5A2CDFC974D6__INCLUDED_)
|
||||
#define AFX_STDAFX_H__57EDECC9_FB36_43F9_AC7F_5A2CDFC974D6__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
|
||||
|
||||
#include <afxwin.h> // MFC core and standard components
|
||||
#include <afxext.h> // MFC extensions
|
||||
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
|
||||
#ifndef _AFX_NO_AFXCMN_SUPPORT
|
||||
#include <afxcmn.h> // MFC support for Windows Common Controls
|
||||
#endif // _AFX_NO_AFXCMN_SUPPORT
|
||||
|
||||
#include <afxsock.h> // MFC socket extensions
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_STDAFX_H__57EDECC9_FB36_43F9_AC7F_5A2CDFC974D6__INCLUDED_)
|
||||
@@ -0,0 +1,125 @@
|
||||
// SubmitScoresdlg.cpp : implementation file
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "gsMasterServerClient.h"
|
||||
#include "SubmitScoresdlg.h"
|
||||
#include "GSTypes.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CSubmitScoresdlg dialog
|
||||
|
||||
|
||||
CSubmitScoresdlg::CSubmitScoresdlg(CWnd* pParent /*=NULL*/)
|
||||
: CDialog(CSubmitScoresdlg::IDD, pParent)
|
||||
{
|
||||
//{{AFX_DATA_INIT(CSubmitScoresdlg)
|
||||
// NOTE: the ClassWizard will add member initialization here
|
||||
//}}AFX_DATA_INIT
|
||||
m_uiMatchID = 0;
|
||||
m_iLobbyID = 0;
|
||||
m_iRoomID = 0;
|
||||
m_pParentDlg = (CGsMasterServerClientDlg*)pParent;
|
||||
|
||||
}
|
||||
|
||||
|
||||
void CSubmitScoresdlg::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CSubmitScoresdlg)
|
||||
DDX_Control(pDX, IDC_EDITUsername, m_editUsername);
|
||||
DDX_Control(pDX, IDC_EDITLobbyID, m_editLobbyID);
|
||||
DDX_Control(pDX, IDC_EDITRoomID, m_editRoomID);
|
||||
DDX_Control(pDX, IDC_EDITMatchID, m_editMatchID);
|
||||
DDX_Control(pDX, IDC_EDITFieldValue, m_editFieldValue);
|
||||
DDX_Control(pDX, IDC_EDITFieldID, m_editFieldID);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CSubmitScoresdlg, CDialog)
|
||||
//{{AFX_MSG_MAP(CSubmitScoresdlg)
|
||||
ON_BN_CLICKED(IDC_BUTTONinit, OnBUTTONinit)
|
||||
ON_BN_CLICKED(IDC_BUTTONSet, OnBUTTONSet)
|
||||
ON_BN_CLICKED(IDC_BUTTONSubmit, OnBUTTONSubmit)
|
||||
ON_BN_CLICKED(IDC_BUTTONUninit, OnBUTTONUninit)
|
||||
ON_BN_CLICKED(IDC_BUTTONFinished, OnBUTTONFinished)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CSubmitScoresdlg message handlers
|
||||
|
||||
GSvoid CSubmitScoresdlg::SetServerID(GSint iLobbyID,GSint iRoomID)
|
||||
{
|
||||
m_iLobbyID = iLobbyID;
|
||||
m_iRoomID = iRoomID;
|
||||
}
|
||||
|
||||
GSvoid CSubmitScoresdlg::SetMatchID(GSuint uiMatchID)
|
||||
{
|
||||
m_uiMatchID = uiMatchID;
|
||||
}
|
||||
|
||||
BOOL CSubmitScoresdlg::OnInitDialog()
|
||||
{
|
||||
CDialog::OnInitDialog();
|
||||
|
||||
GSchar szText[1024];
|
||||
|
||||
_snprintf(szText,1024,"%i",m_iLobbyID);
|
||||
|
||||
m_editLobbyID.SetWindowText(szText);
|
||||
|
||||
_snprintf(szText,1024,"%i",m_iRoomID);
|
||||
|
||||
m_editRoomID.SetWindowText(szText);
|
||||
|
||||
return TRUE; // return TRUE unless you set the focus to a control
|
||||
// EXCEPTION: OCX Property Pages should return FALSE
|
||||
}
|
||||
|
||||
void CSubmitScoresdlg::OnBUTTONinit()
|
||||
{
|
||||
m_pParentDlg->InitMatchResult(m_uiMatchID);
|
||||
}
|
||||
|
||||
void CSubmitScoresdlg::OnBUTTONSet()
|
||||
{
|
||||
GSchar szUsername[NICKNAMELENGTH];
|
||||
GSchar szText[1024];
|
||||
GSuint uiFieldID;
|
||||
GSint iFieldValue;
|
||||
|
||||
m_editUsername.GetWindowText(szUsername,NICKNAMELENGTH);
|
||||
|
||||
m_editFieldID.GetWindowText(szText,1024);
|
||||
uiFieldID = atol(szText);
|
||||
|
||||
m_editFieldValue.GetWindowText(szText,1024);
|
||||
iFieldValue = atol(szText);
|
||||
|
||||
m_pParentDlg->SetMatchResult(szUsername,uiFieldID,iFieldValue);
|
||||
}
|
||||
|
||||
void CSubmitScoresdlg::OnBUTTONSubmit()
|
||||
{
|
||||
m_pParentDlg->SubmitMatchResult(m_iLobbyID,m_iRoomID);
|
||||
}
|
||||
|
||||
void CSubmitScoresdlg::OnBUTTONUninit()
|
||||
{
|
||||
m_pParentDlg->UninitMatchResult();
|
||||
}
|
||||
|
||||
void CSubmitScoresdlg::OnBUTTONFinished()
|
||||
{
|
||||
m_pParentDlg->MatchFinished(m_iLobbyID,m_iRoomID);
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
#if !defined(AFX_SUBMITSCORESDLG_H__95720E33_2611_47EF_BA0C_4DD5EC46E091__INCLUDED_)
|
||||
#define AFX_SUBMITSCORESDLG_H__95720E33_2611_47EF_BA0C_4DD5EC46E091__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "gsMasterServerClientDlg.h"
|
||||
|
||||
// SubmitScoresdlg.h : header file
|
||||
//
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CSubmitScoresdlg dialog
|
||||
|
||||
class CSubmitScoresdlg : public CDialog
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
CSubmitScoresdlg(CWnd* pParent = NULL); // standard constructor
|
||||
|
||||
GSvoid SetServerID(GSint iLobbyID, GSint iRoomID);
|
||||
GSvoid SetMatchID(GSuint uiMatchID);
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CSubmitScoresdlg)
|
||||
enum { IDD = IDD_DIALOGAddScores };
|
||||
CEdit m_editUsername;
|
||||
CEdit m_editLobbyID;
|
||||
CEdit m_editRoomID;
|
||||
CEdit m_editMatchID;
|
||||
CEdit m_editFieldValue;
|
||||
CEdit m_editFieldID;
|
||||
//}}AFX_DATA
|
||||
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CSubmitScoresdlg)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
GSint m_iLobbyID;
|
||||
GSint m_iRoomID;
|
||||
GSuint m_uiMatchID;
|
||||
CGsMasterServerClientDlg *m_pParentDlg;
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CSubmitScoresdlg)
|
||||
virtual BOOL OnInitDialog();
|
||||
afx_msg void OnBUTTONinit();
|
||||
afx_msg void OnBUTTONSet();
|
||||
afx_msg void OnBUTTONSubmit();
|
||||
afx_msg void OnBUTTONUninit();
|
||||
afx_msg void OnBUTTONFinished();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_SUBMITSCORESDLG_H__95720E33_2611_47EF_BA0C_4DD5EC46E091__INCLUDED_)
|
||||
@@ -0,0 +1,110 @@
|
||||
// gsMasterServerClient.cpp : Defines the class behaviors for the application.
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "gsMasterServerClient.h"
|
||||
#include "gsMasterServerClientDlg.h"
|
||||
|
||||
#include "GSTypes.h"
|
||||
#include "InitSockets.h"
|
||||
#include "define.h"
|
||||
|
||||
|
||||
//UBI.COM: These functions are called by the GSlibraries to allocate/free memory
|
||||
extern "C"{
|
||||
void * __stdcall ExtAlloc_Malloc(int iSize)
|
||||
{
|
||||
return malloc(iSize);
|
||||
}
|
||||
|
||||
void __stdcall ExtAlloc_Free(void * ptr)
|
||||
{
|
||||
free(ptr);
|
||||
}
|
||||
void __stdcall ExtAlloc_Realloc(void * ptr, unsigned int iSize)
|
||||
{
|
||||
realloc(ptr,iSize);
|
||||
}
|
||||
}
|
||||
|
||||
//UBI.COM: The GSLibraries are not thread safe. This mutex will stop us from
|
||||
// calling into the library twice at the same time
|
||||
HANDLE g_Mutex;
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CGsMasterServerClientApp
|
||||
|
||||
BEGIN_MESSAGE_MAP(CGsMasterServerClientApp, CWinApp)
|
||||
//{{AFX_MSG_MAP(CGsMasterServerClientApp)
|
||||
// NOTE - the ClassWizard will add and remove mapping macros here.
|
||||
// DO NOT EDIT what you see in these blocks of generated code!
|
||||
//}}AFX_MSG
|
||||
ON_COMMAND(ID_HELP, CWinApp::OnHelp)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CGsMasterServerClientApp construction
|
||||
|
||||
CGsMasterServerClientApp::CGsMasterServerClientApp()
|
||||
{
|
||||
// TODO: add construction code here,
|
||||
// Place all significant initialization in InitInstance
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// The one and only CGsMasterServerClientApp object
|
||||
|
||||
CGsMasterServerClientApp theApp;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CGsMasterServerClientApp initialization
|
||||
|
||||
BOOL CGsMasterServerClientApp::InitInstance()
|
||||
{
|
||||
if (!AfxSocketInit())
|
||||
{
|
||||
AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Standard initialization
|
||||
// If you are not using these features and wish to reduce the size
|
||||
// of your final executable, you should remove from the following
|
||||
// the specific initialization routines you do not need.
|
||||
|
||||
#ifdef _AFXDLL
|
||||
Enable3dControls(); // Call this when using MFC in a shared DLL
|
||||
#else
|
||||
Enable3dControlsStatic(); // Call this when linking to MFC statically
|
||||
#endif
|
||||
|
||||
|
||||
//UBI.COM: Initialize the Socket library. InitializeSockets will return the
|
||||
// local IPAddress that is found.
|
||||
GSchar szIPAddress[IPADDRESSLENGTH]="";
|
||||
|
||||
g_Mutex = CreateMutex(NULL,false,NULL);
|
||||
LOCKMUTEX();
|
||||
InitializeSockets(szIPAddress);
|
||||
UNLOCKMUTEX();
|
||||
|
||||
|
||||
CGsMasterServerClientDlg dlg;
|
||||
m_pMainWnd = &dlg;
|
||||
int nResponse = dlg.DoModal();
|
||||
|
||||
//UBI.COM: Uninitialize the socket library and exit the program
|
||||
LOCKMUTEX();
|
||||
UninitializeSockets();
|
||||
UNLOCKMUTEX();
|
||||
|
||||
// Since the dialog has been closed, return FALSE so that we exit the
|
||||
// application, rather than start the application's message pump.
|
||||
return FALSE;
|
||||
}
|
||||
@@ -0,0 +1,166 @@
|
||||
# Microsoft Developer Studio Project File - Name="gsMasterServerClient" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Application" 0x0101
|
||||
|
||||
CFG=gsMasterServerClient - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "gsMasterServerClient.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "gsMasterServerClient.mak" CFG="gsMasterServerClient - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "gsMasterServerClient - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "gsMasterServerClient - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""$/GSServices/tools-gui/gs-masterserverclient", JLGEAAAA"
|
||||
# PROP Scc_LocalPath "."
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "gsMasterServerClient - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 6
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 5
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c
|
||||
# ADD CPP /nologo /Gz /MT /W3 /GX /O2 /I "../../sdks/gs-sdk-common/include" /I "../../sdks/gs-sdk-msclient/include" /I "../../sdks/gs-sdk-base/include" /I "../../sdks/versions" /D "NDEBUG" /D "DEFVERSION_LIBGSSOCKET" /D "DEFVERSION_LIBGSUTILITY" /D "DEFVERSION_LIBGSCONNECT" /D "DEFVERSION_LIBGSCLIENT" /D "DEFVERSION_LIBGSPROXYCLIENT" /D "DEFVERSION_LIBGSRESULt" /D "DEFVERSION_LIBGSMSCLIENT" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "GS_WIN32" /D "_STLP_NO_IOSTREAMS" /D "DEFVER_LIBGSSOCKET" /D "DEFVER_LIBGSUTILITY" /D "DEFVER_LIBGSCONNECT" /D "DEFVER_LIBGSCLIENT" /D "DEFVER_LIBGSPROXYCLIENT" /D "DEFVER_LIBGSRESULT" /D "DEFVER_LIBGSMSCLIENT" /FD /c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x1009 /d "NDEBUG" /d "_AFXDLL"
|
||||
# ADD RSC /l 0x1009 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386
|
||||
# ADD LINK32 libgssocket.lib libgsutility.lib libgsconnect.lib libgscrypto.lib libgsproxyclient.lib libgsresult.lib libgsclient.lib libgsmsclient.lib Ws2_32.lib /nologo /subsystem:windows /machine:I386 /libpath:"../../sdks/gs-sdk-http/lib_win32" /libpath:"../../sdks/gs-sdk-msclient/lib_win32../../sdks/gs-sdk-result/lib_win32" /libpath:"../../sdks/gs-sdk-common/lib_win32" /libpath:"../../sdks/gs-sdk-msclient/lib_win32" /libpath:"../../sdks/gs-sdk-result/lib_win32" /libpath:"../../sdks/gs-sdk-proxyclient/lib_win32" /libpath:"../../sdks/gs-sdk-base/lib_win32"
|
||||
|
||||
!ELSEIF "$(CFG)" == "gsMasterServerClient - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 6
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 5
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /GZ /c
|
||||
# ADD CPP /nologo /Gz /MTd /W3 /Gm /GX /ZI /Od /I "../../sdks/gs-sdk-common/include" /I "../../sdks/gs-sdk-msclient/include" /I "../../sdks/gs-sdk-base/include" /I "../../sdks/versions" /D "_DEBUG" /D "DEFVER_LIBGSSOCKET" /D "DEFVER_LIBGSUTILITY" /D "DEFVER_LIBGSCONNECT" /D "DEFVER_LIBGSCLIENT" /D "DEFVER_LIBGSPROXYCLIENT" /D "DEFVER_LIBGSRESULT" /D "DEFVER_LIBGSMSCLIENT" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "GS_WIN32" /D "_STLP_NO_IOSTREAMS" /FD /GZ /c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x1009 /d "_DEBUG" /d "_AFXDLL"
|
||||
# ADD RSC /l 0x1009 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 libgssocket_debug.lib libgsutility_debug.lib libgsconnect_debug.lib libgscrypto_debug.lib libgsproxyclient_debug.lib libgsresult_debug.lib libgsclient_debug.lib libgsmsclient_debug.lib Ws2_32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept /libpath:"../../sdks/gs-sdk-http/lib_win32" /libpath:"../../sdks/gs-sdk-msclient/lib_win32" /libpath:"../../sdks/gs-sdk-result/lib_win32" /libpath:"../../sdks/gs-sdk-common/lib_win32" /libpath:"../../sdks/gs-sdk-proxyclient/lib_win32" /libpath:"../../sdks/gs-sdk-base/lib_win32"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "gsMasterServerClient - Win32 Release"
|
||||
# Name "gsMasterServerClient - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\gsMasterServerClient.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\gsMasterServerClient.rc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\gsMasterServerClientDlg.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Registry.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\StdAfx.cpp
|
||||
# ADD CPP /Yc"stdafx.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\SubmitScoresdlg.cpp
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\gsMasterServerClient.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\gsMasterServerClientDlg.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Registry.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Resource.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\StdAfx.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\SubmitScoresdlg.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\gsMasterServerClient.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\gsMasterServerClient.rc2
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\MSClient.ini
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
||||
@@ -0,0 +1,73 @@
|
||||
// gsMasterServerClient.h : main header file for the GSMASTERSERVERCLIENT application
|
||||
//
|
||||
|
||||
#if !defined(AFX_GSMASTERSERVERCLIENT_H__105658B5_BC80_41F6_9297_FE8034DAE519__INCLUDED_)
|
||||
#define AFX_GSMASTERSERVERCLIENT_H__105658B5_BC80_41F6_9297_FE8034DAE519__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#ifndef __AFXWIN_H__
|
||||
#error include 'stdafx.h' before including this file for PCH
|
||||
#endif
|
||||
|
||||
#include "resource.h" // main symbols
|
||||
|
||||
#include "GSTypes.h"
|
||||
|
||||
//UBI.COM: Macros to help with locking the Mutex defined in gsMasterServerClient.cpp
|
||||
#define LOCKMUTEX() WaitForSingleObject(g_Mutex,INFINITE)
|
||||
#define UNLOCKMUTEX() ReleaseMutex(g_Mutex)
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CGsMasterServerClientApp:
|
||||
// See gsMasterServerClient.cpp for the implementation of this class
|
||||
//
|
||||
class CGsMasterServerClientApp : public CWinApp
|
||||
{
|
||||
public:
|
||||
CGsMasterServerClientApp();
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CGsMasterServerClientApp)
|
||||
public:
|
||||
virtual BOOL InitInstance();
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
|
||||
//{{AFX_MSG(CGsMasterServerClientApp)
|
||||
// NOTE - the ClassWizard will add and remove member functions here.
|
||||
// DO NOT EDIT what you see in these blocks of generated code !
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
|
||||
};
|
||||
|
||||
|
||||
//UBI.COM: The callbacks to register.
|
||||
|
||||
GSvoid __stdcall MSGameServer(GSuint uiID,
|
||||
GSshort siGroupType,GSchar *szGroupName, GSint iConfig,
|
||||
GSchar *szMaster,GSchar *szAllowedGames,GSchar *szGames,
|
||||
GSchar *szGameVersion,GSchar *szGSVersion,GSvoid *vpInfo,GSint iSize,
|
||||
GSuint uiMaxPlayer,GSuint uiNbrPlayer,GSuint uiMaxVisitor,
|
||||
GSuint uiNbrVisitor,GSchar *szIPAddress,GSchar *szAltIPAddress,
|
||||
GSint iEventID);
|
||||
|
||||
GSvoid __stdcall MSError(GSint iReason);
|
||||
|
||||
GSvoid __stdcall MSInitFinished();
|
||||
|
||||
GSvoid __stdcall MSRequestFinished();
|
||||
|
||||
GSvoid __stdcall MSJoinFinished(GSuint uiID,GSvoid *vpGameData,GSint iSize,
|
||||
GSchar *szIPAddress,GSchar *szAltIPAddress,GSushort usPort);
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_GSMASTERSERVERCLIENT_H__105658B5_BC80_41F6_9297_FE8034DAE519__INCLUDED_)
|
||||
@@ -0,0 +1,284 @@
|
||||
//Microsoft Developer Studio generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "afxres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.S.) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
IDD_GSMASTERSERVERCLIENT_DIALOG DIALOGEX 0, 0, 447, 293
|
||||
STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION |
|
||||
WS_SYSMENU
|
||||
EXSTYLE WS_EX_APPWINDOW
|
||||
CAPTION "gsMasterServerClient"
|
||||
FONT 8, "Arial"
|
||||
BEGIN
|
||||
EDITTEXT IDC_EDITServerIP,64,26,65,13,ES_AUTOHSCROLL
|
||||
EDITTEXT IDC_EDITPort,64,44,65,13,ES_AUTOHSCROLL
|
||||
EDITTEXT IDC_EDITUsername,181,25,65,13,ES_AUTOHSCROLL
|
||||
EDITTEXT IDC_EDITPassword,181,44,65,13,ES_AUTOHSCROLL
|
||||
EDITTEXT IDC_EDITVersion,181,61,65,13,ES_AUTOHSCROLL
|
||||
PUSHBUTTON "Download config",IDC_BUTTONDownload,285,25,65,14
|
||||
EDITTEXT IDC_EDITGameName,64,61,65,13,ES_AUTOHSCROLL
|
||||
PUSHBUTTON "Initialize",IDC_BUTTONInitialize,285,43,65,14
|
||||
PUSHBUTTON "Uninitialize",IDC_BUTTONUninitialize,285,60,65,14
|
||||
PUSHBUTTON "Request",IDC_BUTTONRequest,358,25,65,14
|
||||
CONTROL "List4",IDC_LISTGameServers,"SysListView32",LVS_REPORT |
|
||||
WS_BORDER | WS_TABSTOP,22,103,405,115
|
||||
EDITTEXT IDC_EDITGamePassword,137,244,65,13,ES_AUTOHSCROLL
|
||||
DEFPUSHBUTTON "Join Server",IDC_BUTTONJoin,22,244,65,14
|
||||
PUSHBUTTON "Leave Server",IDC_BUTTONLeave,22,264,65,14
|
||||
PUSHBUTTON "Exit",IDEXIT,368,264,60,14
|
||||
LTEXT "Game name",IDC_STATIC,20,65,43,8
|
||||
LTEXT "Server IP",IDC_STATIC,20,30,30,8
|
||||
LTEXT "Server port",IDC_STATIC,20,48,36,8
|
||||
LTEXT "Username",IDC_STATIC,139,29,33,8
|
||||
LTEXT "Password",IDC_STATIC,139,48,32,8
|
||||
LTEXT "Version",IDC_STATIC,139,65,24,8
|
||||
LTEXT "Password",IDC_STATIC,97,247,34,8
|
||||
PUSHBUTTON "About",IDC_BUTTONAbout,368,245,60,14
|
||||
PUSHBUTTON "Refresh",IDC_BUTTONRefresh,358,60,65,14
|
||||
PUSHBUTTON "Scores",IDC_BUTTONScores,358,43,65,14
|
||||
PUSHBUTTON "Get Alt Info",IDC_BUTTONGetAlt,213,244,65,14
|
||||
PUSHBUTTON "Start Match",IDC_BUTTONStartMatch,213,264,65,14
|
||||
PUSHBUTTON "Connected",IDC_BUTTONConnected,137,264,65,14
|
||||
GROUPBOX "Operations",IDC_STATIC,272,12,163,70
|
||||
GROUPBOX "Connection properties",IDC_STATIC,13,12,243,70
|
||||
GROUPBOX "Server list",IDC_STATIC,13,88,422,140
|
||||
GROUPBOX "Game server operations",IDC_STATIC,13,232,274,53
|
||||
GROUPBOX "Misc",IDC_STATIC,294,232,141,53
|
||||
PUSHBUTTON "Get MOTD",IDC_BUTTON_GETMOTD,300,245,60,14
|
||||
END
|
||||
|
||||
|
||||
#ifndef _MAC
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,0,0,1
|
||||
PRODUCTVERSION 1,0,0,1
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x4L
|
||||
FILETYPE 0x1L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904B0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "\0"
|
||||
VALUE "FileDescription", "gsMasterServerClient MFC Application\0"
|
||||
VALUE "FileVersion", "1, 0, 0, 1\0"
|
||||
VALUE "InternalName", "gsMasterServerClient\0"
|
||||
VALUE "LegalCopyright", "Copyright (C) 2002\0"
|
||||
VALUE "LegalTrademarks", "\0"
|
||||
VALUE "OriginalFilename", "gsMasterServerClient.EXE\0"
|
||||
VALUE "ProductName", "gsMasterServerClient Application\0"
|
||||
VALUE "ProductVersion", "1, 0, 0, 1\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
|
||||
#endif // !_MAC
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DESIGNINFO
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
GUIDELINES DESIGNINFO DISCARDABLE
|
||||
BEGIN
|
||||
IDD_GSMASTERSERVERCLIENT_DIALOG, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 440
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 286
|
||||
END
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// String Table
|
||||
//
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDP_SOCKETS_INIT_FAILED "Windows sockets initialization failed."
|
||||
END
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (Canada) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENC)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_CAN
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
IDD_DIALOGAddScores DIALOG DISCARDABLE 0, 0, 247, 239
|
||||
STYLE DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Submit Scores"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "Init Match",IDC_BUTTONinit,182,7,57,14
|
||||
PUSHBUTTON "Set Match",IDC_BUTTONSet,182,25,57,14
|
||||
LTEXT "Lobby ID:",IDC_STATIC,7,13,32,8
|
||||
EDITTEXT IDC_EDITLobbyID,45,7,40,14,ES_AUTOHSCROLL | ES_READONLY |
|
||||
ES_NUMBER
|
||||
LTEXT "Match ID:",IDC_STATIC,7,68,32,8
|
||||
EDITTEXT IDC_EDITMatchID,45,62,40,14,ES_AUTOHSCROLL | ES_READONLY |
|
||||
ES_NUMBER
|
||||
LTEXT "Username:",IDC_STATIC,7,90,35,8
|
||||
EDITTEXT IDC_EDITUsername,45,84,40,14,ES_AUTOHSCROLL
|
||||
LTEXT "Field ID:",IDC_STATIC,7,112,27,8
|
||||
EDITTEXT IDC_EDITFieldID,45,106,40,14,ES_AUTOHSCROLL | ES_NUMBER
|
||||
LTEXT "Field Value:",IDC_STATIC,7,134,38,8
|
||||
EDITTEXT IDC_EDITFieldValue,45,128,40,14,ES_AUTOHSCROLL |
|
||||
ES_NUMBER
|
||||
PUSHBUTTON "Submit Match",IDC_BUTTONSubmit,182,43,57,14
|
||||
PUSHBUTTON "Uninit Match",IDC_BUTTONUninit,182,61,57,14
|
||||
PUSHBUTTON "Match Finish",IDC_BUTTONFinished,182,79,58,14
|
||||
LTEXT "Room ID:",IDC_STATIC,7,36,31,8
|
||||
EDITTEXT IDC_EDITRoomID,45,30,40,14,ES_AUTOHSCROLL | ES_READONLY |
|
||||
ES_NUMBER
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DESIGNINFO
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
GUIDELINES DESIGNINFO DISCARDABLE
|
||||
BEGIN
|
||||
IDD_DIALOGAddScores, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 240
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 232
|
||||
END
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#include ""afxres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#define _AFX_NO_SPLITTER_RESOURCES\r\n"
|
||||
"#define _AFX_NO_OLE_RESOURCES\r\n"
|
||||
"#define _AFX_NO_TRACKER_RESOURCES\r\n"
|
||||
"#define _AFX_NO_PROPERTY_RESOURCES\r\n"
|
||||
"\r\n"
|
||||
"#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
|
||||
"#ifdef _WIN32\r\n"
|
||||
"LANGUAGE 9, 1\r\n"
|
||||
"#pragma code_page(1252)\r\n"
|
||||
"#endif //_WIN32\r\n"
|
||||
"#include ""res\\gsMasterServerClient.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
|
||||
"#include ""afxres.rc"" // Standard components\r\n"
|
||||
"#endif\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Icon
|
||||
//
|
||||
|
||||
// Icon with lowest ID value placed first to ensure application icon
|
||||
// remains consistent on all systems.
|
||||
IDR_MAINFRAME ICON DISCARDABLE "res\\gsMasterServerClient.ico"
|
||||
#endif // English (Canada) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
#define _AFX_NO_SPLITTER_RESOURCES
|
||||
#define _AFX_NO_OLE_RESOURCES
|
||||
#define _AFX_NO_TRACKER_RESOURCES
|
||||
#define _AFX_NO_PROPERTY_RESOURCES
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE 9, 1
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
#include "res\gsMasterServerClient.rc2" // non-Microsoft Visual C++ edited resources
|
||||
#include "afxres.rc" // Standard components
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
@@ -0,0 +1,803 @@
|
||||
// gsMasterServerClientDlg.cpp : implementation file
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "gsMasterServerClient.h"
|
||||
#include "gsMasterServerClientDlg.h"
|
||||
#include "SubmitScoresdlg.h"
|
||||
//#include "GSHttpInterface.h"
|
||||
#include "wininet.h"
|
||||
#include "define.h"
|
||||
#include "Registry.h"
|
||||
|
||||
#include "version_manager.h"
|
||||
|
||||
extern HANDLE g_Mutex;
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CGsMasterServerClientDlg dialog
|
||||
|
||||
CGsMasterServerClientDlg::CGsMasterServerClientDlg(CWnd* pParent /*=NULL*/)
|
||||
: CDialog(CGsMasterServerClientDlg::IDD, pParent)
|
||||
{
|
||||
//{{AFX_DATA_INIT(CGsMasterServerClientDlg)
|
||||
//}}AFX_DATA_INIT
|
||||
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
|
||||
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
|
||||
m_bInitialized = false;
|
||||
m_iLobbyID = 0;
|
||||
m_iRoomID = 0;
|
||||
m_uiMatchID = 0;
|
||||
}
|
||||
|
||||
CGsMasterServerClientDlg::~CGsMasterServerClientDlg()
|
||||
{
|
||||
LOCKMUTEX();
|
||||
}
|
||||
void CGsMasterServerClientDlg::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CGsMasterServerClientDlg)
|
||||
DDX_Control(pDX, IDC_EDITGamePassword, m_editGamePassword);
|
||||
DDX_Control(pDX, IDC_LISTGameServers, m_listGameServers);
|
||||
DDX_Control(pDX, IDC_EDITVersion, m_editVersion);
|
||||
DDX_Control(pDX, IDC_EDITUsername, m_editUsername);
|
||||
DDX_Control(pDX, IDC_EDITServerIP, m_editServerIP);
|
||||
DDX_Control(pDX, IDC_EDITPort, m_editPort);
|
||||
DDX_Control(pDX, IDC_EDITPassword, m_editPassword);
|
||||
DDX_Control(pDX, IDC_EDITGameName, m_editGameName);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
BEGIN_MESSAGE_MAP(CGsMasterServerClientDlg, CDialog)
|
||||
//{{AFX_MSG_MAP(CGsMasterServerClientDlg)
|
||||
ON_WM_PAINT()
|
||||
ON_WM_QUERYDRAGICON()
|
||||
ON_BN_CLICKED(IDEXIT, OnExit)
|
||||
ON_BN_CLICKED(IDC_BUTTONInitialize, OnBUTTONInitialize)
|
||||
ON_BN_CLICKED(IDC_BUTTONRequest, OnBUTTONRequest)
|
||||
ON_BN_CLICKED(IDC_BUTTONJoin, OnBUTTONJoin)
|
||||
ON_NOTIFY(NM_DBLCLK, IDC_LISTGameServers, OnDblclkLISTGameServers)
|
||||
ON_BN_CLICKED(IDC_BUTTONLeave, OnBUTTONLeave)
|
||||
ON_BN_CLICKED(IDC_BUTTONUninitialize, OnBUTTONUninitialize)
|
||||
ON_BN_CLICKED(IDC_BUTTONDownload, OnBUTTONDownload)
|
||||
ON_BN_CLICKED(IDC_BUTTONAbout, OnBUTTONAbout)
|
||||
ON_BN_CLICKED(IDC_BUTTONRefresh, OnBUTTONRefresh)
|
||||
ON_BN_CLICKED(IDC_BUTTONScores, OnBUTTONScores)
|
||||
ON_BN_CLICKED(IDC_BUTTONGetAlt, OnBUTTONGetAlt)
|
||||
ON_BN_CLICKED(IDC_BUTTONStartMatch, OnBUTTONStartMatch)
|
||||
ON_BN_CLICKED(IDC_BUTTONConnected, OnBUTTONConnected)
|
||||
ON_BN_CLICKED(IDC_BUTTON_GETMOTD,OnButtonGetMOTD)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CGsMasterServerClientDlg message handlers
|
||||
|
||||
//UBI.COM: This thread just calls the MSClient_Engine function. It is safe
|
||||
// to call this even thought the library has not been initialized,
|
||||
// but we do have to make sure no to call it at the same time as
|
||||
// one of the other functions, therefore we use a Mutex.
|
||||
DWORD ThreadEngine(void* pArg)
|
||||
{
|
||||
CGsMasterServerClientDlg *pMSClient = (CGsMasterServerClientDlg *)pArg;
|
||||
while (true)
|
||||
{
|
||||
Sleep(10);
|
||||
LOCKMUTEX();
|
||||
if (pMSClient->m_bInitialized)
|
||||
pMSClient->Engine();
|
||||
UNLOCKMUTEX();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
BOOL CGsMasterServerClientDlg::OnInitDialog()
|
||||
{
|
||||
CDialog::OnInitDialog();
|
||||
|
||||
// Set the icon for this dialog. The framework does this automatically
|
||||
// when the application's main window is not a dialog
|
||||
SetIcon(m_hIcon, TRUE); // Set big icon
|
||||
SetIcon(m_hIcon, FALSE); // Set small icon
|
||||
|
||||
// TODO: Add extra initialization here
|
||||
|
||||
char szUsername[NICKNAMELENGTH],szGamename[GAMELENGTH],szPassword[PASSWORDLENGTH];
|
||||
char szVersion[VERSIONLENGTH],szGamePassword[PASSWORDLENGTH];
|
||||
char szServerIP[IPADDRESSLENGTH],szServerPort[100];
|
||||
|
||||
char szDirectory[1024];
|
||||
GetCurrentDirectory(1024,szDirectory);
|
||||
|
||||
CString csMSClientIniFile = szDirectory;
|
||||
csMSClientIniFile += "\\MSClient.ini";
|
||||
|
||||
GetPrivateProfileString("MSClient","Username",
|
||||
"user10",szUsername,NICKNAMELENGTH,csMSClientIniFile);
|
||||
GetPrivateProfileString("MSClient","Gamename",
|
||||
"GHOSTRECON",szGamename,GAMELENGTH,csMSClientIniFile);
|
||||
GetPrivateProfileString("MSClient","Password",
|
||||
"testtest",szPassword,PASSWORDLENGTH,csMSClientIniFile);
|
||||
GetPrivateProfileString("MSClient","Version",
|
||||
"PC4.2",szVersion,VERSIONLENGTH,csMSClientIniFile);
|
||||
GetPrivateProfileString("MSClient","GamePassword",
|
||||
"",szGamePassword,PASSWORDLENGTH,csMSClientIniFile);
|
||||
GetPrivateProfileString("MSClient","ServerIP",
|
||||
"",szServerIP,IPADDRESSLENGTH,csMSClientIniFile);
|
||||
GetPrivateProfileString("MSClient","ServerPort",
|
||||
"",szServerPort,100,csMSClientIniFile);
|
||||
|
||||
|
||||
m_editGameName.SetWindowText(szGamename);
|
||||
m_editPassword.SetWindowText(szPassword);
|
||||
m_editPort.SetWindowText(szServerPort);
|
||||
m_editServerIP.SetWindowText(szServerIP);
|
||||
m_editUsername.SetWindowText(szUsername);
|
||||
m_editVersion.SetWindowText(szVersion);
|
||||
m_editGamePassword.SetWindowText(szGamePassword);
|
||||
|
||||
m_listGameServers.InsertColumn(0,"LobbyID",LVCFMT_LEFT,60);
|
||||
m_listGameServers.InsertColumn(1,"RoomID",LVCFMT_LEFT,60);
|
||||
m_listGameServers.InsertColumn(2,"Server Name",LVCFMT_LEFT,85);
|
||||
m_listGameServers.InsertColumn(3,"Master Name",LVCFMT_LEFT,75);
|
||||
m_listGameServers.InsertColumn(4,"Version",LVCFMT_LEFT,60);
|
||||
m_listGameServers.InsertColumn(5,"Players",LVCFMT_LEFT,60);
|
||||
m_listGameServers.InsertColumn(6,"IPAddress",LVCFMT_LEFT,60);
|
||||
m_listGameServers.InsertColumn(7,"Alt IPAddress",LVCFMT_LEFT,75);
|
||||
m_listGameServers.InsertColumn(8,"GroupData",LVCFMT_LEFT,75);
|
||||
|
||||
m_listGameServers.SetExtendedStyle(LVS_EX_FULLROWSELECT);
|
||||
|
||||
|
||||
//UBI.COM: Create the thread that keeps calling MSClient_Engine
|
||||
DWORD iThread;
|
||||
CreateThread(NULL,0,ThreadEngine,this,0,&iThread);
|
||||
|
||||
|
||||
return TRUE; // return TRUE unless you set the focus to a control
|
||||
}
|
||||
|
||||
// If you add a minimize button to your dialog, you will need the code below
|
||||
// to draw the icon. For MFC applications using the document/view model,
|
||||
// this is automatically done for you by the framework.
|
||||
|
||||
void CGsMasterServerClientDlg::OnPaint()
|
||||
{
|
||||
if (IsIconic())
|
||||
{
|
||||
CPaintDC dc(this); // device context for painting
|
||||
|
||||
SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
|
||||
|
||||
// Center icon in client rectangle
|
||||
int cxIcon = GetSystemMetrics(SM_CXICON);
|
||||
int cyIcon = GetSystemMetrics(SM_CYICON);
|
||||
CRect rect;
|
||||
GetClientRect(&rect);
|
||||
int x = (rect.Width() - cxIcon + 1) / 2;
|
||||
int y = (rect.Height() - cyIcon + 1) / 2;
|
||||
|
||||
// Draw the icon
|
||||
dc.DrawIcon(x, y, m_hIcon);
|
||||
}
|
||||
else
|
||||
{
|
||||
CDialog::OnPaint();
|
||||
}
|
||||
}
|
||||
|
||||
// The system calls this to obtain the cursor to display while the user drags
|
||||
// the minimized window.
|
||||
HCURSOR CGsMasterServerClientDlg::OnQueryDragIcon()
|
||||
{
|
||||
return (HCURSOR) m_hIcon;
|
||||
}
|
||||
|
||||
void CGsMasterServerClientDlg::OnExit()
|
||||
{
|
||||
Shutdown();
|
||||
}
|
||||
|
||||
//UBI.COM: Uninitialize the library and close the window.
|
||||
void CGsMasterServerClientDlg::Shutdown()
|
||||
{
|
||||
LOCKMUTEX();
|
||||
Uninitialize();
|
||||
m_bInitialized = false;
|
||||
|
||||
UNLOCKMUTEX();
|
||||
this->DestroyWindow();
|
||||
}
|
||||
|
||||
void CGsMasterServerClientDlg::OnBUTTONInitialize()
|
||||
{
|
||||
GSchar szServer[IPADDRESSLENGTH];
|
||||
GSchar szPort[10];
|
||||
GSushort usPort;
|
||||
GSchar szUsername[NICKNAMELENGTH];
|
||||
GSchar szPassword[PASSWORDLENGTH];
|
||||
GSchar szVersion[VERSIONLENGTH];
|
||||
|
||||
m_editServerIP.GetWindowText(szServer,IPADDRESSLENGTH);
|
||||
m_editPort.GetWindowText(szPort,10);
|
||||
usPort = (GSushort)atol(szPort);
|
||||
m_editUsername.GetWindowText(szUsername,NICKNAMELENGTH);
|
||||
m_editPassword.GetWindowText(szPassword,PASSWORDLENGTH);
|
||||
m_editVersion.GetWindowText(szVersion,VERSIONLENGTH);
|
||||
|
||||
|
||||
//UBI.COM: Initialize the library
|
||||
LOCKMUTEX();
|
||||
if (!Initialize(szServer,usPort,szUsername,szPassword,szVersion))
|
||||
{
|
||||
MessageBox("Initialize Failed");
|
||||
UNLOCKMUTEX();
|
||||
return;
|
||||
}
|
||||
m_bInitialized = true;
|
||||
|
||||
UNLOCKMUTEX();
|
||||
|
||||
}
|
||||
|
||||
//UBI.COM: Callbacks
|
||||
|
||||
//UBI.COM: Add the recieved Game Server to the list box.
|
||||
GSvoid CGsMasterServerClientDlg::GameServerCB(GSint iLobbyID,GSint iRoomID,
|
||||
GSshort siGroupType,GSchar *szGroupName, GSint iConfig,
|
||||
GSchar *szMaster,GSchar *szAllowedGames,GSchar *szGames,
|
||||
GSchar *szGameVersion,GSchar *szGSVersion,GSvoid *vpInfo,GSint iSize,
|
||||
GSuint uiMaxPlayer,GSuint uiNbrPlayer,GSuint uiMaxVisitor,
|
||||
GSuint uiNbrVisitor,GSchar *szIPAddress,GSchar *szAltIPAddress,
|
||||
GSint iEventID)
|
||||
{
|
||||
GSchar szText[100];
|
||||
|
||||
m_listGameServers.InsertItem(m_iNbrGameServers,ltoa(iLobbyID,szText,10));
|
||||
m_listGameServers.SetItemText(m_iNbrGameServers,1,ltoa(iRoomID,szText,10));
|
||||
m_listGameServers.SetItemText(m_iNbrGameServers,2,szGroupName);
|
||||
m_listGameServers.SetItemText(m_iNbrGameServers,3,szMaster);
|
||||
m_listGameServers.SetItemText(m_iNbrGameServers,4,szGSVersion);
|
||||
|
||||
sprintf(szText,"%i/%i",uiNbrPlayer,uiMaxPlayer);
|
||||
m_listGameServers.SetItemText(m_iNbrGameServers,5,szText);
|
||||
|
||||
m_listGameServers.SetItemText(m_iNbrGameServers,6,szIPAddress);
|
||||
m_listGameServers.SetItemText(m_iNbrGameServers,7,szAltIPAddress);
|
||||
m_listGameServers.SetItemText(m_iNbrGameServers,8,(char*)vpInfo);
|
||||
|
||||
m_iNbrGameServers++;
|
||||
}
|
||||
|
||||
GSvoid CGsMasterServerClientDlg::AlternateInfoCB(GSint iLobbyID,GSint iRoomID,const GSvoid* pcAltGroupInfo,
|
||||
GSint iAltGroupInfoSize)
|
||||
{
|
||||
GSchar szText[100];
|
||||
sprintf(szText,"AltInfo: %s",pcAltGroupInfo);
|
||||
MessageBox(szText);
|
||||
}
|
||||
|
||||
//UBI.COM: Display a message box with the error code received
|
||||
GSvoid CGsMasterServerClientDlg::ErrorCB(GSint iReason,GSint iLobbyID,GSint iRoomID)
|
||||
{
|
||||
GSchar szText[100];
|
||||
sprintf(szText,"Error Code: %i %i %i",iReason,iLobbyID,iRoomID);
|
||||
MessageBox(szText);
|
||||
}
|
||||
|
||||
//UBI.COM: Display a message box saying that the init has finished
|
||||
GSvoid CGsMasterServerClientDlg::InitFinishedCB(GSubyte ubType,GSint iError,GSchar *szUserName)
|
||||
{
|
||||
GSchar szText[100];
|
||||
if (ubType == GSSUCCESS)
|
||||
{
|
||||
sprintf(szText,"Initialization Finished %s",szUserName);
|
||||
MessageBox(szText);
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf(szText,"Initialization Error : %i",iError);
|
||||
MessageBox(szText);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//UBI.COM: Display a message box that we've been disconnect from the Router
|
||||
GSvoid CGsMasterServerClientDlg::LoginDisconnectCB()
|
||||
{
|
||||
GSchar szText[100];
|
||||
sprintf(szText,"Login Disconnected\n");
|
||||
MessageBox(szText);
|
||||
}
|
||||
|
||||
//UBI.COM: Display a message box that we've been disconnect from the Lobby
|
||||
GSvoid CGsMasterServerClientDlg::LobbyDisconnectCB()
|
||||
{
|
||||
GSchar szText[100];
|
||||
sprintf(szText,"Lobby Disconnected\n");
|
||||
MessageBox(szText);
|
||||
}
|
||||
|
||||
//UBI.COM: Display a message box saying that the request has finished
|
||||
GSvoid CGsMasterServerClientDlg::RequestFinishedCB()
|
||||
{
|
||||
MessageBox("Request Finished");
|
||||
}
|
||||
|
||||
//UBI.COM: Display a message box saying that the join has finished
|
||||
GSvoid CGsMasterServerClientDlg::JoinFinishedCB(GSint iLobbyID,GSint iRoomID,GSvoid *vpGameData,GSint iSize,
|
||||
GSchar *szIPAddress,GSchar *szAltIPAddress,GSushort usPort)
|
||||
{
|
||||
char szText[1024];
|
||||
sprintf(szText,"Join Finished: %s %s %s %i",vpGameData,szIPAddress,szAltIPAddress,usPort);
|
||||
MessageBox(szText);
|
||||
}
|
||||
|
||||
GSvoid CGsMasterServerClientDlg::AccountCreationCB(GSubyte ucType,GSint iReason)
|
||||
{
|
||||
char szText[1024];
|
||||
|
||||
if (ucType == GSSUCCESS)
|
||||
sprintf(szText,"Account Creation succeeded");
|
||||
else
|
||||
sprintf(szText,"Account Creation failed %i",iReason);
|
||||
MessageBox(szText);
|
||||
}
|
||||
|
||||
|
||||
GSvoid CGsMasterServerClientDlg::ModifyAccountCB(GSubyte ucType,GSint iReason)
|
||||
{
|
||||
char szText[1024];
|
||||
|
||||
if (ucType == GSSUCCESS)
|
||||
sprintf(szText,"Modify Account Creation succeeded");
|
||||
else
|
||||
sprintf(szText,"Modify Account failed %i",iReason);
|
||||
MessageBox(szText);
|
||||
}
|
||||
|
||||
GSvoid CGsMasterServerClientDlg::MatchStartedCB(GSint iLobbyID,GSint iRoomID,GSuint uiMatchID)
|
||||
{
|
||||
char szText[1024];
|
||||
sprintf(szText,"Match Started: %i %i %i",iLobbyID,iRoomID, uiMatchID);
|
||||
MessageBox(szText);
|
||||
m_iLobbyID = iLobbyID;
|
||||
m_iRoomID = iRoomID;
|
||||
m_uiMatchID = uiMatchID;
|
||||
}
|
||||
|
||||
GSvoid CGsMasterServerClientDlg::SubmitMatchCB(GSubyte ucType,GSint iReason,GSuint uiMatchID)
|
||||
{
|
||||
char szText[1024];
|
||||
|
||||
if (ucType == GSSUCCESS)
|
||||
{
|
||||
sprintf(szText,"Submit Match Sucessfull: %i",uiMatchID);
|
||||
MessageBox(szText);
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf(szText,"Submit Match Fail: %i %i",iReason,uiMatchID);
|
||||
MessageBox(szText);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
GSvoid CGsMasterServerClientDlg::RequestMOTDCB(GSubyte ubType, GSchar *szUbiMOTD,
|
||||
GSchar *szGameMOTD, GSint iReason)
|
||||
{
|
||||
CString csText;
|
||||
if (ubType == GSSUCCESS)
|
||||
{
|
||||
csText.Format("Message of the day request successfull.\r\nUbi motd: %s\r\nGame motd: %s",szUbiMOTD,szGameMOTD);
|
||||
AfxMessageBox(csText,MB_OK);
|
||||
}
|
||||
else
|
||||
{
|
||||
csText.Format("Message of the day request failure. Error id: %d",iReason);
|
||||
AfxMessageBox(csText,MB_ICONERROR);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void CGsMasterServerClientDlg::OnBUTTONRequest()
|
||||
{
|
||||
GSchar szGameName[GAMELENGTH];
|
||||
|
||||
m_editGameName.GetWindowText(szGameName,GAMELENGTH);
|
||||
|
||||
//UBI.COM: Request the list of gameserver with the game name
|
||||
LOCKMUTEX();
|
||||
clMSClientClass::RequestGameServers(szGameName);
|
||||
UNLOCKMUTEX();
|
||||
|
||||
m_listGameServers.DeleteAllItems();
|
||||
m_iNbrGameServers = 0;
|
||||
}
|
||||
|
||||
void CGsMasterServerClientDlg::OnBUTTONJoin()
|
||||
{
|
||||
POSITION pos = m_listGameServers.GetFirstSelectedItemPosition();
|
||||
if (pos == NULL)
|
||||
MessageBox("No Game Server Seleted");
|
||||
else
|
||||
{
|
||||
if (pos)
|
||||
{
|
||||
int iItem = m_listGameServers.GetNextSelectedItem(pos);
|
||||
JoinGameServer(iItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CGsMasterServerClientDlg::JoinGameServer(int iItem)
|
||||
{
|
||||
char szText[10];
|
||||
char szPassword[PASSWORDLENGTH]="";
|
||||
char szVersion[VERSIONLENGTH]="";
|
||||
char szGameName[GAMELENGTH]="";
|
||||
GSint iLobbyID,iRoomID;
|
||||
|
||||
m_listGameServers.GetItemText(iItem,0,szText,10);
|
||||
iLobbyID = atol(szText);
|
||||
|
||||
m_listGameServers.GetItemText(iItem,1,szText,10);
|
||||
iRoomID = atol(szText);
|
||||
|
||||
m_listGameServers.GetItemText(iItem,4,szVersion,VERSIONLENGTH);
|
||||
|
||||
m_editGamePassword.GetWindowText(szPassword,PASSWORDLENGTH);
|
||||
m_editGameName.GetWindowText(szGameName,GAMELENGTH);
|
||||
|
||||
//UBI.COM: Join the selected game server
|
||||
LOCKMUTEX();
|
||||
clMSClientClass::JoinGameServer(iLobbyID,iRoomID,szPassword,szVersion,szGameName,
|
||||
"test",5);
|
||||
UNLOCKMUTEX();
|
||||
|
||||
}
|
||||
|
||||
void CGsMasterServerClientDlg::LeaveGameServer(int iItem)
|
||||
{
|
||||
char szText[10];
|
||||
GSint iLobbyID,iRoomID;
|
||||
|
||||
m_listGameServers.GetItemText(iItem,0,szText,10);
|
||||
iLobbyID = atol(szText);
|
||||
|
||||
m_listGameServers.GetItemText(iItem,1,szText,10);
|
||||
iRoomID = atol(szText);
|
||||
|
||||
//UBI.COM: Leave the selected game server
|
||||
LOCKMUTEX();
|
||||
clMSClientClass::LeaveGameServer(iLobbyID,iRoomID);
|
||||
UNLOCKMUTEX();
|
||||
|
||||
}
|
||||
|
||||
void CGsMasterServerClientDlg::OnDblclkLISTGameServers(NMHDR* pNMHDR, LRESULT* pResult)
|
||||
{
|
||||
POSITION pos = m_listGameServers.GetFirstSelectedItemPosition();
|
||||
if (pos == NULL)
|
||||
MessageBox("No Game Server Seleted");
|
||||
else
|
||||
{
|
||||
while (pos)
|
||||
{
|
||||
int iItem = m_listGameServers.GetNextSelectedItem(pos);
|
||||
JoinGameServer(iItem);
|
||||
}
|
||||
}
|
||||
|
||||
*pResult = 0;
|
||||
}
|
||||
|
||||
void CGsMasterServerClientDlg::OnBUTTONLeave()
|
||||
{
|
||||
POSITION pos = m_listGameServers.GetFirstSelectedItemPosition();
|
||||
if (pos == NULL)
|
||||
MessageBox("No Game Server Seleted");
|
||||
else
|
||||
{
|
||||
if (pos)
|
||||
{
|
||||
int iItem = m_listGameServers.GetNextSelectedItem(pos);
|
||||
LeaveGameServer(iItem);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//UBI.COM: Uninitialize the Library but don't close the window.
|
||||
void CGsMasterServerClientDlg::OnBUTTONUninitialize()
|
||||
{
|
||||
LOCKMUTEX();
|
||||
Uninitialize();
|
||||
m_bInitialized = false;
|
||||
UNLOCKMUTEX();
|
||||
}
|
||||
|
||||
void CGsMasterServerClientDlg::OnBUTTONDownload()
|
||||
{
|
||||
CRegistry registry(HKEY_LOCAL_MACHINE, CString("SOFTWARE\\Ubi Soft\\Game Service"),
|
||||
false,KEY_READ);
|
||||
CString csGSIniURL;
|
||||
|
||||
char szDirectory[100];
|
||||
GetCurrentDirectory(100,szDirectory);
|
||||
|
||||
CString csGSIniFile = szDirectory;
|
||||
csGSIniFile += "\\GS.ini";
|
||||
|
||||
CString csMSClientIniFile = szDirectory;
|
||||
csMSClientIniFile += "\\MSClient.ini";
|
||||
|
||||
registry.OpenKey();
|
||||
|
||||
//UBI.COM: Try to read the ConnectURL from the registry
|
||||
// If it fails we'll look in Launcher.ini
|
||||
if (!registry.ReadString(CString("ConnectURL"), &csGSIniURL))
|
||||
{
|
||||
char szUrl[1024];
|
||||
|
||||
MessageBox("Registry failed; using MSClient.ini");
|
||||
|
||||
GetPrivateProfileString("MSClient","ConnectURL",
|
||||
"http://gsconnect.ubisoft.com/gsinit.php?user=%s&dp=%s",szUrl,
|
||||
1024,csMSClientIniFile);
|
||||
csGSIniURL = szUrl;
|
||||
|
||||
}
|
||||
registry.CloseKey();
|
||||
|
||||
char szUsername[NICKNAMELENGTH],szGamename[GAMELENGTH];
|
||||
|
||||
m_editUsername.GetWindowText(szUsername,NICKNAMELENGTH);
|
||||
m_editGameName.GetWindowText(szGamename,GAMELENGTH);
|
||||
|
||||
//UBI.COM: Replace the strings in the URL
|
||||
csGSIniURL.Replace("user=%s",(CString("user=")+szUsername));
|
||||
csGSIniURL.Replace("dp=%s",(CString("dp=")+szGamename));
|
||||
|
||||
//UBI.COM: Try to download the file GS.ini file if it fails
|
||||
// we can use the old local one
|
||||
HINTERNET hNet = InternetOpen("",INTERNET_OPEN_TYPE_PRECONFIG,NULL,NULL,NULL);
|
||||
if (!hNet)
|
||||
MessageBox("InternetOpen Failed");
|
||||
else
|
||||
{
|
||||
HINTERNET hURL = InternetOpenUrl(hNet,csGSIniURL,NULL,0,INTERNET_FLAG_HYPERLINK,NULL);
|
||||
|
||||
if (!hURL)
|
||||
MessageBox("InternetOpenUrl Failed");
|
||||
else
|
||||
{
|
||||
GSchar szBuffer[1024];
|
||||
GSint iSize = 1024;
|
||||
DWORD iRead = 0;
|
||||
|
||||
FILE *pFile = fopen(csGSIniFile,"w");
|
||||
while (InternetReadFile(hURL,szBuffer,iSize,&iRead))
|
||||
{
|
||||
if (iRead != 0)
|
||||
{
|
||||
fwrite(szBuffer,sizeof(GSchar),iRead,pFile);
|
||||
}
|
||||
else
|
||||
{
|
||||
fclose(pFile);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
char szIPAddress[IPADDRESSLENGTH];
|
||||
char szPort[100];
|
||||
|
||||
//UBI.COM: Read in the Address of the GSRouter.
|
||||
// We'll only read in the first address, in a real application
|
||||
// you should get both so that if one fails you can try the
|
||||
// other.
|
||||
GetPrivateProfileString("Servers","RouterIP0","srv-gstest",szIPAddress,
|
||||
IPADDRESSLENGTH,csGSIniFile);
|
||||
//UBI.COM: Read in the Port of the GSRouter
|
||||
GetPrivateProfileString("Servers","RouterPort0","41000",szPort,
|
||||
100,csGSIniFile);
|
||||
|
||||
m_editServerIP.SetWindowText(szIPAddress);
|
||||
m_editPort.SetWindowText(szPort);
|
||||
|
||||
MessageBox("Download Finished");
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
void CGsMasterServerClientDlg::OnBUTTONAbout()
|
||||
{
|
||||
char *szBuffer;
|
||||
unsigned int iBufferSize;
|
||||
|
||||
CGSVersion ver;
|
||||
ver.PrintModulesVersion(NULL,&iBufferSize);
|
||||
|
||||
szBuffer = (char*)malloc(iBufferSize);
|
||||
|
||||
ver.PrintModulesVersion(szBuffer,&iBufferSize);
|
||||
|
||||
MessageBox(szBuffer);
|
||||
free(szBuffer);
|
||||
}
|
||||
|
||||
void CGsMasterServerClientDlg::OnBUTTONRefresh()
|
||||
{
|
||||
POSITION pos = m_listGameServers.GetFirstSelectedItemPosition();
|
||||
if (pos == NULL)
|
||||
MessageBox("No Game Server Seleted");
|
||||
else
|
||||
{
|
||||
GSuint iCount = m_listGameServers.GetSelectedCount();
|
||||
GSint iNum=0;
|
||||
|
||||
while (pos)
|
||||
{
|
||||
char szText[10];
|
||||
GSint iLobbyID;
|
||||
GSint iRoomID;
|
||||
|
||||
GSint iItem= m_listGameServers.GetNextSelectedItem(pos);
|
||||
m_listGameServers.GetItemText(iItem,0,szText,10);
|
||||
iLobbyID = atol(szText);
|
||||
|
||||
m_listGameServers.GetItemText(iItem,1,szText,10);
|
||||
iRoomID = atol(szText);
|
||||
|
||||
LOCKMUTEX();
|
||||
clMSClientClass::RefreshGameServer(iLobbyID,iRoomID);
|
||||
UNLOCKMUTEX();
|
||||
}
|
||||
|
||||
m_listGameServers.DeleteAllItems();
|
||||
m_iNbrGameServers = 0;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void CGsMasterServerClientDlg::OnBUTTONScores()
|
||||
{
|
||||
if (m_iLobbyID)
|
||||
{
|
||||
CSubmitScoresdlg dlgSubmitScores(this);
|
||||
|
||||
dlgSubmitScores.SetServerID(m_iLobbyID,m_iRoomID);
|
||||
dlgSubmitScores.SetMatchID(m_uiMatchID);
|
||||
|
||||
dlgSubmitScores.DoModal();
|
||||
m_iLobbyID = 0;
|
||||
m_iRoomID = 0;
|
||||
m_uiMatchID = 0;
|
||||
}
|
||||
//else
|
||||
// MessageBox("Have not received MatchStarted\n");
|
||||
|
||||
}
|
||||
|
||||
/*void CGsMasterServerClientDlg::OnBUTTONJoinID()
|
||||
{
|
||||
GSchar szGameName[GAMELENGTH];
|
||||
|
||||
m_editGameName.GetWindowText(szGameName,GAMELENGTH);
|
||||
|
||||
LOCKMUTEX();
|
||||
clMSClientClass::JoinGameServer(7,-154,"","2.0",szGameName);
|
||||
UNLOCKMUTEX();
|
||||
}*/
|
||||
|
||||
void CGsMasterServerClientDlg::OnBUTTONGetAlt()
|
||||
{
|
||||
POSITION pos = m_listGameServers.GetFirstSelectedItemPosition();
|
||||
if (pos == NULL)
|
||||
MessageBox("No Game Server Seleted");
|
||||
else
|
||||
{
|
||||
while (pos)
|
||||
{
|
||||
int iItem = m_listGameServers.GetNextSelectedItem(pos);
|
||||
|
||||
GSchar szText[10];
|
||||
GSint iLobbyID,iRoomID;
|
||||
|
||||
m_listGameServers.GetItemText(iItem,0,szText,10);
|
||||
iLobbyID = atol(szText);
|
||||
|
||||
m_listGameServers.GetItemText(iItem,1,szText,10);
|
||||
iRoomID = atol(szText);
|
||||
|
||||
|
||||
//UBI.COM: Join the request the game servers Alt Info
|
||||
LOCKMUTEX();
|
||||
clMSClientClass::RequestAlternateInfo(iLobbyID,iRoomID);
|
||||
UNLOCKMUTEX();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void CGsMasterServerClientDlg::OnBUTTONStartMatch()
|
||||
{
|
||||
POSITION pos = m_listGameServers.GetFirstSelectedItemPosition();
|
||||
if (pos == NULL)
|
||||
MessageBox("No Game Server Seleted");
|
||||
else
|
||||
{
|
||||
while (pos)
|
||||
{
|
||||
int iItem = m_listGameServers.GetNextSelectedItem(pos);
|
||||
|
||||
GSchar szText[10];
|
||||
GSint iLobbyID,iRoomID;
|
||||
|
||||
m_listGameServers.GetItemText(iItem,0,szText,10);
|
||||
iLobbyID = atol(szText);
|
||||
|
||||
m_listGameServers.GetItemText(iItem,1,szText,10);
|
||||
iRoomID = atol(szText);
|
||||
|
||||
|
||||
//UBI.COM: Join the request the game servers Alt Info
|
||||
LOCKMUTEX();
|
||||
clMSClientClass::MatchStarted(iLobbyID,iRoomID);
|
||||
UNLOCKMUTEX();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void CGsMasterServerClientDlg::OnBUTTONConnected()
|
||||
{
|
||||
POSITION pos = m_listGameServers.GetFirstSelectedItemPosition();
|
||||
if (pos == NULL)
|
||||
MessageBox("No Game Server Seleted");
|
||||
else
|
||||
{
|
||||
while (pos)
|
||||
{
|
||||
int iItem = m_listGameServers.GetNextSelectedItem(pos);
|
||||
|
||||
GSchar szText[10];
|
||||
GSint iLobbyID,iRoomID;
|
||||
|
||||
m_listGameServers.GetItemText(iItem,0,szText,10);
|
||||
iLobbyID = atol(szText);
|
||||
|
||||
m_listGameServers.GetItemText(iItem,1,szText,10);
|
||||
iRoomID = atol(szText);
|
||||
|
||||
|
||||
//UBI.COM: Tell The Lobby server we've connected to the game
|
||||
LOCKMUTEX();
|
||||
clMSClientClass::GameServerConnected(iLobbyID,iRoomID);
|
||||
UNLOCKMUTEX();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void CGsMasterServerClientDlg::OnButtonGetMOTD()
|
||||
{
|
||||
LOCKMUTEX();
|
||||
RequestMOTD("fr");
|
||||
UNLOCKMUTEX();
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
// gsMasterServerClientDlg.h : header file
|
||||
//
|
||||
|
||||
#if !defined(AFX_GSMASTERSERVERCLIENTDLG_H__14918F3D_F9D7_4962_9438_7CB4C4CDEDB4__INCLUDED_)
|
||||
#define AFX_GSMASTERSERVERCLIENTDLG_H__14918F3D_F9D7_4962_9438_7CB4C4CDEDB4__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "MSClientClass.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CGsMasterServerClientDlg dialog
|
||||
|
||||
class CGsMasterServerClientDlg : public CDialog, public clMSClientClass
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
void Shutdown();
|
||||
CGsMasterServerClientDlg(CWnd* pParent = NULL); // standard constructor
|
||||
~CGsMasterServerClientDlg();
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CGsMasterServerClientDlg)
|
||||
enum { IDD = IDD_GSMASTERSERVERCLIENT_DIALOG };
|
||||
|
||||
CEdit m_editGamePassword;
|
||||
CListCtrl m_listGameServers;
|
||||
CEdit m_editVersion;
|
||||
CEdit m_editUsername;
|
||||
CEdit m_editServerIP;
|
||||
CEdit m_editPort;
|
||||
CEdit m_editPassword;
|
||||
CEdit m_editGameName;
|
||||
//}}AFX_DATA
|
||||
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CGsMasterServerClientDlg)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
HICON m_hIcon;
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CGsMasterServerClientDlg)
|
||||
virtual BOOL OnInitDialog();
|
||||
afx_msg void OnPaint();
|
||||
afx_msg HCURSOR OnQueryDragIcon();
|
||||
afx_msg void OnExit();
|
||||
afx_msg void OnBUTTONInitialize();
|
||||
afx_msg void OnBUTTONRequest();
|
||||
afx_msg void OnBUTTONJoin();
|
||||
afx_msg void OnDblclkLISTGameServers(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
afx_msg void OnBUTTONLeave();
|
||||
afx_msg void OnBUTTONUninitialize();
|
||||
afx_msg void OnBUTTONDownload();
|
||||
afx_msg void OnBUTTONAbout();
|
||||
afx_msg void OnBUTTONRefresh();
|
||||
afx_msg void OnBUTTONScores();
|
||||
afx_msg void OnBUTTONGetAlt();
|
||||
afx_msg void OnBUTTONStartMatch();
|
||||
afx_msg void OnBUTTONConnected();
|
||||
afx_msg void OnButtonGetMOTD();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
public:
|
||||
GSvoid GameServerCB(GSint iLobbyID,GSint iRoomID,
|
||||
GSshort siGroupType,GSchar *szGroupName, GSint iConfig,
|
||||
GSchar *szMaster,GSchar *szAllowedGames,GSchar *szGames,
|
||||
GSchar *szGameVersion,GSchar *szGSVersion,GSvoid *vpInfo,GSint iSize,
|
||||
GSuint uiMaxPlayer,GSuint uiNbrPlayer,GSuint uiMaxVisitor,
|
||||
GSuint uiNbrVisitor,GSchar *szIPAddress,GSchar *szAltIPAddress,
|
||||
GSint iEventID);
|
||||
|
||||
GSvoid AlternateInfoCB(GSint iLobbyID,GSint iRoomID,const GSvoid* pcAltGroupInfo,
|
||||
GSint iAltGroupInfoSize);
|
||||
|
||||
GSvoid ErrorCB(GSint iReason,GSint iLobbyId,GSint iRoomID);
|
||||
GSvoid InitFinishedCB(GSubyte ubType,GSint iError,GSchar *szUserName);
|
||||
GSvoid LoginDisconnectCB();
|
||||
GSvoid LobbyDisconnectCB();
|
||||
|
||||
GSvoid RequestFinishedCB();
|
||||
|
||||
GSvoid JoinFinishedCB(GSint iLobbyID,GSint iRoomID,GSvoid *vpGameData,GSint iSize,
|
||||
GSchar *szIPAddress,GSchar *szAltIPAddress,GSushort usPort);
|
||||
|
||||
GSvoid AccountCreationCB(GSubyte ucType,GSint iReason);
|
||||
GSvoid ModifyAccountCB(GSubyte ucType,GSint iReason);
|
||||
|
||||
GSvoid MatchStartedCB(GSint iLobbyID,GSint iRoomID,GSuint uiMatchID);
|
||||
GSvoid SubmitMatchCB(GSubyte ucType,GSint iReason,GSuint uiMatchID);
|
||||
|
||||
GSvoid RequestMOTDCB(GSubyte ubType, GSchar *szUbiMOTD,
|
||||
GSchar *szGameMOTD, GSint iReason);
|
||||
|
||||
GSbool m_bInitialized;
|
||||
private:
|
||||
GSint m_iNbrGameServers;
|
||||
GSuint m_uiMatchID;
|
||||
GSint m_iLobbyID;
|
||||
GSint m_iRoomID;
|
||||
|
||||
void JoinGameServer(GSint iItem);
|
||||
void LeaveGameServer(GSint iItem);
|
||||
};
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_GSMASTERSERVERCLIENTDLG_H__14918F3D_F9D7_4962_9438_7CB4C4CDEDB4__INCLUDED_)
|
||||
@@ -0,0 +1,383 @@
|
||||
/***SDOC*******************************************************************************************
|
||||
*
|
||||
* UbiSoft Development Network
|
||||
* ---------------------------
|
||||
*
|
||||
* FILE........: httpconfig.cpp
|
||||
* CREATION....: 11 Dec. 2001
|
||||
* AUTHOR......: Guillaume Plante
|
||||
*
|
||||
* DESCRIPTION.: implementation of the CGSHttpConfig class
|
||||
*
|
||||
**************************************************************************************************
|
||||
* FILE HISTORY
|
||||
**************************************************************************************************
|
||||
*
|
||||
* DATE........:
|
||||
* AUTHOR......:
|
||||
* DESCRIPTION.:
|
||||
*
|
||||
******************************************************************************************EDOC***/
|
||||
|
||||
#include "httpconfig.h"
|
||||
|
||||
//these 2 are included for the binary mode in case of binary download
|
||||
#include <io.h>
|
||||
#include <fcntl.h>
|
||||
#include <winsock2.h>
|
||||
|
||||
|
||||
//===================================================================================================
|
||||
// CLASS CGSHttpConfig
|
||||
// METHOD CGSHttpConfig
|
||||
// AUTHOR: Guillaume Plante
|
||||
// CREATION: April 4, 2002
|
||||
//
|
||||
// DESCRIPTION: Default constructor
|
||||
//===================================================================================================
|
||||
CGSHttpConfig::CGSHttpConfig()
|
||||
{
|
||||
m_iTimeOut = 0;
|
||||
m_bInitialised = false;
|
||||
}
|
||||
|
||||
//===================================================================================================
|
||||
// CLASS CGSHttpConfig
|
||||
// METHOD PrintError
|
||||
// AUTHOR: Guillaume Plante
|
||||
// CREATION: April 4, 2002
|
||||
//
|
||||
// DESCRIPTION: Print error code on stderr
|
||||
//===================================================================================================
|
||||
void CGSHttpConfig::PrintError(const char * szError)
|
||||
{
|
||||
fprintf(stderr,"\nerror: %s\nwsalasterror: %d\n", szError, WSAGetLastError());
|
||||
}
|
||||
|
||||
//===================================================================================================
|
||||
// CLASS CGSHttpConfig
|
||||
// METHOD Initialize
|
||||
// AUTHOR: Guillaume Plante
|
||||
// CREATION: April 4, 2002
|
||||
//
|
||||
// DESCRIPTION: Initialize the class (winsock2)
|
||||
//===================================================================================================
|
||||
bool CGSHttpConfig::Initialize()
|
||||
{
|
||||
if(m_bInitialised)
|
||||
return false;
|
||||
|
||||
// set the default time out value
|
||||
m_iTimeOut = _DEFAULT_TIMEOUT;
|
||||
m_bInitialised = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
//===================================================================================================
|
||||
// CLASS CGSHttpConfig
|
||||
// METHOD Uninitialize
|
||||
// AUTHOR: Guillaume Plante
|
||||
// CREATION: April 4, 2002
|
||||
//
|
||||
// DESCRIPTION: Uninitialize the class (winsock2)
|
||||
//===================================================================================================
|
||||
bool CGSHttpConfig::Uninitialize()
|
||||
{
|
||||
if(!m_bInitialised)
|
||||
return false;
|
||||
m_bInitialised = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
//===================================================================================================
|
||||
// CLASS CGSHttpConfig
|
||||
// METHOD GetWebFile
|
||||
// AUTHOR: Guillaume Plante
|
||||
// CREATION: April 4, 2002
|
||||
//
|
||||
// DESCRIPTION: Get the a file given a url and write it to a location
|
||||
//===================================================================================================
|
||||
int CGSHttpConfig::GetWebFile(const char * szURL,const char * szLocalFileName)
|
||||
{
|
||||
_urlinfo UrlInfo;
|
||||
if(!ParseURL(szURL,&UrlInfo))
|
||||
return -1;
|
||||
|
||||
|
||||
// Lookup host
|
||||
LPHOSTENT lpHostEntry;
|
||||
lpHostEntry = gethostbyname(UrlInfo.szHost);
|
||||
if (lpHostEntry == NULL)
|
||||
{
|
||||
PrintError("gethostbyname()");
|
||||
return -1;
|
||||
}
|
||||
|
||||
// file object
|
||||
FILE *fData = NULL;
|
||||
// make sure the file is empty first
|
||||
if(szLocalFileName)
|
||||
{
|
||||
// write to file
|
||||
if(!(fData = fopen(szLocalFileName,"w")))
|
||||
{
|
||||
PrintError("Could not open local file");
|
||||
return -1;
|
||||
}
|
||||
// set the output as binary in case of a jpg or else
|
||||
_setmode(_fileno(fData), _O_BINARY);
|
||||
fwrite("", 1, 1, fData);
|
||||
fclose(fData);
|
||||
}
|
||||
// Fill in the server address structure
|
||||
SOCKADDR_IN sa;
|
||||
sa.sin_family = AF_INET;
|
||||
sa.sin_addr = *((LPIN_ADDR)*lpHostEntry->h_addr_list);
|
||||
sa.sin_port = htons(UrlInfo.usPort);
|
||||
|
||||
// Create a TCP/IP stream socket
|
||||
SOCKET Socket;
|
||||
Socket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
|
||||
if (Socket == INVALID_SOCKET)
|
||||
{
|
||||
PrintError("socket()");
|
||||
return -1;
|
||||
}
|
||||
|
||||
//
|
||||
// Create an event object to be used with this socket
|
||||
//
|
||||
WSAEVENT hEvent;
|
||||
hEvent = WSACreateEvent();
|
||||
if (hEvent == WSA_INVALID_EVENT)
|
||||
{
|
||||
PrintError("WSACreateEvent()");
|
||||
closesocket(Socket);
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Make the socket non-blocking and
|
||||
// associate it with network event
|
||||
int nRet;
|
||||
nRet = WSAEventSelect(Socket,
|
||||
hEvent,
|
||||
FD_READ|FD_CONNECT|FD_CLOSE);
|
||||
if (nRet == SOCKET_ERROR)
|
||||
{
|
||||
PrintError("EventSelect()");
|
||||
closesocket(Socket);
|
||||
WSACloseEvent(hEvent);
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Request a connection
|
||||
nRet = connect(Socket, (LPSOCKADDR)&sa, sizeof(SOCKADDR_IN));
|
||||
|
||||
if (nRet == SOCKET_ERROR)
|
||||
{
|
||||
nRet = WSAGetLastError();
|
||||
if (nRet == WSAEWOULDBLOCK)
|
||||
{
|
||||
fprintf(stderr,"\nConnect would block");
|
||||
}
|
||||
else
|
||||
{
|
||||
PrintError("connect()");
|
||||
closesocket(Socket);
|
||||
WSACloseEvent(hEvent);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
// Handle async network events
|
||||
char szBuffer[4096];
|
||||
WSANETWORKEVENTS events;
|
||||
while(1)
|
||||
{
|
||||
// Wait for something to happen
|
||||
//fprintf(stderr,"\nWaitForMultipleEvents()");
|
||||
DWORD dwRet;
|
||||
dwRet = WSAWaitForMultipleEvents(1,
|
||||
&hEvent,
|
||||
FALSE,
|
||||
1000,
|
||||
FALSE);
|
||||
|
||||
if (dwRet == WSA_WAIT_TIMEOUT)
|
||||
{
|
||||
fprintf(stderr,"\nWait timed out");
|
||||
break;
|
||||
}
|
||||
|
||||
// Figure out what happened
|
||||
//fprintf(stderr,"\nWSAEnumNetworkEvents()");
|
||||
nRet = WSAEnumNetworkEvents(Socket, hEvent,&events);
|
||||
if (nRet == SOCKET_ERROR)
|
||||
{
|
||||
PrintError("WSAEnumNetworkEvents()");
|
||||
break;
|
||||
}
|
||||
|
||||
// handling events
|
||||
|
||||
// Connect event
|
||||
if (events.lNetworkEvents & FD_CONNECT)
|
||||
{
|
||||
// Send the http request
|
||||
// make the request
|
||||
MakeRequest(szBuffer,UrlInfo.szObject,UrlInfo.szHost);
|
||||
nRet = send(Socket, szBuffer, strlen(szBuffer), 0);
|
||||
if (nRet == SOCKET_ERROR)
|
||||
{
|
||||
PrintError("send()");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Read event
|
||||
if (events.lNetworkEvents & FD_READ)
|
||||
{
|
||||
// Read the data and write it to stdout
|
||||
nRet = recv(Socket, szBuffer, sizeof(szBuffer), 0);
|
||||
if (nRet == SOCKET_ERROR)
|
||||
{
|
||||
PrintError("recv()");
|
||||
break;
|
||||
}
|
||||
//fprintf(stderr,"\nRead %d bytes", nRet);
|
||||
|
||||
if(szLocalFileName)
|
||||
{
|
||||
// write to file
|
||||
if(!(fData = fopen(szLocalFileName,"a+")))
|
||||
{
|
||||
PrintError("Could not open local file");
|
||||
return -1;
|
||||
}
|
||||
// set the output as binary in case of a jpg or else
|
||||
_setmode(_fileno(fData), _O_BINARY);
|
||||
fwrite(szBuffer, nRet, 1, fData);
|
||||
fclose(fData);
|
||||
}
|
||||
else
|
||||
{
|
||||
// set the output as binary in case of a jpg or else
|
||||
_setmode(_fileno(stdout), _O_BINARY);
|
||||
// Write to stdout
|
||||
fwrite(szBuffer, nRet, 1, stdout);
|
||||
}
|
||||
}
|
||||
|
||||
// Close event
|
||||
if (events.lNetworkEvents & FD_CLOSE)
|
||||
break;
|
||||
}
|
||||
closesocket(Socket);
|
||||
WSACloseEvent(hEvent);
|
||||
return 1;
|
||||
}
|
||||
|
||||
//===================================================================================================
|
||||
// CLASS CGSHttpConfig
|
||||
// METHOD MakeRequest
|
||||
// AUTHOR: Guillaume Plante
|
||||
// CREATION: April 4, 2002
|
||||
//
|
||||
// DESCRIPTION: Make a standard http "GET" request based on a absolute file path and hostname
|
||||
//===================================================================================================
|
||||
char *CGSHttpConfig::MakeRequest(char * szBuffer,const char * szFile,const char * szHostname)
|
||||
{
|
||||
sprintf(szBuffer, "GET %s HTTP/1.1\nHost: %s\n\n", szFile,szHostname);
|
||||
return szBuffer;
|
||||
}
|
||||
|
||||
//===================================================================================================
|
||||
// CLASS CGSHttpConfig
|
||||
// METHOD ParseURL
|
||||
// AUTHOR: Guillaume Plante
|
||||
// CREATION: April 4, 2002
|
||||
//
|
||||
// DESCRIPTION: Parse a URL to give back the server, object, service name and port number in a struct
|
||||
//===================================================================================================
|
||||
bool CGSHttpConfig::ParseURL(const char *szURL,_urlinfo *UrlInfo)
|
||||
{
|
||||
char szTempURL[256];
|
||||
char *pc = NULL;
|
||||
char *pcPort = NULL;
|
||||
char *pcObj = NULL;
|
||||
int cpt = 0;
|
||||
int len = 0;
|
||||
|
||||
memset(UrlInfo->szHost,0,sizeof(UrlInfo->szHost));
|
||||
memset(UrlInfo->szService,0,sizeof(UrlInfo->szService));
|
||||
memset(UrlInfo->szObject,0,sizeof(UrlInfo->szObject));
|
||||
UrlInfo->usPort = 0;
|
||||
|
||||
// make a copy of the url
|
||||
strncpy(szTempURL,szURL,255);
|
||||
|
||||
if(!strstr(szTempURL,HTTP_SEP_PROTO_HOST))
|
||||
return false;
|
||||
|
||||
// first find the service type
|
||||
pc = strtok(szTempURL,HTTP_SEP_PROTO_HOST);
|
||||
if(!pc)
|
||||
return false;
|
||||
// put service in uppercase
|
||||
len = strlen(pc);
|
||||
for(cpt = 0;cpt<=len;cpt++)
|
||||
{
|
||||
pc[cpt] = tolower(pc[cpt]);
|
||||
}
|
||||
// copy the service name
|
||||
strncpy(UrlInfo->szService,pc,sizeof(UrlInfo->szService));
|
||||
|
||||
// check for invalid service.
|
||||
if((strcmp(UrlInfo->szService,NET_SERVICE_HTTP))&&(strcmp(UrlInfo->szService,NET_SERVICE_FTP))&&
|
||||
(strcmp(UrlInfo->szService,NET_SERVICE_GOPHER)))
|
||||
return false;
|
||||
|
||||
// make a copy of the url
|
||||
strncpy(szTempURL,szURL,255);
|
||||
// find the port is there is none, port is 80 (standard)
|
||||
pc = strchr(szTempURL,':');
|
||||
if(pc)
|
||||
{
|
||||
if(pc = strtok(++pc,HTTP_SEP_SLASH))
|
||||
pcPort = strrchr(pc,HTTP_SEP_COLON_INT);
|
||||
else
|
||||
return false; // could not determine hostname
|
||||
if(pcPort)
|
||||
{
|
||||
UrlInfo->usPort = atoi(++pcPort);
|
||||
if(pc = strtok(pc,HTTP_SEP_COLON))
|
||||
strncpy(UrlInfo->szHost,pc,sizeof(UrlInfo->szHost));
|
||||
else
|
||||
return false; // could not find hostname
|
||||
}
|
||||
else
|
||||
{
|
||||
strncpy(UrlInfo->szHost,pc,sizeof(UrlInfo->szHost));
|
||||
UrlInfo->usPort = HTTP_DEFAULT_PORT; // well known http port
|
||||
}
|
||||
}
|
||||
else
|
||||
return false;
|
||||
// in case of badly formed url put the default http port
|
||||
if(!UrlInfo->usPort)
|
||||
UrlInfo->usPort = HTTP_DEFAULT_PORT;
|
||||
// make a copy of the url
|
||||
strncpy(szTempURL,szURL,255);
|
||||
// now find the object
|
||||
pcObj = strstr(szTempURL,UrlInfo->szHost);
|
||||
if(pcObj)
|
||||
{
|
||||
if(pcObj = strchr(pcObj+cpt,HTTP_SEP_SLASH_INT))
|
||||
strncpy(UrlInfo->szObject,pcObj,sizeof(UrlInfo->szObject));
|
||||
else
|
||||
strncpy(UrlInfo->szObject,"/",sizeof(UrlInfo->szObject));
|
||||
}
|
||||
else
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
/***SDOC*******************************************************************************************
|
||||
*
|
||||
* UbiSoft Development Network
|
||||
* ---------------------------
|
||||
*
|
||||
* FILE........: httpconfig.h
|
||||
* CREATION....: 11 Dec. 2001
|
||||
* AUTHOR......: Guillaume Plante
|
||||
*
|
||||
* DESCRIPTION.: wrapper class around winsock to get a file on the net via the http protocol,
|
||||
* using event objects and WSASelectEvent()
|
||||
*
|
||||
**************************************************************************************************
|
||||
* FILE HISTORY
|
||||
**************************************************************************************************
|
||||
*
|
||||
* DATE........:
|
||||
* AUTHOR......:
|
||||
* DESCRIPTION.:
|
||||
*
|
||||
******************************************************************************************EDOC***/
|
||||
|
||||
|
||||
#ifndef _HTTPCONFIG_H_
|
||||
#define _HTTPCONFIG_H_
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#define _DEFAULT_TIMEOUT 10
|
||||
|
||||
#define NET_SERVICE_HTTP "http"
|
||||
#define NET_SERVICE_FTP "ftp"
|
||||
#define NET_SERVICE_GOPHER "gopher"
|
||||
|
||||
#define HTTP_DEFAULT_PORT 80
|
||||
#define HTTP_SEP_COLON ":"
|
||||
#define HTTP_SEP_COLON_INT ':'
|
||||
#define HTTP_SEP_SLASH "/"
|
||||
#define HTTP_SEP_SLASH_INT '/'
|
||||
#define HTTP_SEP_PROTO_HOST "://"
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char szService[12];
|
||||
char szHost[128];
|
||||
char szObject[128];
|
||||
unsigned short int usPort;
|
||||
} _urlinfo;
|
||||
|
||||
class CGSHttpConfig
|
||||
{
|
||||
public:
|
||||
CGSHttpConfig(); // constructor
|
||||
~CGSHttpConfig(){}; // destructor
|
||||
bool Initialize(); // Initialize winsock.
|
||||
bool Uninitialize(); // clean up the place.
|
||||
// set the time out for a http query
|
||||
void SetTimeOut(int iTimeout){m_iTimeOut = iTimeout;};
|
||||
// get the timeout in second for a query
|
||||
int GetTimeOut(){return m_iTimeOut;};
|
||||
// get the file and write it into a buffer
|
||||
// (stdout if szFileBuf is NULL)
|
||||
int GetWebFile(const char *szURL,const char *szFileBuf = NULL);
|
||||
private:
|
||||
bool ParseURL(const char *szURL,_urlinfo *UrlInfo);
|
||||
// create a http GET request
|
||||
char *MakeRequest(char *szBuffer,const char *szFile,const char *szHost);
|
||||
void PrintError(const char *szError);// print the last error encountered
|
||||
bool m_bInitialised; // initialisation flag
|
||||
int m_iTimeOut; // Time out value in second for a query
|
||||
};
|
||||
|
||||
#endif //_HTTPCONFIG_H_
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// GSMASTERSERVERCLIENT.RC2 - resources Microsoft Visual C++ does not edit directly
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#error this file is not editable by Microsoft Visual C++
|
||||
#endif //APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Add manually edited resources here...
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
@@ -0,0 +1,53 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Developer Studio generated include file.
|
||||
// Used by gsMasterServerClient.rc
|
||||
//
|
||||
#define IDD_GSMASTERSERVERCLIENT_DIALOG 102
|
||||
#define IDP_SOCKETS_INIT_FAILED 103
|
||||
#define IDR_MAINFRAME 128
|
||||
#define IDD_DIALOGAddScores 129
|
||||
#define IDC_EDITGameName 1001
|
||||
#define IDC_BUTTONRequest 1002
|
||||
#define IDC_BUTTONJoin 1003
|
||||
#define IDEXIT 1004
|
||||
#define IDC_EDITServerIP 1005
|
||||
#define IDC_EDITPort 1006
|
||||
#define IDC_EDITUsername 1008
|
||||
#define IDC_EDITPassword 1009
|
||||
#define IDC_EDITVersion 1010
|
||||
#define IDC_BUTTONInitialize 1011
|
||||
#define IDC_LISTGameServers 1014
|
||||
#define IDC_BUTTONLeave 1015
|
||||
#define IDC_BUTTONUninitialize 1016
|
||||
#define IDC_EDITGamePassword 1017
|
||||
#define IDC_BUTTONDownload 1018
|
||||
#define IDC_BUTTONAbout 1019
|
||||
#define IDC_BUTTONRefresh 1020
|
||||
#define IDC_EDITServerID 1021
|
||||
#define IDC_EDITLobbyID 1021
|
||||
#define IDC_EDITMatchID 1022
|
||||
#define IDC_BUTTONinit 1023
|
||||
#define IDC_EDITRoomID 1024
|
||||
#define IDC_EDITFieldID 1025
|
||||
#define IDC_EDITFieldValue 1026
|
||||
#define IDC_BUTTONSet 1027
|
||||
#define IDC_BUTTONSubmit 1028
|
||||
#define IDC_BUTTONUninit 1029
|
||||
#define IDC_BUTTONFinished 1030
|
||||
#define IDC_BUTTONScores 1031
|
||||
#define IDC_BUTTONJoinID 1032
|
||||
#define IDC_BUTTONGetAlt 1033
|
||||
#define IDC_BUTTONStartMatch 1034
|
||||
#define IDC_BUTTONConnected 1035
|
||||
#define IDC_BUTTON_GETMOTD 1036
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 131
|
||||
#define _APS_NEXT_COMMAND_VALUE 32771
|
||||
#define _APS_NEXT_CONTROL_VALUE 1036
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,20 @@
|
||||
[Launcher]
|
||||
ConnectURL=http://gsconnect.ubisoft.com/gsinit.php?user=%s&dp=%s
|
||||
Username=user10
|
||||
Password=testtest
|
||||
Version=RSPC1.0
|
||||
Gamename=RAVENSHIELD
|
||||
ServerIP=
|
||||
ServerPort=
|
||||
|
||||
[GameServer]
|
||||
Name=Test Server
|
||||
Type=1
|
||||
MaxPlayers=4
|
||||
MaxVisitors=0
|
||||
Password=
|
||||
GroupData=123
|
||||
GameData=456
|
||||
GameVersion=1.0
|
||||
GSVersion=2.0
|
||||
GamePort=6667
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,66 @@
|
||||
// Registry.h: interface for the CRegistry class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_REGISTRY_H__E7B8045A_B6E3_11D2_AF1A_00105A9F8688__INCLUDED_)
|
||||
#define AFX_REGISTRY_H__E7B8045A_B6E3_11D2_AF1A_00105A9F8688__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#ifndef UBI_CREGISTRY_NAMEBUFFERSIZE
|
||||
#define UBI_CREGISTRY_NAMEBUFFERSIZE _MAX_PATH+1
|
||||
#endif // UBI_CREGISTRY_NAMEBUFFERSIZE
|
||||
|
||||
#include "StdAfx.h"
|
||||
#include "GSTypes.h"
|
||||
|
||||
|
||||
/*#ifdef WITHIN_THE_GLOBJECTLIB_PROJECT
|
||||
class __declspec(dllexport) CRegistry
|
||||
#else // WITHIN_THE_GLOBJECTLIB_PROJECT
|
||||
class __declspec(dllimport) CRegistry : public CObject
|
||||
#endif // WITHIN_THE_GLOBJECTLIB_PROJECT
|
||||
*/
|
||||
class CRegistry : public CObject
|
||||
{
|
||||
public:
|
||||
CRegistry();
|
||||
CRegistry(HKEY hKey, LPCTSTR lpszPath, GSbool bShouldCreateKeyIfNotExist = GS_TRUE, REGSAM samSecurity = KEY_ALL_ACCESS);
|
||||
virtual ~CRegistry();
|
||||
|
||||
GSbool CreateKey(DWORD dwOptions = REG_OPTION_NON_VOLATILE);
|
||||
GSbool DeleteKey();
|
||||
GSbool OpenKey();
|
||||
GSbool CloseKey();
|
||||
GSbool DoesKeyExist();
|
||||
|
||||
HKEY SetRootKey(HKEY hRootKey = HKEY_LOCAL_MACHINE);
|
||||
CString SetPath(LPCTSTR lpszPath = "");
|
||||
REGSAM SetSecurity(REGSAM samSecurity = KEY_ALL_ACCESS);
|
||||
GSvoid SetShouldCreateKeyIfNotExist(GSbool bShouldCreateKeyIfNotExist = GS_TRUE);
|
||||
|
||||
GSbool ReadBinary(LPCTSTR lpszValueName, LPVOID lpBuffer, GSuint uiBufferSize);
|
||||
GSbool ReadDWord (LPCTSTR lpszValueName, LPDWORD lpBuffer);
|
||||
GSbool ReadString(LPCTSTR lpszValueName, CString* pcsBuffer);
|
||||
GSbool EnumKeys(CStringList* pcslKeys);
|
||||
|
||||
GSbool WriteBinary(LPCTSTR lpszValueName, LPVOID lpBuffer, GSuint uiBufferSize);
|
||||
GSbool WriteDWord (LPCTSTR lpszValueName, DWORD dwBuffer);
|
||||
GSbool WriteString(LPCTSTR lpszValueName, LPCTSTR lpszBuffer);
|
||||
|
||||
GSbool DeleteValue(LPCTSTR lpszValueName);
|
||||
GSbool DeleteKeyValues();
|
||||
|
||||
protected:
|
||||
CString m_csPath; // Subpath within the root key
|
||||
HKEY m_hRootKey; // Root registry key
|
||||
HKEY m_hKey; // Handle to current key
|
||||
REGSAM m_samSecurity; // Security descriptor (access-rights specifier)
|
||||
|
||||
GSbool m_bShouldCreateKeyIfNotExist; // Flag indicating if key should be created if don't exist when it is to be opened
|
||||
GSbool m_bKeyOpen; // Flag indicating wether or not the current key is open
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_REGISTRY_H__E7B8045A_B6E3_11D2_AF1A_00105A9F8688__INCLUDED_)
|
||||
@@ -0,0 +1,8 @@
|
||||
// stdafx.cpp : source file that includes just the standard includes
|
||||
// gsMasterServerLauncher.pch will be the pre-compiled header
|
||||
// stdafx.obj will contain the pre-compiled type information
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
// stdafx.h : include file for standard system include files,
|
||||
// or project specific include files that are used frequently, but
|
||||
// are changed infrequently
|
||||
//
|
||||
|
||||
#if !defined(AFX_STDAFX_H__E36B1790_5E25_4E93_A566_09817115937D__INCLUDED_)
|
||||
#define AFX_STDAFX_H__E36B1790_5E25_4E93_A566_09817115937D__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
|
||||
|
||||
#include <afxwin.h> // MFC core and standard components
|
||||
#include <afxext.h> // MFC extensions
|
||||
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
|
||||
#ifndef _AFX_NO_AFXCMN_SUPPORT
|
||||
#include <afxcmn.h> // MFC support for Windows Common Controls
|
||||
#endif // _AFX_NO_AFXCMN_SUPPORT
|
||||
|
||||
#include <afxsock.h> // MFC socket extensions
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_STDAFX_H__E36B1790_5E25_4E93_A566_09817115937D__INCLUDED_)
|
||||
@@ -0,0 +1,112 @@
|
||||
// gsMasterServerLauncher.cpp : Defines the class behaviors for the application.
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "gsMasterServerLauncher.h"
|
||||
#include "gsMasterServerLauncherDlg.h"
|
||||
|
||||
#include "GSTypes.h"
|
||||
#include "InitSockets.h"
|
||||
#include "define.h"
|
||||
|
||||
|
||||
//UBI.COM: These functions are called by the GSlibraries to allocate/free memory
|
||||
extern "C"{
|
||||
void * __stdcall ExtAlloc_Malloc(int iSize)
|
||||
{
|
||||
return malloc(iSize);
|
||||
}
|
||||
|
||||
void __stdcall ExtAlloc_Free(void * ptr)
|
||||
{
|
||||
free(ptr);
|
||||
}
|
||||
void * __stdcall ExtAlloc_Realloc(void * ptr,int iSize)
|
||||
{
|
||||
return realloc( ptr, iSize);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//UBI.COM: The GSLibraries are not thread safe. This mutex will stop us from
|
||||
// calling into the library twice at the same time
|
||||
HANDLE g_Mutex;
|
||||
|
||||
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CGsMasterServerLauncherApp
|
||||
|
||||
BEGIN_MESSAGE_MAP(CGsMasterServerLauncherApp, CWinApp)
|
||||
//{{AFX_MSG_MAP(CGsMasterServerLauncherApp)
|
||||
// NOTE - the ClassWizard will add and remove mapping macros here.
|
||||
// DO NOT EDIT what you see in these blocks of generated code!
|
||||
//}}AFX_MSG
|
||||
ON_COMMAND(ID_HELP, CWinApp::OnHelp)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CGsMasterServerLauncherApp construction
|
||||
|
||||
CGsMasterServerLauncherApp::CGsMasterServerLauncherApp()
|
||||
{
|
||||
// TODO: add construction code here,
|
||||
// Place all significant initialization in InitInstance
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// The one and only CGsMasterServerLauncherApp object
|
||||
|
||||
CGsMasterServerLauncherApp theApp;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CGsMasterServerLauncherApp initialization
|
||||
|
||||
BOOL CGsMasterServerLauncherApp::InitInstance()
|
||||
{
|
||||
if (!AfxSocketInit())
|
||||
{
|
||||
AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Standard initialization
|
||||
// If you are not using these features and wish to reduce the size
|
||||
// of your final executable, you should remove from the following
|
||||
// the specific initialization routines you do not need.
|
||||
|
||||
#ifdef _AFXDLL
|
||||
Enable3dControls(); // Call this when using MFC in a shared DLL
|
||||
#else
|
||||
Enable3dControlsStatic(); // Call this when linking to MFC statically
|
||||
#endif
|
||||
|
||||
|
||||
//UBI.COM: Initialize the Socket library. InitializeSockets will return the
|
||||
// local IPAddress that is found.
|
||||
GSchar szIPAddress[IPADDRESSLENGTH]="";
|
||||
|
||||
g_Mutex = CreateMutex(NULL,false,NULL);
|
||||
LOCKMUTEX();
|
||||
InitializeSockets(szIPAddress);
|
||||
UNLOCKMUTEX();
|
||||
|
||||
CGsMasterServerLauncherDlg dlg;
|
||||
m_pMainWnd = &dlg;
|
||||
int nResponse = dlg.DoModal();
|
||||
|
||||
//UBI.COM: Uninitialize the socket library and exit the program
|
||||
LOCKMUTEX();
|
||||
UninitializeSockets();
|
||||
UNLOCKMUTEX();
|
||||
|
||||
// Since the dialog has been closed, return FALSE so that we exit the
|
||||
// application, rather than start the application's message pump.
|
||||
return FALSE;
|
||||
}
|
||||
@@ -0,0 +1,162 @@
|
||||
# Microsoft Developer Studio Project File - Name="gsMasterServerLauncher" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Application" 0x0101
|
||||
|
||||
CFG=gsMasterServerLauncher - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "gsMasterServerLauncher.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "gsMasterServerLauncher.mak" CFG="gsMasterServerLauncher - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "gsMasterServerLauncher - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "gsMasterServerLauncher - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""$/GSServices/tools-gui/gs-masterserverlauncher", MOGEAAAA"
|
||||
# PROP Scc_LocalPath "."
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "gsMasterServerLauncher - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 5
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 5
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /Yu"stdafx.h" /FD /c
|
||||
# ADD CPP /nologo /Gz /MT /W3 /GX /O2 /I "../../sdks/gs-sdk-base/include" /I "../../sdks/gs-sdk-common/include" /I "../../sdks/gs-sdk-regserver/include" /I "../../sdks/versions" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "GS_WIN32" /D "_STLP_NO_IOSTREAMS" /D "DEFVER_LIBGSSOCKET" /D "DEFVER_LIBGSUTILITY" /D "DEFVER_LIBGSCONNECT" /D "DEFVER_LIBGSREGSERVER" /FD /c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x1009 /d "NDEBUG"
|
||||
# ADD RSC /l 0x1009 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386
|
||||
# ADD LINK32 libgssocket.lib libgsutility.lib libgsconnect.lib libgsregserver.lib libgscrypto.lib Ws2_32.lib /nologo /subsystem:windows /machine:I386 /libpath:"../../sdks/gs-sdk-http/lib_win32" /libpath:"../../sdks/gs-sdk-common/lib_win32" /libpath:"../../sdks/gs-sdk-regserver/lib_win32"
|
||||
|
||||
!ELSEIF "$(CFG)" == "gsMasterServerLauncher - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 5
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 5
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /Yu"stdafx.h" /FD /GZ /c
|
||||
# ADD CPP /nologo /Gz /MTd /W3 /Gm /GX /ZI /Od /I "../../sdks/gs-sdk-base/include" /I "../../sdks/gs-sdk-common/include" /I "../../sdks/gs-sdk-regserver/include" /I "../../sdks/versions" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "GS_WIN32" /D "_STLP_NO_IOSTREAMS" /D "DEFVER_LIBGSSOCKET" /D "DEFVER_LIBGSUTILITY" /D "DEFVER_LIBGSCONNECT" /D "DEFVER_LIBGSREGSERVER" /FD /GZ /c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x1009 /d "_DEBUG"
|
||||
# ADD RSC /l 0x1009 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 libgssocket_debug.lib libgsutility_debug.lib libgsconnect_debug.lib libgscrypto_debug.lib libgsregserver_debug.lib Ws2_32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept /libpath:"../../sdks/gs-sdk-http/lib_win32" /libpath:"../../sdks/gs-sdk-common/lib_win32" /libpath:"../../sdks/gs-sdk-regserver/lib_win32"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "gsMasterServerLauncher - Win32 Release"
|
||||
# Name "gsMasterServerLauncher - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\gsMasterServerLauncher.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\gsMasterServerLauncher.rc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\gsMasterServerLauncherDlg.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Registry.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\StdAfx.cpp
|
||||
# ADD CPP /Yc"stdafx.h"
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\gsMasterServerLauncher.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\gsMasterServerLauncherDlg.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Registry.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Resource.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\StdAfx.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\gsMasterServerLauncher.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\gsMasterServerLauncher.rc2
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Launcher.ini
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ReadMe.txt
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
||||
@@ -0,0 +1,53 @@
|
||||
// gsMasterServerLauncher.h : main header file for the GSMASTERSERVERLAUNCHER application
|
||||
//
|
||||
|
||||
#if !defined(AFX_GSMASTERSERVERLAUNCHER_H__D07D2F27_AD98_4851_A9F7_AF54CD40648E__INCLUDED_)
|
||||
#define AFX_GSMASTERSERVERLAUNCHER_H__D07D2F27_AD98_4851_A9F7_AF54CD40648E__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#ifndef __AFXWIN_H__
|
||||
#error include 'stdafx.h' before including this file for PCH
|
||||
#endif
|
||||
|
||||
#include "resource.h" // main symbols
|
||||
#include "GSTypes.h"
|
||||
//UBI.COM: Macros to help with locking the Mutex defined in gsMasterServerLauncher.cpp
|
||||
#define LOCKMUTEX() WaitForSingleObject(g_Mutex,INFINITE)
|
||||
#define UNLOCKMUTEX() ReleaseMutex(g_Mutex)
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CGsMasterServerLauncherApp:
|
||||
// See gsMasterServerLauncher.cpp for the implementation of this class
|
||||
//
|
||||
|
||||
class CGsMasterServerLauncherApp : public CWinApp
|
||||
{
|
||||
public:
|
||||
CGsMasterServerLauncherApp();
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CGsMasterServerLauncherApp)
|
||||
public:
|
||||
virtual BOOL InitInstance();
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
|
||||
//{{AFX_MSG(CGsMasterServerLauncherApp)
|
||||
// NOTE - the ClassWizard will add and remove member functions here.
|
||||
// DO NOT EDIT what you see in these blocks of generated code !
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_GSMASTERSERVERLAUNCHER_H__D07D2F27_AD98_4851_A9F7_AF54CD40648E__INCLUDED_)
|
||||
@@ -0,0 +1,274 @@
|
||||
//Microsoft Developer Studio generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "afxres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.S.) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
IDD_GSMASTERSERVERLAUNCHER_DIALOG DIALOGEX 0, 0, 362, 285
|
||||
STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION |
|
||||
WS_SYSMENU
|
||||
EXSTYLE WS_EX_APPWINDOW
|
||||
CAPTION "gsMasterServerLauncher"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
EDITTEXT IDC_EDITIPAddress,46,7,61,14,ES_AUTOHSCROLL
|
||||
EDITTEXT IDC_EDITPort,46,29,40,14,ES_AUTOHSCROLL
|
||||
EDITTEXT IDC_EDITUsername,150,7,40,14,ES_AUTOHSCROLL
|
||||
EDITTEXT IDC_EDITPassword,150,29,40,14,ES_AUTOHSCROLL
|
||||
EDITTEXT IDC_EDITVersion,244,7,40,14,ES_AUTOHSCROLL
|
||||
EDITTEXT IDC_EDITGameName,244,29,55,14,ES_AUTOHSCROLL
|
||||
PUSHBUTTON "Download Info",IDC_BUTTONDownload,301,7,53,14
|
||||
PUSHBUTTON "Login",IDC_BUTTONLogin,7,49,50,14
|
||||
PUSHBUTTON "Disconnect",IDC_BUTTONDisconnect,70,49,50,14
|
||||
PUSHBUTTON "Request Groups",IDC_BUTTONReqGroups,242,49,57,14
|
||||
CONTROL "List1",IDC_LISTGroups,"SysListView32",LVS_REPORT |
|
||||
LVS_SINGLESEL | WS_BORDER | WS_TABSTOP,7,105,164,178
|
||||
EDITTEXT IDC_EDITServerName,223,73,97,14,ES_AUTOHSCROLL
|
||||
COMBOBOX IDC_COMBOServerType,223,92,96,95,CBS_DROPDOWNLIST |
|
||||
CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
|
||||
EDITTEXT IDC_EDITMaxPlayers,223,109,40,14,ES_AUTOHSCROLL
|
||||
EDITTEXT IDC_EDITMaxVisitors,223,126,40,14,ES_AUTOHSCROLL
|
||||
EDITTEXT IDC_EDITGamePassword,223,146,40,14,ES_AUTOHSCROLL
|
||||
EDITTEXT IDC_EDITGrpData,223,166,40,14,ES_AUTOHSCROLL
|
||||
EDITTEXT IDC_EDITGameData,223,185,40,14,ES_AUTOHSCROLL
|
||||
EDITTEXT IDC_EDITGameVersion,223,222,40,14,ES_AUTOHSCROLL
|
||||
EDITTEXT IDC_EDITGSVersion,223,240,40,14,ES_AUTOHSCROLL
|
||||
PUSHBUTTON "Register Server",IDC_BUTTONRegServer,297,161,57,14
|
||||
PUSHBUTTON "Terminate Server",IDC_BUTTONTermServer,297,179,57,14
|
||||
PUSHBUTTON "Update Server",IDC_BUTTONUpdate,297,196,57,14
|
||||
PUSHBUTTON "Exit",IDOK,297,269,57,14
|
||||
LTEXT "IP Address:",IDC_STATIC,7,13,37,8
|
||||
LTEXT "Port:",IDC_STATIC,7,35,16,8
|
||||
LTEXT "Username:",IDC_STATIC,110,13,35,8
|
||||
LTEXT "Password:",IDC_STATIC,110,35,34,8
|
||||
LTEXT "Version:",IDC_STATIC,196,13,26,8
|
||||
LTEXT "Game Name:",IDC_STATIC,196,35,42,8
|
||||
EDITTEXT IDC_EDITExtIP,188,49,40,14,ES_AUTOHSCROLL | ES_READONLY
|
||||
LTEXT "External IP:",IDC_STATIC,142,53,37,8
|
||||
LTEXT "Server Name:",IDC_STATIC,175,77,44,8
|
||||
LTEXT "Server Type:",IDC_STATIC,175,96,42,8
|
||||
LTEXT "Max Players:",IDC_STATIC,175,115,41,8
|
||||
LTEXT "Max Visitors",IDC_STATIC,175,132,38,8
|
||||
LTEXT "Password:",IDC_STATIC,175,152,34,8
|
||||
LTEXT "Group Data:",IDC_STATIC,175,172,40,8
|
||||
LTEXT "Game Data:",IDC_STATIC,175,191,39,8
|
||||
LTEXT "Game Version:",IDC_STATIC,175,228,47,8
|
||||
LTEXT "GS Version:",IDC_STATIC,175,246,38,8
|
||||
LTEXT "Group ID:",IDC_STATIC,267,115,32,8
|
||||
EDITTEXT IDC_EDITGroupID,303,109,51,14,ES_AUTOHSCROLL |
|
||||
WS_DISABLED
|
||||
LTEXT "Lobby IP:",IDC_STATIC,267,132,31,8
|
||||
EDITTEXT IDC_EDITLobbyIP,303,126,51,14,ES_AUTOHSCROLL |
|
||||
WS_DISABLED
|
||||
LTEXT "Lobby Port:",IDC_STATIC,269,149,38,8
|
||||
EDITTEXT IDC_EDITLobbyPort,314,144,40,14,ES_AUTOHSCROLL |
|
||||
WS_DISABLED
|
||||
PUSHBUTTON "About",IDC_BUTTONAbout,314,29,40,14
|
||||
LTEXT "Game Port:",IDC_STATIC,176,262,36,8
|
||||
EDITTEXT IDC_EDITGamePort,223,256,40,14,ES_AUTOHSCROLL
|
||||
PUSHBUTTON "Start Match",IDC_BUTTONStartMatch,297,212,57,14
|
||||
PUSHBUTTON "Finish Match",IDC_BUTTONFinishMatch,297,229,57,14
|
||||
EDITTEXT IDC_EDITAltData,223,204,40,14,ES_AUTOHSCROLL
|
||||
LTEXT "Alt Data:",IDC_STATIC,175,210,28,8
|
||||
END
|
||||
|
||||
|
||||
#ifndef _MAC
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,0,0,1
|
||||
PRODUCTVERSION 1,0,0,1
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x4L
|
||||
FILETYPE 0x1L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904B0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "\0"
|
||||
VALUE "FileDescription", "gsMasterServerLauncher MFC Application\0"
|
||||
VALUE "FileVersion", "1, 0, 0, 1\0"
|
||||
VALUE "InternalName", "gsMasterServerLauncher\0"
|
||||
VALUE "LegalCopyright", "Copyright (C) 2002\0"
|
||||
VALUE "LegalTrademarks", "\0"
|
||||
VALUE "OriginalFilename", "gsMasterServerLauncher.EXE\0"
|
||||
VALUE "ProductName", "gsMasterServerLauncher Application\0"
|
||||
VALUE "ProductVersion", "1, 0, 0, 1\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
|
||||
#endif // !_MAC
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DESIGNINFO
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
GUIDELINES DESIGNINFO DISCARDABLE
|
||||
BEGIN
|
||||
IDD_GSMASTERSERVERLAUNCHER_DIALOG, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 354
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 283
|
||||
END
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog Info
|
||||
//
|
||||
|
||||
IDD_GSMASTERSERVERLAUNCHER_DIALOG DLGINIT
|
||||
BEGIN
|
||||
IDC_COMBOServerType, 0x403, 17, 0
|
||||
0x5948, 0x5242, 0x4449, 0x445f, 0x4445, 0x4349, 0x5441, 0x4445, "\000"
|
||||
IDC_COMBOServerType, 0x403, 25, 0
|
||||
0x4255, 0x5f49, 0x4c43, 0x4549, 0x544e, 0x4f48, 0x5453, 0x445f, 0x4445,
|
||||
0x4349, 0x5441, 0x4445, "\000"
|
||||
IDC_COMBOServerType, 0x403, 25, 0
|
||||
0x4255, 0x5f49, 0x4147, 0x454d, 0x4553, 0x5652, 0x5245, 0x445f, 0x4445,
|
||||
0x4349, 0x5441, 0x4445, "\000"
|
||||
0
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// String Table
|
||||
//
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDP_SOCKETS_INIT_FAILED "Windows sockets initialization failed."
|
||||
END
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (Canada) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENC)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_CAN
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#include ""afxres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#define _AFX_NO_SPLITTER_RESOURCES\r\n"
|
||||
"#define _AFX_NO_OLE_RESOURCES\r\n"
|
||||
"#define _AFX_NO_TRACKER_RESOURCES\r\n"
|
||||
"#define _AFX_NO_PROPERTY_RESOURCES\r\n"
|
||||
"\r\n"
|
||||
"#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
|
||||
"#ifdef _WIN32\r\n"
|
||||
"LANGUAGE 9, 1\r\n"
|
||||
"#pragma code_page(1252)\r\n"
|
||||
"#endif //_WIN32\r\n"
|
||||
"#include ""res\\gsMasterServerLauncher.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
|
||||
"#include ""afxres.rc"" // Standard components\r\n"
|
||||
"#endif\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Icon
|
||||
//
|
||||
|
||||
// Icon with lowest ID value placed first to ensure application icon
|
||||
// remains consistent on all systems.
|
||||
IDR_MAINFRAME ICON DISCARDABLE "res\\gsMasterServerLauncher.ico"
|
||||
#endif // English (Canada) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
#define _AFX_NO_SPLITTER_RESOURCES
|
||||
#define _AFX_NO_OLE_RESOURCES
|
||||
#define _AFX_NO_TRACKER_RESOURCES
|
||||
#define _AFX_NO_PROPERTY_RESOURCES
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE 9, 1
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
#include "res\gsMasterServerLauncher.rc2" // non-Microsoft Visual C++ edited resources
|
||||
#include "afxres.rc" // Standard components
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
@@ -0,0 +1,829 @@
|
||||
// gsMasterServerLauncherDlg.cpp : implementation file
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "gsMasterServerLauncher.h"
|
||||
#include "gsMasterServerLauncherDlg.h"
|
||||
//#include "GSHttpInterface.h"
|
||||
#include "wininet.h"
|
||||
#include "define.h"
|
||||
#include "LobbyDefines.h"
|
||||
#include "Registry.h"
|
||||
|
||||
extern HANDLE g_Mutex;
|
||||
bool g_bRun = GS_TRUE;
|
||||
|
||||
#include "version_manager.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
//UBI.COM: This thread just calls the Launcher_Engine function. We do have to
|
||||
// make sure no to call it at the same time as one of the other functions,
|
||||
// therefore we use a Mutex.
|
||||
DWORD ThreadEngine(void* pArg)
|
||||
{
|
||||
CGsMasterServerLauncherDlg *pDlg = (CGsMasterServerLauncherDlg*)pArg;
|
||||
while (true)
|
||||
{
|
||||
Sleep(10);
|
||||
LOCKMUTEX();
|
||||
pDlg->RegServer_Engine();
|
||||
UNLOCKMUTEX();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CGsMasterServerLauncherDlg dialog
|
||||
|
||||
CGsMasterServerLauncherDlg::CGsMasterServerLauncherDlg(CWnd* pParent /*=NULL*/)
|
||||
: CDialog(CGsMasterServerLauncherDlg::IDD, pParent)
|
||||
{
|
||||
//{{AFX_DATA_INIT(CGsMasterServerLauncherDlg)
|
||||
//}}AFX_DATA_INIT
|
||||
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
|
||||
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
|
||||
|
||||
m_iNbrGroups = 0;
|
||||
m_bLoggedIn = false;
|
||||
}
|
||||
|
||||
CGsMasterServerLauncherDlg::~CGsMasterServerLauncherDlg()
|
||||
{
|
||||
//UBI.COM: Stop the thread from calling Launcher_Engine;
|
||||
LOCKMUTEX();
|
||||
//RegServerLibrary_Uninitialize();
|
||||
}
|
||||
|
||||
void CGsMasterServerLauncherDlg::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CGsMasterServerLauncherDlg)
|
||||
DDX_Control(pDX, IDC_EDITAltData, m_editAltData);
|
||||
DDX_Control(pDX, IDC_EDITGamePort, m_editGamePort);
|
||||
DDX_Control(pDX, IDC_EDITLobbyPort, m_editLobbyPort);
|
||||
DDX_Control(pDX, IDC_EDITLobbyIP, m_editLobbyIP);
|
||||
DDX_Control(pDX, IDC_EDITGroupID, m_editGroupID);
|
||||
DDX_Control(pDX, IDC_EDITServerName, m_editServerName);
|
||||
DDX_Control(pDX, IDC_EDITMaxVisitors, m_editMaxVisitors);
|
||||
DDX_Control(pDX, IDC_EDITMaxPlayers, m_editMaxPlayers);
|
||||
DDX_Control(pDX, IDC_EDITGSVersion, m_editGSVersion);
|
||||
DDX_Control(pDX, IDC_EDITGrpData, m_editGrpData);
|
||||
DDX_Control(pDX, IDC_EDITGameVersion, m_editGameVersion);
|
||||
DDX_Control(pDX, IDC_EDITGamePassword, m_editGamePassword);
|
||||
DDX_Control(pDX, IDC_EDITGameData, m_editGameData);
|
||||
DDX_Control(pDX, IDC_COMBOServerType, m_cboServerType);
|
||||
DDX_Control(pDX, IDC_LISTGroups, m_listGroups);
|
||||
DDX_Control(pDX, IDC_EDITExtIP, m_editExtIP);
|
||||
DDX_Control(pDX, IDC_EDITVersion, m_editVersion);
|
||||
DDX_Control(pDX, IDC_EDITUsername, m_editUsername);
|
||||
DDX_Control(pDX, IDC_EDITPort, m_editPort);
|
||||
DDX_Control(pDX, IDC_EDITPassword, m_editPassword);
|
||||
DDX_Control(pDX, IDC_EDITIPAddress, m_editIPAddress);
|
||||
DDX_Control(pDX, IDC_EDITGameName, m_editGamename);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
BEGIN_MESSAGE_MAP(CGsMasterServerLauncherDlg, CDialog)
|
||||
//{{AFX_MSG_MAP(CGsMasterServerLauncherDlg)
|
||||
ON_WM_PAINT()
|
||||
ON_WM_QUERYDRAGICON()
|
||||
ON_BN_CLICKED(IDC_BUTTONLogin, OnBUTTONLogin)
|
||||
ON_BN_CLICKED(IDC_BUTTONReqGroups, OnBUTTONReqGroups)
|
||||
ON_BN_CLICKED(IDC_BUTTONRegServer, OnBUTTONRegServer)
|
||||
ON_BN_CLICKED(IDC_BUTTONTermServer, OnBUTTONTermServer)
|
||||
ON_BN_CLICKED(IDC_BUTTONDisconnect, OnBUTTONDisconnect)
|
||||
ON_BN_CLICKED(IDC_BUTTONUpdate, OnBUTTONUpdate)
|
||||
ON_BN_CLICKED(IDC_BUTTONDownload, OnBUTTONDownload)
|
||||
ON_BN_CLICKED(IDC_BUTTONAbout, OnBUTTONAbout)
|
||||
ON_BN_CLICKED(IDC_BUTTONStartMatch, OnBUTTONStartMatch)
|
||||
ON_BN_CLICKED(IDC_BUTTONFinishMatch, OnBUTTONFinishMatch)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CGsMasterServerLauncherDlg message handlers
|
||||
|
||||
BOOL CGsMasterServerLauncherDlg::OnInitDialog()
|
||||
{
|
||||
CDialog::OnInitDialog();
|
||||
|
||||
// Set the icon for this dialog. The framework does this automatically
|
||||
// when the application's main window is not a dialog
|
||||
SetIcon(m_hIcon, TRUE); // Set big icon
|
||||
SetIcon(m_hIcon, FALSE); // Set small icon
|
||||
|
||||
// TODO: Add extra initialization here
|
||||
|
||||
//UBI.COM: Initialize the library
|
||||
//RegServerLibrary_Initialize();
|
||||
|
||||
char szUsername[NICKNAMELENGTH],szGamename[GAMELENGTH],szPassword[PASSWORDLENGTH];
|
||||
char szVersion[VERSIONLENGTH];
|
||||
char szServerIP[IPADDRESSLENGTH],szServerPort[100];
|
||||
|
||||
char szDirectory[1024];
|
||||
GetCurrentDirectory(1024,szDirectory);
|
||||
|
||||
CString csLauncherIniFile = szDirectory;
|
||||
csLauncherIniFile += "\\Launcher.ini";
|
||||
|
||||
GetPrivateProfileString("Launcher","Username",
|
||||
"user10",szUsername,NICKNAMELENGTH,csLauncherIniFile);
|
||||
GetPrivateProfileString("Launcher","Gamename",
|
||||
"GHOSTRECON",szGamename,GAMELENGTH,csLauncherIniFile);
|
||||
GetPrivateProfileString("Launcher","Password",
|
||||
"testtest",szPassword,PASSWORDLENGTH,csLauncherIniFile);
|
||||
GetPrivateProfileString("Launcher","Version",
|
||||
"PC4.2",szVersion,VERSIONLENGTH,csLauncherIniFile);
|
||||
GetPrivateProfileString("Launcher","ServerIP",
|
||||
"",szServerIP,IPADDRESSLENGTH,csLauncherIniFile);
|
||||
GetPrivateProfileString("Launcher","ServerPort",
|
||||
"",szServerPort,100,csLauncherIniFile);
|
||||
|
||||
m_editGamename.SetWindowText(szGamename);
|
||||
m_editIPAddress.SetWindowText(szServerIP);
|
||||
m_editPassword.SetWindowText(szPassword);
|
||||
m_editPort.SetWindowText(szServerPort);
|
||||
m_editVersion.SetWindowText(szVersion);
|
||||
m_editUsername.SetWindowText(szUsername);
|
||||
|
||||
char szServerName[NAMELENGTH],szMaxPlayers[100],szMaxVisitors[100];
|
||||
int iServerType;
|
||||
char szGamePassword[PASSWORDLENGTH],szGroupData[100];
|
||||
char szGameData[100],szGameVersion[VERSIONLENGTH];
|
||||
char szGSVersion[VERSIONLENGTH];
|
||||
char szGamePort[100];
|
||||
|
||||
GetPrivateProfileString("GameServer","Name",
|
||||
"Test Server",szServerName,NAMELENGTH,csLauncherIniFile);
|
||||
iServerType = GetPrivateProfileInt("GameServer","Type",
|
||||
0,csLauncherIniFile);
|
||||
GetPrivateProfileString("GameServer","MaxPlayers",
|
||||
"4",szMaxPlayers,100,csLauncherIniFile);
|
||||
GetPrivateProfileString("GameServer","MaxVisitors",
|
||||
"0",szMaxVisitors,100,csLauncherIniFile);
|
||||
GetPrivateProfileString("GameServer","Password",
|
||||
"",szGamePassword,PASSWORDLENGTH,csLauncherIniFile);
|
||||
GetPrivateProfileString("GameServer","GroupData",
|
||||
"123",szGroupData,100,csLauncherIniFile);
|
||||
GetPrivateProfileString("GameServer","GameData",
|
||||
"456",szGameData,100,csLauncherIniFile);
|
||||
GetPrivateProfileString("GameServer","GameVersion",
|
||||
"1.0",szGameVersion,VERSIONLENGTH,csLauncherIniFile);
|
||||
GetPrivateProfileString("GameServer","GSVersion",
|
||||
"2.0",szGSVersion,VERSIONLENGTH,csLauncherIniFile);
|
||||
GetPrivateProfileString("GameServer","GamePort",
|
||||
"6667",szGamePort,100,csLauncherIniFile);
|
||||
|
||||
|
||||
m_editServerName.SetWindowText(szServerName);
|
||||
m_cboServerType.SetCurSel(iServerType);
|
||||
m_editMaxPlayers.SetWindowText(szMaxPlayers);
|
||||
m_editMaxVisitors.SetWindowText(szMaxVisitors);
|
||||
m_editGamePassword.SetWindowText(szGamePassword);
|
||||
m_editGrpData.SetWindowText(szGroupData);
|
||||
m_editGameData.SetWindowText(szGameData);
|
||||
m_editGameVersion.SetWindowText(szGameVersion);
|
||||
m_editGSVersion.SetWindowText(szGSVersion);
|
||||
m_editGamePort.SetWindowText(szGamePort);
|
||||
|
||||
|
||||
m_listGroups.InsertColumn(0,"Server ID",LVCFMT_LEFT,60);
|
||||
m_listGroups.InsertColumn(1,"Group ID",LVCFMT_LEFT,60);
|
||||
m_listGroups.InsertColumn(2,"Group Name",LVCFMT_LEFT,75);
|
||||
m_listGroups.InsertColumn(3,"Players",LVCFMT_LEFT,47);
|
||||
m_listGroups.SetExtendedStyle(LVS_EX_FULLROWSELECT);
|
||||
|
||||
//UBI.COM: Create the thread that keeps calling Launcher_Engine
|
||||
DWORD iThread;
|
||||
CreateThread(NULL,0,ThreadEngine,this,0,&iThread);
|
||||
|
||||
|
||||
return TRUE; // return TRUE unless you set the focus to a control
|
||||
}
|
||||
|
||||
// If you add a minimize button to your dialog, you will need the code below
|
||||
// to draw the icon. For MFC applications using the document/view model,
|
||||
// this is automatically done for you by the framework.
|
||||
|
||||
void CGsMasterServerLauncherDlg::OnPaint()
|
||||
{
|
||||
if (IsIconic())
|
||||
{
|
||||
CPaintDC dc(this); // device context for painting
|
||||
|
||||
SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
|
||||
|
||||
// Center icon in client rectangle
|
||||
int cxIcon = GetSystemMetrics(SM_CXICON);
|
||||
int cyIcon = GetSystemMetrics(SM_CYICON);
|
||||
CRect rect;
|
||||
GetClientRect(&rect);
|
||||
int x = (rect.Width() - cxIcon + 1) / 2;
|
||||
int y = (rect.Height() - cyIcon + 1) / 2;
|
||||
|
||||
// Draw the icon
|
||||
dc.DrawIcon(x, y, m_hIcon);
|
||||
}
|
||||
else
|
||||
{
|
||||
CDialog::OnPaint();
|
||||
}
|
||||
}
|
||||
|
||||
// The system calls this to obtain the cursor to display while the user drags
|
||||
// the minimized window.
|
||||
HCURSOR CGsMasterServerLauncherDlg::OnQueryDragIcon()
|
||||
{
|
||||
return (HCURSOR) m_hIcon;
|
||||
}
|
||||
|
||||
|
||||
//UBI.COM: Receive the LoginRouter result
|
||||
GSvoid CGsMasterServerLauncherDlg::RegServerRcv_LoginRouterResult(GSubyte ucType, GSint lReason,
|
||||
const GSchar *szIPAddress)
|
||||
{
|
||||
if (ucType == GSSUCCESS)
|
||||
{
|
||||
MessageBox("Login Successful");
|
||||
m_editExtIP.SetWindowText(szIPAddress);
|
||||
m_bLoggedIn = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
char szText[100];
|
||||
sprintf(szText,"Login Failed: %i",lReason);
|
||||
MessageBox(szText);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//UBI.COM: Receive a disconnection from the Router
|
||||
GSvoid CGsMasterServerLauncherDlg::RegServerRcv_RouterDisconnection()
|
||||
{
|
||||
MessageBox("Login Disconnected");
|
||||
m_bLoggedIn = false;
|
||||
}
|
||||
|
||||
//UBI.COM: Receive a RegisterServer result
|
||||
GSvoid CGsMasterServerLauncherDlg::RegServerRcv_RegisterServerResult(GSubyte ucType,GSint lReason,
|
||||
GSint iGroupID,const GSchar *szAddress,GSushort usPort,const GSchar *szSessionName)
|
||||
{
|
||||
if (ucType == GSFAIL)
|
||||
{
|
||||
char szText[100];
|
||||
sprintf(szText,"Register Failed: %i",lReason);
|
||||
MessageBox(szText);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int iConfig,iMaxPlayers,iMaxVisitors,iGroupDataSize,iGameDataSize;
|
||||
char szGroupData[100],szGameData[100],szPassword[PASSWORDLENGTH];
|
||||
char szText[100], szUsername[NICKNAMELENGTH];
|
||||
|
||||
MessageBox("Register Server Sucessful");
|
||||
|
||||
m_editGroupID.SetWindowText(ltoa(iGroupID,szText,10));
|
||||
m_editLobbyIP.SetWindowText(szAddress);
|
||||
m_editLobbyPort.SetWindowText(ltoa(usPort,szText,10));
|
||||
m_editServerName.SetWindowText(szSessionName);
|
||||
|
||||
|
||||
iConfig = 0;
|
||||
|
||||
m_editMaxPlayers.GetWindowText(szText,100);
|
||||
iMaxPlayers = atol(szText);
|
||||
|
||||
m_editMaxVisitors.GetWindowText(szText,100);
|
||||
iMaxVisitors = atol(szText);
|
||||
|
||||
m_editGamePassword.GetWindowText(szPassword,100);
|
||||
|
||||
m_editGrpData.GetWindowText(szGroupData,100);
|
||||
iGroupDataSize = strlen(szGroupData) + 1;
|
||||
|
||||
m_editGameData.GetWindowText(szGameData,100);
|
||||
iGameDataSize = strlen(szGameData) + 1;
|
||||
|
||||
m_editUsername.GetWindowText(szUsername,NICKNAMELENGTH);
|
||||
|
||||
LOCKMUTEX();
|
||||
|
||||
if (!RegServerSend_LobbyServerConnection(szAddress, usPort))
|
||||
MessageBox("RegServerSend_LobbyServerConnection failed");
|
||||
else
|
||||
RegServerSend_LobbyServerLogin(szUsername, iGroupID);
|
||||
|
||||
UNLOCKMUTEX();
|
||||
|
||||
}
|
||||
|
||||
//UBI.COM: Receive a TerminateServer Result
|
||||
/*GSvoid CGsMasterServerLauncherDlg::LauncherRcv_TerminateServerResult(GSubyte ucType, GSint lReason)
|
||||
{
|
||||
if (ucType == GSSUCCESS)
|
||||
{
|
||||
MessageBox("Terminate Server Successful");
|
||||
m_editGroupID.SetWindowText("");
|
||||
m_editLobbyIP.SetWindowText("");
|
||||
m_editLobbyPort.SetWindowText("");
|
||||
}
|
||||
else
|
||||
{
|
||||
char szText[100];
|
||||
sprintf(szText,"Terminate Server Failed: %i",lReason);
|
||||
MessageBox(szText);
|
||||
}
|
||||
}*/
|
||||
|
||||
//UBI.COM: Receive a RequestParentGroup result
|
||||
GSvoid CGsMasterServerLauncherDlg::RegServerRcv_RequestParentGroupResult(GSubyte ucType, GSint lReason,
|
||||
GSint iServerID,GSint iGroupID, const GSchar *szGroupName, GSuint uiNbPlayers,
|
||||
GSuint uiMaxPlayers)
|
||||
{
|
||||
if (ucType == GSSUCCESS)
|
||||
{
|
||||
//UBI.COM: If the iServerID is greater then 0 its a valid Server.
|
||||
// Negative means we've received the complete list
|
||||
if (iServerID > 0)
|
||||
{
|
||||
char szText[100];
|
||||
|
||||
//UBI.COM: Add the parent group to the control list
|
||||
m_listGroups.InsertItem(m_iNbrGroups,ltoa(iServerID,szText,10));
|
||||
m_listGroups.SetItemText(m_iNbrGroups,1,ltoa(iGroupID,szText,10));
|
||||
m_listGroups.SetItemText(m_iNbrGroups,2,szGroupName);
|
||||
m_listGroups.SetItemText(m_iNbrGroups,3,ltoa(uiNbPlayers,szText,10));
|
||||
m_iNbrGroups++;
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox("Request Finished");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
char szText[100];
|
||||
sprintf(szText,"Request Failed: %i",lReason);
|
||||
MessageBox(szText);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
GSvoid CGsMasterServerLauncherDlg::RegServerRcv_LobbyServerLoginResults(
|
||||
GSubyte ucType, GSint iReason, GSint iLobbyServerID, GSint iGroupID )
|
||||
{
|
||||
if (ucType == GSSUCCESS)
|
||||
{
|
||||
MessageBox("Lobby Server Login Success");
|
||||
}
|
||||
else
|
||||
MessageBox("Lobby Server Login Fail");
|
||||
|
||||
}
|
||||
|
||||
GSvoid CGsMasterServerLauncherDlg::RegServerRcv_LobbyServerUpdateGroupSettingsResults(
|
||||
GSubyte ucType, GSint iReason, GSint iGroupID )
|
||||
{
|
||||
if (ucType == GSSUCCESS)
|
||||
{
|
||||
MessageBox("Update Success");
|
||||
}
|
||||
else
|
||||
MessageBox("Update Fail");
|
||||
}
|
||||
|
||||
GSvoid CGsMasterServerLauncherDlg::RegServerRcv_LobbyServerDisconnection()
|
||||
{
|
||||
MessageBox("Lobby Server Disconnection");
|
||||
}
|
||||
|
||||
GSvoid CGsMasterServerLauncherDlg::RegServerRcv_LobbyServerMemberNew( const GSchar* szMember, GSbool bSpectator,
|
||||
const GSchar* szIPAddress, const GSchar* szAltIPAddress, const GSvoid* pPlayerInfo,
|
||||
GSuint uiPlayerInfoSize, GSushort usPlayerStatus )
|
||||
{
|
||||
char szText[1024];
|
||||
sprintf(szText,"New Member %s",szMember);
|
||||
MessageBox(szText);
|
||||
}
|
||||
|
||||
GSvoid CGsMasterServerLauncherDlg::RegServerRcv_LobbyServerMatchStartReply( GSubyte ucType, GSint iReason, GSint iGroupID )
|
||||
{
|
||||
char szText[1024];
|
||||
sprintf(szText,"Match Start");
|
||||
MessageBox(szText);
|
||||
}
|
||||
|
||||
GSvoid CGsMasterServerLauncherDlg::RegServerRcv_LobbyServerMemberLeft( const GSchar* szMember )
|
||||
{
|
||||
char szText[1024];
|
||||
sprintf(szText,"Member Left %s",szMember);
|
||||
MessageBox(szText);
|
||||
}
|
||||
|
||||
GSvoid CGsMasterServerLauncherDlg::RegServerRcv_LobbyServerMatchFinishReply( GSubyte ucType, GSint iReason, GSint iGroupID )
|
||||
{
|
||||
char szText[1024];
|
||||
sprintf(szText,"Match Finish ");
|
||||
MessageBox(szText);
|
||||
}
|
||||
|
||||
GSvoid CGsMasterServerLauncherDlg::RegServerRcv_LobbyServerMemberUpdateInfo( const GSchar* szMember,
|
||||
const GSvoid* pPlayerInfo, GSuint uiPlayerInfoSize )
|
||||
{
|
||||
char szText[1024];
|
||||
sprintf(szText,"Member Info Update: %s",szMember);
|
||||
MessageBox(szText);
|
||||
}
|
||||
|
||||
GSvoid CGsMasterServerLauncherDlg::RegServerRcv_LobbyServerGroupConfigUpdate( GSuint uiGroupConfig, GSint iGroupID )
|
||||
{
|
||||
char szText[1024];
|
||||
sprintf(szText,"Group Config Update: %i %i",uiGroupConfig,iGroupID);
|
||||
MessageBox(szText);
|
||||
}
|
||||
|
||||
GSvoid CGsMasterServerLauncherDlg::RegServerRcv_LobbyServerMemberUpdateStatus( const GSchar* szPlayer,
|
||||
GSushort usPlayerStatus )
|
||||
{
|
||||
char szText[1024];
|
||||
sprintf(szText,"Member Status Update : %s %i",szPlayer,usPlayerStatus);
|
||||
MessageBox(szText);
|
||||
}
|
||||
|
||||
GSvoid CGsMasterServerLauncherDlg::RegServerRcv_LobbyServerNewGroup ( GSushort usRoomType,
|
||||
const GSchar* szRoomName,GSint iGroupID,GSint iLobbyServerID,GSint iParentGroupID,
|
||||
GSint uiGroupConfig,GSshort sGroupLevel,const GSchar* szMaster,const GSchar* szAllowedGames,
|
||||
const GSchar* szGame,const GSvoid* pGroupInfo,GSuint GroupInfoSize,GSuint uiMatchEventID,
|
||||
GSuint uiMaxPlayers,GSuint uiNbPlayers, GSuint uiMaxSpectators, GSuint uiNbSpectators,
|
||||
const GSchar* szGameVersion,const GSchar* szGSGameVersion,const GSchar* szIPAddress,
|
||||
const GSchar* szAltIPAddress )
|
||||
{
|
||||
char szText[1024];
|
||||
sprintf(szText,"Group Update : %s",szRoomName);
|
||||
MessageBox(szText);
|
||||
}
|
||||
|
||||
|
||||
//UBI.COM: Connect to the GSRouter and Login
|
||||
void CGsMasterServerLauncherDlg::OnBUTTONLogin()
|
||||
{
|
||||
char szIPAddress[IPADDRESSLENGTH];
|
||||
char szPort[100];
|
||||
GSushort usPort;
|
||||
char szUsername[NICKNAMELENGTH];
|
||||
char szPassword[PASSWORDLENGTH];
|
||||
char szVersion[VERSIONLENGTH];
|
||||
|
||||
m_editIPAddress.GetWindowText(szIPAddress,IPADDRESSLENGTH);
|
||||
m_editPort.GetWindowText(szPort,100);
|
||||
usPort = (GSushort)atol(szPort);
|
||||
|
||||
LOCKMUTEX();
|
||||
if (!RegServerSend_RouterConnect(szIPAddress,usPort))
|
||||
{
|
||||
MessageBox("RegServerSend_Connect Failed");
|
||||
UNLOCKMUTEX();
|
||||
return;
|
||||
}
|
||||
UNLOCKMUTEX();
|
||||
|
||||
m_editUsername.GetWindowText(szUsername,NICKNAMELENGTH);
|
||||
m_editPassword.GetWindowText(szPassword,PASSWORDLENGTH);
|
||||
m_editVersion.GetWindowText(szVersion,VERSIONLENGTH);
|
||||
|
||||
LOCKMUTEX();
|
||||
RegServerSend_LoginRouter(szUsername,szPassword,szVersion);
|
||||
UNLOCKMUTEX();
|
||||
|
||||
}
|
||||
|
||||
//UBI.COM: Request the list of Parent Groups
|
||||
void CGsMasterServerLauncherDlg::OnBUTTONReqGroups()
|
||||
{
|
||||
char szGamename[GAMELENGTH];
|
||||
|
||||
if (!m_bLoggedIn)
|
||||
{
|
||||
MessageBox("Not Logged In");
|
||||
return;
|
||||
}
|
||||
|
||||
m_editGamename.GetWindowText(szGamename,GAMELENGTH);
|
||||
|
||||
m_listGroups.DeleteAllItems();
|
||||
m_iNbrGroups = 0;
|
||||
|
||||
LOCKMUTEX();
|
||||
RegServerSend_RequestParentGroupOnLobby(szGamename);
|
||||
UNLOCKMUTEX();
|
||||
|
||||
|
||||
}
|
||||
|
||||
//UBI.COM: Register a server on the selected Parent Group
|
||||
void CGsMasterServerLauncherDlg::OnBUTTONRegServer()
|
||||
{
|
||||
int iServerID;
|
||||
int iParentID;
|
||||
char szServerName[NAMELENGTH];
|
||||
char szGamename[GAMELENGTH];
|
||||
int iServerType;
|
||||
char szText[100];
|
||||
int iMaxPlayers;
|
||||
int iMaxVisitors;
|
||||
char szPassword[PASSWORDLENGTH];
|
||||
char szGroupData[100];
|
||||
int iGroupDataSize;
|
||||
char szAltData[100];
|
||||
int iAltDataSize;
|
||||
char szGameData[100];
|
||||
int iGameDataSize;
|
||||
char szGameVersion[VERSIONLENGTH];
|
||||
char szGSVersion[VERSIONLENGTH];
|
||||
int iGamePort;
|
||||
|
||||
if (!m_bLoggedIn)
|
||||
{
|
||||
MessageBox("Not Logged In");
|
||||
return;
|
||||
}
|
||||
|
||||
POSITION pos = m_listGroups.GetFirstSelectedItemPosition();
|
||||
if (pos == NULL)
|
||||
{
|
||||
MessageBox("No Group Seleted");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
int iItem = m_listGroups.GetNextSelectedItem(pos);
|
||||
|
||||
m_listGroups.GetItemText(iItem,0,szText,100);
|
||||
iServerID = atol(szText);
|
||||
|
||||
m_listGroups.GetItemText(iItem,1,szText,100);
|
||||
iParentID = atol(szText);
|
||||
}
|
||||
|
||||
|
||||
m_editServerName.GetWindowText(szServerName,NAMELENGTH);
|
||||
|
||||
m_editGamename.GetWindowText(szGamename,NAMELENGTH);
|
||||
|
||||
int iSelection = m_cboServerType.GetCurSel();
|
||||
|
||||
switch(iSelection)
|
||||
{
|
||||
case 0:
|
||||
iServerType = ROOM_HYBRID_REGSERVER;
|
||||
break;
|
||||
case 1:
|
||||
iServerType = ROOM_UBI_CLIENTHOST_REGSERVER;
|
||||
break;
|
||||
case 2:
|
||||
iServerType = ROOM_UBI_GAMESERVER_REGSERVER;
|
||||
break;
|
||||
}
|
||||
|
||||
m_editMaxPlayers.GetWindowText(szText,100);
|
||||
iMaxPlayers = atol(szText);
|
||||
|
||||
m_editMaxVisitors.GetWindowText(szText,100);
|
||||
iMaxVisitors = atol(szText);
|
||||
|
||||
m_editGamePassword.GetWindowText(szPassword,100);
|
||||
|
||||
m_editGrpData.GetWindowText(szGroupData,100);
|
||||
iGroupDataSize = strlen(szGroupData) + 1;
|
||||
|
||||
m_editAltData.GetWindowText(szAltData,100);
|
||||
iAltDataSize = strlen(szAltData) + 1;
|
||||
|
||||
m_editGameData.GetWindowText(szGameData,100);
|
||||
iGameDataSize = strlen(szGameData) + 5;
|
||||
|
||||
GSubyte *pubGameData = (GSubyte*)malloc(iGameDataSize);
|
||||
|
||||
memset(pubGameData,0,iGameDataSize);
|
||||
|
||||
memcpy(pubGameData+4,szGameData,strlen(szGameData));
|
||||
|
||||
|
||||
m_editGameVersion.GetWindowText(szGameVersion,VERSIONLENGTH);
|
||||
m_editGSVersion.GetWindowText(szGSVersion,VERSIONLENGTH);
|
||||
|
||||
m_editGamePort.GetWindowText(szText,100);
|
||||
iGamePort = atol(szText);
|
||||
|
||||
LOCKMUTEX();
|
||||
RegServerSend_RegisterServerOnLobby(iServerID,iParentID,szServerName,szGamename,
|
||||
iServerType,iMaxPlayers,iMaxVisitors,szPassword,(GSubyte*)szGroupData,
|
||||
iGroupDataSize,(GSubyte*)szAltData,iAltDataSize,(GSubyte*)pubGameData,
|
||||
iGameDataSize,iGamePort,szGameVersion,szGSVersion,GS_FALSE,GS_FALSE);
|
||||
UNLOCKMUTEX();
|
||||
free(pubGameData);
|
||||
}
|
||||
|
||||
//UBI.COM: Terminate the registered server.
|
||||
void CGsMasterServerLauncherDlg::OnBUTTONTermServer()
|
||||
{
|
||||
LOCKMUTEX();
|
||||
RegServerSend_LobbyServerClose();
|
||||
UNLOCKMUTEX();
|
||||
}
|
||||
|
||||
//UBI.COM: Disconnect from the GSRouter
|
||||
void CGsMasterServerLauncherDlg::OnBUTTONDisconnect()
|
||||
{
|
||||
LOCKMUTEX();
|
||||
//RegServerSend_LobbyServerClose();
|
||||
RegServerSend_RouterDisconnect();
|
||||
UNLOCKMUTEX();
|
||||
}
|
||||
|
||||
//UBI.COM: Change the registered server info
|
||||
void CGsMasterServerLauncherDlg::OnBUTTONUpdate()
|
||||
{
|
||||
char szIPAddress[IPADDRESSLENGTH];
|
||||
GSushort usPort;
|
||||
int iMaxPlayers,iMaxVisitors,iGroupDataSize;
|
||||
int iGroupID,iGameDataSize,iGamePort,iAltDataSize;
|
||||
char szText[100],szPassword[PASSWORDLENGTH],szGroupData[100];
|
||||
char szGameData[100];
|
||||
char szAltData[100];
|
||||
|
||||
m_editLobbyIP.GetWindowText(szIPAddress,IPADDRESSLENGTH);
|
||||
m_editLobbyPort.GetWindowText(szText,100);
|
||||
usPort = (GSushort)atol(szText);
|
||||
|
||||
m_editGroupID.GetWindowText(szText,100);
|
||||
iGroupID = atol(szText);
|
||||
|
||||
m_editMaxPlayers.GetWindowText(szText,100);
|
||||
iMaxPlayers = atol(szText);
|
||||
|
||||
m_editMaxVisitors.GetWindowText(szText,100);
|
||||
iMaxVisitors = atol(szText);
|
||||
|
||||
m_editGamePassword.GetWindowText(szPassword,100);
|
||||
|
||||
m_editGrpData.GetWindowText(szGroupData,100);
|
||||
iGroupDataSize = strlen(szGroupData) + 1;
|
||||
|
||||
m_editAltData.GetWindowText(szAltData,100);
|
||||
iAltDataSize = strlen(szAltData) + 1;
|
||||
|
||||
m_editGameData.GetWindowText(szGameData,100);
|
||||
iGameDataSize = strlen(szGameData) + 1;
|
||||
|
||||
m_editGamePort.GetWindowText(szText,100);
|
||||
iGamePort = atol(szText);
|
||||
|
||||
LOCKMUTEX();
|
||||
RegServerSend_UpdateGroupSettings(iGroupID,-1,-1,-1,
|
||||
iMaxPlayers,iMaxVisitors,szPassword,(GSubyte*)szGroupData,iGroupDataSize,
|
||||
(GSubyte*)szAltData,iAltDataSize,(GSubyte*)szGameData,iGameDataSize,iGamePort);
|
||||
UNLOCKMUTEX();
|
||||
}
|
||||
|
||||
void CGsMasterServerLauncherDlg::OnBUTTONDownload()
|
||||
{
|
||||
CRegistry registry(HKEY_LOCAL_MACHINE, CString("SOFTWARE\\Ubi Soft\\Game Service"),
|
||||
false,KEY_READ);
|
||||
CString csGSIniURL;
|
||||
|
||||
char szDirectory[100];
|
||||
GetCurrentDirectory(100,szDirectory);
|
||||
|
||||
CString csGSIniFile = szDirectory;
|
||||
csGSIniFile += "\\GS.ini";
|
||||
|
||||
CString csLauncherIniFile = szDirectory;
|
||||
csLauncherIniFile += "\\Launcher.ini";
|
||||
|
||||
registry.OpenKey();
|
||||
|
||||
//UBI.COM: Try to read the ConnectURL from the registry
|
||||
// If it fails we'll look in Launcher.ini
|
||||
if (!registry.ReadString(CString("ConnectURL"), &csGSIniURL))
|
||||
{
|
||||
char szUrl[1024];
|
||||
|
||||
MessageBox("Registry failed; using Launcher.ini");
|
||||
|
||||
GetPrivateProfileString("Launcher","ConnectURL",
|
||||
"http://gsconnect.ubisoft.com/gsinit.php?user=%s&dp=%s",szUrl,
|
||||
1024,csLauncherIniFile);
|
||||
csGSIniURL = szUrl;
|
||||
|
||||
}
|
||||
registry.CloseKey();
|
||||
|
||||
char szUsername[NICKNAMELENGTH],szGamename[GAMELENGTH];
|
||||
|
||||
m_editUsername.GetWindowText(szUsername,NICKNAMELENGTH);
|
||||
m_editGamename.GetWindowText(szGamename,GAMELENGTH);
|
||||
|
||||
//UBI.COM: Replace the strings in the URL
|
||||
csGSIniURL.Replace("user=%s",(CString("user=")+szUsername));
|
||||
csGSIniURL.Replace("dp=%s",(CString("dp=")+szGamename));
|
||||
|
||||
//UBI.COM: Try to download the file GS.ini file if it fails
|
||||
// we can use the old local one.
|
||||
HINTERNET hNet = InternetOpen("",INTERNET_OPEN_TYPE_PRECONFIG,NULL,NULL,NULL);
|
||||
if (!hNet)
|
||||
MessageBox("InternetOpen Failed");
|
||||
else
|
||||
{
|
||||
HINTERNET hURL = InternetOpenUrl(hNet,csGSIniURL,NULL,0,INTERNET_FLAG_HYPERLINK,NULL);
|
||||
|
||||
if (!hURL)
|
||||
MessageBox("InternetOpenUrl Failed");
|
||||
else
|
||||
{
|
||||
GSchar szBuffer[1024];
|
||||
GSint iSize = 1024;
|
||||
DWORD iRead = 0;
|
||||
|
||||
FILE *pFile = fopen(csGSIniFile,"w");
|
||||
while (InternetReadFile(hURL,szBuffer,iSize,&iRead))
|
||||
{
|
||||
if (iRead != 0)
|
||||
{
|
||||
fwrite(szBuffer,sizeof(GSchar),iRead,pFile);
|
||||
}
|
||||
else
|
||||
{
|
||||
fclose(pFile);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
char szIPAddress[IPADDRESSLENGTH];
|
||||
char szPort[100];
|
||||
|
||||
//UBI.COM: Read in the Address of the GSRouter.
|
||||
// We'll only read in the first address, in a real application
|
||||
// you should get both so that if one fails you can try the
|
||||
// other.
|
||||
GetPrivateProfileString("Servers","RouterIP0","srv-gstest",szIPAddress,
|
||||
IPADDRESSLENGTH,csGSIniFile);
|
||||
//UBI.COM: Read in the Launcher Port of the GSRouter
|
||||
GetPrivateProfileString("Servers","RouterLauncherPort0","41005",szPort,
|
||||
100,csGSIniFile);
|
||||
|
||||
m_editIPAddress.SetWindowText(szIPAddress);
|
||||
m_editPort.SetWindowText(szPort);
|
||||
|
||||
MessageBox("Download Finished");
|
||||
return;
|
||||
}
|
||||
|
||||
void CGsMasterServerLauncherDlg::OnBUTTONAbout()
|
||||
{
|
||||
char *szBuffer;
|
||||
unsigned int iBufferSize;
|
||||
|
||||
CGSVersion ver;
|
||||
ver.PrintModulesVersion(NULL,&iBufferSize);
|
||||
|
||||
szBuffer = (char*)malloc(iBufferSize);
|
||||
|
||||
ver.PrintModulesVersion(szBuffer,&iBufferSize);
|
||||
|
||||
MessageBox(szBuffer);
|
||||
free(szBuffer);
|
||||
}
|
||||
|
||||
void CGsMasterServerLauncherDlg::OnBUTTONStartMatch()
|
||||
{
|
||||
//GSchar szText[1024];
|
||||
//GSint iGroupID;
|
||||
|
||||
// m_editGroupID.GetWindowText(szText,100);
|
||||
// iGroupID = atol(szText);
|
||||
|
||||
|
||||
//Send the mode
|
||||
RegServerSend_MatchStart(1);
|
||||
}
|
||||
|
||||
void CGsMasterServerLauncherDlg::OnBUTTONFinishMatch()
|
||||
{
|
||||
|
||||
RegServerSend_MatchFinish();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
// gsMasterServerLauncherDlg.h : header file
|
||||
//
|
||||
|
||||
#if !defined(AFX_GSMASTERSERVERLAUNCHERDLG_H__18BF17A9_2273_4EE5_84FE_2AAA288837D1__INCLUDED_)
|
||||
#define AFX_GSMASTERSERVERLAUNCHERDLG_H__18BF17A9_2273_4EE5_84FE_2AAA288837D1__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "RegServerLib.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CGsMasterServerLauncherDlg dialog
|
||||
|
||||
class CGsMasterServerLauncherDlg : public CDialog , public CRegisterServer
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
bool m_bLoggedIn;
|
||||
CGsMasterServerLauncherDlg(CWnd* pParent = NULL); // standard constructor
|
||||
~CGsMasterServerLauncherDlg();
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CGsMasterServerLauncherDlg)
|
||||
enum { IDD = IDD_GSMASTERSERVERLAUNCHER_DIALOG };
|
||||
CEdit m_editAltData;
|
||||
CEdit m_editGamePort;
|
||||
CEdit m_editLobbyPort;
|
||||
CEdit m_editLobbyIP;
|
||||
CEdit m_editGroupID;
|
||||
CEdit m_editServerName;
|
||||
CEdit m_editMaxVisitors;
|
||||
CEdit m_editMaxPlayers;
|
||||
CEdit m_editGSVersion;
|
||||
CEdit m_editGrpData;
|
||||
CEdit m_editGameVersion;
|
||||
CEdit m_editGamePassword;
|
||||
CEdit m_editGameData;
|
||||
CComboBox m_cboServerType;
|
||||
CListCtrl m_listGroups;
|
||||
CEdit m_editExtIP;
|
||||
CEdit m_editVersion;
|
||||
CEdit m_editUsername;
|
||||
CEdit m_editPort;
|
||||
CEdit m_editPassword;
|
||||
CEdit m_editIPAddress;
|
||||
CEdit m_editGamename;
|
||||
//}}AFX_DATA
|
||||
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CGsMasterServerLauncherDlg)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
|
||||
//UBI.COM: The Callbacks inherited from CRegisterServer
|
||||
GSvoid RegServerRcv_LoginRouterResult(GSubyte ucType, GSint lReason,
|
||||
const GSchar *szIPAddress);
|
||||
GSvoid RegServerRcv_RouterDisconnection();
|
||||
GSvoid RegServerRcv_RegisterServerResult(GSubyte pucType,GSint plReason,
|
||||
GSint iGroupID,const GSchar *szAddress,GSushort usPort,const GSchar *szSessionName);
|
||||
//GSvoid LauncherRcv_TerminateServerResult(GSubyte pucType, GSint plReason);
|
||||
GSvoid RegServerRcv_RequestParentGroupResult(GSubyte ucType, GSint lReason,
|
||||
GSint iServerID,GSint iGroupID, const GSchar *szGroupName, GSuint uiNbPlayers,
|
||||
GSuint uiMaxPlayers);
|
||||
|
||||
GSvoid RegServerRcv_LobbyServerLoginResults( GSubyte ucType, GSint iReason,
|
||||
GSint iLobbyServerID, GSint iGroupID );
|
||||
GSvoid RegServerRcv_LobbyServerUpdateGroupSettingsResults( GSubyte ucType,
|
||||
GSint iReason, GSint iGroupID );
|
||||
GSvoid RegServerRcv_LobbyServerDisconnection();
|
||||
GSvoid RegServerRcv_LobbyServerMemberNew( const GSchar* szMember, GSbool bSpectator,
|
||||
const GSchar* szIPAddress, const GSchar* szAltIPAddress, const GSvoid* pPlayerInfo,
|
||||
GSuint uiPlayerInfoSize, GSushort usPlayerStatus );
|
||||
GSvoid RegServerRcv_LobbyServerMatchStartReply( GSubyte ucType, GSint iReason, GSint iGroupID );
|
||||
GSvoid RegServerRcv_LobbyServerMemberLeft( const GSchar* szMember );
|
||||
GSvoid RegServerRcv_LobbyServerMatchFinishReply( GSubyte ucType, GSint iReason, GSint iGroupID );
|
||||
GSvoid RegServerRcv_LobbyServerNewGroup ( GSushort usRoomType,
|
||||
const GSchar* szRoomName,GSint iGroupID,GSint iLobbyServerID,GSint iParentGroupID,
|
||||
GSint uiGroupConfig,GSshort sGroupLevel,const GSchar* szMaster,const GSchar* szAllowedGames,
|
||||
const GSchar* szGame,const GSvoid* pGroupInfo,GSuint GroupInfoSize,GSuint uiMatchEventID,
|
||||
GSuint uiMaxPlayers,GSuint uiNbPlayers, GSuint uiMaxSpectators, GSuint uiNbSpectators,
|
||||
const GSchar* szGameVersion,const GSchar* szGSGameVersion,const GSchar* szIPAddress,
|
||||
const GSchar* szAltIPAddress );
|
||||
GSvoid RegServerRcv_LobbyServerMemberUpdateInfo( const GSchar* szMember,
|
||||
const GSvoid* pPlayerInfo, GSuint uiPlayerInfoSize );
|
||||
GSvoid RegServerRcv_LobbyServerGroupConfigUpdate( GSuint uiGroupConfig, GSint iGroupID );
|
||||
GSvoid RegServerRcv_LobbyServerMemberUpdateStatus( const GSchar* szPlayer, GSushort usPlayerStatus );
|
||||
|
||||
private:
|
||||
int m_iNbrGroups;
|
||||
|
||||
protected:
|
||||
HICON m_hIcon;
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CGsMasterServerLauncherDlg)
|
||||
virtual BOOL OnInitDialog();
|
||||
afx_msg void OnPaint();
|
||||
afx_msg HCURSOR OnQueryDragIcon();
|
||||
afx_msg void OnBUTTONLogin();
|
||||
afx_msg void OnBUTTONReqGroups();
|
||||
afx_msg void OnBUTTONRegServer();
|
||||
afx_msg void OnBUTTONTermServer();
|
||||
afx_msg void OnBUTTONDisconnect();
|
||||
afx_msg void OnBUTTONUpdate();
|
||||
afx_msg void OnBUTTONDownload();
|
||||
afx_msg void OnBUTTONAbout();
|
||||
afx_msg void OnBUTTONStartMatch();
|
||||
afx_msg void OnBUTTONFinishMatch();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_GSMASTERSERVERLAUNCHERDLG_H__18BF17A9_2273_4EE5_84FE_2AAA288837D1__INCLUDED_)
|
||||
@@ -0,0 +1,383 @@
|
||||
/***SDOC*******************************************************************************************
|
||||
*
|
||||
* UbiSoft Development Network
|
||||
* ---------------------------
|
||||
*
|
||||
* FILE........: httpconfig.cpp
|
||||
* CREATION....: 11 Dec. 2001
|
||||
* AUTHOR......: Guillaume Plante
|
||||
*
|
||||
* DESCRIPTION.: implementation of the CGSHttpConfig class
|
||||
*
|
||||
**************************************************************************************************
|
||||
* FILE HISTORY
|
||||
**************************************************************************************************
|
||||
*
|
||||
* DATE........:
|
||||
* AUTHOR......:
|
||||
* DESCRIPTION.:
|
||||
*
|
||||
******************************************************************************************EDOC***/
|
||||
|
||||
#include "httpconfig.h"
|
||||
|
||||
//these 2 are included for the binary mode in case of binary download
|
||||
#include <io.h>
|
||||
#include <fcntl.h>
|
||||
#include <winsock2.h>
|
||||
|
||||
|
||||
//===================================================================================================
|
||||
// CLASS CGSHttpConfig
|
||||
// METHOD CGSHttpConfig
|
||||
// AUTHOR: Guillaume Plante
|
||||
// CREATION: April 4, 2002
|
||||
//
|
||||
// DESCRIPTION: Default constructor
|
||||
//===================================================================================================
|
||||
CGSHttpConfig::CGSHttpConfig()
|
||||
{
|
||||
m_iTimeOut = 0;
|
||||
m_bInitialised = false;
|
||||
}
|
||||
|
||||
//===================================================================================================
|
||||
// CLASS CGSHttpConfig
|
||||
// METHOD PrintError
|
||||
// AUTHOR: Guillaume Plante
|
||||
// CREATION: April 4, 2002
|
||||
//
|
||||
// DESCRIPTION: Print error code on stderr
|
||||
//===================================================================================================
|
||||
void CGSHttpConfig::PrintError(const char * szError)
|
||||
{
|
||||
fprintf(stderr,"\nerror: %s\nwsalasterror: %d\n", szError, WSAGetLastError());
|
||||
}
|
||||
|
||||
//===================================================================================================
|
||||
// CLASS CGSHttpConfig
|
||||
// METHOD Initialize
|
||||
// AUTHOR: Guillaume Plante
|
||||
// CREATION: April 4, 2002
|
||||
//
|
||||
// DESCRIPTION: Initialize the class (winsock2)
|
||||
//===================================================================================================
|
||||
bool CGSHttpConfig::Initialize()
|
||||
{
|
||||
if(m_bInitialised)
|
||||
return false;
|
||||
|
||||
// set the default time out value
|
||||
m_iTimeOut = _DEFAULT_TIMEOUT;
|
||||
m_bInitialised = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
//===================================================================================================
|
||||
// CLASS CGSHttpConfig
|
||||
// METHOD Uninitialize
|
||||
// AUTHOR: Guillaume Plante
|
||||
// CREATION: April 4, 2002
|
||||
//
|
||||
// DESCRIPTION: Uninitialize the class (winsock2)
|
||||
//===================================================================================================
|
||||
bool CGSHttpConfig::Uninitialize()
|
||||
{
|
||||
if(!m_bInitialised)
|
||||
return false;
|
||||
m_bInitialised = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
//===================================================================================================
|
||||
// CLASS CGSHttpConfig
|
||||
// METHOD GetWebFile
|
||||
// AUTHOR: Guillaume Plante
|
||||
// CREATION: April 4, 2002
|
||||
//
|
||||
// DESCRIPTION: Get the a file given a url and write it to a location
|
||||
//===================================================================================================
|
||||
int CGSHttpConfig::GetWebFile(const char * szURL,const char * szLocalFileName)
|
||||
{
|
||||
_urlinfo UrlInfo;
|
||||
if(!ParseURL(szURL,&UrlInfo))
|
||||
return -1;
|
||||
|
||||
|
||||
// Lookup host
|
||||
LPHOSTENT lpHostEntry;
|
||||
lpHostEntry = gethostbyname(UrlInfo.szHost);
|
||||
if (lpHostEntry == NULL)
|
||||
{
|
||||
PrintError("gethostbyname()");
|
||||
return -1;
|
||||
}
|
||||
|
||||
// file object
|
||||
FILE *fData = NULL;
|
||||
// make sure the file is empty first
|
||||
if(szLocalFileName)
|
||||
{
|
||||
// write to file
|
||||
if(!(fData = fopen(szLocalFileName,"w")))
|
||||
{
|
||||
PrintError("Could not open local file");
|
||||
return -1;
|
||||
}
|
||||
// set the output as binary in case of a jpg or else
|
||||
_setmode(_fileno(fData), _O_BINARY);
|
||||
fwrite("", 1, 1, fData);
|
||||
fclose(fData);
|
||||
}
|
||||
// Fill in the server address structure
|
||||
SOCKADDR_IN sa;
|
||||
sa.sin_family = AF_INET;
|
||||
sa.sin_addr = *((LPIN_ADDR)*lpHostEntry->h_addr_list);
|
||||
sa.sin_port = htons(UrlInfo.usPort);
|
||||
|
||||
// Create a TCP/IP stream socket
|
||||
SOCKET Socket;
|
||||
Socket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
|
||||
if (Socket == INVALID_SOCKET)
|
||||
{
|
||||
PrintError("socket()");
|
||||
return -1;
|
||||
}
|
||||
|
||||
//
|
||||
// Create an event object to be used with this socket
|
||||
//
|
||||
WSAEVENT hEvent;
|
||||
hEvent = WSACreateEvent();
|
||||
if (hEvent == WSA_INVALID_EVENT)
|
||||
{
|
||||
PrintError("WSACreateEvent()");
|
||||
closesocket(Socket);
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Make the socket non-blocking and
|
||||
// associate it with network event
|
||||
int nRet;
|
||||
nRet = WSAEventSelect(Socket,
|
||||
hEvent,
|
||||
FD_READ|FD_CONNECT|FD_CLOSE);
|
||||
if (nRet == SOCKET_ERROR)
|
||||
{
|
||||
PrintError("EventSelect()");
|
||||
closesocket(Socket);
|
||||
WSACloseEvent(hEvent);
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Request a connection
|
||||
nRet = connect(Socket, (LPSOCKADDR)&sa, sizeof(SOCKADDR_IN));
|
||||
|
||||
if (nRet == SOCKET_ERROR)
|
||||
{
|
||||
nRet = WSAGetLastError();
|
||||
if (nRet == WSAEWOULDBLOCK)
|
||||
{
|
||||
fprintf(stderr,"\nConnect would block");
|
||||
}
|
||||
else
|
||||
{
|
||||
PrintError("connect()");
|
||||
closesocket(Socket);
|
||||
WSACloseEvent(hEvent);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
// Handle async network events
|
||||
char szBuffer[4096];
|
||||
WSANETWORKEVENTS events;
|
||||
while(1)
|
||||
{
|
||||
// Wait for something to happen
|
||||
//fprintf(stderr,"\nWaitForMultipleEvents()");
|
||||
DWORD dwRet;
|
||||
dwRet = WSAWaitForMultipleEvents(1,
|
||||
&hEvent,
|
||||
FALSE,
|
||||
1000,
|
||||
FALSE);
|
||||
|
||||
if (dwRet == WSA_WAIT_TIMEOUT)
|
||||
{
|
||||
fprintf(stderr,"\nWait timed out");
|
||||
break;
|
||||
}
|
||||
|
||||
// Figure out what happened
|
||||
//fprintf(stderr,"\nWSAEnumNetworkEvents()");
|
||||
nRet = WSAEnumNetworkEvents(Socket, hEvent,&events);
|
||||
if (nRet == SOCKET_ERROR)
|
||||
{
|
||||
PrintError("WSAEnumNetworkEvents()");
|
||||
break;
|
||||
}
|
||||
|
||||
// handling events
|
||||
|
||||
// Connect event
|
||||
if (events.lNetworkEvents & FD_CONNECT)
|
||||
{
|
||||
// Send the http request
|
||||
// make the request
|
||||
MakeRequest(szBuffer,UrlInfo.szObject,UrlInfo.szHost);
|
||||
nRet = send(Socket, szBuffer, strlen(szBuffer), 0);
|
||||
if (nRet == SOCKET_ERROR)
|
||||
{
|
||||
PrintError("send()");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Read event
|
||||
if (events.lNetworkEvents & FD_READ)
|
||||
{
|
||||
// Read the data and write it to stdout
|
||||
nRet = recv(Socket, szBuffer, sizeof(szBuffer), 0);
|
||||
if (nRet == SOCKET_ERROR)
|
||||
{
|
||||
PrintError("recv()");
|
||||
break;
|
||||
}
|
||||
//fprintf(stderr,"\nRead %d bytes", nRet);
|
||||
|
||||
if(szLocalFileName)
|
||||
{
|
||||
// write to file
|
||||
if(!(fData = fopen(szLocalFileName,"a+")))
|
||||
{
|
||||
PrintError("Could not open local file");
|
||||
return -1;
|
||||
}
|
||||
// set the output as binary in case of a jpg or else
|
||||
_setmode(_fileno(fData), _O_BINARY);
|
||||
fwrite(szBuffer, nRet, 1, fData);
|
||||
fclose(fData);
|
||||
}
|
||||
else
|
||||
{
|
||||
// set the output as binary in case of a jpg or else
|
||||
_setmode(_fileno(stdout), _O_BINARY);
|
||||
// Write to stdout
|
||||
fwrite(szBuffer, nRet, 1, stdout);
|
||||
}
|
||||
}
|
||||
|
||||
// Close event
|
||||
if (events.lNetworkEvents & FD_CLOSE)
|
||||
break;
|
||||
}
|
||||
closesocket(Socket);
|
||||
WSACloseEvent(hEvent);
|
||||
return 1;
|
||||
}
|
||||
|
||||
//===================================================================================================
|
||||
// CLASS CGSHttpConfig
|
||||
// METHOD MakeRequest
|
||||
// AUTHOR: Guillaume Plante
|
||||
// CREATION: April 4, 2002
|
||||
//
|
||||
// DESCRIPTION: Make a standard http "GET" request based on a absolute file path and hostname
|
||||
//===================================================================================================
|
||||
char *CGSHttpConfig::MakeRequest(char * szBuffer,const char * szFile,const char * szHostname)
|
||||
{
|
||||
sprintf(szBuffer, "GET %s HTTP/1.1\nHost: %s\n\n", szFile,szHostname);
|
||||
return szBuffer;
|
||||
}
|
||||
|
||||
//===================================================================================================
|
||||
// CLASS CGSHttpConfig
|
||||
// METHOD ParseURL
|
||||
// AUTHOR: Guillaume Plante
|
||||
// CREATION: April 4, 2002
|
||||
//
|
||||
// DESCRIPTION: Parse a URL to give back the server, object, service name and port number in a struct
|
||||
//===================================================================================================
|
||||
bool CGSHttpConfig::ParseURL(const char *szURL,_urlinfo *UrlInfo)
|
||||
{
|
||||
char szTempURL[256];
|
||||
char *pc = NULL;
|
||||
char *pcPort = NULL;
|
||||
char *pcObj = NULL;
|
||||
int cpt = 0;
|
||||
int len = 0;
|
||||
|
||||
memset(UrlInfo->szHost,0,sizeof(UrlInfo->szHost));
|
||||
memset(UrlInfo->szService,0,sizeof(UrlInfo->szService));
|
||||
memset(UrlInfo->szObject,0,sizeof(UrlInfo->szObject));
|
||||
UrlInfo->usPort = 0;
|
||||
|
||||
// make a copy of the url
|
||||
strncpy(szTempURL,szURL,255);
|
||||
|
||||
if(!strstr(szTempURL,HTTP_SEP_PROTO_HOST))
|
||||
return false;
|
||||
|
||||
// first find the service type
|
||||
pc = strtok(szTempURL,HTTP_SEP_PROTO_HOST);
|
||||
if(!pc)
|
||||
return false;
|
||||
// put service in uppercase
|
||||
len = strlen(pc);
|
||||
for(cpt = 0;cpt<=len;cpt++)
|
||||
{
|
||||
pc[cpt] = tolower(pc[cpt]);
|
||||
}
|
||||
// copy the service name
|
||||
strncpy(UrlInfo->szService,pc,sizeof(UrlInfo->szService));
|
||||
|
||||
// check for invalid service.
|
||||
if((strcmp(UrlInfo->szService,NET_SERVICE_HTTP))&&(strcmp(UrlInfo->szService,NET_SERVICE_FTP))&&
|
||||
(strcmp(UrlInfo->szService,NET_SERVICE_GOPHER)))
|
||||
return false;
|
||||
|
||||
// make a copy of the url
|
||||
strncpy(szTempURL,szURL,255);
|
||||
// find the port is there is none, port is 80 (standard)
|
||||
pc = strchr(szTempURL,':');
|
||||
if(pc)
|
||||
{
|
||||
if(pc = strtok(++pc,HTTP_SEP_SLASH))
|
||||
pcPort = strrchr(pc,HTTP_SEP_COLON_INT);
|
||||
else
|
||||
return false; // could not determine hostname
|
||||
if(pcPort)
|
||||
{
|
||||
UrlInfo->usPort = atoi(++pcPort);
|
||||
if(pc = strtok(pc,HTTP_SEP_COLON))
|
||||
strncpy(UrlInfo->szHost,pc,sizeof(UrlInfo->szHost));
|
||||
else
|
||||
return false; // could not find hostname
|
||||
}
|
||||
else
|
||||
{
|
||||
strncpy(UrlInfo->szHost,pc,sizeof(UrlInfo->szHost));
|
||||
UrlInfo->usPort = HTTP_DEFAULT_PORT; // well known http port
|
||||
}
|
||||
}
|
||||
else
|
||||
return false;
|
||||
// in case of badly formed url put the default http port
|
||||
if(!UrlInfo->usPort)
|
||||
UrlInfo->usPort = HTTP_DEFAULT_PORT;
|
||||
// make a copy of the url
|
||||
strncpy(szTempURL,szURL,255);
|
||||
// now find the object
|
||||
pcObj = strstr(szTempURL,UrlInfo->szHost);
|
||||
if(pcObj)
|
||||
{
|
||||
if(pcObj = strchr(pcObj+cpt,HTTP_SEP_SLASH_INT))
|
||||
strncpy(UrlInfo->szObject,pcObj,sizeof(UrlInfo->szObject));
|
||||
else
|
||||
strncpy(UrlInfo->szObject,"/",sizeof(UrlInfo->szObject));
|
||||
}
|
||||
else
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
/***SDOC*******************************************************************************************
|
||||
*
|
||||
* UbiSoft Development Network
|
||||
* ---------------------------
|
||||
*
|
||||
* FILE........: httpconfig.h
|
||||
* CREATION....: 11 Dec. 2001
|
||||
* AUTHOR......: Guillaume Plante
|
||||
*
|
||||
* DESCRIPTION.: wrapper class around winsock to get a file on the net via the http protocol,
|
||||
* using event objects and WSASelectEvent()
|
||||
*
|
||||
**************************************************************************************************
|
||||
* FILE HISTORY
|
||||
**************************************************************************************************
|
||||
*
|
||||
* DATE........:
|
||||
* AUTHOR......:
|
||||
* DESCRIPTION.:
|
||||
*
|
||||
******************************************************************************************EDOC***/
|
||||
|
||||
|
||||
#ifndef _HTTPCONFIG_H_
|
||||
#define _HTTPCONFIG_H_
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#define _DEFAULT_TIMEOUT 10
|
||||
|
||||
#define NET_SERVICE_HTTP "http"
|
||||
#define NET_SERVICE_FTP "ftp"
|
||||
#define NET_SERVICE_GOPHER "gopher"
|
||||
|
||||
#define HTTP_DEFAULT_PORT 80
|
||||
#define HTTP_SEP_COLON ":"
|
||||
#define HTTP_SEP_COLON_INT ':'
|
||||
#define HTTP_SEP_SLASH "/"
|
||||
#define HTTP_SEP_SLASH_INT '/'
|
||||
#define HTTP_SEP_PROTO_HOST "://"
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char szService[12];
|
||||
char szHost[128];
|
||||
char szObject[128];
|
||||
unsigned short int usPort;
|
||||
} _urlinfo;
|
||||
|
||||
class CGSHttpConfig
|
||||
{
|
||||
public:
|
||||
CGSHttpConfig(); // constructor
|
||||
~CGSHttpConfig(){}; // destructor
|
||||
bool Initialize(); // Initialize winsock.
|
||||
bool Uninitialize(); // clean up the place.
|
||||
// set the time out for a http query
|
||||
void SetTimeOut(int iTimeout){m_iTimeOut = iTimeout;};
|
||||
// get the timeout in second for a query
|
||||
int GetTimeOut(){return m_iTimeOut;};
|
||||
// get the file and write it into a buffer
|
||||
// (stdout if szFileBuf is NULL)
|
||||
int GetWebFile(const char *szURL,const char *szFileBuf = NULL);
|
||||
private:
|
||||
bool ParseURL(const char *szURL,_urlinfo *UrlInfo);
|
||||
// create a http GET request
|
||||
char *MakeRequest(char *szBuffer,const char *szFile,const char *szHost);
|
||||
void PrintError(const char *szError);// print the last error encountered
|
||||
bool m_bInitialised; // initialisation flag
|
||||
int m_iTimeOut; // Time out value in second for a query
|
||||
};
|
||||
|
||||
#endif //_HTTPCONFIG_H_
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// GSMASTERSERVERLAUNCHER.RC2 - resources Microsoft Visual C++ does not edit directly
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#error this file is not editable by Microsoft Visual C++
|
||||
#endif //APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Add manually edited resources here...
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
@@ -0,0 +1,50 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Developer Studio generated include file.
|
||||
// Used by gsMasterServerLauncher.rc
|
||||
//
|
||||
#define IDD_GSMASTERSERVERLAUNCHER_DIALOG 102
|
||||
#define IDP_SOCKETS_INIT_FAILED 103
|
||||
#define IDR_MAINFRAME 128
|
||||
#define IDC_EDITIPAddress 1000
|
||||
#define IDC_EDITPort 1001
|
||||
#define IDC_EDITUsername 1002
|
||||
#define IDC_EDITPassword 1003
|
||||
#define IDC_EDITVersion 1004
|
||||
#define IDC_EDITGameName 1005
|
||||
#define IDC_BUTTONLogin 1006
|
||||
#define IDC_EDITExtIP 1007
|
||||
#define IDC_BUTTONReqGroups 1008
|
||||
#define IDC_LISTGroups 1009
|
||||
#define IDC_BUTTONRegServer 1010
|
||||
#define IDC_EDITServerName 1011
|
||||
#define IDC_COMBOServerType 1012
|
||||
#define IDC_EDITMaxPlayers 1013
|
||||
#define IDC_EDITMaxVisitors 1014
|
||||
#define IDC_EDITGamePassword 1015
|
||||
#define IDC_EDITGrpData 1016
|
||||
#define IDC_EDITGameData 1017
|
||||
#define IDC_EDITGameVersion 1018
|
||||
#define IDC_EDITGSVersion 1019
|
||||
#define IDC_EDITAltData 1020
|
||||
#define IDC_BUTTONTermServer 1027
|
||||
#define IDC_EDITGroupID 1028
|
||||
#define IDC_BUTTONDisconnect 1029
|
||||
#define IDC_BUTTONUpdate 1030
|
||||
#define IDC_EDITLobbyIP 1031
|
||||
#define IDC_EDITLobbyPort 1032
|
||||
#define IDC_BUTTONDownload 1033
|
||||
#define IDC_BUTTONAbout 1034
|
||||
#define IDC_EDITGamePort 1035
|
||||
#define IDC_BUTTONStartMatch 1036
|
||||
#define IDC_BUTTONFinishMatch 1037
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 130
|
||||
#define _APS_NEXT_COMMAND_VALUE 32771
|
||||
#define _APS_NEXT_CONTROL_VALUE 1038
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
Reference in New Issue
Block a user