[Sphere-axis-commits] CVS: Axis/S_Sphere52 RemoteConsoleDlg.cpp,NONE,1.1 RemoteConsoleDlg.h,NONE,1.1
Brought to you by:
pesterle
From: Philip E. <pes...@us...> - 2003-07-27 20:44:58
|
Update of /cvsroot/sphere-axis/Axis/S_Sphere52 In directory sc8-pr-cvs1:/tmp/cvs-serv9503/S_Sphere52 Modified Files: AccountDlg.cpp NameEditDlg.cpp PotionEdit.cpp Resource.h S_Sphere52.rc S_Sphere52.vcproj Scripts.cpp ScriptsMain.cpp ScriptsMain.h ScriptTables.cpp ScriptTables.h strings.h TOreDef.cpp XMLConfig.cpp XMLConfig.h Added Files: RemoteConsoleDlg.cpp RemoteConsoleDlg.h Log Message: no message --- NEW FILE: RemoteConsoleDlg.cpp --- /* $Id: RemoteConsoleDlg.cpp,v 1.1 2003/07/27 20:44:55 pesterle Exp $ ********************************************************************** * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify * it under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * ********************************************************************** */ // RemoteConsoleDlg.cpp : implementation file // #include "stdafx.h" #include "Scripts.h" #include "RemoteConsoleDlg.h" #include "RemoteConsole.h" #include <afxdlgs.h> #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CRemoteConsoleDlg dialog CRemoteConsoleDlg::CRemoteConsoleDlg(CWnd* pParent /*=NULL*/) : CDialog(CRemoteConsoleDlg::IDD, pParent) { CWaitCursor hourglass; this->m_bIsConnected = false; m_bLogging = false; m_csLogFile = _T(""); m_rConsole = NULL; //{{AFX_DATA_INIT(CRemoteConsoleDlg) //}}AFX_DATA_INIT } void CRemoteConsoleDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CRemoteConsoleDlg) DDX_Control(pDX, IDC_COMMAND_SEND, m_ccbCommand); DDX_Control(pDX, IDC_CONSOLE_SEND, m_ccbBroadcast); DDX_Control(pDX, IDC_ENABLE_LOGGING, m_cbLogging); DDX_Control(pDX, IDC_SENDCOMMAND, m_cbCommand); DDX_Control(pDX, IDC_SENDTEXT, m_cbBroadcast); DDX_Control(pDX, IDC_RC_VERBOSE, m_cbVerbose); DDX_Control(pDX, IDC_RC_SHUTDOWN, m_cbShutdown); DDX_Control(pDX, IDC_RC_SECURE, m_cbSecure); DDX_Control(pDX, IDC_RC_SAVE, m_cbSave); DDX_Control(pDX, IDC_RC_PROFILE, m_cbProfile); DDX_Control(pDX, IDC_RC_PAUSE, m_cbPause); DDX_Control(pDX, IDC_RC_LOG, m_cbLog); DDX_Control(pDX, IDC_RC_INFORMATION, m_cbInformation); DDX_Control(pDX, IDC_RC_HEARALL, m_cbHearall); DDX_Control(pDX, IDC_RC_GARBAGE, m_cbGarbage); DDX_Control(pDX, IDC_RC_CLIENT, m_cbClient); DDX_Control(pDX, IDC_RC_ACCOUNT, m_cbAccountUpdate); DDX_Control(pDX, IDC_RE_CONSOLE, m_creConsole); DDX_Control(pDX, IDC_RECONNECT, m_cbReconnect); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CRemoteConsoleDlg, CDialog) //{{AFX_MSG_MAP(CRemoteConsoleDlg) ON_BN_CLICKED(IDC_SENDTEXT, OnSendtext) ON_BN_CLICKED(IDC_RECONNECT, OnReconnect) ON_WM_TIMER() ON_WM_SIZE() ON_BN_CLICKED(IDC_RC_LOG, OnRcLog) ON_BN_CLICKED(IDC_RC_ACCOUNT, OnRcAccount) ON_BN_CLICKED(IDC_RC_CLIENT, OnRcClient) ON_BN_CLICKED(IDC_RC_GARBAGE, OnRcGarbage) ON_BN_CLICKED(IDC_RC_HEARALL, OnRcHearall) ON_BN_CLICKED(IDC_RC_INFORMATION, OnRcInformation) ON_BN_CLICKED(IDC_RC_PAUSE, OnRcPause) ON_BN_CLICKED(IDC_RC_PROFILE, OnRcProfile) ON_BN_CLICKED(IDC_RC_SAVE, OnRcSave) ON_BN_CLICKED(IDC_RC_SECURE, OnRcSecure) ON_BN_CLICKED(IDC_RC_SHUTDOWN, OnRcShutdown) ON_BN_CLICKED(IDC_RC_VERBOSE, OnRcVerbose) ON_BN_CLICKED(IDC_SENDCOMMAND, OnSendcommand) ON_BN_CLICKED(IDC_ENABLE_LOGGING, OnEnableLogging) ON_COMMAND(ID_RC_OPTIONS_CLEARWINDOWBUFFER, OnRcOptionsClearwindowbuffer) //}}AFX_MSG_MAP ON_MESSAGE(WM_RCONSOLEMESSAGE, OnRConsoleMessage) ON_MESSAGE(WM_RCONSOLERECONNECT, OnRConsoleReconnect) ON_WM_CLOSE() END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CRemoteConsoleDlg message handlers void CRemoteConsoleDlg::OnSendtext() { CString csMessage; this->m_ccbBroadcast.GetWindowText(csMessage); if ( csMessage.GetLength() > 75 ) { AfxMessageBox(locale->String(IDS_REMOTE_CMDTOOLONG), MB_OK); return; } m_rConsole->Broadcast(csMessage); // Add the _string to the listbox if ( m_ccbBroadcast.FindString(-1, csMessage) == -1 ) m_ccbBroadcast.AddString(csMessage); // Add the values in here to the registry CStringArray sa; for ( int i = 0; i < m_ccbBroadcast.GetCount(); i++ ) { CString csValue; m_ccbBroadcast.GetLBText(i, csValue); sa.Add(csValue); } Main->m_config.SetRCBroadcasts(&sa); } CRemoteConsoleDlg::~CRemoteConsoleDlg() { if (m_rConsole != NULL) { m_rConsole->m_bContinue = false; int i = 0; while (m_rConsole->IsConnected() && i < 100) { Sleep(100); i++; } delete m_rConsole; } } void CRemoteConsoleDlg::OnReconnect() { if (m_bIsConnected) { CWaitCursor hourglass; m_bIsConnected = false; this->m_rConsole->m_bContinue = false; int i = 0; this->m_cbReconnect.SetWindowText(locale->String(IDS_REMOTE_RECONNECT)); } else { if (m_rConsole != NULL) { m_bIsConnected = true; this->m_cbReconnect.SetWindowText(locale->String(IDS_REMOTE_DISCONNECT)); delete m_rConsole; m_rConsole = new CRemoteConsole(this->GetSafeHwnd()); SetTimer(this->m_nIDTimer, 1000, NULL); } } } void CRemoteConsoleDlg::OnTimer(UINT nIDEvent) { // Timer expired...Check to see if we are still connected if (this->m_rConsole->IsConnected()) { // Reset the timer? } else { this->m_cbReconnect.SetWindowText(locale->String(IDS_REMOTE_RECONNECT)); this->m_bIsConnected = false; // Kill the timer KillTimer(nIDEvent); } CString csTitle; csTitle.Format(_T("Remote Console - %s (%s)"), Main->GetProfileString(), m_rConsole->IsConnected() ? locale->String(IDS_RC_CONNECTED) : locale->String(IDS_RC_DISCONNECTED)); this->SetWindowText(csTitle); CDialog::OnTimer(nIDEvent); } BOOL CRemoteConsoleDlg::OnInitDialog() { CDialog::OnInitDialog(); Localize(); if (Main->m_pRConsole == NULL) this->m_rConsole = new CRemoteConsole(this->GetSafeHwnd()); else { this->m_rConsole = Main->m_pRConsole; this->m_rConsole->m_parentHWnd = this->GetSafeHwnd(); } this->m_bIsConnected = this->m_rConsole->IsConnected(); if (this->m_bIsConnected) this->m_cbReconnect.SetWindowText(locale->String(IDS_REMOTE_DISCONNECT)); this->m_ccbBroadcast.SetFocus(); this->m_nIDTimer = 4000; this->m_creConsole.LimitText(0x7FFFFFFF); // Get the current positions of all the windows GetWindowRect(m_crOriginal); m_cbAccountUpdate.GetWindowRect(m_crAccount); m_cbClient.GetWindowRect(m_crClient); m_cbGarbage.GetWindowRect(m_crGarbage); m_cbHearall.GetWindowRect(m_crHearAll); m_cbInformation.GetWindowRect(m_crInformation); m_cbLog.GetWindowRect(m_crLog); m_cbPause.GetWindowRect(m_crPause); m_cbProfile.GetWindowRect(m_crProfile); m_cbReconnect.GetWindowRect(m_crReConnect); m_cbSave.GetWindowRect(m_crSave); m_cbSecure.GetWindowRect(m_crSecure); m_cbShutdown.GetWindowRect(m_crShutdown); m_cbVerbose.GetWindowRect(m_crVerbose); m_ccbBroadcast.GetWindowRect(m_crText); m_creConsole.GetWindowRect(m_crConsole); m_cbBroadcast.GetWindowRect(m_crBroadcast); m_cbCommand.GetWindowRect(m_crCommand); m_ccbCommand.GetWindowRect(m_crCommandText); m_cbLogging.GetWindowRect(m_crLogging); ScreenToClient(m_crOriginal); ScreenToClient(m_crAccount); ScreenToClient(m_crClient); ScreenToClient(m_crGarbage); ScreenToClient(m_crHearAll); ScreenToClient(m_crInformation); ScreenToClient(m_crLog); ScreenToClient(m_crPause); ScreenToClient(m_crProfile); ScreenToClient(m_crReConnect); ScreenToClient(m_crSave); ScreenToClient(m_crSecure); ScreenToClient(m_crShutdown); ScreenToClient(m_crVerbose); ScreenToClient(m_crText); ScreenToClient(m_crConsole); ScreenToClient(m_crBroadcast); ScreenToClient(m_crCommand); ScreenToClient(m_crCommandText); ScreenToClient(m_crLogging); iTop = m_crConsole.top - m_crOriginal.top; iLeft = m_crConsole.left - m_crOriginal.left; iRight = m_crConsole.right - m_crOriginal.right; iBottom = m_crText.bottom - m_crOriginal.bottom; CStringArray sa; Main->m_config.GetRCBroadcasts(&sa); m_ccbBroadcast.ResetContent(); for ( int i = 0; i < sa.GetSize(); i++ ) m_ccbBroadcast.AddString(sa.GetAt(i)); Main->m_config.GetRCCommands(&sa); m_ccbCommand.ResetContent(); for ( i = 0; i < sa.GetSize(); i++ ) m_ccbCommand.AddString(sa.GetAt(i)); SetTimer(this->m_nIDTimer, 1000, NULL); return FALSE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } LRESULT CRemoteConsoleDlg::OnRConsoleMessage(WPARAM wParam, LPARAM lParam) { // this is a message from m_rConsole TCHAR * pText = (TCHAR *) wParam; if (pText == 0x00) return 0; TCHAR crlf [] = {0x0d, 0x0a, 0x00}; TCHAR eol [] = {0x0a, 0x00}; TCHAR * pNewText = new TCHAR [_tcsclen(pText) + 1]; memset(&pNewText[0], 0x00, _tcsclen(pText) + 1); int iPtr = 0; int iScrollCnt = 0; for ( int i = 0; i < (int) _tcsclen(pText); i++ ) { if (*(pText + i) == 0x08 && iPtr > 0) { // backspace iPtr--; pNewText[iPtr] = 0x00; } else { if ( *(pText + i) != 0x08 ) { if ( *(pText + i) == 0x0d ) iScrollCnt++; pNewText[iPtr] = *(pText + i); iPtr++; } } } pNewText[iPtr] = 0x00; // Log it try { if ( m_bLogging && m_csLogFile != _T("") ) { CStdioFile file; CString csText = pNewText; csText.Replace(crlf, _T("\n")); if ( file.Open(m_csLogFile, CFile::modeWrite | CFile::modeCreate | CFile::modeNoTruncate | CFile::typeText | CFile::shareDenyWrite) ) { file.SeekToEnd(); file.WriteString(csText); file.Close(); } } } catch (CFileException * e) { e->Delete(); } int lastLine = m_creConsole.GetLineCount(); int lastchar = m_creConsole.LineIndex(lastLine); m_creConsole.SetSel(lastchar, lastchar); m_creConsole.ReplaceSel(pNewText); m_creConsole.LineScroll(iScrollCnt); delete [] pNewText; return 0; } BOOL CRemoteConsoleDlg::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo) { if (nID == 2 ) { //CMiscTab *pParent = ( CMiscTab * ) m_pParent; //pParent->HitConsole(); //return true; } return CDialog::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo); } BOOL CRemoteConsoleDlg::Create( UINT IDD, CWnd* pParentWnd) { this->m_pParent = pParentWnd; return CDialog::Create(IDD, pParentWnd); } LRESULT CRemoteConsoleDlg::OnRConsoleReconnect(WPARAM wParam, LPARAM lParam) { this->m_cbReconnect.SetWindowText(locale->String(IDS_REMOTE_DISCONNECT)); this->m_bIsConnected = true; SetTimer(this->m_nIDTimer, 1000, NULL); this->m_rConsole = ( CRemoteConsole * ) wParam; return 0; } void CRemoteConsoleDlg::OnSize(UINT nType, int cx, int cy) { // Make sure we aren't trying to be narrower or shorter than the original if ( cx < m_crOriginal.Width() ) cx = m_crOriginal.Width(); if ( cy < m_crOriginal.Height() ) cy = m_crOriginal.Height(); int dx, dy; dx = 0; dy = 0; CRect crNew; GetWindowRect(crNew); ScreenToClient(crNew); dx = crNew.Width() - m_crOriginal.Width(); dy = crNew.Height() - m_crOriginal.Height(); // Resize the console window m_creConsole.MoveWindow(m_crConsole.left , m_crConsole.top, m_crConsole.Width() + dx, m_crConsole.Height() + dy); // Move the other windows m_cbAccountUpdate.MoveWindow(m_crAccount.left, m_crAccount.top + dy, m_crAccount.Width(), m_crAccount.Height()); m_cbClient.MoveWindow(m_crClient.left, m_crClient.top + dy, m_crClient.Width(), m_crClient.Height()); m_cbGarbage.MoveWindow(m_crGarbage.left, m_crGarbage.top + dy, m_crGarbage.Width(), m_crGarbage.Height()); m_cbHearall.MoveWindow(m_crHearAll.left, m_crHearAll.top + dy, m_crHearAll.Width(), m_crHearAll.Height()); m_cbInformation.MoveWindow(m_crInformation.left, m_crInformation.top + dy, m_crInformation.Width(), m_crInformation.Height()); m_cbLog.MoveWindow(m_crLog.left, m_crLog.top + dy, m_crLog.Width(), m_crLog.Height()); m_cbPause.MoveWindow(m_crPause.left, m_crPause.top + dy, m_crPause.Width(), m_crPause.Height()); m_cbProfile.MoveWindow(m_crProfile.left, m_crProfile.top + dy, m_crProfile.Width(), m_crProfile.Height()); m_cbReconnect.MoveWindow(m_crReConnect.left, m_crReConnect.top + dy, m_crReConnect.Width(), m_crReConnect.Height()); m_cbSave.MoveWindow(m_crSave.left, m_crSave.top + dy, m_crSave.Width(), m_crSave.Height()); m_cbSecure.MoveWindow(m_crSecure.left, m_crSecure.top + dy, m_crSecure.Width(), m_crSecure.Height()); m_cbShutdown.MoveWindow(m_crShutdown.left, m_crShutdown.top + dy, m_crShutdown.Width(), m_crShutdown.Height()); m_cbVerbose.MoveWindow(m_crVerbose.left, m_crVerbose.top + dy, m_crVerbose.Width(), m_crVerbose.Height()); m_ccbBroadcast.MoveWindow(m_crText.left, m_crText.top + dy, m_crText.Width(), m_crText.Height()); m_cbBroadcast.MoveWindow(m_crBroadcast.left, m_crBroadcast.top + dy, m_crBroadcast.Width(), m_crBroadcast.Height()); m_cbCommand.MoveWindow(m_crCommand.left, m_crCommand.top + dy, m_crCommand.Width(), m_crCommand.Height()); m_ccbCommand.MoveWindow(m_crCommandText.left, m_crCommandText.top + dy, m_crCommandText.Width(), m_crCommandText.Height()); m_cbLogging.MoveWindow(m_crLogging.left, m_crLogging.top + dy, m_crLogging.Width(), m_crLogging.Height()); CDialog::OnSize(nType, cx, cy); this->Invalidate(); } void CRemoteConsoleDlg::OnRcLog() { m_rConsole->ToggleLog(); } void CRemoteConsoleDlg::OnRcAccount() { m_rConsole->AccountUpdate(); } void CRemoteConsoleDlg::OnRcClient() { m_rConsole->ClientList(); } void CRemoteConsoleDlg::OnRcGarbage() { m_rConsole->GarbageCollect(); } void CRemoteConsoleDlg::OnRcHearall() { m_rConsole->ToggleHearAll(); } void CRemoteConsoleDlg::OnRcInformation() { m_rConsole->Information(); } void CRemoteConsoleDlg::OnRcPause() { m_rConsole->Pause(); } void CRemoteConsoleDlg::OnRcProfile() { m_rConsole->ProfileInfo(); } void CRemoteConsoleDlg::OnRcSave() { m_rConsole->ForceSave(); } void CRemoteConsoleDlg::OnRcSecure() { m_rConsole->ToggleSecure(); } void CRemoteConsoleDlg::OnRcShutdown() { m_rConsole->Shutdown(); } void CRemoteConsoleDlg::OnRcVerbose() { m_rConsole->ToggleVerbose(); } void CRemoteConsoleDlg::OnSendcommand() { CString csMessage; this->m_ccbCommand.GetWindowText(csMessage); if ( csMessage.GetLength() > 75 ) { AfxMessageBox(locale->String(IDS_REMOTE_CMDTOOLONG), MB_OK); return; } m_rConsole->Command(csMessage); this->m_ccbCommand.SetWindowText(_T("")); // Add the _string to the listbox if ( m_ccbCommand.FindString(-1, csMessage) == -1 ) m_ccbCommand.AddString(csMessage); // Add the values in here to the registry CStringArray sa; for ( int i = 0; i < m_ccbCommand.GetCount(); i++ ) { CString csValue; m_ccbCommand.GetLBText(i, csValue); sa.Add(csValue); } Main->m_config.SetRCCommands(&sa); } void CRemoteConsoleDlg::OnEnableLogging() { m_csLogFile = _T(""); m_bLogging = !m_bLogging; if ( m_bLogging ) { // Find out which file to log to CFileDialog dlg(FALSE, _T(".log"), NULL, OFN_HIDEREADONLY, _T("Log Files (*.log)|*.log||") , NULL); if ( dlg.DoModal() == IDOK ) m_csLogFile = dlg.GetFileName(); } if ( m_csLogFile == _T("") ) { m_bLogging = false; m_cbLogging.SetCheck(0); } } void CRemoteConsoleDlg::OnRcOptionsClearwindowbuffer() { this->m_creConsole.SetSel(0, -1); this->m_creConsole.ReplaceSel(_T("")); this->m_creConsole.EmptyUndoBuffer(); } void CRemoteConsoleDlg::Localize(void) { locale->LocalizeWindow(IDD, 0, NULL, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_COMMAND_SEND, (CWnd*)&m_ccbCommand, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_CONSOLE_SEND, (CWnd*)&m_ccbBroadcast, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_ENABLE_LOGGING, (CWnd*)&m_cbLogging, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_SENDCOMMAND, (CWnd*)&m_cbCommand, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_SENDTEXT, (CWnd*)&m_cbBroadcast, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_RC_VERBOSE, (CWnd*)&m_cbVerbose, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_RC_SHUTDOWN, (CWnd*)&m_cbShutdown, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_RC_SECURE, (CWnd*)&m_cbSecure, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_RC_SAVE, (CWnd*)&m_cbSave, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_RC_PROFILE, (CWnd*)&m_cbProfile, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_RC_PAUSE, (CWnd*)&m_cbPause, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_RC_LOG, (CWnd*)&m_cbLog, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_RC_INFORMATION, (CWnd*)&m_cbInformation, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_RC_HEARALL, (CWnd*)&m_cbHearall, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_RC_GARBAGE, (CWnd*)&m_cbGarbage, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_RC_CLIENT, (CWnd*)&m_cbClient, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_RC_ACCOUNT, (CWnd*)&m_cbAccountUpdate, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_RE_CONSOLE, (CWnd*)&m_creConsole, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_RECONNECT, (CWnd*)&m_cbReconnect, (CWnd*)this); } void CRemoteConsoleDlg::OnClose() { Main->m_pScripts->DeleteRC(); CDialog::OnClose(); } --- NEW FILE: RemoteConsoleDlg.h --- /* $Id: RemoteConsoleDlg.h,v 1.1 2003/07/27 20:44:55 pesterle Exp $ ********************************************************************** * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify * it under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * ********************************************************************** */ #if !defined(AFX_REMOTECONSOLEDLG_H__5D6AFB61_2981_11D3_8723_00805FD91B8C__INCLUDED_) #define AFX_REMOTECONSOLEDLG_H__5D6AFB61_2981_11D3_8723_00805FD91B8C__INCLUDED_ #include "RemoteConsole.h" // Added by ClassView #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 // RemoteConsoleDlg.h : header file // ///////////////////////////////////////////////////////////////////////////// // CRemoteConsoleDlg dialog class CRemoteConsoleDlg : public CDialog { // Construction public: CString m_csCommand; bool m_bIsConnected; int m_nIDTimer; CStringArray m_saMessages; virtual ~CRemoteConsoleDlg(); CRemoteConsole * m_rConsole; CRemoteConsoleDlg(CWnd* pParent = NULL); // standard constructor // Dialog Data //{{AFX_DATA(CRemoteConsoleDlg) enum { IDD = IDD_REMOTECONSOLEDLG }; CComboBox m_ccbCommand; CComboBox m_ccbBroadcast; CButton m_cbLogging; CButton m_cbCommand; CButton m_cbBroadcast; CButton m_cbVerbose; CButton m_cbShutdown; CButton m_cbSecure; CButton m_cbSave; CButton m_cbProfile; CButton m_cbPause; CButton m_cbLog; CButton m_cbInformation; CButton m_cbHearall; CButton m_cbGarbage; CButton m_cbClient; CButton m_cbAccountUpdate; CRichEditCtrl m_creConsole; CButton m_cbReconnect; //}}AFX_DATA // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CRemoteConsoleDlg) public: virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo); virtual BOOL Create( UINT IDD, CWnd* pParentWnd); protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support //}}AFX_VIRTUAL LRESULT OnRConsoleMessage(WPARAM wParam, LPARAM lParam); LRESULT OnRConsoleReconnect(WPARAM wParam, LPARAM lParam); // Implementation protected: CString m_csLogFile; bool m_bLogging; CWnd * m_pParent; CRect m_crConsole, m_crLog, m_crVerbose, m_crHearAll, m_crPause, m_crSecure, m_crGarbage; CRect m_crInformation, m_crClient, m_crSave, m_crShutdown, m_crProfile, m_crAccount, m_crBroadcast; CRect m_crText, m_crReConnect, m_crCommand, m_crCommandText, m_crLogging, m_crOriginal; int iTop, iLeft, iBottom, iRight; // Generated message map functions //{{AFX_MSG(CRemoteConsoleDlg) afx_msg void OnSendtext(); afx_msg void OnReconnect(); afx_msg void OnTimer(UINT nIDEvent); afx_msg void OnSize(UINT nType, int cx, int cy); afx_msg void OnRcLog(); afx_msg void OnRcAccount(); afx_msg void OnRcClient(); afx_msg void OnRcGarbage(); afx_msg void OnRcHearall(); afx_msg void OnRcInformation(); afx_msg void OnRcPause(); afx_msg void OnRcProfile(); afx_msg void OnRcSave(); afx_msg void OnRcSecure(); afx_msg void OnRcShutdown(); afx_msg void OnRcVerbose(); virtual BOOL OnInitDialog(); afx_msg void OnSendcommand(); afx_msg void OnEnableLogging(); afx_msg void OnRcOptionsClearwindowbuffer(); //}}AFX_MSG DECLARE_MESSAGE_MAP() public: void Localize(void); afx_msg void OnClose(); }; //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif // !defined(AFX_REMOTECONSOLEDLG_H__5D6AFB61_2981_11D3_8723_00805FD91B8C__INCLUDED_) Index: AccountDlg.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/AccountDlg.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** AccountDlg.cpp 9 Jul 2003 19:57:25 -0000 1.2 --- AccountDlg.cpp 27 Jul 2003 20:44:55 -0000 1.3 *************** *** 94,98 **** _T("developer"), _T("admin"), ! _T("owner"), }; --- 94,98 ---- _T("developer"), _T("admin"), ! // _T("owner"), }; *************** *** 189,193 **** this->m_ccbLevel.AddString(_T("Developer")); this->m_ccbLevel.AddString(_T("Admin")); ! this->m_ccbLevel.AddString(_T("Owner")); this->m_ccbLevel.SetItemData(0, 0); this->m_ccbLevel.SetItemData(1, 1); --- 189,193 ---- this->m_ccbLevel.AddString(_T("Developer")); this->m_ccbLevel.AddString(_T("Admin")); ! // this->m_ccbLevel.AddString(_T("Owner")); this->m_ccbLevel.SetItemData(0, 0); this->m_ccbLevel.SetItemData(1, 1); *************** *** 364,368 **** else { ! if ( csfIniFile.Open(_T("sphere.ini"), CFile::modeRead | CFile::shareDenyNone) ) { CString csLine; --- 364,369 ---- else { ! csFile.Format(_T("%s\\%s"), Main->m_pScripts->Profile()->BaseDirectory(), _T("sphere.ini")); ! if ( csfIniFile.Open(csFile, CFile::modeRead | CFile::shareDenyNone) ) { CString csLine; *************** *** 619,623 **** else { ! if ( csfIniFile.Open(_T("sphere.ini"), CFile::modeRead | CFile::shareDenyNone) ) { CString csLine; --- 620,625 ---- else { ! csFile.Format(_T("%s\\%s"), Main->m_pScripts->Profile()->BaseDirectory(), _T("sphere.ini")); ! if ( csfIniFile.Open(csFile, CFile::modeRead | CFile::shareDenyNone) ) { CString csLine; Index: NameEditDlg.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/NameEditDlg.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** NameEditDlg.cpp 11 Jul 2003 17:25:25 -0000 1.3 --- NameEditDlg.cpp 27 Jul 2003 20:44:55 -0000 1.4 *************** *** 240,244 **** block.m_bIgnoreComments = true; block.m_bStringsOnly = true; ! block.Load(_T("")); for ( int i = 0; i < block.GetSize(); i++ ) { --- 240,244 ---- block.m_bIgnoreComments = true; block.m_bStringsOnly = true; ! block.Load(_T("[%s]")); for ( int i = 0; i < block.GetSize(); i++ ) { Index: PotionEdit.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/PotionEdit.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** PotionEdit.cpp 11 Jul 2003 17:25:25 -0000 1.3 --- PotionEdit.cpp 27 Jul 2003 20:44:55 -0000 1.4 *************** *** 94,100 **** { CTPotionDef * pPotion = (CTPotionDef *) Main->m_pScripts->m_tables.m_potions.GetAt(i); if ( pPotion ) { ! int iEntry = this->m_ccbEntry.AddString(pPotion->m_csName); this->m_ccbEntry.SetItemDataPtr(iEntry, (void *) pPotion); } --- 94,101 ---- { CTPotionDef * pPotion = (CTPotionDef *) Main->m_pScripts->m_tables.m_potions.GetAt(i); + pPotion->Load(_T("[Potion %s]")); if ( pPotion ) { ! int iEntry = this->m_ccbEntry.AddString(pPotion->m_csValue); this->m_ccbEntry.SetItemDataPtr(iEntry, (void *) pPotion); } Index: Resource.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/Resource.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** Resource.h 25 Jul 2003 05:27:32 -0000 1.14 --- Resource.h 27 Jul 2003 20:44:55 -0000 1.15 *************** *** 25,28 **** --- 25,29 ---- #define IDD_STATRATEEDIT_DLG 171 #define IDD_SPELLEDITDLG 172 + #define IDD_REMOTECONSOLEDLG 174 #define IDD_WOPEDITDLG 175 #define IDD_ORE_EDIT_DLG 177 *************** *** 41,44 **** --- 42,46 ---- #define IDD_PROFILE_EDIT 202 #define IDC_PROFILE_LIST 203 + #define IDR_REMOTECONSOLE_MENU 203 #define IDC_PROFILE_PARMS 204 #define IDI_DOC 204 *************** *** 98,101 **** --- 100,104 ---- #define IDC_NEWTRIGGER 1001 #define IDC_SGADD 1001 + #define IDC_SENDTEXT 1001 #define IDC_NPCATTRREMOVE 1002 #define IDC_OREREMOVE 1002 *************** *** 107,110 **** --- 110,114 ---- #define IDC_NEWREGIONTRIG 1002 #define IDC_SGREMOVE 1002 + #define IDC_SENDCOMMAND 1002 #define IDC_IEPALETTE 1003 #define IDC_NEWNPC 1003 *************** *** 114,117 **** --- 118,122 ---- #define IDC_REMOVESKILL 1003 #define IDC_SGADDCATEGORY 1003 + #define IDC_RECONNECT 1003 #define IDC_ITEM_NEW 1004 #define IDC_EDITNPC 1004 *************** *** 119,122 **** --- 124,128 ---- #define IDC_TMPL_APPLY 1004 #define IDC_NEWSUBMENU 1004 + #define IDC_RC_LOG 1004 #define IDC_ITEM_EDIT 1005 #define IDC_APPLYNPCEDITS 1005 *************** *** 125,128 **** --- 131,135 ---- #define IDC_EDITENTRY 1005 #define IDC_NEWSPAWNGROUP 1005 + #define IDC_RC_VERBOSE 1005 #define IDC_ITEM_APPLY 1006 #define IDC_CANCELNPCEDITS 1006 *************** *** 130,148 **** --- 137,165 ---- #define IDC_ADDRESOURCE 1006 #define IDC_INSRTCOND 1006 + #define IDC_RC_HEARALL 1006 #define IDC_ITEM_CANCEL 1007 #define IDC_NPCADDCATEGORY 1007 #define IDC_ADDSKILL 1007 #define IDC_INSRTATTR 1007 + #define IDC_RC_PAUSE 1007 #define IDC_NPCPALETTE 1008 #define IDC_MOVEUP 1008 #define IDC_PDONE 1008 #define IDC_INSRTREF 1008 + #define IDC_RC_SECURE 1008 #define IDC_NPCADDSUBSECTION 1009 #define IDC_MOVEDOWN 1009 #define IDC_PCANCEL 1009 #define IDC_INSRTVERB 1009 + #define IDC_RC_GARBAGE 1009 #define IDC_INSRTEVAL 1010 + #define IDC_RC_INFORMATION 1010 + #define IDC_RC_CLIENT 1011 #define IDC_INSRTEVNT 1012 + #define IDC_RC_SAVE 1012 #define IDC_INSRTOP 1013 + #define IDC_RC_SHUTDOWN 1013 + #define IDC_RC_PROFILE 1014 + #define IDC_RC_ACCOUNT 1015 #define IDC_NPCATTRLIST 1031 #define IDC_ORELIST 1031 *************** *** 170,173 **** --- 187,191 ---- #define IDC_VENDITEM_CHANCE 1033 #define IDC_REPLICATE 1033 + #define IDC_ENABLE_LOGGING 1033 #define IDC_REPAIRABLE 1034 #define IDC_DRAWRECTS 1034 *************** *** 199,203 **** #define IDC_FOODTYPE_NAME 1059 #define IDC_SGENTRY 1059 - #define IDC_ACCT 1059 #define IDC_NPCDEFNAME 1060 #define IDC_ORECOLOUR 1060 --- 217,220 ---- *************** *** 221,224 **** --- 238,242 ---- #define IDC_SGWEIGHT 1060 #define IDC_PWD 1060 + #define IDC_CONSOLE_SEND 1060 #define IDC_COLORCOMBO 1061 #define IDC_SKILLS 1061 *************** *** 242,245 **** --- 260,264 ---- #define IDC_FOODTYPE_BITES 1061 #define IDC_SGDESCRIPTION 1061 + #define IDC_COMMAND_SEND 1061 #define IDC_ITEMTYPE 1062 #define IDC_NPCDESIRES 1062 *************** *** 450,453 **** --- 469,473 ---- #define IDC_ITEMENTRY 1351 #define IDC_ITEMDISPLAY 1352 + #define IDC_RE_CONSOLE 1364 #define IDC_STATIC_LABEL1 1372 #define IDC_STATIC_LABEL2 1373 *************** *** 693,696 **** --- 713,718 ---- #define IDC_STE_STATIC24 1790 #define IDC_STE_STATIC25 1791 + #define ID_RC_OPTIONS_CHANGEPROFILE 32809 + #define ID_RC_OPTIONS_CLEARWINDOWBUFFER 32810 // Next default values for new objects Index: S_Sphere52.rc =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/S_Sphere52.rc,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -r1.16 -r1.17 *** S_Sphere52.rc 25 Jul 2003 05:27:32 -0000 1.16 --- S_Sphere52.rc 27 Jul 2003 20:44:55 -0000 1.17 *************** *** 1212,1215 **** --- 1212,1252 ---- END + IDD_REMOTECONSOLEDLG DIALOG 0, 0, 354, 294 + STYLE DS_SETFONT | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_CAPTION | WS_SYSMENU | + WS_THICKFRAME + CAPTION "Remote Console" + MENU IDR_REMOTECONSOLE_MENU + FONT 8, "MS Sans Serif" + BEGIN + DEFPUSHBUTTON "Broadcast",IDC_SENDTEXT,7,259,84,13 + PUSHBUTTON "ReConnect",IDC_RECONNECT,299,259,47,13 + DEFPUSHBUTTON "Close",IDOK,297,7,50,14,NOT WS_VISIBLE + PUSHBUTTON "Cancel",IDCANCEL,182,7,50,14,NOT WS_VISIBLE + CONTROL "",IDC_RE_CONSOLE,"RICHEDIT",TCS_HOTTRACK | TCS_VERTICAL | + TCS_RAGGEDRIGHT | TCS_OWNERDRAWFIXED | TCS_MULTISELECT | + WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP,7,7,340, + 212 + PUSHBUTTON "Toggle Log File",IDC_RC_LOG,7,220,84,13 + PUSHBUTTON "Toggle Verbose Mode",IDC_RC_VERBOSE,7,233,84,13 + PUSHBUTTON "Toggle Hear All",IDC_RC_HEARALL,7,246,84,13 + PUSHBUTTON "Pause / Resync",IDC_RC_PAUSE,92,220,84,13 + PUSHBUTTON "Toggle Secure Mode",IDC_RC_SECURE,92,233,84,13 + PUSHBUTTON "Garbage Collection",IDC_RC_GARBAGE,92,246,84,13 + PUSHBUTTON "Information",IDC_RC_INFORMATION,177,220,84,13 + PUSHBUTTON "Client List",IDC_RC_CLIENT,177,233,84,13 + PUSHBUTTON "Force Save",IDC_RC_SAVE,177,246,84,13 + PUSHBUTTON "Shutdown Now",IDC_RC_SHUTDOWN,262,220,84,13 + PUSHBUTTON "Profile Info",IDC_RC_PROFILE,262,233,84,13 + PUSHBUTTON "Account Update",IDC_RC_ACCOUNT,262,246,84,13 + DEFPUSHBUTTON "Command",IDC_SENDCOMMAND,7,272,84,13 + CONTROL "Enable Local Logging",IDC_ENABLE_LOGGING,"Button", + BS_AUTOCHECKBOX | BS_LEFT | BS_VCENTER | WS_TABSTOP,263, + 272,84,13 + COMBOBOX IDC_CONSOLE_SEND,92,259,169,60,CBS_DROPDOWN | + CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_COMMAND_SEND,92,272,169,51,CBS_DROPDOWN | + CBS_AUTOHSCROLL | CBS_SORT | WS_VSCROLL | WS_TABSTOP + END + ///////////////////////////////////////////////////////////////////////////// *************** *** 1475,1478 **** --- 1512,1523 ---- BOTTOMMARGIN, 54 END + + IDD_REMOTECONSOLEDLG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 347 + TOPMARGIN, 7 + BOTTOMMARGIN, 287 + END END #endif // APSTUDIO_INVOKED *************** *** 1529,1532 **** --- 1574,1592 ---- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0 + END + + + ///////////////////////////////////////////////////////////////////////////// + // + // Menu + // + + IDR_REMOTECONSOLE_MENU MENU + BEGIN + POPUP "&Options" + BEGIN + MENUITEM "Clear Window Buffer", ID_RC_OPTIONS_CLEARWINDOWBUFFER + + END END Index: S_Sphere52.vcproj =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/S_Sphere52.vcproj,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -r1.16 -r1.17 *** S_Sphere52.vcproj 25 Jul 2003 05:27:32 -0000 1.16 --- S_Sphere52.vcproj 27 Jul 2003 20:44:55 -0000 1.17 *************** *** 218,221 **** --- 218,224 ---- </File> <File + RelativePath="RemoteConsoleDlg.cpp"> + </File> + <File RelativePath="RemoteConsoleLoginDlg.cpp"> </File> *************** *** 469,472 **** --- 472,478 ---- <File RelativePath="RemoteConsole.h"> + </File> + <File + RelativePath="RemoteConsoleDlg.h"> </File> <File Index: Scripts.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/Scripts.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** Scripts.cpp 23 Jul 2003 19:10:57 -0000 1.9 --- Scripts.cpp 27 Jul 2003 20:44:55 -0000 1.10 *************** *** 44,47 **** --- 44,48 ---- m_pAxis = new CAxisLibWrapper; m_pAxis->LocaleFile(m_config.LocaleFile()); + m_pRConsole = NULL; } *************** *** 54,57 **** --- 55,60 ---- m_instances.pop_back(); m_instance--; + if ( m_pRConsole != NULL ) + delete m_pRConsole; } Index: ScriptsMain.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/ScriptsMain.cpp,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -r1.28 -r1.29 *** ScriptsMain.cpp 23 Jul 2003 19:10:57 -0000 1.28 --- ScriptsMain.cpp 27 Jul 2003 20:44:55 -0000 1.29 *************** *** 162,165 **** --- 162,168 ---- m_bBrainsFound = false; m_bMidisFound = false; + + m_pRCDlg = NULL; + m_bDeleteRC = false; } *************** *** 172,175 **** --- 175,180 ---- m_vBrains.erase(m_vBrains.begin(), m_vBrains.end()); m_vMidis.erase(m_vMidis.begin(), m_vMidis.end()); + if ( m_pRCDlg != NULL ) + delete m_pRCDlg; } *************** *** 1708,1717 **** { // Read all of the moongates from the table ! bool bContinue = true; while ( bContinue ) { DWORD dwPos = (DWORD) csfInput.GetPosition(); CString csLine; ! bContinue = csfInput.ReadString(csLine) ? true : false; if ( csLine[0] == _T('[') ) { --- 1713,1722 ---- { // Read all of the moongates from the table ! BOOL bContinue = TRUE; while ( bContinue ) { DWORD dwPos = (DWORD) csfInput.GetPosition(); CString csLine; ! bContinue = csfInput.ReadString(csLine); if ( csLine[0] == _T('[') ) { *************** *** 1745,1748 **** --- 1750,1755 ---- break; case RES_NOTOTITLES: // (SI) Define the noto titles used. + this->m_tables.m_notoTitles.m_bIgnoreBlanks = true; + this->m_tables.m_notoTitles.m_bIgnoreComments = true; this->m_tables.m_notoTitles.Read(csfInput); this->m_tables.m_notoTitles.m_dwFileOffset = dwOffset; *************** *** 1755,1761 **** break; case RES_ORE: // An ore table ! this->m_tables.m_ores.Read(csfInput); ! this->m_tables.m_ores.m_dwFileOffset = dwOffset; ! this->m_tables.m_ores.m_csFilename = csFile; break; case RES_PLEVEL: // Define the list of commands that a PLEVEL can access. (or not access) --- 1762,1787 ---- break; case RES_ORE: // An ore table ! { ! this->m_tables.m_ores.m_dwFileOffset = dwOffset; ! this->m_tables.m_ores.m_csFilename = csFile; ! BOOL bContinue = TRUE; ! while ( bContinue ) ! { ! DWORD dwPosition = (DWORD)csfInput.GetPosition(); ! bContinue = csfInput.ReadString(csLine); ! if ( csLine.Find(_T("[")) != -1 ) ! { ! csfInput.Seek( (LONG) (dwPosition - csfInput.GetPosition()), CFile::current ); ! break; ! } ! csLine = csLine.SpanExcluding(_T("//")); ! csLine.TrimLeft(); csLine.TrimRight(); ! if ( csLine == _T("") ) ! continue; ! CTOreDef * pOre = new (CTOreDef); ! pOre->Load(csLine); ! this->m_tables.m_ores.Add(pOre); ! } ! } break; case RES_PLEVEL: // Define the list of commands that a PLEVEL can access. (or not access) *************** *** 1785,1792 **** pPotion->m_csValue = csIndex; pPotion->m_bType = TYPE_POTION; ! int iOld = m_tables.m_potions.Find(csIndex); ! if ( iOld != -1 ) ! m_tables.m_potions.RemoveAt(iOld); ! m_tables.m_potions.Insert(pPotion); } break; --- 1811,1815 ---- pPotion->m_csValue = csIndex; pPotion->m_bType = TYPE_POTION; ! m_tables.m_potions.Add(pPotion); } break; *************** *** 3492,3495 **** --- 3515,3530 ---- void CScriptsMain::InvokeRemoteConsole() { + if ( m_bDeleteRC ) + { + delete m_pRCDlg; + m_pRCDlg = NULL; + m_bDeleteRC = false; + } + if ( m_pRCDlg == NULL ) + { + m_pRCDlg = new CRemoteConsoleDlg; + m_pRCDlg->Create(IDD_REMOTECONSOLEDLG, NULL); + } + m_pRCDlg->ShowWindow(SW_SHOWNORMAL); } Index: ScriptsMain.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/ScriptsMain.h,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -r1.19 -r1.20 *** ScriptsMain.h 23 Jul 2003 19:10:57 -0000 1.19 --- ScriptsMain.h 27 Jul 2003 20:44:55 -0000 1.20 *************** *** 31,34 **** --- 31,35 ---- #include "FileReadProgress.h" #include "MapScriptEditDlg.h" + #include "RemoteConsoleDlg.h" #include <vector> *************** *** 356,359 **** --- 357,362 ---- void SetMulFile(ULONG index, CString sFile); + void DeleteRC() { m_bDeleteRC = true; } + protected: bool m_bDefsLoaded; *************** *** 372,375 **** --- 375,379 ---- bool m_bDeleteDialog; + bool m_bDeleteRC; CScriptProfile * m_pProfile; *************** *** 450,452 **** --- 454,457 ---- CString m_sMulPath; vector<CString> m_vMulFiles; + CRemoteConsoleDlg * m_pRCDlg; }; Index: ScriptTables.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/ScriptTables.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** ScriptTables.cpp 23 Jul 2003 19:10:57 -0000 1.6 --- ScriptTables.cpp 27 Jul 2003 20:44:55 -0000 1.7 *************** *** 280,283 **** --- 280,285 ---- break; case 14: // Nototitles + this->m_notoTitles.m_bIgnoreBlanks = true; + this->m_notoTitles.m_bIgnoreComments = true; this->m_notoTitles.Read(csfTables); break; Index: ScriptTables.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/ScriptTables.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** ScriptTables.h 23 Jul 2003 19:10:57 -0000 1.4 --- ScriptTables.h 27 Jul 2003 20:44:55 -0000 1.5 *************** *** 45,49 **** CScriptArray<CScriptBase*> m_starts; CStringBlock m_runes; ! CScriptArray<CScriptBase*> m_ores; CTObArray<CScriptBase*> m_skillClasses; CTObArray<CScriptBase*> m_skills; --- 45,49 ---- CScriptArray<CScriptBase*> m_starts; CStringBlock m_runes; ! CTObArray<CScriptBase*> m_ores; CTObArray<CScriptBase*> m_skillClasses; CTObArray<CScriptBase*> m_skills; Index: strings.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/strings.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** strings.h 25 Jul 2003 05:27:32 -0000 1.10 --- strings.h 27 Jul 2003 20:44:55 -0000 1.11 *************** *** 217,219 **** #define IDS_REMOTE_SESELECT 178 #define IDS_REMOTE_TIMEOUT 179 ! --- 217,222 ---- #define IDS_REMOTE_SESELECT 178 #define IDS_REMOTE_TIMEOUT 179 ! #define IDS_REMOTE_RECONNECT 418 ! #define IDS_REMOTE_DISCONNECT 419 ! #define IDS_RC_CONNECTED 420 ! #define IDS_RC_DISCONNECTED 421 Index: TOreDef.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/TOreDef.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** TOreDef.cpp 23 Jul 2003 19:10:57 -0000 1.3 --- TOreDef.cpp 27 Jul 2003 20:44:55 -0000 1.4 *************** *** 53,56 **** --- 53,57 ---- case 0: this->m_csName = csTemp; + this->m_csValue = csTemp; // The value is the key in the script array, so we need this to exist. break; case 1: Index: XMLConfig.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/XMLConfig.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** XMLConfig.cpp 23 Jul 2003 19:10:57 -0000 1.7 --- XMLConfig.cpp 27 Jul 2003 20:44:55 -0000 1.8 *************** *** 168,171 **** --- 168,173 ---- ReadValue(pRoot, _T("LocaleFile"), (void*)&sLocaleFile, XML_String); LocaleFile(sLocaleFile); // Pass it through here to handle cases where it's an empty string. + ReadValue(pRoot, _T("RCBroadcasts"), (void*)&m_saRCBroadcasts, XML_StringArray); + ReadValue(pRoot, _T("RCCommands"), (void*)&m_saRCCommands, XML_StringArray); xmlNodePtr pNode = FindNode(m_pXMLDoc, _T("ScriptProfile"), pRoot); while ( pNode != NULL ) *************** *** 200,203 **** --- 202,207 ---- AddValue(pDoc, pRoot, _T("LocaleFile"), (void*) &m_sLocaleFile, XML_String, 1); + AddValue(pDoc, pRoot, _T("RCBroadcasts"), (void*) &m_saRCBroadcasts, XML_StringArray, 1); + AddValue(pDoc, pRoot, _T("RCCommands"), (void*) &m_saRCCommands, XML_StringArray, 1); for ( int i = 0; i < m_pProfiles.GetCount(); i++ ) *************** *** 533,535 **** } m_pProfiles.RemoveAll(); ! } \ No newline at end of file --- 537,561 ---- } m_pProfiles.RemoveAll(); ! } ! ! void CXMLConfig::SetRCBroadcasts(CStringArray *sa) ! { ! m_saRCBroadcasts.Copy(*sa); ! SaveConfig(); ! } ! ! void CXMLConfig::SetRCCommands(CStringArray *sa) ! { ! m_saRCCommands.Copy(*sa); ! SaveConfig(); ! } ! ! void CXMLConfig::GetRCBroadcasts(CStringArray *sa) ! { ! sa->Copy(m_saRCBroadcasts); ! } ! ! void CXMLConfig::GetRCCommands(CStringArray *sa) ! { ! sa->Copy(m_saRCCommands); ! } Index: XMLConfig.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/XMLConfig.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** XMLConfig.h 23 Jul 2003 19:10:57 -0000 1.7 --- XMLConfig.h 27 Jul 2003 20:44:55 -0000 1.8 *************** *** 54,57 **** --- 54,61 ---- void AddProfile(CScriptProfile * pNewProfile); void DeleteProfile(CScriptProfile * pProfile); + void SetRCBroadcasts(CStringArray *sa); + void SetRCCommands(CStringArray *sa); + void GetRCBroadcasts(CStringArray *sa); + void GetRCCommands(CStringArray *sa); protected: *************** *** 60,63 **** --- 64,69 ---- xmlDocPtr m_pXMLDoc; CString m_sLocaleFile; + CStringArray m_saRCBroadcasts; + CStringArray m_saRCCommands; bool LoadFromRegistry(); *************** *** 80,82 **** --- 86,89 ---- void GetRegistryMultiSz(HKEY hKey, CString sTag, CStringArray& sa); void CleanupProfiles(); + }; |