[Sphere-axis-commits] CVS: Axis common.cpp,1.17,1.18 CScriptObjects.cpp,1.15,1.16 Drewsky.cpp,1.12,1
Brought to you by:
pesterle
From: Philip E. <pes...@us...> - 2002-05-15 22:18:53
|
Update of /cvsroot/sphere-axis/Axis In directory usw-pr-cvs1:/tmp/cvs-serv5251 Modified Files: common.cpp CScriptObjects.cpp Drewsky.cpp Drewsky.h drewsky.rc MISCTAB.CPP RemoteConsole.cpp RemoteProfileDlg.cpp RemoteProfileDlg.h resource.h settingstab.cpp traveltab.cpp Log Message: More mods related to the multiple local profiles bit. Allowed for local scripts/remote console/ remote spawns. Index: common.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/common.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -r1.17 -r1.18 *** common.cpp 14 May 2002 20:03:34 -0000 1.17 --- common.cpp 15 May 2002 22:18:48 -0000 1.18 *************** *** 2828,2835 **** char szPath[MAX_PATH]; memset(szPath, 0x00, sizeof(szPath)); ! getcwd(szPath, sizeof(szPath)); strcat(szPath, "\\"); csPath = _T(szPath); ! BOOL bStatus = csfIni.Open(INI_FILE, CFile::modeRead | CFile::shareDenyNone ); if ( !bStatus ) return csPath; --- 2828,2839 ---- char szPath[MAX_PATH]; memset(szPath, 0x00, sizeof(szPath)); ! if ( Main->m_csRootDirectory == "" ) ! getcwd(szPath, sizeof(szPath)); ! else ! sprintf(szPath, "%s", Main->m_csRootDirectory); strcat(szPath, "\\"); csPath = _T(szPath); ! CString csIni = csPath + _T(INI_FILE); ! BOOL bStatus = csfIni.Open(csIni, CFile::modeRead | CFile::shareDenyNone ); if ( !bStatus ) return csPath; Index: CScriptObjects.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/CScriptObjects.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -r1.15 -r1.16 *** CScriptObjects.cpp 14 May 2002 20:03:34 -0000 1.15 --- CScriptObjects.cpp 15 May 2002 22:18:48 -0000 1.16 *************** *** 2478,2483 **** bool bFoundScripts = false; char cwd[MAX_PATH]; ! int cwdSize = sizeof(cwd); ! getcwd(&cwd[0], cwdSize); Main->m_log.Add("Current working directory is %s", cwd); --- 2478,2489 ---- bool bFoundScripts = false; char cwd[MAX_PATH]; ! memset(&cwd[0], 0x00, MAX_PATH); ! if ( Main->GetProfileType() == PROFILE_LOCAL ) ! sprintf(cwd, "%s", Main->m_csRootDirectory); ! if ( cwd[0] == 0x00 ) ! { ! int cwdSize = sizeof(cwd); ! getcwd(&cwd[0], cwdSize); ! } Main->m_log.Add("Current working directory is %s", cwd); *************** *** 2498,2501 **** --- 2504,2509 ---- Main->m_log.Add("Reading server INI file from working directory"); csLoadFile.Format("%s\\%s", cwd, INI_FILE); + Main->m_pScripts->m_tables.m_Sphere.m_csFilename = csLoadFile; + Main->m_pScripts->m_config.m_sSCPBaseDir = cwd; if ( !this->LoadFile(csLoadFile) && !bFoundScripts ) bFoundScripts = false; *************** *** 2775,2777 **** delete m_pDlg; m_pDlg = NULL; ! } \ No newline at end of file --- 2783,2785 ---- delete m_pDlg; m_pDlg = NULL; ! } \ No newline at end of file Index: Drewsky.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/Drewsky.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** Drewsky.cpp 14 May 2002 20:03:34 -0000 1.12 --- Drewsky.cpp 15 May 2002 22:18:48 -0000 1.13 *************** *** 128,131 **** --- 128,132 ---- m_dwItemSpawnColor = 0x0000FF00; m_dwNoNPCAnimations = 0; + m_dwRemoteSpawns = 0; m_iReceiveTimeout = 60000; m_dwDialogColor = GetSysColor(COLOR_3DFACE); *************** *** 190,199 **** { CString csKey; ! m_log.Add("Retrieving remote profiles"); csKey.Format("SOFTWARE\\Menasoft\\GM Tools\\Remote Profiles\\%s", GetProfileString()); m_csUserID = GetRegistryString("Username", "", HKEY_LOCAL_MACHINE, csKey); m_csPassword = GetRegistryString("Password", "", HKEY_LOCAL_MACHINE, csKey); m_csServerIP = GetRegistryString("ServerIP", "", HKEY_LOCAL_MACHINE, csKey); - m_csMonPassword = GetRegistryString("MonPassword", "", HKEY_LOCAL_MACHINE, csKey); m_csAxissvrPort = GetRegistryString("HogPort", "4006", HKEY_LOCAL_MACHINE, csKey); m_csSpherePort = GetRegistryString("TusPort", "2593", HKEY_LOCAL_MACHINE, csKey); --- 191,199 ---- { CString csKey; ! m_log.Add("Retrieving remote profile"); csKey.Format("SOFTWARE\\Menasoft\\GM Tools\\Remote Profiles\\%s", GetProfileString()); m_csUserID = GetRegistryString("Username", "", HKEY_LOCAL_MACHINE, csKey); m_csPassword = GetRegistryString("Password", "", HKEY_LOCAL_MACHINE, csKey); m_csServerIP = GetRegistryString("ServerIP", "", HKEY_LOCAL_MACHINE, csKey); m_csAxissvrPort = GetRegistryString("HogPort", "4006", HKEY_LOCAL_MACHINE, csKey); m_csSpherePort = GetRegistryString("TusPort", "2593", HKEY_LOCAL_MACHINE, csKey); *************** *** 203,207 **** m_csPassword = Encrypt(m_csPassword); ! m_csMonPassword = Encrypt(m_csMonPassword); } --- 203,224 ---- m_csPassword = Encrypt(m_csPassword); ! } ! if ( GetProfileType() == PROFILE_LOCAL ) ! { ! CString csKey; ! m_log.Add("Retrieving local profile"); ! csKey.Format("SOFTWARE\\Menasoft\\GM Tools\\Local Profiles\\%s", GetProfileString()); ! m_csRootDirectory = GetRegistryString("Root Directory", "", HKEY_LOCAL_MACHINE, csKey); ! m_csServerIP = GetRegistryString("ServerIP", "127.0.0.1", HKEY_LOCAL_MACHINE, csKey); ! m_csSpherePort = GetRegistryString("Port", "2593", HKEY_LOCAL_MACHINE, csKey); ! m_csUserID = GetRegistryString("Username", "", HKEY_LOCAL_MACHINE, csKey); ! m_csPassword = GetRegistryString("Password", "", HKEY_LOCAL_MACHINE, csKey); ! m_csAxissvrPort = GetRegistryString("HogPort", "4006", HKEY_LOCAL_MACHINE, csKey); ! m_dwRemoteSpawns = GetRegistryDword("Read Remote Spawnpoints", 0, HKEY_LOCAL_MACHINE, csKey); ! m_iReceiveTimeout = (int) GetRegistryDword("ReceiveTimeout", 60000, HKEY_LOCAL_MACHINE, csKey); ! if ( m_iReceiveTimeout < 1000 ) ! m_iReceiveTimeout = 1000; ! ! m_csPassword = Encrypt(m_csPassword); } Index: Drewsky.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/Drewsky.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** Drewsky.h 14 May 2002 20:03:34 -0000 1.9 --- Drewsky.h 15 May 2002 22:18:48 -0000 1.10 *************** *** 98,101 **** --- 98,102 ---- DWORD m_dwDialogColor; DWORD m_dwTextColor; + DWORD m_dwRemoteSpawns; bool m_bNoScripts; CStringArray m_saSpells; *************** *** 105,108 **** --- 106,110 ---- bool m_bKeepGoing; bool m_bSeerMode; + CString m_csRootDirectory; CString m_csUserID; CString m_csPassword; *************** *** 111,115 **** CString m_csAxissvrPort; CString m_csProfile; - CString m_csMonPassword; CRemoteConsole * m_pRConsole; CString m_csPosition; --- 113,116 ---- Index: drewsky.rc =================================================================== RCS file: /cvsroot/sphere-axis/Axis/drewsky.rc,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -r1.35 -r1.36 *** drewsky.rc 14 May 2002 20:03:34 -0000 1.35 --- drewsky.rc 15 May 2002 22:18:48 -0000 1.36 *************** *** 639,651 **** WS_VISIBLE PUSHBUTTON "Refresh Categories",IDC_REFRESHCATEGORIES,369,29,85,13 - GROUPBOX "Actions",IDC_STATIC,283,2,75,112 - GROUPBOX "Profiles",IDC_STATIC,168,2,113,112 - LTEXT "NPC Spawn Color",IDC_STATIC,374,69,58,8,NOT WS_GROUP - LTEXT "Item Spawn Color",IDC_STATIC,374,80,56,8,NOT WS_GROUP - CONTROL "",IDC_NPC_COLOR,"Static",SS_BLACKFRAME | SS_NOTIFY | - SS_SUNKEN,362,69,10,9 - CONTROL "",IDC_ITEM_COLOR,"Static",SS_BLACKFRAME | SS_NOTIFY | - SS_SUNKEN,362,80,10,9 - GROUPBOX "Command Mode",IDC_STATIC,360,91,113,23 CONTROL "dot",IDC_CMDMODE0,"Button",BS_AUTORADIOBUTTON | WS_GROUP,361,101,26,10 --- 639,642 ---- *************** *** 654,665 **** CONTROL "slash",IDC_CMDMODE2,"Button",BS_AUTORADIOBUTTON,440,101, 32,10 CONTROL "",IDC_DIALOG_COLOR,"Static",SS_BLACKFRAME | SS_NOTIFY | SS_SUNKEN | NOT WS_VISIBLE,362,49,10,9 CONTROL "",IDC_TEXT_COLOR,"Static",SS_BLACKFRAME | SS_NOTIFY | SS_SUNKEN | NOT WS_VISIBLE,362,59,10,9 LTEXT "Interface Dialog Color",IDC_STATIC,374,49,69,8,NOT WS_VISIBLE ! LTEXT "Interface Text Color",IDC_STATIC,374,59,63,8,NOT ! WS_VISIBLE END --- 645,665 ---- CONTROL "slash",IDC_CMDMODE2,"Button",BS_AUTORADIOBUTTON,440,101, 32,10 + LTEXT "Interface Text Color",IDC_STATIC,374,59,63,8,NOT + WS_VISIBLE + LTEXT "NPC Spawn Color",IDC_STATIC,374,69,58,8,NOT WS_GROUP + LTEXT "Item Spawn Color",IDC_STATIC,374,80,56,8,NOT WS_GROUP CONTROL "",IDC_DIALOG_COLOR,"Static",SS_BLACKFRAME | SS_NOTIFY | SS_SUNKEN | NOT WS_VISIBLE,362,49,10,9 CONTROL "",IDC_TEXT_COLOR,"Static",SS_BLACKFRAME | SS_NOTIFY | SS_SUNKEN | NOT WS_VISIBLE,362,59,10,9 + CONTROL "",IDC_NPC_COLOR,"Static",SS_BLACKFRAME | SS_NOTIFY | + SS_SUNKEN,362,69,10,9 + CONTROL "",IDC_ITEM_COLOR,"Static",SS_BLACKFRAME | SS_NOTIFY | + SS_SUNKEN,362,80,10,9 LTEXT "Interface Dialog Color",IDC_STATIC,374,49,69,8,NOT WS_VISIBLE ! GROUPBOX "Actions",IDC_STATIC,283,2,75,112 ! GROUPBOX "Profiles",IDC_STATIC,168,2,113,112 ! GROUPBOX "Command Mode",IDC_STATIC,360,91,113,23 END *************** *** 1821,1850 **** END ! IDD_REMOTEPROFILEDLG DIALOG DISCARDABLE 0, 0, 175, 172 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU ! CAPTION "Remote Profile" FONT 8, "MS Sans Serif" BEGIN ! DEFPUSHBUTTON "OK",IDOK,118,7,50,14 ! PUSHBUTTON "Cancel",IDCANCEL,118,24,50,14 ! RTEXT "Name",IDC_STATIC,65,49,20,8 ! RTEXT "Server IP",IDC_STATIC,55,64,30,8 ! RTEXT "Sphere Server Port",IDC_STATIC,7,79,78,8 ! RTEXT "Username",IDC_STATIC,52,94,33,8 ! RTEXT "Password",IDC_STATIC,53,109,32,8 ! RTEXT "Axis Server Port",IDC_STATIC,32,124,53,8 ! RTEXT "RemoteAdmin Password",IDC_STATIC,7,139,78,8 ! EDITTEXT IDC_RMTPROFILE_NAME,88,46,80,14,ES_AUTOHSCROLL ! EDITTEXT IDC_RMTPROFILE_IP,88,61,80,14,ES_AUTOHSCROLL ! EDITTEXT IDC_RMTPROFILE_TUSPORT,88,76,80,14,ES_AUTOHSCROLL ! EDITTEXT IDC_RMTPROFILE_USERNAME,88,91,80,14,ES_AUTOHSCROLL ! EDITTEXT IDC_RMTPROFILE_PASSWORD,88,106,80,14,ES_PASSWORD | ! ES_AUTOHSCROLL ! EDITTEXT IDC_RMTPROFILE_HOGPORT,88,121,80,14,ES_AUTOHSCROLL ! EDITTEXT IDC_RMTPROFILE_RMTPWD,88,136,80,14,ES_PASSWORD | ES_AUTOHSCROLL ! EDITTEXT IDC_RMTPROFILE_RECEIVETIMEOUT,88,151,80,14, ES_AUTOHSCROLL | ES_NUMBER ! LTEXT "Receive Timeout (ms)",IDC_STATIC,15,154,70,8 END --- 1821,1859 ---- END ! IDD_REMOTEPROFILEDLG DIALOG DISCARDABLE 0, 0, 182, 199 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU ! CAPTION "Script Profile" FONT 8, "MS Sans Serif" BEGIN ! CONTROL "Local",IDC_RADIO_LOCAL,"Button",BS_AUTORADIOBUTTON | ! BS_NOTIFY | WS_GROUP | WS_TABSTOP,13,20,33,10 ! CONTROL "Remote",IDC_RADIO_REMOTE,"Button",BS_AUTORADIOBUTTON | ! BS_NOTIFY | WS_GROUP,68,20,42,10 ! EDITTEXT IDC_RMTPROFILE_NAME,91,43,80,14,ES_AUTOHSCROLL ! EDITTEXT IDC_RMTPROFILE_IP,91,58,80,14,ES_AUTOHSCROLL ! EDITTEXT IDC_RMTPROFILE_TUSPORT,91,72,80,14,ES_AUTOHSCROLL ! EDITTEXT IDC_LOCALPROFILE_BASEDIR,91,92,80,14,ES_AUTOHSCROLL ! EDITTEXT IDC_RMTPROFILE_USERNAME,90,130,80,14,ES_AUTOHSCROLL ! EDITTEXT IDC_RMTPROFILE_PASSWORD,90,145,80,14,ES_PASSWORD | ES_AUTOHSCROLL ! EDITTEXT IDC_RMTPROFILE_HOGPORT,90,160,80,14,ES_AUTOHSCROLL ! EDITTEXT IDC_RMTPROFILE_RECEIVETIMEOUT,90,175,80,14, ES_AUTOHSCROLL | ES_NUMBER ! DEFPUSHBUTTON "OK",IDOK,125,7,50,14 ! PUSHBUTTON "Cancel",IDCANCEL,125,24,50,14 ! RTEXT "Name",IDC_STATIC,69,45,20,8 ! RTEXT "Server IP",IDC_STATIC,59,61,30,8 ! RTEXT "Sphere Server Port",IDC_STATIC,27,75,61,8 ! RTEXT "Username",IDC_STATIC,54,133,33,8 ! RTEXT "Password",IDC_STATIC,55,148,32,8 ! RTEXT "Axis Server Port",IDC_STATIC,36,163,51,8 ! LTEXT "Receive Timeout (ms)",IDC_STATIC,17,178,70,8 ! GROUPBOX "Remote Settings",IDC_STATIC,7,122,168,70 ! GROUPBOX "Local Settings",IDC_STATIC,7,85,168,37 ! GROUPBOX "Profile Type",IDC_STATIC,7,9,110,27 ! RTEXT "Base Script Directory",IDC_STATIC,22,95,67,8 ! CONTROL "Load Spawnpoints from Remote Server",IDC_REMOTESPAWNS, ! "Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,30, ! 108,141,9 END *************** *** 2750,2756 **** BEGIN LEFTMARGIN, 7 ! RIGHTMARGIN, 168 TOPMARGIN, 7 ! BOTTOMMARGIN, 165 END --- 2759,2765 ---- BEGIN LEFTMARGIN, 7 ! RIGHTMARGIN, 175 TOPMARGIN, 7 ! BOTTOMMARGIN, 191 END Index: MISCTAB.CPP =================================================================== RCS file: /cvsroot/sphere-axis/Axis/MISCTAB.CPP,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** MISCTAB.CPP 14 May 2002 20:03:34 -0000 1.11 --- MISCTAB.CPP 15 May 2002 22:18:48 -0000 1.12 *************** *** 830,835 **** this->m_ccSpellList.ResetContent(); ! Main->m_pScripts->LoadDefs(); ! Main->m_pScripts->LoadTables(); // Fill the spells list --- 830,835 ---- this->m_ccSpellList.ResetContent(); ! //Main->m_pScripts->LoadDefs(); ! //Main->m_pScripts->LoadTables(); // Fill the spells list *************** *** 856,860 **** { CDef * pDef = (CDef *) Main->m_pScripts->m_aDefs.GetAt(i); ! if ( pDef && pDef->m_csGroup == "MIDIS" ) { int index = this->m_ccbMusicList.AddString(pDef->m_csValue); --- 856,860 ---- { CDef * pDef = (CDef *) Main->m_pScripts->m_aDefs.GetAt(i); ! if ( pDef && pDef->m_csValue.Find("MIDI") != -1 ) { int index = this->m_ccbMusicList.AddString(pDef->m_csValue); Index: RemoteConsole.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/RemoteConsole.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** RemoteConsole.cpp 14 May 2002 20:03:35 -0000 1.9 --- RemoteConsole.cpp 15 May 2002 22:18:48 -0000 1.10 *************** *** 44,50 **** CString csSavePath; // Try to find out where to connect to ! if (Main->GetProfileType() == PROFILE_REMOTE) { m_csHostAddress = Main->m_csServerIP; CRemoteConnection remote; m_nHostPort = (UINT) remote.GetRemotePort(); --- 44,52 ---- CString csSavePath; // Try to find out where to connect to ! if (Main->GetProfileType() == PROFILE_REMOTE || Main->GetProfileType() == PROFILE_LOCAL) { m_csHostAddress = Main->m_csServerIP; + m_nHostPort = (UINT) atoi(Main->m_csSpherePort); + /* CRemoteConnection remote; m_nHostPort = (UINT) remote.GetRemotePort(); *************** *** 56,59 **** --- 58,62 ---- m_nHostPort = 2593; } + */ } else Index: RemoteProfileDlg.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/RemoteProfileDlg.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** RemoteProfileDlg.cpp 1 May 2002 03:33:10 -0000 1.3 --- RemoteProfileDlg.cpp 15 May 2002 22:18:48 -0000 1.4 *************** *** 47,54 **** m_csName = _T(""); m_csPwd = _T(""); - m_csRmtPwd = _T(""); m_csUsername = _T(""); m_csTusPort = _T(""); m_csReceiveTimeout = _T("60000"); //}}AFX_DATA_INIT } --- 47,56 ---- m_csName = _T(""); m_csPwd = _T(""); m_csUsername = _T(""); m_csTusPort = _T(""); m_csReceiveTimeout = _T("60000"); + m_csBaseDir = _T(""); + m_iProfile = 0; + m_bRemoteSpawns = false; //}}AFX_DATA_INIT } *************** *** 59,65 **** CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CRemoteProfileDlg) DDX_Control(pDX, IDC_RMTPROFILE_USERNAME, m_ceUsername); DDX_Control(pDX, IDC_RMTPROFILE_TUSPORT, m_ceTusPort); - DDX_Control(pDX, IDC_RMTPROFILE_RMTPWD, m_ceRmtPwd); DDX_Control(pDX, IDC_RMTPROFILE_PASSWORD, m_cePwd); DDX_Control(pDX, IDC_RMTPROFILE_NAME, m_ceName); --- 61,71 ---- CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CRemoteProfileDlg) + DDX_Control(pDX, IDC_REMOTESPAWNS, m_cbRemoteSpawns); + DDX_Control(pDX, IDC_RADIO_REMOTE, m_cbRemote); + DDX_Control(pDX, IDC_RADIO_LOCAL, m_cbLocal); + DDX_Control(pDX, IDC_RMTPROFILE_RECEIVETIMEOUT, m_ceReceiveTimeout); + DDX_Control(pDX, IDC_LOCALPROFILE_BASEDIR, m_ceBaseDir); DDX_Control(pDX, IDC_RMTPROFILE_USERNAME, m_ceUsername); DDX_Control(pDX, IDC_RMTPROFILE_TUSPORT, m_ceTusPort); DDX_Control(pDX, IDC_RMTPROFILE_PASSWORD, m_cePwd); DDX_Control(pDX, IDC_RMTPROFILE_NAME, m_ceName); *************** *** 70,77 **** DDX_Text(pDX, IDC_RMTPROFILE_NAME, m_csName); DDX_Text(pDX, IDC_RMTPROFILE_PASSWORD, m_csPwd); - DDX_Text(pDX, IDC_RMTPROFILE_RMTPWD, m_csRmtPwd); DDX_Text(pDX, IDC_RMTPROFILE_USERNAME, m_csUsername); DDX_Text(pDX, IDC_RMTPROFILE_TUSPORT, m_csTusPort); DDX_Text(pDX, IDC_RMTPROFILE_RECEIVETIMEOUT, m_csReceiveTimeout); //}}AFX_DATA_MAP } --- 76,83 ---- DDX_Text(pDX, IDC_RMTPROFILE_NAME, m_csName); DDX_Text(pDX, IDC_RMTPROFILE_PASSWORD, m_csPwd); DDX_Text(pDX, IDC_RMTPROFILE_USERNAME, m_csUsername); DDX_Text(pDX, IDC_RMTPROFILE_TUSPORT, m_csTusPort); DDX_Text(pDX, IDC_RMTPROFILE_RECEIVETIMEOUT, m_csReceiveTimeout); + DDX_Text(pDX, IDC_LOCALPROFILE_BASEDIR, m_csBaseDir); //}}AFX_DATA_MAP } *************** *** 80,83 **** --- 86,92 ---- BEGIN_MESSAGE_MAP(CRemoteProfileDlg, CDialog) //{{AFX_MSG_MAP(CRemoteProfileDlg) + ON_BN_CLICKED(IDC_RADIO_LOCAL, OnRadioLocal) + ON_BN_CLICKED(IDC_RADIO_REMOTE, OnRadioRemote) + ON_BN_CLICKED(IDC_REMOTESPAWNS, OnRemotespawns) //}}AFX_MSG_MAP END_MESSAGE_MAP() *************** *** 90,97 **** CDialog::OnInitDialog(); UpdateData(false); if ( this->m_csName != "" ) this->m_ceName.EnableWindow(FALSE); ! ! // TODO: Add extra initialization here return TRUE; // return TRUE unless you set the focus to a control --- 99,114 ---- CDialog::OnInitDialog(); UpdateData(false); + this->m_cbRemoteSpawns.SetCheck(m_bRemoteSpawns ? 1 : 0); + EnableWindows(m_iProfile == 0 ? true : false); + OnRemotespawns(); if ( this->m_csName != "" ) + { this->m_ceName.EnableWindow(FALSE); ! this->m_cbLocal.EnableWindow(FALSE); ! this->m_cbRemote.EnableWindow(FALSE); ! } ! this->m_cbLocal.SetCheck(m_iProfile == 0 ); ! this->m_cbRemote.SetCheck(m_iProfile == 1 ); ! return TRUE; // return TRUE unless you set the focus to a control *************** *** 102,105 **** --- 119,162 ---- { UpdateData(true); + if ( m_cbLocal.GetCheck() == 1 ) + m_iProfile = 0; + else + m_iProfile = 1; + m_bRemoteSpawns = m_cbRemoteSpawns.GetCheck() ? true : false; CDialog::OnOK(); + } + + void CRemoteProfileDlg::OnRadioLocal() + { + this->m_cbRemote.SetCheck(0); + EnableWindows(true); + + OnRemotespawns(); + } + + void CRemoteProfileDlg::OnRadioRemote() + { + this->m_cbLocal.SetCheck(0); + EnableWindows(false); + } + + void CRemoteProfileDlg::EnableWindows(bool bLocal) + { + this->m_ceBaseDir.EnableWindow(bLocal); + this->m_cbRemoteSpawns.EnableWindow(bLocal); + + this->m_ceHogPort.EnableWindow(!bLocal); + this->m_cePwd.EnableWindow(!bLocal); + this->m_ceUsername.EnableWindow(!bLocal); + this->m_ceReceiveTimeout.EnableWindow(!bLocal); + } + + void CRemoteProfileDlg::OnRemotespawns() + { + m_bRemoteSpawns = this->m_cbRemoteSpawns.GetCheck() ? true : false; + + this->m_ceHogPort.EnableWindow(m_bRemoteSpawns); + this->m_cePwd.EnableWindow(m_bRemoteSpawns); + this->m_ceUsername.EnableWindow(m_bRemoteSpawns); + this->m_ceReceiveTimeout.EnableWindow(m_bRemoteSpawns); } Index: RemoteProfileDlg.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/RemoteProfileDlg.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** RemoteProfileDlg.h 1 May 2002 03:33:10 -0000 1.4 --- RemoteProfileDlg.h 15 May 2002 22:18:48 -0000 1.5 *************** *** 43,50 **** //{{AFX_DATA(CRemoteProfileDlg) enum { IDD = IDD_REMOTEPROFILEDLG }; CEdit m_ceRemoteAccount; CEdit m_ceUsername; CEdit m_ceTusPort; - CEdit m_ceRmtPwd; CEdit m_cePwd; CEdit m_ceName; --- 43,54 ---- //{{AFX_DATA(CRemoteProfileDlg) enum { IDD = IDD_REMOTEPROFILEDLG }; + CButton m_cbRemoteSpawns; + CButton m_cbRemote; + CButton m_cbLocal; + CEdit m_ceReceiveTimeout; + CEdit m_ceBaseDir; CEdit m_ceRemoteAccount; CEdit m_ceUsername; CEdit m_ceTusPort; CEdit m_cePwd; CEdit m_ceName; *************** *** 55,62 **** CString m_csName; CString m_csPwd; - CString m_csRmtPwd; CString m_csUsername; CString m_csTusPort; CString m_csReceiveTimeout; //}}AFX_DATA --- 59,68 ---- CString m_csName; CString m_csPwd; CString m_csUsername; CString m_csTusPort; CString m_csReceiveTimeout; + CString m_csBaseDir; + int m_iProfile; + bool m_bRemoteSpawns; //}}AFX_DATA *************** *** 71,74 **** --- 77,81 ---- // Implementation protected: + void EnableWindows(bool bLocal); // Generated message map functions *************** *** 76,79 **** --- 83,89 ---- virtual BOOL OnInitDialog(); virtual void OnOK(); + afx_msg void OnRadioLocal(); + afx_msg void OnRadioRemote(); + afx_msg void OnRemotespawns(); //}}AFX_MSG DECLARE_MESSAGE_MAP() *************** *** 84,85 **** --- 94,96 ---- #endif // !defined(AFX_REMOTEPROFILEDLG_H__FD7E0E66_DB23_11D3_A38A_00805FD91B8C__INCLUDED_) + Index: resource.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/resource.h,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -r1.25 -r1.26 *** resource.h 14 May 2002 20:03:35 -0000 1.25 --- resource.h 15 May 2002 22:18:48 -0000 1.26 *************** *** 400,403 **** --- 400,404 ---- #define IDC_SAVEPWD 1033 #define IDC_AS_SPAWNMSG 1033 + #define IDC_REMOTESPAWNS 1033 #define IDC_BUTTON33 1034 #define IDC_CHECK2 1034 *************** *** 568,571 **** --- 569,573 ---- #define IDC_NSO_COPYBASE 1058 #define IDC_INDOORS 1058 + #define IDC_RADIO_LOCAL 1058 #define IDC_RADIO2 1059 #define IDC_EDIT1 1059 *************** *** 817,820 **** --- 819,823 ---- #define IDC_WOP9 1067 #define IDC_CLIENTLIST 1067 + #define IDC_RADIO_REMOTE 1067 #define IDC_RADIO11 1068 #define IDC_BESERKBRAIN 1068 *************** *** 826,829 **** --- 829,833 ---- #define IDC_FORCESAVE 1068 #define IDC_BUYVALUEMAX 1068 + #define IDC_LOCALPROFILE_NAME 1068 #define IDC_RADIO12 1069 #define IDC_UNDEADBRAIN 1069 *************** *** 835,838 **** --- 839,843 ---- #define IDC_SHUTDOWN_NOW 1069 #define IDC_SELLVALUEMAX 1069 + #define IDC_LOCALPROFILE_IP 1069 #define IDC_RADIO13 1070 #define IDC_DRAGONBRAIN 1070 *************** *** 843,846 **** --- 848,852 ---- #define IDC_WOP12 1070 #define IDC_BROADCAST 1070 + #define IDC_LOCALPROFILE_PORT 1070 #define IDC_RADIO14 1071 #define IDC_OFFDUTYBRAIN 1071 *************** *** 851,854 **** --- 857,861 ---- #define IDC_WOP13 1071 #define IDC_PROFILE_INFO 1071 + #define IDC_LOCALPROFILE_BASEDIR 1071 #define IDC_FLAG_VALUE 1072 #define IDC_NPCHPMIN 1072 Index: settingstab.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/settingstab.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -r1.17 -r1.18 *** settingstab.cpp 14 May 2002 20:03:35 -0000 1.17 --- settingstab.cpp 15 May 2002 22:18:48 -0000 1.18 *************** *** 174,178 **** { CString csProfile; ! csProfile.Format("Local: %", szBuffer); this->m_clcRmtProfiles.AddString(csProfile); } --- 174,178 ---- { CString csProfile; ! csProfile.Format("Local: %s", szBuffer); this->m_clcRmtProfiles.AddString(csProfile); } *************** *** 182,185 **** --- 182,186 ---- } // Read the existing remote profiles from the registry + iIndex = 0; lStatus = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Menasoft\\GM Tools\\Remote Profiles", 0, KEY_ALL_ACCESS, &hKey); if ( lStatus == ERROR_SUCCESS ) *************** *** 416,436 **** return; CString csKey, csRmtPwd, csPwd; - csRmtPwd = Encrypt(dlg.m_csRmtPwd); csPwd = Encrypt(dlg.m_csPwd); int iTimeout = atoi(dlg.m_csReceiveTimeout); if ( iTimeout < 1000 ) iTimeout = 1000; ! csKey.Format("SOFTWARE\\Menasoft\\GM Tools\\Remote Profiles\\%s", dlg.m_csName); ! Main->PutRegistryString("Username", dlg.m_csUsername, HKEY_LOCAL_MACHINE, csKey); ! Main->PutRegistryString("Password", csPwd, HKEY_LOCAL_MACHINE, csKey); ! Main->PutRegistryString("ServerIP", dlg.m_csIP, HKEY_LOCAL_MACHINE, csKey); ! Main->PutRegistryString("HoGPort", dlg.m_csHogPort, HKEY_LOCAL_MACHINE, csKey); ! Main->PutRegistryString("TUSPort", dlg.m_csTusPort, HKEY_LOCAL_MACHINE, csKey); ! Main->PutRegistryString("MonPassword", csRmtPwd, HKEY_LOCAL_MACHINE, csKey); ! Main->PutRegistryDword("ReceiveTimeout", (DWORD) iTimeout, HKEY_LOCAL_MACHINE, csKey); ! this->m_clcRmtProfiles.AddString(dlg.m_csName); ! this->m_clcRmtProfiles.SelectString(-1, dlg.m_csName); } --- 417,459 ---- return; CString csKey, csRmtPwd, csPwd; csPwd = Encrypt(dlg.m_csPwd); int iTimeout = atoi(dlg.m_csReceiveTimeout); + int iRemoteSpawns = dlg.m_bRemoteSpawns ? 1 : 0; if ( iTimeout < 1000 ) iTimeout = 1000; ! switch ( dlg.m_iProfile ) ! { ! case 0: ! { ! csKey.Format("SOFTWARE\\Menasoft\\GM Tools\\Local Profiles\\%s", dlg.m_csName); ! ! Main->PutRegistryString("Username", dlg.m_csUsername, HKEY_LOCAL_MACHINE, csKey); ! Main->PutRegistryString("Password", csPwd, HKEY_LOCAL_MACHINE, csKey); ! Main->PutRegistryString("HoGPort", dlg.m_csHogPort, HKEY_LOCAL_MACHINE, csKey); ! Main->PutRegistryString("ServerIP", dlg.m_csIP, HKEY_LOCAL_MACHINE, csKey); ! Main->PutRegistryString("Port", dlg.m_csTusPort, HKEY_LOCAL_MACHINE, csKey); ! Main->PutRegistryString("Root Directory", dlg.m_csBaseDir, HKEY_LOCAL_MACHINE, csKey); ! Main->PutRegistryDword("ReceiveTimeout", (DWORD) iTimeout, HKEY_LOCAL_MACHINE, csKey); ! Main->PutRegistryDword("Read Remote Spawnpoints", (DWORD) iRemoteSpawns, HKEY_LOCAL_MACHINE, csKey); ! } ! break; ! case 1: ! { ! csKey.Format("SOFTWARE\\Menasoft\\GM Tools\\Remote Profiles\\%s", dlg.m_csName); ! Main->PutRegistryString("Username", dlg.m_csUsername, HKEY_LOCAL_MACHINE, csKey); ! Main->PutRegistryString("Password", csPwd, HKEY_LOCAL_MACHINE, csKey); ! Main->PutRegistryString("ServerIP", dlg.m_csIP, HKEY_LOCAL_MACHINE, csKey); ! Main->PutRegistryString("HoGPort", dlg.m_csHogPort, HKEY_LOCAL_MACHINE, csKey); ! Main->PutRegistryString("TUSPort", dlg.m_csTusPort, HKEY_LOCAL_MACHINE, csKey); ! Main->PutRegistryDword("ReceiveTimeout", (DWORD) iTimeout, HKEY_LOCAL_MACHINE, csKey); ! } ! break; ! } ! CString csProfile; ! csProfile.Format("%s: %s", dlg.m_iProfile == 0 ? "Local" : "Remote", dlg.m_csName); ! this->m_clcRmtProfiles.AddString(csProfile); ! this->m_clcRmtProfiles.SelectString(-1, csProfile); } *************** *** 442,455 **** CRemoteProfileDlg dlg; dlg.m_csName = Main->GetProfileString(); ! dlg.m_csHogPort = Main->m_csAxissvrPort; ! dlg.m_csIP = Main->m_csServerIP; ! dlg.m_csPwd = Main->m_csPassword; ! dlg.m_csRmtPwd = Main->m_csMonPassword; ! dlg.m_csTusPort = Main->m_csSpherePort; ! dlg.m_csUsername = Main->m_csUserID; ! dlg.m_csReceiveTimeout.Format("%ld", Main->m_iReceiveTimeout); if ( dlg.DoModal() != IDOK ) return; int iTimeout = atoi(dlg.m_csReceiveTimeout); if ( iTimeout < 1000 ) --- 465,494 ---- CRemoteProfileDlg dlg; dlg.m_csName = Main->GetProfileString(); ! if ( Main->GetProfileType() == PROFILE_REMOTE ) ! { ! dlg.m_csHogPort = Main->m_csAxissvrPort; ! dlg.m_csIP = Main->m_csServerIP; ! dlg.m_csPwd = Main->m_csPassword; ! dlg.m_csTusPort = Main->m_csSpherePort; ! dlg.m_csUsername = Main->m_csUserID; ! dlg.m_csReceiveTimeout.Format("%ld", Main->m_iReceiveTimeout); ! dlg.m_iProfile = 1; ! } ! else ! { ! dlg.m_csHogPort = Main->m_csAxissvrPort; ! dlg.m_csIP = Main->m_csServerIP; ! dlg.m_csPwd = Main->m_csPassword; ! dlg.m_csTusPort = Main->m_csSpherePort; ! dlg.m_csUsername = Main->m_csUserID; ! dlg.m_csReceiveTimeout.Format("%ld", Main->m_iReceiveTimeout); ! dlg.m_csBaseDir = Main->m_csRootDirectory; ! dlg.m_bRemoteSpawns = Main->m_dwRemoteSpawns ? true : false; ! dlg.m_iProfile = 0; ! } if ( dlg.DoModal() != IDOK ) return; + int iRemoteSpawns = dlg.m_bRemoteSpawns ? 1 : 0; int iTimeout = atoi(dlg.m_csReceiveTimeout); if ( iTimeout < 1000 ) *************** *** 457,472 **** CString csKey, csRmtPwd, csPwd; - csRmtPwd = Encrypt(dlg.m_csRmtPwd); csPwd = Encrypt(dlg.m_csPwd); ! csKey.Format("SOFTWARE\\Menasoft\\GM Tools\\Remote Profiles\\%s", dlg.m_csName); ! Main->PutRegistryString("Username", dlg.m_csUsername, HKEY_LOCAL_MACHINE, csKey); ! Main->PutRegistryString("Password", csPwd, HKEY_LOCAL_MACHINE, csKey); ! Main->PutRegistryString("ServerIP", dlg.m_csIP, HKEY_LOCAL_MACHINE, csKey); ! Main->PutRegistryString("HoGPort", dlg.m_csHogPort, HKEY_LOCAL_MACHINE, csKey); ! Main->PutRegistryString("TUSPort", dlg.m_csTusPort, HKEY_LOCAL_MACHINE, csKey); ! Main->PutRegistryString("MonPassword", csRmtPwd, HKEY_LOCAL_MACHINE, csKey); ! Main->PutRegistryDword("ReceiveTimeout", (DWORD) iTimeout, HKEY_LOCAL_MACHINE, csKey); this->OnSelchangeRemoteprofiles(); --- 496,530 ---- CString csKey, csRmtPwd, csPwd; csPwd = Encrypt(dlg.m_csPwd); ! switch ( dlg.m_iProfile ) ! { ! case 0: ! { ! csKey.Format("SOFTWARE\\Menasoft\\GM Tools\\Local Profiles\\%s", dlg.m_csName); ! Main->PutRegistryString("Username", dlg.m_csUsername, HKEY_LOCAL_MACHINE, csKey); ! Main->PutRegistryString("Password", csPwd, HKEY_LOCAL_MACHINE, csKey); ! Main->PutRegistryString("HoGPort", dlg.m_csHogPort, HKEY_LOCAL_MACHINE, csKey); ! Main->PutRegistryString("ServerIP", dlg.m_csIP, HKEY_LOCAL_MACHINE, csKey); ! Main->PutRegistryString("Port", dlg.m_csTusPort, HKEY_LOCAL_MACHINE, csKey); ! Main->PutRegistryString("Root Directory", dlg.m_csBaseDir, HKEY_LOCAL_MACHINE, csKey); ! Main->PutRegistryDword("ReceiveTimeout", (DWORD) iTimeout, HKEY_LOCAL_MACHINE, csKey); ! Main->PutRegistryDword("Read Remote Spawns", (DWORD) iRemoteSpawns, HKEY_LOCAL_MACHINE, csKey); ! } ! break; ! case 1: ! { ! csKey.Format("SOFTWARE\\Menasoft\\GM Tools\\Remote Profiles\\%s", dlg.m_csName); ! ! Main->PutRegistryString("Username", dlg.m_csUsername, HKEY_LOCAL_MACHINE, csKey); ! Main->PutRegistryString("Password", csPwd, HKEY_LOCAL_MACHINE, csKey); ! Main->PutRegistryString("ServerIP", dlg.m_csIP, HKEY_LOCAL_MACHINE, csKey); ! Main->PutRegistryString("HoGPort", dlg.m_csHogPort, HKEY_LOCAL_MACHINE, csKey); ! Main->PutRegistryString("TUSPort", dlg.m_csTusPort, HKEY_LOCAL_MACHINE, csKey); ! Main->PutRegistryDword("ReceiveTimeout", (DWORD) iTimeout, HKEY_LOCAL_MACHINE, csKey); ! } ! break; ! } this->OnSelchangeRemoteprofiles(); *************** *** 487,493 **** Main->m_csAxissvrPort = ""; Main->m_csServerIP = ""; - Main->m_csMonPassword = ""; Main->GetProfileString() = ""; Main->m_iReceiveTimeout = 60000; } --- 545,551 ---- Main->m_csAxissvrPort = ""; Main->m_csServerIP = ""; Main->GetProfileString() = ""; Main->m_iReceiveTimeout = 60000; + Main->m_dwRemoteSpawns = 0; } *************** *** 496,511 **** { int iSel = this->m_clcRmtProfiles.GetCurSel(); ! if ( iSel == -1 ) ! { ! Main->m_csUserID = ""; ! Main->m_csPassword = ""; ! Main->m_csSpherePort = ""; ! Main->m_csAxissvrPort = ""; ! Main->m_csServerIP = ""; ! Main->m_csMonPassword = ""; ! Main->GetProfileString() = ""; ! Main->m_iReceiveTimeout = 60000; ! return; ! } this->m_clcRmtProfiles.GetText( iSel, Main->m_csProfile ); switch ( Main->GetProfileType() ) --- 554,568 ---- { int iSel = this->m_clcRmtProfiles.GetCurSel(); ! // Clear out all of the values ! Main->m_csUserID = ""; ! Main->m_csPassword = ""; ! Main->m_csSpherePort = ""; ! Main->m_csAxissvrPort = ""; ! Main->m_csServerIP = ""; ! Main->GetProfileString() = ""; ! Main->m_iReceiveTimeout = 60000; ! Main->m_csRootDirectory = ""; ! Main->m_dwRemoteSpawns = 0; ! this->m_clcRmtProfiles.GetText( iSel, Main->m_csProfile ); switch ( Main->GetProfileType() ) *************** *** 525,529 **** Main->m_csAxissvrPort = Main->GetRegistryString("HogPort", "4006", HKEY_LOCAL_MACHINE, csKey); Main->m_csSpherePort = Main->GetRegistryString("TusPort", "2593", HKEY_LOCAL_MACHINE, csKey); - Main->m_csMonPassword = Main->GetRegistryString("MonPassword", "", HKEY_LOCAL_MACHINE, csKey); Main->m_iReceiveTimeout = (int) Main->GetRegistryDword("ReceiveTimeout", 60000, HKEY_LOCAL_MACHINE, csKey); --- 582,585 ---- *************** *** 531,535 **** Main->m_iReceiveTimeout = 1000; Main->m_csPassword = Encrypt(Main->m_csPassword); - Main->m_csMonPassword = Encrypt(Main->m_csMonPassword); } this->m_cbRPDelete.EnableWindow(TRUE); --- 587,590 ---- *************** *** 537,540 **** --- 592,611 ---- break; case PROFILE_LOCAL: + { + CString csKey; + csKey.Format("SOFTWARE\\Menasoft\\GM Tools\\Local Profiles\\%s", Main->GetProfileString()); + Main->m_csUserID = Main->GetRegistryString("Username", "", HKEY_LOCAL_MACHINE, csKey); + Main->m_csPassword = Main->GetRegistryString("Password", "", HKEY_LOCAL_MACHINE, csKey); + Main->m_csServerIP = Main->GetRegistryString("ServerIP", "", HKEY_LOCAL_MACHINE, csKey); + Main->m_csAxissvrPort = Main->GetRegistryString("HogPort", "4006", HKEY_LOCAL_MACHINE, csKey); + Main->m_csSpherePort = Main->GetRegistryString("Port", "2593", HKEY_LOCAL_MACHINE, csKey); + Main->m_csRootDirectory = Main->GetRegistryString("Root Directory", "", HKEY_LOCAL_MACHINE, csKey); + Main->m_dwRemoteSpawns = Main->GetRegistryDword("Read Remote Spawns", 0, HKEY_LOCAL_MACHINE, csKey); + + Main->m_iReceiveTimeout = (int) Main->GetRegistryDword("ReceiveTimeout", 60000, HKEY_LOCAL_MACHINE, csKey); + if ( Main->m_iReceiveTimeout < 1000 ) + Main->m_iReceiveTimeout = 1000; + Main->m_csPassword = Encrypt(Main->m_csPassword); + } this->m_cbRPDelete.EnableWindow(TRUE); this->m_cbRPEdit.EnableWindow(TRUE); Index: traveltab.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/traveltab.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** traveltab.cpp 14 May 2002 20:03:35 -0000 1.13 --- traveltab.cpp 15 May 2002 22:18:48 -0000 1.14 *************** *** 680,686 **** // First we need to find the location of the world files CStdioFile csfIniFile; ! if (!csfIniFile.Open(INI_FILE, CFile::modeRead | CFile::shareDenyNone)) { ! sprintf(szBuf, "Error -- Could not open %s%s", INI_FILE, crlf); return; } --- 680,687 ---- // First we need to find the location of the world files CStdioFile csfIniFile; ! CString csIni = Main->m_csRootDirectory + _T(INI_FILE); ! if (!csfIniFile.Open(csIni, CFile::modeRead | CFile::shareDenyNone)) { ! sprintf(szBuf, "Error -- Could not open %s%s", csIni, crlf); return; } *************** *** 928,932 **** m_crosshairIndex = m_TravelMap.AddDrawObject(x, y, 1, 3, 0x00FFFFFF); ! if ( Main->GetProfileType() == PROFILE_REMOTE ) { CRemoteConnection remote; --- 929,933 ---- m_crosshairIndex = m_TravelMap.AddDrawObject(x, y, 1, 3, 0x00FFFFFF); ! if ( Main->GetProfileType() == PROFILE_REMOTE || ( Main->GetProfileType() == PROFILE_LOCAL && Main->m_dwRemoteSpawns ) ) { CRemoteConnection remote; |