sphere-axis-commits Mailing List for Axis for Sphere (Page 7)
Brought to you by:
pesterle
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(71) |
Jun
(4) |
Jul
(26) |
Aug
(23) |
Sep
(6) |
Oct
(2) |
Nov
(74) |
Dec
(89) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(88) |
Feb
(51) |
Mar
(26) |
Apr
(8) |
May
(55) |
Jun
(67) |
Jul
(37) |
Aug
(46) |
Sep
(12) |
Oct
(6) |
Nov
|
Dec
|
2004 |
Jan
|
Feb
|
Mar
(13) |
Apr
(8) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Philip E. <pes...@us...> - 2003-06-17 14:40:07
|
Update of /cvsroot/sphere-axis/axissvr In directory sc8-pr-cvs1:/tmp/cvs-serv13047 Modified Files: ClientObj.cpp Log Message: no message Index: ClientObj.cpp =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/ClientObj.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** ClientObj.cpp 16 Jun 2003 22:05:59 -0000 1.4 --- ClientObj.cpp 17 Jun 2003 14:40:04 -0000 1.5 *************** *** 653,661 **** void CAxisClient::GetDirInfo(LPCTSTR pszPathname) { ! #ifdef _WIN32 unsigned int iSize = MAX_BUFFER; unsigned int iLen = 0; ! TCHAR szBuffer[MAX_BUFFER]; ! memset(szBuffer, 0x00, sizeof(szBuffer)); WIN32_FIND_DATA findData; memset(&findData, 0x00, sizeof(findData)); --- 653,692 ---- void CAxisClient::GetDirInfo(LPCTSTR pszPathname) { ! CHAR szBuffer[MAX_BUFFER]; ! memset(szBuffer, 0x00, sizeof(szBuffer)); ! CHAR szEOF [] = {0x0d, 0x0a, '.', 0x0d, 0x0a, 0x00}; unsigned int iSize = MAX_BUFFER; unsigned int iLen = 0; ! if ( UseDB() ) ! { ! // Only send the file list if the client is requesting the CWD ! if ( _tcscmp(pszPathname, _T(".")) != 0 ) ! { ! Send((BYTE*)szEOF, strlen(szEOF)); ! return; ! } ! vector<string> files = m_pServer->m_pDB->AllowedFileList(m_iDBUserID); ! vector<string>::iterator p = files.begin(); ! while ( p != files.end() ) ! { ! string s = *p; ! if ( iLen + s.length() + sizeof(int) + 2 > iSize ) ! { ! Send((BYTE*)szBuffer, iLen); ! memset(szBuffer, 0x00, sizeof(szBuffer)); ! iLen = 0; ! } ! int iType = 0x80; ! memcpy(&szBuffer[iLen], &iType, sizeof(int)); ! memcpy(&szBuffer[iLen + 4], s.c_str(), s.length()); ! iLen += s.length() + 5; ! p++; ! } ! Send((BYTE*)szEOF, strlen(szEOF)); ! return; ! } ! ! // We need to make sure everthing sent to the client is in ANSI. ! #ifdef _WIN32 WIN32_FIND_DATA findData; memset(&findData, 0x00, sizeof(findData)); *************** *** 725,737 **** Send((BYTE*)szBuffer, iLen); FindClose(hSearch); - TCHAR szEOF [] = {0x0d, 0x0a, _T('.'), 0x0d, 0x0a, 0x00}; Send((BYTE*)szEOF, _tcsclen(szEOF)); #else // LINUX - TCHAR szEOF [] = {0x0d, 0x0a, _T('.'), 0x0d, 0x0a, 0x00}; unsigned int iSize = MAX_BUFFER; unsigned int iLen = 0; - TCHAR szBuffer[MAX_BUFFER]; - memset(szBuffer, 0x00, sizeof(szBuffer)); DIR * dirp; struct dirent *direntp; --- 756,764 ---- *************** *** 749,753 **** // Handle the error _tprintf(_T("Unable to open directdory %s\n"), szPath); ! Send(szEOF, _tcsclen(szEOF)); return; } --- 776,780 ---- // Handle the error _tprintf(_T("Unable to open directdory %s\n"), szPath); ! Send(szEOF, strlen(szEOF)); return; } |
From: Philip E. <pes...@us...> - 2003-06-16 22:06:02
|
Update of /cvsroot/sphere-axis/axissvr In directory sc8-pr-cvs1:/tmp/cvs-serv12380 Modified Files: AxisServer.cpp ClientObj.cpp ClientObj.h DBConfig.cpp DBConfig.h FontSelectionDlg.cpp MainFrm.cpp ntservice.cpp ntservice.h ServerObj.cpp ServerObj.h Log Message: no message Index: AxisServer.cpp =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/AxisServer.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** AxisServer.cpp 16 Jun 2003 03:58:35 -0000 1.3 --- AxisServer.cpp 16 Jun 2003 22:05:59 -0000 1.4 *************** *** 120,124 **** NULL); ! m_hIcon = this->LoadIcon(IDR_MAINFRAME); pFrame->SetIcon(m_hIcon, TRUE); --- 120,124 ---- NULL); ! m_hIcon = LoadIcon(IDR_MAINFRAME); pFrame->SetIcon(m_hIcon, TRUE); Index: ClientObj.cpp =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/ClientObj.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** ClientObj.cpp 16 Jun 2003 03:58:35 -0000 1.3 --- ClientObj.cpp 16 Jun 2003 22:05:59 -0000 1.4 *************** *** 77,137 **** { BYTE szOutput[MAX_BUFFER]; char crlf [] = { 0x0d, 0x0a, 0x00 }; char szEOF [] = {0x0d, 0x0a, '.', 0x0d, 0x0a, 0x00}; FILE *pFile; - TCHAR szScriptPath[MAX_PATH]; - memset(szScriptPath, 0x00, sizeof(szScriptPath)); - // Check to see if the scripts are somewhere else. - FILE *pIniFile; - pIniFile = _tfopen(INI_FILE, _T("r")); - if (pIniFile != NULL) - { - TCHAR szLine[MAX_PATH]; - while(!feof(pIniFile)) - { - fReadLine(pIniFile, &szLine[0], sizeof(szLine)); - Trim(&szLine[0], _tcsclen(szLine)); - if (szLine[0] != 0x00) - { - if (_tcscmp( pszFileName, m_pServer->m_szAccuFile) == 0) - { - if (_tcsstr(szLine, _T("ACCTFILES=")) == szLine) - { - memcpy(&szScriptPath[0], &szLine[9], (_tcsclen(szLine) - 9) * sizeof(TCHAR)); - break; - } - else if ( szScriptPath[0] == 0x00 && (_tcsstr(szLine, _T("WORLDSAVE=")) == szLine) ) - { - memcpy(&szScriptPath[0], &szLine[9], (_tcsclen(szLine) - 9) * sizeof(TCHAR)); - break; - } - } - else - { - if (_tcsstr(szLine, _T("SCPFILES=")) == szLine) - { - memcpy(&szScriptPath[0], &szLine[9], (_tcsclen(szLine) - 9) * sizeof(TCHAR)); - break; - } - } - } - } - fclose(pIniFile); - } - TCHAR szFilename[MAX_PATH]; ! pFile = _tfopen(pszFileName, _T("r")); if (pFile == NULL) { ! SysMessage(_T("Error -- Could not open file %s\n"), pszFileName); #ifdef _UNICODE ! sprintf((CHAR*)szOutput, "Could not open file %S.%s", pszFileName, crlf); #else ! sprintf((CHAR*)szOutput, "Could not open file %s.%s", pszFileName, crlf); #endif int iBytesSent = Send(szOutput, strlen((char*)szOutput)); if ( iBytesSent < 0 ) { ! SysMessage(_T("Error occurred while sending file %s - File could not be opened\n"), szFilename ); fclose(pFile); return; --- 77,120 ---- { BYTE szOutput[MAX_BUFFER]; + // Make sure this user has permission to read this file + TCHAR szFullPath[MAX_PATH]; + // if the file name doesn't have the full path, then expand the filename + #ifdef _WIN32 + if ( _tcsstr(pszFileName, _T(":")) == NULL ) + #else + if ( *pszFileName != _T("/") ) + #endif + _stprintf(szFullPath, _T("%s%s"), m_pServer->BasePath(), pszFileName); + else + _stprintf(szFullPath, pszFileName); + + if ( UseDB() ) + { + if ( m_pServer->m_pDB->FilePermissions(m_iDBUserID, szFullPath) == 0 ) + { + SysMessage(_T("User %s requested file %s, but is not allowed access to it."), m_szUser, szFullPath); + sprintf((char*)szOutput, "Access denied.%c%c", 0x0d, 0x0a); + Send(szOutput, strlen((char*)szOutput)); + return; + } + } + char crlf [] = { 0x0d, 0x0a, 0x00 }; char szEOF [] = {0x0d, 0x0a, '.', 0x0d, 0x0a, 0x00}; FILE *pFile; ! pFile = _tfopen(szFullPath, _T("r")); if (pFile == NULL) { ! SysMessage(_T("Error -- Could not open file %s\n"), szFullPath); #ifdef _UNICODE ! sprintf((CHAR*)szOutput, "Could not open file %S.%s", szFullPath, crlf); #else ! sprintf((CHAR*)szOutput, "Could not open file %s.%s", szFullPath, crlf); #endif int iBytesSent = Send(szOutput, strlen((char*)szOutput)); if ( iBytesSent < 0 ) { ! SysMessage(_T("Error occurred while sending file %s - File could not be opened\n"), szFullPath ); fclose(pFile); return; *************** *** 187,252 **** { BYTE szBuffer[MAX_BUFFER]; ! TCHAR szNewFilename[MAX_PATH]; ! TCHAR szTmpFilename[MAX_PATH]; ! char szEOF [] = {0x0d, 0x0a, '.', 0x0d, 0x0a, 0x00}; ! TCHAR szScriptPath[MAX_PATH]; ! memset(szScriptPath, 0x00, sizeof(szScriptPath)); ! // Check to see if the scripts are somewhere else. ! FILE *pIniFile; ! pIniFile = _tfopen(INI_FILE, _T("r")); ! if (pIniFile != NULL) ! { ! TCHAR szLine[MAX_PATH]; ! while(!feof(pIniFile)) ! { ! fReadLine(pIniFile, &szLine[0], sizeof(szLine)); ! Trim(&szLine[0], _tcsclen(szLine)); ! if (szLine[0] != 0x00) ! { ! if (_tcsstr(szLine, _T("SCPFILES=")) == szLine) ! { ! memcpy(&szScriptPath[0], &szLine[9], (_tcsclen(szLine) - 9) * sizeof(TCHAR)); ! break; ! } ! } ! } ! fclose(pIniFile); ! } ! TCHAR szFilename[MAX_PATH]; ! #ifdef WIN32 ! if ( szScriptPath[0] != 0x00 && _tcsstr(pszFileName, _T("\\")) == NULL) #else ! if ( szScriptPath[0] != 0x00 && _tcsstr(pszFileName, _T("/")) == NULL) #endif { ! #ifdef WIN32 ! if ( szScriptPath[_tcsclen(szScriptPath) - 1] != _T('\\') ) ! _stprintf(szFilename, _T("%s\\%s"), szScriptPath, pszFileName); ! else ! _stprintf(szFilename, _T("%s%s"), szScriptPath, pszFileName); ! #else ! if ( szScriptPath[_tcsclen(szScriptPath) - 1] != _T('/') ) ! _stprintf(szFilename, _T("%s/%s"), szScriptPath, pszFileName); ! else ! _stprintf(szFilename, _T("%s%s"), szScriptPath, pszFileName); ! #endif } ! else ! _stprintf(szFilename, _T("%s"), pszFileName); // Back up the current file TCHAR szBackupName[MAX_PATH]; time_t now = time(NULL); ! _stprintf(szBackupName, _T("%s.bkp.%ld"), szFilename, now); ! _stprintf(szNewFilename, szFilename); ! _stprintf(szTmpFilename, _T("%s.tmp"), szFilename); FILE * tmpFile = _tfopen(szTmpFilename, _T("w")); if (tmpFile == NULL) { ! SysMessage(_T("Error opening temporary file on server (%s)\n"), pszFileName); #ifdef UNICODE ! sprintf((char*)szBuffer, "Error opening file on remote server (%S)%c%c", pszFileName, 0x0d, 0x0a); #else ! sprintf((char*)szBuffer, "Error opening file on remote server (%s)%c%c", pszFileName, 0x0d, 0x0a); #endif Send((BYTE*)szBuffer, strlen((char*)szBuffer)); --- 170,215 ---- { BYTE szBuffer[MAX_BUFFER]; ! // Make sure this user has permission to write to this file ! TCHAR szFullPath[MAX_PATH]; ! // if the file name doesn't have the full path, then expand the filename ! #ifdef _WIN32 ! if ( _tcsstr(pszFileName, _T(":")) == NULL ) #else ! if ( *pszFileName != _T("/") ) #endif + _stprintf(szFullPath, _T("%s%s"), m_pServer->BasePath(), pszFileName); + else + _stprintf(szFullPath, pszFileName); + + if ( UseDB() ) { ! if ( m_pServer->m_pDB->FilePermissions(m_iDBUserID, szFullPath) == 0 ) ! { ! SysMessage(_T("User %s attempted to update file %s, but is not allowed access to it."), m_szUser, szFullPath); ! sprintf((char*)szBuffer, "Access denied.%c%c", 0x0d, 0x0a); ! Send(szBuffer, strlen((char*)szBuffer)); ! return; ! } } ! ! TCHAR szNewFilename[MAX_PATH]; ! TCHAR szTmpFilename[MAX_PATH]; ! char szEOF [] = {0x0d, 0x0a, '.', 0x0d, 0x0a, 0x00}; ! // Back up the current file TCHAR szBackupName[MAX_PATH]; time_t now = time(NULL); ! _stprintf(szBackupName, _T("%s.bkp.%ld"), szFullPath, now); ! _stprintf(szNewFilename, szFullPath); ! _stprintf(szTmpFilename, _T("%s.tmp"), szFullPath); FILE * tmpFile = _tfopen(szTmpFilename, _T("w")); if (tmpFile == NULL) { ! SysMessage(_T("Error opening temporary file on server (%s)\n"), szFullPath); #ifdef UNICODE ! sprintf((char*)szBuffer, "Error opening file on remote server (%S)%c%c", szFullPath, 0x0d, 0x0a); #else ! sprintf((char*)szBuffer, "Error opening file on remote server (%s)%c%c", szFullPath, 0x0d, 0x0a); #endif Send((BYTE*)szBuffer, strlen((char*)szBuffer)); *************** *** 919,930 **** if ( nBytes < 0 ) { ! shutdown(GetSocket(), 2 ); ! SysMessage(_T("Error receiving data on socket %ld. Closing\n"), (int) GetSocket()); ! SysMessage(_T("Socket %ld from %s closed.\n"), (int) GetSocket(), m_szIPAddr); #ifdef WIN32 ! closesocket(GetSocket()); return; #else ! close(GetSocket()); return NULL; #endif --- 882,893 ---- if ( nBytes < 0 ) { ! shutdown(m_sock, 2 ); ! SysMessage(_T("Error receiving data on socket %ld. Closing\n"), (int) m_sock); ! SysMessage(_T("Socket %ld from %s closed.\n"), (int) m_sock, m_szIPAddr); #ifdef WIN32 ! closesocket(m_sock); return; #else ! close(m_sock); return NULL; #endif *************** *** 951,962 **** } ! shutdown(GetSocket(), 2 ); ! SysMessage(_T("Socket %ld from %s closed.\n"), (int) GetSocket(), m_szIPAddr); #ifdef WIN32 ! closesocket(GetSocket()); m_bIsFinished = TRUE; return; #else ! close(GetSocket()); m_bIsFinished = TRUE; return NULL; --- 914,925 ---- } ! shutdown(m_sock, 2 ); ! SysMessage(_T("Socket %ld from %s closed.\n"), (int) m_sock, m_szIPAddr); #ifdef WIN32 ! closesocket(m_sock); m_bIsFinished = TRUE; return; #else ! close(m_sock); m_bIsFinished = TRUE; return NULL; *************** *** 1036,1121 **** { case 0: ! this->SysMessage(_T("Retrieving SpawnPoints for user %s\n"), m_szUser); ! this->GetSpawnPoints(); break; case 1: ! this->SysMessage(_T("Retrieving Items for user %s\n"), m_szUser); ! this->SendFile(USER_ITEM_FILE); break; case 2: ! this->SysMessage(_T("Retrieving NPCs for user %s\n"), m_szUser); ! this->SendFile(USER_NPC_FILE); break; case 3: ! this->SysMessage(_T("Retrieving defs for user %s\n"), m_szUser); ! this->SendFile(USER_DEFS_FILE); break; case 4: ! this->SysMessage(_T("Retrieving map for user %s\n"), m_szUser); ! this->SendFile(USER_MAP_FILE); break; case 5: ! this->SysMessage(_T("Retrieving tables for user %s\n"), m_szUser); ! this->SendFile(USER_TABLE_FILE); break; case 6: ! this->SysMessage(_T("Retrieving templates for user %s\n"), m_szUser); ! this->SendFile(USER_TEMPLATE_FILE); break; case 7: ! this->SysMessage(_T("Retrieving magic for user %s\n"), m_szUser); ! this->SendFile(USER_MAGIC_FILE); break; case 8: ! this->SysMessage(_T("Retrieving skills for user %s\n"), m_szUser); ! this->SendFile(USER_SKILL_FILE); break; case 9: ! this->SysMessage(_T("Retrieving speech for user %s\n"), m_szUser); ! this->SendFile(USER_SPEECH_FILE); break; case 10: ! this->SysMessage(_T("Retrieving names for user %s\n"), m_szUser); ! this->SendFile(USER_NAME_FILE); break; case 11: ! this->SysMessage(_T("Receiving custom item from user %s\n"), m_szUser); ! this->GetNewItem(m_szUser, true); break; case 12: ! this->SysMessage(_T("Receiving custom NPC from user %s\n"), m_szUser); ! this->GetNewItem(m_szUser, false); break; case 13: ! this->SysMessage(_T("Updating defs from user %s\n"), m_szUser); ! this->ReceiveFile(USER_DEFS_FILE); break; case 14: ! this->SysMessage(_T("Updating map from user %s\n"), m_szUser); ! this->ReceiveFile(USER_MAP_FILE); break; case 15: ! this->SysMessage(_T("Updating tables from user %s\n"), m_szUser); ! this->ReceiveFile(USER_TABLE_FILE); break; case 16: ! this->SysMessage(_T("Updating templates from user %s\n"), m_szUser); ! this->ReceiveFile(USER_TEMPLATE_FILE); break; case 17: ! this->SysMessage(_T("Updating magic from user %s\n"), m_szUser); ! this->ReceiveFile(USER_MAGIC_FILE); break; case 18: ! this->SysMessage(_T("Updating skills from user %s\n"), m_szUser); ! this->ReceiveFile(USER_SKILL_FILE); break; case 19: ! this->SysMessage(_T("Updating speech from user %s\n"), m_szUser); ! this->ReceiveFile(USER_SPEECH_FILE); break; case 20: ! this->SysMessage(_T("Updating names from user %s\n"), m_szUser); ! this->ReceiveFile(USER_NAME_FILE); break; case 21: --- 999,1084 ---- { case 0: ! SysMessage(_T("Retrieving SpawnPoints for user %s\n"), m_szUser); ! GetSpawnPoints(); break; case 1: ! SysMessage(_T("Retrieving Items for user %s\n"), m_szUser); ! SendFile(USER_ITEM_FILE); break; case 2: ! SysMessage(_T("Retrieving NPCs for user %s\n"), m_szUser); ! SendFile(USER_NPC_FILE); break; case 3: ! SysMessage(_T("Retrieving defs for user %s\n"), m_szUser); ! SendFile(USER_DEFS_FILE); break; case 4: ! SysMessage(_T("Retrieving map for user %s\n"), m_szUser); ! SendFile(USER_MAP_FILE); break; case 5: ! SysMessage(_T("Retrieving tables for user %s\n"), m_szUser); ! SendFile(USER_TABLE_FILE); break; case 6: ! SysMessage(_T("Retrieving templates for user %s\n"), m_szUser); ! SendFile(USER_TEMPLATE_FILE); break; case 7: ! SysMessage(_T("Retrieving magic for user %s\n"), m_szUser); ! SendFile(USER_MAGIC_FILE); break; case 8: ! SysMessage(_T("Retrieving skills for user %s\n"), m_szUser); ! SendFile(USER_SKILL_FILE); break; case 9: ! SysMessage(_T("Retrieving speech for user %s\n"), m_szUser); ! SendFile(USER_SPEECH_FILE); break; case 10: ! SysMessage(_T("Retrieving names for user %s\n"), m_szUser); ! SendFile(USER_NAME_FILE); break; case 11: ! SysMessage(_T("Receiving custom item from user %s\n"), m_szUser); ! GetNewItem(m_szUser, true); break; case 12: ! SysMessage(_T("Receiving custom NPC from user %s\n"), m_szUser); ! GetNewItem(m_szUser, false); break; case 13: ! SysMessage(_T("Updating defs from user %s\n"), m_szUser); ! ReceiveFile(USER_DEFS_FILE); break; case 14: ! SysMessage(_T("Updating map from user %s\n"), m_szUser); ! ReceiveFile(USER_MAP_FILE); break; case 15: ! SysMessage(_T("Updating tables from user %s\n"), m_szUser); ! ReceiveFile(USER_TABLE_FILE); break; case 16: ! SysMessage(_T("Updating templates from user %s\n"), m_szUser); ! ReceiveFile(USER_TEMPLATE_FILE); break; case 17: ! SysMessage(_T("Updating magic from user %s\n"), m_szUser); ! ReceiveFile(USER_MAGIC_FILE); break; case 18: ! SysMessage(_T("Updating skills from user %s\n"), m_szUser); ! ReceiveFile(USER_SKILL_FILE); break; case 19: ! SysMessage(_T("Updating speech from user %s\n"), m_szUser); ! ReceiveFile(USER_SPEECH_FILE); break; case 20: ! SysMessage(_T("Updating names from user %s\n"), m_szUser); ! ReceiveFile(USER_NAME_FILE); break; case 21: *************** *** 1126,1141 **** bQuit = TRUE; sprintf((char*)szBuf, "Closing connection.%s", crlf); ! this->Send((BYTE*)szBuf, strlen((char*)szBuf)); } break; case 22: // GTRG ! this->SysMessage(_T("Retrieving Triggers for user %s\n"), m_szUser); ! this->SendFile(USER_TRIGGER_FILE); break; case 23: // STRG ! this->SysMessage(_T("Updating triggers from user %s\n"), m_szUser); ! this->ReceiveFile(USER_TRIGGER_FILE); break; case 24: --- 1089,1104 ---- bQuit = TRUE; sprintf((char*)szBuf, "Closing connection.%s", crlf); ! Send((BYTE*)szBuf, strlen((char*)szBuf)); } break; case 22: // GTRG ! SysMessage(_T("Retrieving Triggers for user %s\n"), m_szUser); ! SendFile(USER_TRIGGER_FILE); break; case 23: // STRG ! SysMessage(_T("Updating triggers from user %s\n"), m_szUser); ! ReceiveFile(USER_TRIGGER_FILE); break; case 24: *************** *** 1143,1184 **** { TCHAR szPort[80]; ! _stprintf(szPort, _T("%ld"), this->m_pServer->m_dwSpherePort); ! this->SysMessage(_T("Retrieving Sphere port for user %s\n"), m_szUser); ! this->Send((BYTE*)szPort, _tcsclen(szPort)); } break; case 25: // GINI ! this->SysMessage(_T("Retrieving ini file for user %s\n"), m_szUser); ! this->SendFile(INI_FILE); break; case 26: // SINI ! this->SysMessage(_T("Updating ini file from user %s\n"), m_szUser); ! this->ReceiveFile(INI_FILE); break; case 27: // STRT ! this->SysMessage(_T("User %s is attempting to start the server\n"), m_szUser); ! this->StartServer(); break; case 28: // GACT ! this->SysMessage(_T("Retrieving account file for user %s\n"), m_szUser); ! this->SendFile(this->m_pServer->m_szAccuFile); break; case 29: // SACT ! this->SysMessage(_T("Updating account file from user %s\n"), m_szUser); ! this->ReceiveFile(this->m_pServer->m_szAcctFile); break; case 30: // GDIR ! this->SysMessage(_T("Retrieving directory information for path %s for user %s\n"), pszArgs, m_szUser); ! this->GetDirInfo(pszArgs); break; case 31: // GFIL ! this->SysMessage(_T("Retrieving file %s for user %s\n"), pszArgs, m_szUser); #ifndef _WIN32 { --- 1106,1147 ---- { TCHAR szPort[80]; ! _stprintf(szPort, _T("%ld"), m_pServer->m_dwSpherePort); ! SysMessage(_T("Retrieving Sphere port for user %s\n"), m_szUser); ! Send((BYTE*)szPort, _tcsclen(szPort)); } break; case 25: // GINI ! SysMessage(_T("Retrieving ini file for user %s\n"), m_szUser); ! SendFile(INI_FILE); break; case 26: // SINI ! SysMessage(_T("Updating ini file from user %s\n"), m_szUser); ! ReceiveFile(INI_FILE); break; case 27: // STRT ! SysMessage(_T("User %s is attempting to start the server\n"), m_szUser); ! StartServer(); break; case 28: // GACT ! SysMessage(_T("Retrieving account file for user %s\n"), m_szUser); ! SendFile(m_pServer->m_szAccuFile); break; case 29: // SACT ! SysMessage(_T("Updating account file from user %s\n"), m_szUser); ! ReceiveFile(m_pServer->m_szAcctFile); break; case 30: // GDIR ! SysMessage(_T("Retrieving directory information for path %s for user %s\n"), pszArgs, m_szUser); ! GetDirInfo(pszArgs); break; case 31: // GFIL ! SysMessage(_T("Retrieving file %s for user %s\n"), pszArgs, m_szUser); #ifndef _WIN32 { *************** *** 1188,1196 **** } #endif ! this->SendFile(pszArgs); break; case 32: // SFIL ! this->SysMessage(_T("Updating file %s from user %s\n"), pszArgs, m_szUser); #ifndef _WIN32 { --- 1151,1159 ---- } #endif ! SendFile(pszArgs); break; case 32: // SFIL ! SysMessage(_T("Updating file %s from user %s\n"), pszArgs, m_szUser); #ifndef _WIN32 { *************** *** 1200,1224 **** } #endif ! this->ReceiveFile(pszArgs); break; case 33: // SCH2 ! this->SysMessage(_T("Updating NPC file from user %s\n"), m_szUser); ! this->ReceiveFile(USER_NPC_FILE); break; case 34: // SIT2 ! this->SysMessage(_T("Updating Item file from user %s\n"), m_szUser); ! this->ReceiveFile(USER_ITEM_FILE); break; case 35: // GRES ! this->SysMessage(_T("Retrieving Resources for user %s\n"), m_szUser); ! this->SendResources(); break; case 36: // GFCS ! this->SysMessage(_T("Getting checksum on file %s for user %s\n"), pszArgs, m_szUser); ! this->SendChecksum(pszArgs); break; default: --- 1163,1187 ---- } #endif ! ReceiveFile(pszArgs); break; case 33: // SCH2 ! SysMessage(_T("Updating NPC file from user %s\n"), m_szUser); ! ReceiveFile(USER_NPC_FILE); break; case 34: // SIT2 ! SysMessage(_T("Updating Item file from user %s\n"), m_szUser); ! ReceiveFile(USER_ITEM_FILE); break; case 35: // GRES ! SysMessage(_T("Retrieving Resources for user %s\n"), m_szUser); ! SendResources(); break; case 36: // GFCS ! SysMessage(_T("Getting checksum on file %s for user %s\n"), pszArgs, m_szUser); ! SendChecksum(pszArgs); break; default: *************** *** 1227,1232 **** CHAR crlf[] = { 0x0d, 0x0a, 0x00 }; sprintf((char*)szBuf, "Command unknown (%s).%s", pszCmd, crlf); ! this->Send((BYTE*)szBuf, strlen((char*)szBuf)); ! this->SysMessage(_T("Unknown message %s received from user %s\n"), pszCmd, m_szUser); break; } --- 1190,1195 ---- CHAR crlf[] = { 0x0d, 0x0a, 0x00 }; sprintf((char*)szBuf, "Command unknown (%s).%s", pszCmd, crlf); ! Send((BYTE*)szBuf, strlen((char*)szBuf)); ! SysMessage(_T("Unknown message %s received from user %s\n"), pszCmd, m_szUser); break; } *************** *** 1304,1308 **** } else ! this->SysMessage(_T("Unable to open the INI file...using defaults\n")); TCHAR szCmd[MAX_PATH]; TCHAR szCwd[MAX_PATH]; --- 1267,1271 ---- } else ! SysMessage(_T("Unable to open the INI file...using defaults\n")); TCHAR szCmd[MAX_PATH]; TCHAR szCwd[MAX_PATH]; *************** *** 1312,1328 **** { _stprintf(szCmd, _T("Sphere - %s"), szServerName); ! this->SysMessage(_T("Attempting to open the SCUM\n")); SC_HANDLE hScum = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS); if ( hScum != NULL ) { ! this->SysMessage(_T("Attempting to open the %s service\n"), szCmd); SC_HANDLE hService = OpenService(hScum, szCmd, SERVICE_START); if ( hService != NULL ) { ! this->SysMessage(_T("Attempting to start the service\n")); if ( StartService( hService, NULL, NULL ) ) ! this->SysMessage(_T("Service Started Successfully\n")); else ! this->SysMessage(_T("Service Start Failed\n")); CloseServiceHandle(hService); CloseServiceHandle(hScum); --- 1275,1291 ---- { _stprintf(szCmd, _T("Sphere - %s"), szServerName); ! SysMessage(_T("Attempting to open the SCUM\n")); SC_HANDLE hScum = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS); if ( hScum != NULL ) { ! SysMessage(_T("Attempting to open the %s service\n"), szCmd); SC_HANDLE hService = OpenService(hScum, szCmd, SERVICE_START); if ( hService != NULL ) { ! SysMessage(_T("Attempting to start the service\n")); if ( StartService( hService, NULL, NULL ) ) ! SysMessage(_T("Service Started Successfully\n")); else ! SysMessage(_T("Service Start Failed\n")); CloseServiceHandle(hService); CloseServiceHandle(hScum); *************** *** 1331,1335 **** else { ! this->SysMessage(_T("Unable to open the service\n")); CloseServiceHandle(hScum); return; --- 1294,1298 ---- else { ! SysMessage(_T("Unable to open the service\n")); CloseServiceHandle(hScum); return; *************** *** 1338,1342 **** else { ! this->SysMessage(_T("Unable to open the SCUM\n")); return; } --- 1301,1305 ---- else { ! SysMessage(_T("Unable to open the SCUM\n")); return; } *************** *** 1350,1367 **** PROCESS_INFORMATION procInfo; memset( &procInfo, 0x00, sizeof(procInfo) ); ! this->SysMessage(_T("Attempting CreateProcess() for %s\n"), szCmd); if ( ! CreateProcess( szCmd, NULL, NULL, NULL, FALSE, CREATE_NEW_CONSOLE, NULL, szCwd, &start, &procInfo ) ) { DWORD dwError = GetLastError(); ! this->SysMessage(_T("CreateProcess() returned error %ld - %s\n"), dwError, strerror(dwError)); } } #else ! this->SysMessage(_T("Attempting to start server...\n")); int pid = fork(); if ( pid == 0 ) { // This is the child ! this->SysMessage(_T("fork() returned 0\n")); TCHAR szPath[MAX_PATH]; _tgetcwd(&szPath[0], MAX_PATH); --- 1313,1330 ---- PROCESS_INFORMATION procInfo; memset( &procInfo, 0x00, sizeof(procInfo) ); ! SysMessage(_T("Attempting CreateProcess() for %s\n"), szCmd); if ( ! CreateProcess( szCmd, NULL, NULL, NULL, FALSE, CREATE_NEW_CONSOLE, NULL, szCwd, &start, &procInfo ) ) { DWORD dwError = GetLastError(); ! SysMessage(_T("CreateProcess() returned error %ld - %s\n"), dwError, strerror(dwError)); } } #else ! SysMessage(_T("Attempting to start server...\n")); int pid = fork(); if ( pid == 0 ) { // This is the child ! SysMessage(_T("fork() returned 0\n")); TCHAR szPath[MAX_PATH]; _tgetcwd(&szPath[0], MAX_PATH); *************** *** 1373,1380 **** //argv[3] = 0; int rc = execvp(_T("./sphere"), argv ); ! this->SysMessage(_T("execlp() returned error %ld\n"), rc); } if ( pid == -1 ) ! this->SysMessage(_T("fork() failed...\n")); #endif } --- 1336,1343 ---- //argv[3] = 0; int rc = execvp(_T("./sphere"), argv ); ! SysMessage(_T("execlp() returned error %ld\n"), rc); } if ( pid == -1 ) ! SysMessage(_T("fork() failed...\n")); #endif } *************** *** 1385,1390 **** SOCKADDR_IN sin; sin.sin_family = AF_INET; ! bind(GetSocket(), (LPSOCKADDR) &sin, sizeof(sin)); ! connect(GetSocket(), (LPSOCKADDR) &sin, sizeof(sin)); #ifdef _WIN32 struct linger opt; --- 1348,1353 ---- SOCKADDR_IN sin; sin.sin_family = AF_INET; ! bind(m_sock, (LPSOCKADDR) &sin, sizeof(sin)); ! connect(m_sock, (LPSOCKADDR) &sin, sizeof(sin)); #ifdef _WIN32 struct linger opt; *************** *** 1394,1398 **** opt.l_onoff = 1; opt.l_linger = 60; ! setsockopt(GetSocket(), SOL_SOCKET, SO_LINGER, (CHAR *)&opt, sizeof(opt)); BYTE szBuf[MAX_BUFFER]; BYTE szIn[MAX_BUFFER]; --- 1357,1361 ---- opt.l_onoff = 1; opt.l_linger = 60; ! setsockopt(m_sock, SOL_SOCKET, SO_LINGER, (CHAR *)&opt, sizeof(opt)); BYTE szBuf[MAX_BUFFER]; BYTE szIn[MAX_BUFFER]; *************** *** 1404,1414 **** if ( nBytes < 0 ) { ! shutdown(GetSocket(), 2 ); ! SysMessage(_T("Error receiving data on socket %ld. Closing\n"), (int) GetSocket()); ! SysMessage(_T("Socket %ld from %s closed.\n"), (int) GetSocket(), m_szIPAddr); #ifdef WIN32 ! closesocket(GetSocket()); #else ! close(GetSocket()); #endif return FALSE; --- 1367,1377 ---- if ( nBytes < 0 ) { ! shutdown(m_sock, 2 ); ! SysMessage(_T("Error receiving data on socket %ld. Closing\n"), (int) m_sock); ! SysMessage(_T("Socket %ld from %s closed.\n"), (int) m_sock, m_szIPAddr); #ifdef WIN32 ! closesocket(m_sock); #else ! close(m_sock); #endif return FALSE; *************** *** 1427,1437 **** if ( nBytes < 0 ) { ! shutdown(GetSocket(), 2 ); ! SysMessage(_T("Error receiving data on socket %ld. Closing\n"), (int) GetSocket()); ! SysMessage(_T("Socket %ld from %s closed.\n"), (int) GetSocket(), m_szIPAddr); #ifdef WIN32 ! closesocket(GetSocket()); #else ! close(GetSocket()); #endif return FALSE; --- 1390,1400 ---- if ( nBytes < 0 ) { ! shutdown(m_sock, 2 ); ! SysMessage(_T("Error receiving data on socket %ld. Closing\n"), (int) m_sock); ! SysMessage(_T("Socket %ld from %s closed.\n"), (int) m_sock, m_szIPAddr); #ifdef WIN32 ! closesocket(m_sock); #else ! close(m_sock); #endif return FALSE; *************** *** 1484,1494 **** fd_set fd; FD_ZERO(&fd); ! FD_SET(GetSocket(), &fd); struct timeval timeout; timeout.tv_sec = 0; timeout.tv_usec = 1000; ! int rc = select(GetSocket()+1, &fd, 0, 0, &timeout); if (rc < 0) SysMessage(_T("Error while receiving data: select() on socket %ld returned %ld\n"), m_sock, rc); return rc; } --- 1447,1470 ---- fd_set fd; FD_ZERO(&fd); ! FD_SET(m_sock, &fd); struct timeval timeout; timeout.tv_sec = 0; timeout.tv_usec = 1000; ! int rc = select(m_sock+1, &fd, 0, 0, &timeout); if (rc < 0) SysMessage(_T("Error while receiving data: select() on socket %ld returned %ld\n"), m_sock, rc); return rc; + } + + int CAxisClient::Login(char *pszID, char *pszPassword, char *pszIP, HOSTENT *pHost) + { + if ( UseDB() ) + { + int iUserID; + int status = m_pServer->m_pDB->Login(pszID, pszPassword, pszIP, pHost, &iUserID); + m_iDBUserID = iUserID; + return status; + } + else + return m_pServer->Login(pszID, pszPassword, pszIP, pHost); } Index: ClientObj.h =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/ClientObj.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** ClientObj.h 16 Jun 2003 03:58:35 -0000 1.3 --- ClientObj.h 16 Jun 2003 22:05:59 -0000 1.4 *************** *** 32,51 **** CAxisClient(); CAxisClient(SOCKET sock, CAxisServer * pServer); ! int Login(char *pszID, char *pszPassword, char *pszIP, HOSTENT * pHost) { return m_pServer->Login(pszID, pszPassword, m_szIPAddr, &m_host); } ! SOCKET GetSocket() { return m_sock; } ! void SetSocket(SOCKET sock) { m_sock = sock; } ! void GetSpawnPoints(); ! void SendFile(TCHAR *pszFileName); ! void ReceiveFile(TCHAR *pszFileName); ! void GetNewItem(TCHAR *pszUserID, bool bItemFlag); ! void SendResources(); ! void SendChecksum(LPCTSTR pszFilename ); ! void GetDirInfo(LPCTSTR pszPathname ); ! void SysMessage(LPCTSTR, ...); ! int Receive(BYTE * pszBuffer, int iMaxLength); ! int Send(BYTE * pszBuffer, int iLength); static void _cdecl EntryProc(LPVOID pData); BOOL IsFinished() { return m_bIsFinished; } ! BOOL Command(TCHAR * pszCmd, TCHAR * pszArgs); int Privs() { return m_iPrivs; } void Privs(int i) { m_iPrivs = i; } --- 32,47 ---- CAxisClient(); CAxisClient(SOCKET sock, CAxisServer * pServer); ! SOCKET Socket() { return m_sock; } ! void Socket(SOCKET s) { m_sock = s; } static void _cdecl EntryProc(LPVOID pData); BOOL IsFinished() { return m_bIsFinished; } ! void Server(CAxisServer *pServer) { m_pServer = pServer; } ! CAxisServer* Server() { return m_pServer; } ! TCHAR * User() { return m_szUser; } ! TCHAR * Pwd() { return m_szPwd; } ! HOSTENT * Host() { return &m_host; } ! void Host(HOSTENT *h) { memcpy(&m_host, h, sizeof(HOSTENT)); } ! TCHAR * IP() { return m_szIPAddr; } ! void IP(TCHAR *pIP) { _stprintf(m_szIPAddr, pIP); } int Privs() { return m_iPrivs; } void Privs(int i) { m_iPrivs = i; } *************** *** 54,62 **** ~CAxisClient(); - // We should protect this! - CAxisServer * m_pServer; - TCHAR m_szIPAddr[256]; - HOSTENT m_host; - protected: SOCKET m_sock; --- 50,53 ---- *************** *** 66,69 **** --- 57,77 ---- TCHAR m_szPwd[256]; int m_iPrivs; + CAxisServer * m_pServer; + TCHAR m_szIPAddr[256]; + HOSTENT m_host; + int m_iDBUserID; + + int Login(char *pszID, char *pszPassword, char *pszIP, HOSTENT * pHost); + int Receive(BYTE * pszBuffer, int iMaxLength); + int Send(BYTE * pszBuffer, int iLength); + BOOL Command(TCHAR * pszCmd, TCHAR * pszArgs); + void SysMessage(LPCTSTR, ...); + void GetSpawnPoints(); + void SendFile(TCHAR *pszFileName); + void ReceiveFile(TCHAR *pszFileName); + void GetNewItem(TCHAR *pszUserID, bool bItemFlag); + void SendResources(); + void SendChecksum(LPCTSTR pszFilename ); + void GetDirInfo(LPCTSTR pszPathname ); void NoPrivs(TCHAR * pszCmd, TCHAR * pszArgs); void NoReadPrivs(TCHAR * pszCmd, TCHAR * pszArgs); *************** *** 72,75 **** --- 80,84 ---- void StartServer(); BOOL SetupConnection(); + BOOL UseDB() { return m_pServer->m_config.UseDB(); } int Select(); }; Index: DBConfig.cpp =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/DBConfig.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** DBConfig.cpp 16 Jun 2003 03:58:35 -0000 1.3 --- DBConfig.cpp 16 Jun 2003 22:05:59 -0000 1.4 *************** *** 24,31 **** #include "stdafx.h" #include "dbconfig.h" CDBConfig::CDBConfig(void) { ! } --- 24,36 ---- #include "stdafx.h" #include "dbconfig.h" + #include "ServerObj.h" + + #include "md5.h" + using namespace std; + using namespace CryptoPP; CDBConfig::CDBConfig(void) { ! m_pServer = NULL; } *************** *** 39,43 **** } ! CDBConfig::CDBConfig(const TCHAR * psDSN, const TCHAR * psUser, const TCHAR * psPassword, const TCHAR * psPrefix) { m_hEnv = m_hDbc = m_hStmt = m_hDesc = SQL_NULL_HANDLE; --- 44,48 ---- } ! CDBConfig::CDBConfig(const TCHAR * psDSN, const TCHAR * psUser, const TCHAR * psPassword, const TCHAR * psPrefix, CAxisServer * pServer) { m_hEnv = m_hDbc = m_hStmt = m_hDesc = SQL_NULL_HANDLE; *************** *** 65,68 **** --- 70,74 ---- Password(szPassword); Prefix(szPrefix); + m_pServer = pServer; } *************** *** 137,139 **** --- 143,555 ---- else return hStmt; + } + + int CDBConfig::Login(const TCHAR *pszUser, const TCHAR* pszPassword, const TCHAR* pszHost, HOSTENT * pHost, int *iUserID) + { + // Using access masks in a database + BYTE bPermissions, bHosts; + SQLCHAR szQuery[8192]; + MD5 md5; + BYTE bMD5Pwd[16]; + md5.CalculateDigest(bMD5Pwd, (const byte*) pszPassword, strlen(pszPassword)); + char szPwd[64]; + memset(szPwd, 0x00, sizeof(szPwd)); + for ( int i = 0; i < 16; i++ ) + { + char szByte[3]; + sprintf(szByte, "%02x", bMD5Pwd[i]); + strcat(szPwd, szByte); + } + SQLHANDLE hStmtUser; + SQLHANDLE hStmtPrivs; + hStmtUser = hStmtPrivs = SQL_NULL_HANDLE; + SQLRETURN rc = 0; + int status = -1; + try + { + hStmtUser = NewStmtHandle(); + if ( hStmtUser == SQL_NULL_HANDLE ) + throw 0x100; + + sprintf((char *)szQuery, "select id, default_file_permissions, default_hostflags from %s_users where username=\"%s\" and password=\"%s\";",Prefix(), pszUser, szPwd); + rc = SQLExecDirect(hStmtUser, szQuery, strlen((const char*)szQuery)); + if ( SQLFAILED(rc) ) + throw 0x200; + SQLINTEGER cbID, cbPermissions, cbHosts; + rc = SQLBindCol(hStmtUser, 1, SQL_C_SLONG, &iUserID, sizeof(iUserID), &cbID); + if ( SQLFAILED(rc) ) + throw 0x200; + rc = SQLBindCol(hStmtUser, 2, SQL_C_TINYINT, &bPermissions, sizeof(bPermissions), &cbPermissions); + if ( SQLFAILED(rc) ) + throw 0x200; + rc = SQLBindCol(hStmtUser, 3, SQL_C_TINYINT, &bHosts, sizeof(bHosts), &cbHosts); + if ( SQLFAILED(rc) ) + throw 0x200; + while ( true ) + { + rc = SQLFetch(hStmtUser); + if ( SQLFAILED(rc) ) + break; + // Check if the host matches the allowed hosts for this user + // Need a new query handle.... + hStmtPrivs = NewStmtHandle(); + if ( hStmtPrivs == SQL_NULL_HANDLE ) + throw 0x100; + + sprintf((char*)szQuery, "select hostmask, flags from %s_hosts where user_id=%ld;", Prefix(), iUserID); + rc = SQLExecDirect(hStmtPrivs, szQuery, strlen((const char*)szQuery)); + if ( SQLFAILED(rc) ) + throw 0x300; + + SQLCHAR szHostmask[256]; + BYTE bFlag; + SQLINTEGER iHostLen, iFlagLen; + rc = SQLBindCol(hStmtPrivs, 1, SQL_C_CHAR, &szHostmask[0], 255, &iHostLen); + if ( SQLFAILED(rc) ) + throw 0x300; + rc = SQLBindCol(hStmtPrivs, 2, SQL_C_TINYINT, &bFlag, sizeof(SQL_C_TINYINT), &iFlagLen); + if ( SQLFAILED(rc) ) + throw 0x300; + while( true ) + { + rc = SQLFetch(hStmtPrivs); + if ( SQLFAILED(rc) ) + break; + if ( m_pServer->m_config.IsHostMatch(pszHost, pHost, (LPCTSTR) &szHostmask[0]) ) + { + // what do the flags say about this? + if ( bFlag ) + throw (int) bPermissions; + throw -2; + } + } + // What are the default priv flags for this user? + if ( !bHosts ) + throw -2; + throw (int) bPermissions; + } + // Login failure + status = -1; + } + catch (int e) + { + status = e; + } + catch (...) + { + } + switch(status) + { + case -2: + // Host not allowed + m_pServer->SysMessage(_T("User %s not allowed to log in from host %s.\n"), pszUser, pszHost); + break; + case -1: + // Login failure + m_pServer->SysMessage(_T("Unknown user %s.\n"), pszUser); + break; + case 0: + // No permissions + m_pServer->SysMessage(_T("User %s has no read/write permissions by default.\n"), pszUser); + break; + case 1: + // Read only + m_pServer->SysMessage(_T("User %s has read-only permissions by default.\n"), pszUser); + break; + case 2: + // Read/write + m_pServer->SysMessage(_T("User %s has read/write permissions by default.\n"), pszUser); + break; + default: + // SQL Error + m_pServer->SysMessage(_T("Login for user %s failed due to SQL Error.\n"), pszUser); + break; + } + if ( SQLFAILED(rc) && status > 0xFF) + { + // Format the last message + SQLCHAR sSQLState[6]; + SQLSMALLINT iRec = 1; + SQLCHAR sSQLMessage[MAX_BUFFER]; + SQLINTEGER iNative; + SQLSMALLINT iBufLength = MAX_BUFFER; + SQLSMALLINT iTextLength; + memset(&sSQLState[0], 0x00, 6); + memset(&sSQLMessage[0], 0x00, MAX_BUFFER); + SQLSMALLINT iType; + SQLHANDLE hHandle; + switch(status) + { + case 0x100: + // Error getting handle + iType = SQL_HANDLE_DBC; + hHandle = DbcHandle(); + break; + case 0x200: + // Error with user statement + iType = SQL_HANDLE_STMT; + hHandle = hStmtUser; + break; + case 0x300: + // Error with privs statement + iType = SQL_HANDLE_STMT; + hHandle = hStmtPrivs; + break; + } + SQLGetDiagRec(iType, hHandle, iRec, sSQLState, &iNative, sSQLMessage, iBufLength, &iTextLength); + if ( status == 0x100 ) + m_pServer->SysMessage(_T("Error allocating statement handle.\n")); + else + m_pServer->SysMessage(_T("Error occurred while processing query '%s'.\n"), szQuery); + m_pServer->SysMessage(_T("--%s. %s\n"), sSQLState, sSQLMessage); + status = -4; + } + if ( hStmtUser != SQL_NULL_HANDLE ) + SQLFreeHandle(SQL_HANDLE_STMT, hStmtUser); + if ( hStmtPrivs != SQL_NULL_HANDLE ) + SQLFreeHandle(SQL_HANDLE_STMT, hStmtPrivs); + + return status; + } + + vector<string> CDBConfig::AllowedFileList(const int userID) + { + vector<string> v; + SQLRETURN rc; + SQLHANDLE hStmt = SQL_NULL_HANDLE; + SQLHANDLE hStmt2 = SQL_NULL_HANDLE; + BYTE bPermissions = 0; + SQLCHAR szQuery[MAX_BUFFER]; + memset(szQuery, 0x00, sizeof(szQuery)); + try + { + // Value thrown is a flag + // 0x100 -- Error on first handle + // 0x200 -- Error on second handle + // 0x010 -- Query is valid + // 0x001 -- First Handle is valid + // 0x002 -- Second handle is valid + + // First get the default permissions for this user + hStmt = NewStmtHandle(); + if ( hStmt == SQL_NULL_HANDLE ) + throw 0x100; + sprintf((char*)szQuery, "select default_file_permissions from %s_users where id=%ld;", Prefix(), userID); + rc = SQLExecDirect(hStmt, szQuery, strlen((char*)szQuery)); + if ( SQLFAILED(rc) ) + throw 0x111; + + SQLINTEGER cbPermissions = sizeof(bPermissions); + rc = SQLBindCol(hStmt, 1, SQL_C_TINYINT, &bPermissions, cbPermissions, &cbPermissions); + if ( SQLFAILED(rc) ) + throw 0x111; + + while ( TRUE ) + { + // There should only be one row. + rc = SQLFetch(hStmt); + if ( SQLFAILED(rc) ) + break; + } + + sprintf((char*)szQuery, "select id, filename from %s_files;", Prefix()); + rc = SQLExecDirect(hStmt, szQuery, strlen((char*)szQuery)); + if ( SQLFAILED(rc) ) + throw 0x111; + + CHAR szFile[MAX_PATH]; + int iFileID; + SQLINTEGER cbFile, cbID; + cbFile = sizeof(szFile); + cbID = sizeof(iFileID); + + rc = SQLBindCol(hStmt, 1, SQL_C_SLONG, &iFileID, cbID, &cbID); + if ( SQLFAILED(rc) ) + throw 0x111; + rc = SQLBindCol(hStmt, 2, SQL_C_CHAR, szFile, cbFile, &cbFile); + if ( SQLFAILED(rc) ) + throw 0x111; + + while ( TRUE ) + { + rc = SQLFetch(hStmt); + if ( SQLFAILED(rc) ) + { + if ( hStmt2 != SQL_NULL_HANDLE ) + SQLFreeHandle(SQL_HANDLE_STMT, hStmt2); + break; + } + + hStmt2 = NewStmtHandle(); + if ( hStmt2 == SQL_NULL_HANDLE ) + throw 0x201; + sprintf((char*)szQuery, "select flags from %s_file_permissions where file_id=%ld, user_id=%ld;", Prefix(), iFileID, userID); + rc = SQLExecDirect(hStmt2, szQuery, strlen((char*)szQuery)); + if ( SQLFAILED(rc) ) + throw 0x213; + + BYTE bFlags = 0xFF; + SQLINTEGER cbFlags = sizeof(bFlags); + rc = SQLBindCol(hStmt2, 1, SQL_C_TINYINT, &bFlags, cbFlags, &cbFlags); + if ( SQLFAILED(rc) ) + throw 0x213; + while ( TRUE ) + { + rc = SQLFetch(hStmt2); + if ( SQLFAILED(rc) ) + break; + } + if ( bFlags == 0xFF ) + { + bFlags = bPermissions; + } + switch ( bFlags ) + { + case 0: + // No permissions + break; + case 1: + case 2: + { + string s; + // Convert to unicode, if necessary + TCHAR tFile[MAX_PATH]; + #ifdef _UNICODE + _stprintf(tFile, "%S", szFile); + #else + _stprintf(tFile, "%s", szFile); + #endif + s.assign(tFile); + v.push_back(s); + } + break; + default: + break; + } + } + throw 0x011; + } + catch (int i) + { + if ( i & 0x300 ) + { + // Format the last message + SQLCHAR sSQLState[6]; + SQLSMALLINT iRec = 1; + SQLCHAR sSQLMessage[MAX_BUFFER]; + SQLINTEGER iNative; + SQLSMALLINT iBufLength = MAX_BUFFER; + SQLSMALLINT iTextLength; + memset(&sSQLState[0], 0x00, 6); + memset(&sSQLMessage[0], 0x00, MAX_BUFFER); + // Display the error + if ( i & 0x003 ) + { + if ( i & 0x001 ) + SQLGetDiagRec(SQL_HANDLE_STMT, hStmt, iRec, sSQLState, &iNative, sSQLMessage, iBufLength, &iTextLength); + else + SQLGetDiagRec(SQL_HANDLE_STMT, hStmt2, iRec, sSQLState, &iNative, sSQLMessage, iBufLength, &iTextLength); + m_pServer->SysMessage(_T("Error occurred while processing query '%s'.\n"), szQuery); + } + else + { + SQLGetDiagRec(SQL_HANDLE_DBC, DbcHandle(), iRec, sSQLState, &iNative, sSQLMessage, iBufLength, &iTextLength); + m_pServer->SysMessage(_T("Error allocating statement handle.\n")); + } + m_pServer->SysMessage(_T("--%s. %s\n"), sSQLState, sSQLMessage); + bPermissions = 0; + } + if ( i & 0x001 ) + SQLFreeHandle(SQL_HANDLE_STMT, hStmt); + if ( i & 0x002 ) + SQLFreeHandle(SQL_HANDLE_STMT, hStmt2); + } + return v; + } + + BYTE CDBConfig::FilePermissions(const int userID, const TCHAR * pszFilename) + { + SQLRETURN rc; + SQLHANDLE hStmt = SQL_NULL_HANDLE; + BYTE bPermissions = 0; + SQLCHAR szQuery[MAX_BUFFER]; + memset(szQuery, 0x00, sizeof(szQuery)); + try + { + // Value thrown is a flag + // 0x100 -- Error + // 0x010 -- Query is valid + // 0x001 -- Handle is valid + + // First get the default permissions for this user + hStmt = NewStmtHandle(); + if ( hStmt == SQL_NULL_HANDLE ) + throw 0x100; + sprintf((char*)szQuery, "select default_file_permissions from %s_users where id=%ld;", Prefix(), userID); + rc = SQLExecDirect(hStmt, szQuery, strlen((char*)szQuery)); + if ( SQLFAILED(rc) ) + throw 0x111; + + SQLINTEGER cbPermissions = sizeof(bPermissions); + rc = SQLBindCol(hStmt, 1, SQL_C_TINYINT, &bPermissions, cbPermissions, &cbPermissions); + if ( SQLFAILED(rc) ) + throw 0x111; + + while ( TRUE ) + { + // There should only be one row. + rc = SQLFetch(hStmt); + if ( SQLFAILED(rc) ) + break; + } + + // Next see if the file is in the list for this user + sprintf((char*)szQuery, "select flags from %s_file_permissions as t1 left join %s_files as t2 on t1.file_id=t2.id where t2.filename=\"%s\" and t1.user_id=%ld;", Prefix(), Prefix(), pszFilename, userID); + rc = SQLExecDirect(hStmt, szQuery, strlen((char*)szQuery)); + if ( SQLFAILED(rc) ) + throw 0x111; + cbPermissions = sizeof(bPermissions); + rc = SQLBindCol(hStmt, 1, SQL_C_TINYINT, &bPermissions, cbPermissions, &cbPermissions); + if ( SQLFAILED(rc) ) + throw 0x111; + + while (TRUE) + { + rc = SQLFetch(hStmt); + if ( SQLFAILED(rc) ) + break; + } + throw 0x011; + } + catch (int i) + { + if ( i & 0x100 ) + { + // Format the last message + SQLCHAR sSQLState[6]; + SQLSMALLINT iRec = 1; + SQLCHAR sSQLMessage[MAX_BUFFER]; + SQLINTEGER iNative; + SQLSMALLINT iBufLength = MAX_BUFFER; + SQLSMALLINT iTextLength; + memset(&sSQLState[0], 0x00, 6); + memset(&sSQLMessage[0], 0x00, MAX_BUFFER); + // Display the error + if ( i & 0x001 ) + { + SQLGetDiagRec(SQL_HANDLE_STMT, hStmt, iRec, sSQLState, &iNative, sSQLMessage, iBufLength, &iTextLength); + m_pServer->SysMessage(_T("Error occurred while processing query '%s'.\n"), szQuery); + } + else + { + SQLGetDiagRec(SQL_HANDLE_DBC, DbcHandle(), iRec, sSQLState, &iNative, sSQLMessage, iBufLength, &iTextLength); + m_pServer->SysMessage(_T("Error allocating statement handle.\n")); + } + m_pServer->SysMessage(_T("--%s. %s\n"), sSQLState, sSQLMessage); + bPermissions = 0; + } + if ( i & 0x001 ) + SQLFreeHandle(SQL_HANDLE_STMT, hStmt); + } + return bPermissions; } Index: DBConfig.h =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/DBConfig.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** DBConfig.h 16 Jun 2003 03:58:35 -0000 1.3 --- DBConfig.h 16 Jun 2003 22:05:59 -0000 1.4 *************** *** 33,37 **** public: CDBConfig(void); ! CDBConfig(const TCHAR * psDSN, const TCHAR * psUser, const TCHAR * psPassword, const TCHAR * psPrefix ); ~CDBConfig(void); void DSN(const SQLCHAR * s) { if (strlen((const char *)s) > 0 ) sprintf((char *)m_szDSN, (const char *)s); } --- 33,37 ---- public: CDBConfig(void); ! CDBConfig(const TCHAR * psDSN, const TCHAR * psUser, const TCHAR * psPassword, const TCHAR * psPrefix, class CAxisServer * pServer); ~CDBConfig(void); void DSN(const SQLCHAR * s) { if (strlen((const char *)s) > 0 ) sprintf((char *)m_szDSN, (const char *)s); } *************** *** 51,54 **** --- 51,58 ---- bool Init(); + int Login(const TCHAR* pszUser, const TCHAR* pszPassword, const TCHAR * pszHost, HOSTENT * pHost, int * iUserID); + vector<string> AllowedFileList(const int userID); + BYTE FilePermissions(const int userID, const TCHAR* pszFilename); + protected: SQLCHAR m_szDSN[256]; // Data Source Name *************** *** 61,63 **** --- 65,69 ---- SQLHANDLE m_hStmt; SQLHANDLE m_hDesc; + + class CAxisServer * m_pServer; }; Index: FontSelectionDlg.cpp =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/FontSelectionDlg.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** FontSelectionDlg.cpp 16 Jun 2003 03:58:35 -0000 1.3 --- FontSelectionDlg.cpp 16 Jun 2003 22:05:59 -0000 1.4 *************** *** 94,98 **** // Fill in the font list ! CDC * pDC = this->GetDC(); LOGFONT logfont; memset( &logfont, 0, sizeof(logfont) ); --- 94,98 ---- // Fill in the font list ! CDC * pDC = GetDC(); LOGFONT logfont; memset( &logfont, 0, sizeof(logfont) ); *************** *** 117,121 **** void CFontSelectionDlg::GetFont(CFont &font) { ! if ( !IsWindow(this->m_hWnd) ) { memcpy(&font, &m_font, sizeof(CFont) ); --- 117,121 ---- void CFontSelectionDlg::GetFont(CFont &font) { ! if ( !IsWindow(m_hWnd) ) { memcpy(&font, &m_font, sizeof(CFont) ); *************** *** 130,134 **** iSize = 36; ! CDC * pDC = this->GetDC(); font.CreateFont(-MulDiv(iSize, GetDeviceCaps(pDC->GetSafeHdc(), LOGPIXELSY), 72), 0, 0, 0, m_bBold ? FW_BOLD : FW_NORMAL, m_bItalic ? 1 : 0, 0, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, ANTIALIASED_QUALITY, DEFAULT_PITCH, m_sFontName); --- 130,134 ---- iSize = 36; ! CDC * pDC = GetDC(); font.CreateFont(-MulDiv(iSize, GetDeviceCaps(pDC->GetSafeHdc(), LOGPIXELSY), 72), 0, 0, 0, m_bBold ? FW_BOLD : FW_NORMAL, m_bItalic ? 1 : 0, 0, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, ANTIALIASED_QUALITY, DEFAULT_PITCH, m_sFontName); Index: MainFrm.cpp =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/MainFrm.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** MainFrm.cpp 16 Jun 2003 03:58:35 -0000 1.3 --- MainFrm.cpp 16 Jun 2003 22:05:59 -0000 1.4 *************** *** 154,158 **** { CRect wRect; ! this->GetClientRect(&wRect); // Find out how big the status bar is --- 154,158 ---- { CRect wRect; ! GetClientRect(&wRect); // Find out how big the status bar is *************** *** 170,174 **** CString csTitle; csTitle.Format(_T("Axis Server (v%s)"), pApp->m_server.GetVersionString() ); ! this->SetWindowText(csTitle); return CFrameWnd::OnCreateClient(lpcs, pContext); --- 170,174 ---- CString csTitle; csTitle.Format(_T("Axis Server (v%s)"), pApp->m_server.GetVersionString() ); ! SetWindowText(csTitle); return CFrameWnd::OnCreateClient(lpcs, pContext); *************** *** 216,222 **** // Something bad happened KillTimer(IDT_TIMER); ! this->ShowWindow(SW_SHOWNORMAL); AfxMessageBox(_T("Axis Server encountered an error and is shutting down.\nView the log file for more information."), MB_OK); ! this->PostMessage(WM_CLOSE, 0, 0); return; } --- 216,222 ---- // Something bad happened KillTimer(IDT_TIMER); ! ShowWindow(SW_SHOWNORMAL); AfxMessageBox(_T("Axis Server encountered an error and is shutting down.\nView the log file for more information."), MB_OK); ! PostMessage(WM_CLOSE, 0, 0); return; } *************** *** 227,231 **** KillTimer(IDT_TIMER); m_wndStatusBar.SetWindowText(_T("Axis Server has stopped")); ! this->PostMessage(WM_CLOSE, 0, 0); return; } --- 227,231 ---- KillTimer(IDT_TIMER); m_wndStatusBar.SetWindowText(_T("Axis Server has stopped")); ! PostMessage(WM_CLOSE, 0, 0); return; } *************** *** 236,240 **** } else ! this->m_wndStatusBar.SetWindowText(csText); return; case IDT_NIDTIP: --- 236,240 ---- } else ! m_wndStatusBar.SetWindowText(csText); return; case IDT_NIDTIP: *************** *** 277,281 **** if ( lParam == WM_LBUTTONDOWN ) { ! this->ShowWindow(SW_SHOWNORMAL); return TRUE; } --- 277,281 ---- if ( lParam == WM_LBUTTONDOWN ) { ! ShowWindow(SW_SHOWNORMAL); return TRUE; } *************** *** 285,294 **** if ( wParam == SC_MINIMIZE ) { ! this->ShowWindow(SW_HIDE); return TRUE; } if ( wParam == SC_CLOSE ) { ! this->ShowWindow(SW_HIDE); return TRUE; } --- 285,294 ---- if ( wParam == SC_MINIMIZE ) { ! ShowWindow(SW_HIDE); return TRUE; } if ( wParam == SC_CLOSE ) { ! ShowWindow(SW_HIDE); return TRUE; } *************** *** 349,353 **** void CMainFrame::SetConsoleFont(LPCTSTR pszFontName, int iFontSize, BYTE bFlags) { ! CDC * pDC = this->m_console.GetDC(); m_font.DeleteObject(); --- 349,353 ---- void CMainFrame::SetConsoleFont(LPCTSTR pszFontName, int iFontSize, BYTE bFlags) { ! CDC * pDC = m_console.GetDC(); m_font.DeleteObject(); *************** *** 371,375 **** // Find the height and width CRect rc; ! this->GetWindowRect(&rc); CAxisServerApp *pApp = (CAxisServerApp *) AfxGetApp(); pApp->m_server.m_config.Geometry(rc.left, rc.top, rc.Width(), rc.Height()); --- 371,375 ---- // Find the height and width CRect rc; ! GetWindowRect(&rc); CAxisServerApp *pApp = (CAxisServerApp *) AfxGetApp(); pApp->m_server.m_config.Geometry(rc.left, rc.top, rc.Width(), rc.Height()); Index: ntservice.cpp =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/ntservice.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** ntservice.cpp 16 Jun 2003 03:58:35 -0000 1.10 --- ntservice.cpp 16 Jun 2003 22:05:59 -0000 1.11 *************** *** 190,194 **** int CService::Debug(int argc, TCHAR **argv) { ! this->m_bDebug = true; _tprintf(_T("Debugging %s.\n"), m_szTitle); SetConsoleCtrlHandler( ControlHandler, TRUE ); --- 190,194 ---- int CService::Debug(int argc, TCHAR **argv) { ! m_bDebug = true; _tprintf(_T("Debugging %s.\n"), m_szTitle); SetConsoleCtrlHandler( ControlHandler, TRUE ); *************** *** 220,226 **** AddToMessageLog(m_szTitle, NULL, APP_SERVICE_STARTING, EVENTLOG_INFORMATION_TYPE ); ! this->ReportStatus(); ! this->m_hStopEvent = CreateEvent( NULL, TRUE, FALSE, NULL ); ReportStatus(); --- 220,226 ---- AddToMessageLog(m_szTitle, NULL, APP_SERVICE_STARTING, EVENTLOG_INFORMATION_TYPE ); ! ReportStatus(); ! m_hStopEvent = CreateEvent( NULL, TRUE, FALSE, NULL ); ReportStatus(); *************** *** 239,243 **** HKEY hKey; TCHAR szKey[MAX_PATH]; ! _stprintf(szKey, _T("System\\CurrentControlSet\\Services\\%s\\Parameters"), this->m_szTitle ); TCHAR szGlobalPath[MAX_PATH]; memset(&szGlobalPath[0], 0x00, sizeof(szGlobalPath)); --- 239,243 ---- HKEY hKey; TCHAR szKey[MAX_PATH]; ! _stprintf(szKey, _T("System\\CurrentControlSet\\Services\\%s\\Parameters"), m_szTitle ); TCHAR szGlobalPath[MAX_PATH]; memset(&szGlobalPath[0], 0x00, sizeof(szGlobalPath)); *************** *** 284,288 **** } _stprintf(szMsg, _T("An unexpected error occurred (rc = %ld).\n"), rc); ! if ( this->m_bDebug ) _tprintf(szMsg); else --- 284,288 ---- } _stprintf(szMsg, _T("An unexpected error occurred (rc = %ld).\n"), rc); ! if ( m_bDebug ) _tprintf(szMsg); else *************** *** 295,301 **** void CService::Stop() { ! this->m_ssStatus.dwCurrentState = SERVICE_STOP_PENDING; ! this->ReportStatus(); ! if ( this->m_hStopEvent ) SetEvent(m_hStopEvent); } --- 295,301 ---- void CService::Stop() { ! m_ssStatus.dwCurrentState = SERVICE_STOP_PENDING; ! ReportStatus(); ! if ( m_hStopEvent ) SetEvent(m_hStopEvent); } *************** *** 366,372 **** return TRUE; ! this->m_ssStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS; ! if ( this->m_ssStatus.dwCurrentState == SERVICE_START_PENDING ) m_ssStatus.dwControlsAccepted = 0; else --- 366,372 ---- return TRUE; ! m_ssStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS; ! if ( m_ssStatus.dwCurrentState == SERVICE_START_PENDING ) m_ssStatus.dwControlsAccepted = 0; else *************** *** 383,387 **** m_ssStatus.dwWaitHint = 5000; } ! BOOL rc = SetServiceStatus( m_sshStatusHandle, &this->m_ssStatus ); if ( rc == 0 ) --- 383,387 ---- m_ssStatus.dwWaitHint = 5000; } ! BOOL rc = SetServiceStatus( m_sshStatusHandle, &m_ssStatus ); if ( rc == 0 ) *************** *** 451,475 **** CService::CService(LPTSTR szName, LPTSTR szDisplayName, LPTSTR szServerName) { ! this->m_bUseService = FALSE; ! this->m_bDebug = FALSE; ! this->m_hStopEvent = NULL; ! this->m_sshStatusHandle = NULL; ! _stprintf( this->m_szServerName, _T("") ); ! _stprintf( this->m_szServiceName, _T("unnamed") ); ! _stprintf( this->m_szDisplayName, _T("unnamed service") ); ! _stprintf( this->m_szTitle, m_szDisplayName ); ! this->m_ssStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS; ! this->m_ssStatus.dwCurrentState = SERVICE_STOPPED; ! this->m_ssStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN; ! this->m_ssStatus.dwWin32ExitCode = NO_ERROR; ! this->m_ssStatus.dwCheckPoint = 0; ! this->m_ssStatus.dwWaitHint = 5000; ! this->m_ssStatus.dwServiceSpecificExitCode = 0; ! ! _stprintf( this->m_szServiceName, szName ); ! _stprintf( this->m_szDisplayName, szDisplayName ); ! _stprintf( this->m_szServerName, szServerName ); if ( szServerName[0] == 0x00 ) ! _stprintf( this->m_szTitle, szDisplayName ); else _stprintf( m_szTitle, _T("%s - %s"), szDisplayName, szServerName ); --- 451,475 ---- CService::CService(LPTSTR szName, LPTSTR szDisplayName, LPTSTR szServerName) { ! m_bUseService = FALSE; ! m_bDebug = FALSE; ! m_hStopEvent = NULL; ! m_sshStatusHandle = NULL; ! _stprintf( m_szServerName, _T("") ); ! _stprintf( m_szServiceName, _T("unnamed") ); ! _stprintf( m_szDisplayName, _T("unnamed service") ); ! _stprintf( m_szTitle, m_szDisplayName ); ! m_ssStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS; ! m_ssStatus.dwCurrentState = SERVICE_STOPPED; ! m_ssStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN; ! m_ssStatus.dwWin32ExitCode = NO_ERROR; ! m_ssStatus.dwCheckPoint = 0; ! m_ssStatus.dwWaitHint = 5000; ! m_ssStatus.dwServiceSpecificExitCode = 0; ! ! _stprintf( m_szServiceName, szName ); ! _stprintf( m_szDisplayName, szDisplayName ); ! _stprintf( m_szServerName, szServerName ); if ( szServerName[0] == 0x00 ) ! _stprintf( m_szTitle, szDisplayName ); else _stprintf( m_szTitle, _T("%s - %s"), szDisplayName, szServerName ); Index: ntservice.h =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/ntservice.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** ntservice.h 16 Jun 2003 03:58:35 -0000 1.5 --- ntservice.h 16 Jun 2003 22:05:59 -0000 1.6 *************** *** 65,69 **** DWORD GetState() { return( m_ssStatus.dwCurrentState ); }; void Dispatch(); ! TCHAR * GetServerName() {return &this->m_szServerName[0]; }; void UseService(BOOL bFlag) { m_bUseService = bFlag; } BOOL UseService() { return m_bUseService; } --- 65,69 ---- DWORD GetState() { return( m_ssStatus.dwCurrentState ); }; void Dispatch(); ! TCHAR * GetServerName() {return &m_szServerName[0]; }; void UseService(BOOL bFlag) { m_bUseService = bFlag; } BOOL UseService() { return m_bUseService; } Index: ServerObj.cpp =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/ServerObj.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** ServerObj.cpp 16 Jun 2003 03:58:35 -0000 1.3 --- ServerObj.cpp 16 Jun 2003 22:05:59 -0000 1.4 *************** *** 30,39 **** #include "gwhogsvr.h" - #include "md5.h" #include <sql.h> - using namespace std; - using namespace CryptoPP; - LPCTSTR pszPLevels [] = { --- 30,35 ---- *************** *** 391,396 **** HOSTENT * hp = gethostbyaddr((char *) &SockAddr.sin_addr, sizeof(in_addr), AF_INET); #ifdef WIN32 ! _stprintf(pClient->m_szIPAddr, _T("%d.%d.%d.%d"), ((((SockAddr).sin_addr).S_un).S_un_b).s_b1, ((((SockAddr).sin_addr).S_un).S_un_b).s_b2, ((((SockAddr).sin_addr).S_un).S_un_b).s_b3, ((((SockAddr).sin_addr).S_un).S_un_b).s_b4); #else int a, b, c, d; --- 387,394 ---- HOSTENT * hp = gethostbyaddr((char *) &SockAddr.sin_addr, sizeof(in_addr), AF_INET); + TCHAR szIP[16]; #ifdef WIN32 ! _stprintf(szIP, _T("%d.%d.%d.%d"), ((((SockAddr).sin_addr).S_un).S_un_b).s_b1, ((((SockAddr).sin_addr).S_un).S_un_b).s_b2, ((((SockAddr).sin_addr).S_un).S_un_b).s_b3, ((((SockAddr).sin_addr).S_un).S_un_b).s_b4); ! pClient->IP(szIP); #else int a, b, c, d; *************** *** 400,415 **** b = (addr >> 8) & 0x000000ff; a = (addr & 0x000000ff); ! _stprintf(pClient->m_szIPAddr, _T("%d.%d.%d.%d"), a, b, c, d); #endif ! memcpy(&(pClient->m_host), hp, sizeof(HOSTENT)); // Check to see whether this host is allowed or not ! if ( !m_config.HostIsAllowed(pClient->m_szIPAddr, hp) ) { shutdown(m_sock, 2); if ( hp ) ! SysMessage(_T("Blocking incoming connection from %s (%S).\n"), pClient->m_szIPAddr, hp->h_name); else ! SysMessage(_T("Blocking incoming connection from %s.\n"), pClient->m_szIPAddr); #ifdef WIN32 closesocket(Sock); --- 398,414 ---- b = (addr >> 8) & 0x000000ff; a = (addr & 0x000000ff); ! _stprintf(szIP, _T("%d.%d.%d.%d"), a, b, c, d); ! pClient->IP(szIP); #endif ! pClient->Host(hp); // Check to see whether this host is allowed or not ! if ( !m_config.HostIsAllowed(pClient->IP(), hp) ) { shutdown(m_sock, 2); if ( hp ) ! SysMessage(_T("Blocking incoming connection from %s (%S).\n"), pClient->IP(), hp->h_name); else ! SysMessage(_T("Blocking incoming connection from %s.\n"), pClient->IP()); #ifdef WIN32 closesocket(Sock); *************** *** 422,428 **** { if ( hp ) ! SysMessage(_T("Socket %ld connected from %s (%S).\n"), (int) pClient->GetSocket(), pClient->m_szIPAddr, hp->h_name); else ! SysMessage(_T("Socket %ld connected from %s.\n"), (int) pClient->GetSocket(), pClient->m_szIPAddr); if ( m_config.UseThreads() ) { --- 421,427 ---- { if ( hp ) ! SysMessage(_T("Socket %ld connected from %s (%S).\n"), (int) pClient->Socket(), pClient->IP(), hp->h_name); else ! SysMe... [truncated message content] |
From: Philip E. <pes...@us...> - 2003-06-16 03:58:39
|
Update of /cvsroot/sphere-axis/axissvr In directory sc8-pr-cvs1:/tmp/cvs-serv7804 Modified Files: AxisServer.cpp AxisServer.h AxisServer.rc ClientObj.cpp ClientObj.h DBConfig.cpp DBConfig.h DBConfigDlg.cpp FontSelectionDlg.cpp FontSelectionDlg.h gwhogsvr.cpp gwhogsvr.h MainFrm.cpp MainFrm.h ntservice.cpp ntservice.h ServerObj.cpp ServerObj.h StdAfx.cpp StdAfx.h Log Message: no message Index: AxisServer.cpp =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/AxisServer.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** AxisServer.cpp 23 May 2003 15:38:25 -0000 1.2 --- AxisServer.cpp 16 Jun 2003 03:58:35 -0000 1.3 *************** *** 3,7 **** ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2002 * * This program is free software; you can redistribute it and/or modify --- 3,7 ---- ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify Index: AxisServer.h =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/AxisServer.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** AxisServer.h 23 May 2003 15:38:26 -0000 1.2 --- AxisServer.h 16 Jun 2003 03:58:35 -0000 1.3 *************** *** 3,7 **** ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2002 * * This program is free software; you can redistribute it and/or modify --- 3,7 ---- ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify Index: AxisServer.rc =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/AxisServer.rc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** AxisServer.rc 23 May 2003 15:38:26 -0000 1.2 --- AxisServer.rc 16 Jun 2003 03:58:35 -0000 1.3 *************** *** 132,136 **** LTEXT "AxisServer Version 1.0",IDC_STATIC,40,10,119,8, SS_NOPREFIX ! LTEXT "Copyright (C) 2002",IDC_STATIC,40,25,119,8 DEFPUSHBUTTON "OK",IDOK,178,7,50,14,WS_GROUP END --- 132,136 ---- LTEXT "AxisServer Version 1.0",IDC_STATIC,40,10,119,8, SS_NOPREFIX ! LTEXT "Copyright (C) 1998-2003",IDC_STATIC,40,25,119,8 DEFPUSHBUTTON "OK",IDOK,178,7,50,14,WS_GROUP END *************** *** 346,350 **** VALUE "FileVersion", "0, 14, 0, 0" VALUE "InternalName", "AxisServer" ! VALUE "LegalCopyright", "Copyright (C) 2002" VALUE "OriginalFilename", "AxisServer.EXE" VALUE "ProductName", "AxisServer Application" --- 346,350 ---- VALUE "FileVersion", "0, 14, 0, 0" VALUE "InternalName", "AxisServer" ! VALUE "LegalCopyright", "Copyright (C) 1998-2003" VALUE "OriginalFilename", "AxisServer.EXE" VALUE "ProductName", "AxisServer Application" Index: ClientObj.cpp =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/ClientObj.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** ClientObj.cpp 23 May 2003 15:38:26 -0000 1.2 --- ClientObj.cpp 16 Jun 2003 03:58:35 -0000 1.3 *************** *** 3,7 **** ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2002 * * This program is free software; you can redistribute it and/or modify --- 3,7 ---- ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2003 * [...1403 lines suppressed...] + Send((BYTE*)szBuf, strlen((char*)szBuf)); + + return TRUE; } + int CAxisClient::Select() + { + // Do a select here... + fd_set fd; + FD_ZERO(&fd); + FD_SET(GetSocket(), &fd); + struct timeval timeout; + timeout.tv_sec = 0; + timeout.tv_usec = 1000; + int rc = select(GetSocket()+1, &fd, 0, 0, &timeout); + if (rc < 0) + SysMessage(_T("Error while receiving data: select() on socket %ld returned %ld\n"), m_sock, rc); + return rc; + } \ No newline at end of file Index: ClientObj.h =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/ClientObj.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** ClientObj.h 23 May 2003 15:38:26 -0000 1.2 --- ClientObj.h 16 Jun 2003 03:58:35 -0000 1.3 *************** *** 3,7 **** ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2002 * * This program is free software; you can redistribute it and/or modify --- 3,7 ---- ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify *************** *** 39,43 **** void ReceiveFile(TCHAR *pszFileName); void GetNewItem(TCHAR *pszUserID, bool bItemFlag); - void NoWritePrivs(); void SendResources(); void SendChecksum(LPCTSTR pszFilename ); --- 39,42 ---- *************** *** 48,51 **** --- 47,54 ---- static void _cdecl EntryProc(LPVOID pData); BOOL IsFinished() { return m_bIsFinished; } + BOOL Command(TCHAR * pszCmd, TCHAR * pszArgs); + int Privs() { return m_iPrivs; } + void Privs(int i) { m_iPrivs = i; } + void Work(); ~CAxisClient(); *************** *** 60,63 **** --- 63,76 ---- BOOL m_bIsFinished; BOOL m_bUnicode; + TCHAR m_szUser[256]; + TCHAR m_szPwd[256]; + int m_iPrivs; + void NoPrivs(TCHAR * pszCmd, TCHAR * pszArgs); + void NoReadPrivs(TCHAR * pszCmd, TCHAR * pszArgs); + void NoWritePrivs(TCHAR * pszCmd, TCHAR * pszArgs); + void ReadOnlyMode(); + void StartServer(); + BOOL SetupConnection(); + int Select(); }; Index: DBConfig.cpp =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/DBConfig.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** DBConfig.cpp 23 May 2003 15:38:27 -0000 1.2 --- DBConfig.cpp 16 Jun 2003 03:58:35 -0000 1.3 *************** *** 71,104 **** SQLRETURN rc; rc = SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &m_hEnv); ! if ( rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO ) ! { return false; - } rc = SQLSetEnvAttr(m_hEnv, SQL_ATTR_ODBC_VERSION, (void*)SQL_OV_ODBC3, 0); ! if ( rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO ) ! { return false; - } rc = SQLAllocHandle(SQL_HANDLE_DBC, m_hEnv, &m_hDbc); ! if ( rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO ) ! { return false; - } rc = SQLConnect(m_hDbc, (SQLCHAR*) m_szDSN, strlen((const char*)m_szDSN), (SQLCHAR*) m_szUser, strlen((const char*)m_szUser), (SQLCHAR*) m_szPassword, strlen((const char*)m_szPassword)); ! if ( rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO ) ! { return false; - } // Make sure the tables exist, and have the correct schema rc = SQLAllocHandle(SQL_HANDLE_STMT, m_hDbc, &m_hStmt); ! if ( rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO ) ! { return false; - } SQLCHAR szTable[256]; --- 71,94 ---- SQLRETURN rc; rc = SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &m_hEnv); ! if ( SQLFAILED(rc) ) return false; rc = SQLSetEnvAttr(m_hEnv, SQL_ATTR_ODBC_VERSION, (void*)SQL_OV_ODBC3, 0); ! if ( SQLFAILED(rc) ) return false; rc = SQLAllocHandle(SQL_HANDLE_DBC, m_hEnv, &m_hDbc); ! if ( SQLFAILED(rc) ) return false; rc = SQLConnect(m_hDbc, (SQLCHAR*) m_szDSN, strlen((const char*)m_szDSN), (SQLCHAR*) m_szUser, strlen((const char*)m_szUser), (SQLCHAR*) m_szPassword, strlen((const char*)m_szPassword)); ! if ( SQLFAILED(rc) ) return false; // Make sure the tables exist, and have the correct schema rc = SQLAllocHandle(SQL_HANDLE_STMT, m_hDbc, &m_hStmt); ! if ( SQLFAILED(rc) ) return false; SQLCHAR szTable[256]; *************** *** 109,113 **** sprintf((char*)szSQL, "create table if not exists %s (id int unique primary key auto_increment, username VARCHAR(32) unique not null, password VARCHAR(32) not null, default_file_permissions tinyint default 0, default_hostflags tinyint default 0);", (char*)szTable); rc = SQLExecDirect(m_hStmt, szSQL, strlen((char*)szSQL)); ! if ( rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO ) return false; --- 99,103 ---- sprintf((char*)szSQL, "create table if not exists %s (id int unique primary key auto_increment, username VARCHAR(32) unique not null, password VARCHAR(32) not null, default_file_permissions tinyint default 0, default_hostflags tinyint default 0);", (char*)szTable); rc = SQLExecDirect(m_hStmt, szSQL, strlen((char*)szSQL)); ! if ( SQLFAILED(rc) ) return false; *************** *** 116,120 **** sprintf((char*)szSQL, "create table if not exists %s (id int unique primary key auto_increment, filename VARCHAR(255) unique not null)", szTable); rc = SQLExecDirect(m_hStmt, szSQL, strlen((char*)szSQL)); ! if ( rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO ) return false; --- 106,110 ---- sprintf((char*)szSQL, "create table if not exists %s (id int unique primary key auto_increment, filename VARCHAR(255) unique not null)", szTable); rc = SQLExecDirect(m_hStmt, szSQL, strlen((char*)szSQL)); ! if ( SQLFAILED(rc) ) return false; *************** *** 123,127 **** sprintf((char*)szSQL, "create table if not exists %s (user_id int, file_id int, flags tinyint)", szTable); rc = SQLExecDirect(m_hStmt, szSQL, strlen((char*)szSQL)); ! if ( rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO ) return false; --- 113,117 ---- sprintf((char*)szSQL, "create table if not exists %s (user_id int, file_id int, flags tinyint)", szTable); rc = SQLExecDirect(m_hStmt, szSQL, strlen((char*)szSQL)); ! if ( SQLFAILED(rc) ) return false; *************** *** 130,134 **** sprintf((char*)szSQL, "create table if not exists %s (id int unique primary key auto_increment, hostmask VARCHAR(255), user_id int, flags tinyint)", szTable); rc = SQLExecDirect(m_hStmt, szSQL, strlen((char*)szSQL)); ! if ( rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO ) return false; --- 120,124 ---- sprintf((char*)szSQL, "create table if not exists %s (id int unique primary key auto_increment, hostmask VARCHAR(255), user_id int, flags tinyint)", szTable); rc = SQLExecDirect(m_hStmt, szSQL, strlen((char*)szSQL)); ! if ( SQLFAILED(rc) ) return false; *************** *** 143,147 **** SQLHANDLE hStmt; SQLRETURN rc = SQLAllocHandle(SQL_HANDLE_STMT, m_hDbc, &hStmt); ! if ( rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO ) return NULL; else --- 133,137 ---- SQLHANDLE hStmt; SQLRETURN rc = SQLAllocHandle(SQL_HANDLE_STMT, m_hDbc, &hStmt); ! if ( SQLFAILED(rc) ) return NULL; else Index: DBConfig.h =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/DBConfig.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** DBConfig.h 23 May 2003 15:38:27 -0000 1.2 --- DBConfig.h 16 Jun 2003 03:58:35 -0000 1.3 *************** *** 46,49 **** --- 46,50 ---- SQLHANDLE StmtHandle() { return m_hStmt; } + SQLHANDLE DbcHandle() { return m_hDbc; } SQLHANDLE NewStmtHandle(); Index: DBConfigDlg.cpp =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/DBConfigDlg.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** DBConfigDlg.cpp 23 May 2003 15:38:27 -0000 1.2 --- DBConfigDlg.cpp 16 Jun 2003 03:58:35 -0000 1.3 *************** *** 36,41 **** #include <sql.h> - #define SQLFAILED(x) ( x != SQL_SUCCESS && x != SQL_SUCCESS_WITH_INFO ) - // CDBConfigDlg dialog --- 36,39 ---- Index: FontSelectionDlg.cpp =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/FontSelectionDlg.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** FontSelectionDlg.cpp 23 May 2003 15:38:28 -0000 1.2 --- FontSelectionDlg.cpp 16 Jun 2003 03:58:35 -0000 1.3 *************** *** 3,7 **** ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2002 * * This program is free software; you can redistribute it and/or modify --- 3,7 ---- ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify Index: FontSelectionDlg.h =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/FontSelectionDlg.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** FontSelectionDlg.h 23 May 2003 15:38:28 -0000 1.2 --- FontSelectionDlg.h 16 Jun 2003 03:58:35 -0000 1.3 *************** *** 3,7 **** ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2002 * * This program is free software; you can redistribute it and/or modify --- 3,7 ---- ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify Index: gwhogsvr.cpp =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/gwhogsvr.cpp,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -r1.28 -r1.29 *** gwhogsvr.cpp 23 May 2003 15:38:29 -0000 1.28 --- gwhogsvr.cpp 16 Jun 2003 03:58:35 -0000 1.29 *************** *** 3,7 **** ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2002 * * This program is free software; you can redistribute it and/or modify --- 3,7 ---- ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify Index: gwhogsvr.h =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/gwhogsvr.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** gwhogsvr.h 23 May 2003 15:38:28 -0000 1.8 --- gwhogsvr.h 16 Jun 2003 03:58:35 -0000 1.9 *************** *** 3,7 **** ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2002 * * This program is free software; you can redistribute it and/or modify --- 3,7 ---- ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify Index: MainFrm.cpp =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/MainFrm.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** MainFrm.cpp 23 May 2003 15:38:29 -0000 1.2 --- MainFrm.cpp 16 Jun 2003 03:58:35 -0000 1.3 *************** *** 3,7 **** ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2002 * * This program is free software; you can redistribute it and/or modify --- 3,7 ---- ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify Index: MainFrm.h =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/MainFrm.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** MainFrm.h 23 May 2003 15:38:29 -0000 1.2 --- MainFrm.h 16 Jun 2003 03:58:35 -0000 1.3 *************** *** 3,7 **** ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2002 * * This program is free software; you can redistribute it and/or modify --- 3,7 ---- ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify Index: ntservice.cpp =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/ntservice.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** ntservice.cpp 23 May 2003 15:38:29 -0000 1.9 --- ntservice.cpp 16 Jun 2003 03:58:35 -0000 1.10 *************** *** 3,7 **** ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2002 * * This program is free software; you can redistribute it and/or modify --- 3,7 ---- ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify Index: ntservice.h =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/ntservice.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** ntservice.h 23 May 2003 15:38:29 -0000 1.4 --- ntservice.h 16 Jun 2003 03:58:35 -0000 1.5 *************** *** 3,7 **** ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2002 * * This program is free software; you can redistribute it and/or modify --- 3,7 ---- ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify Index: ServerObj.cpp =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/ServerObj.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** ServerObj.cpp 23 May 2003 15:38:29 -0000 1.2 --- ServerObj.cpp 16 Jun 2003 03:58:35 -0000 1.3 *************** *** 3,7 **** ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2002 * * This program is free software; you can redistribute it and/or modify --- 3,7 ---- ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify *************** *** 586,589 **** --- 586,590 ---- // Using access masks in a database int iUserID; + BYTE bPermissions, bHosts; SQLCHAR szQuery[8192]; MD5 md5; *************** *** 598,656 **** strcat(szPwd, szByte); } ! sprintf((char *)szQuery, "select id from %s_users where username=\"%s\" and password=\"%s\";)", m_pDB->Prefix(), pszID, szPwd); ! SQLRETURN rc = SQLExecDirect(m_pDB->StmtHandle(), szQuery, strlen((const char*)szQuery)); ! if ( rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO ) ! return -3; ! SQLINTEGER iIDLen; ! rc = SQLBindCol(m_pDB->StmtHandle(), 0, SQL_C_SLONG, &iUserID, 32, &iIDLen); ! if ( rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO ) ! return -3; ! while ( true ) ! { ! rc = SQLFetch(m_pDB->StmtHandle()); ! if ( rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO ) ! return -2; ! // Check if the host matches the allowed hosts for this user ! // Need a new query handle.... ! SQLHANDLE hStmt = m_pDB->NewStmtHandle(); ! if ( hStmt == NULL ) ! return -3; ! sprintf((char*)szQuery, "select hostmask, flags from %s_hosts where user_id=%ld;", m_pDB->Prefix(), iUserID); ! rc = SQLExecDirect(hStmt, szQuery, strlen((const char*)szQuery)); ! if ( rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO ) { ! SQLFreeHandle(SQL_HANDLE_STMT, hStmt); ! return -3; ! } ! SQLCHAR szHostmask[256]; ! SQLSMALLINT sFlag; ! SQLINTEGER iHostLen, iFlagLen; ! rc = SQLBindCol(hStmt, 0, SQL_C_CHAR, &szHostmask[0], 255, &iHostLen); ! if ( rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO ) ! { ! SQLFreeHandle(SQL_HANDLE_STMT, hStmt); ! return -3; ! } ! rc = SQLBindCol(hStmt, 1, SQL_C_USHORT, &sFlag, sizeof(SQL_C_USHORT), &iFlagLen); ! if ( rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO ) ! { ! SQLFreeHandle(SQL_HANDLE_STMT, hStmt); ! return -3; ! } ! while( true ) ! { ! rc = SQLFetch(hStmt); ! if ( rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO ) break; ! if ( m_config.IsHostMatch(pszIP, pHost, (LPCTSTR) &szHostmask[0]) ) { ! // what do the flags say about this? ! } } ! SQLFreeHandle(SQL_HANDLE_STMT, hStmt); ! } ! return -2; } --- 599,752 ---- strcat(szPwd, szByte); } ! SQLHANDLE hStmtUser; ! SQLHANDLE hStmtPrivs; ! hStmtUser = hStmtPrivs = SQL_NULL_HANDLE; ! SQLRETURN rc = 0; ! int status = -1; ! try ! { ! hStmtUser = m_pDB->NewStmtHandle(); ! if ( hStmtUser == SQL_NULL_HANDLE ) ! throw 0x100; ! ! sprintf((char *)szQuery, "select id, default_file_permissions, default_hostflags from %s_users where username=\"%s\" and password=\"%s\";", m_pDB->Prefix(), pszID, szPwd); ! rc = SQLExecDirect(hStmtUser, szQuery, strlen((const char*)szQuery)); ! if ( SQLFAILED(rc) ) ! throw 0x200; ! SQLINTEGER cbID, cbPermissions, cbHosts; ! rc = SQLBindCol(hStmtUser, 1, SQL_C_SLONG, &iUserID, sizeof(iUserID), &cbID); ! if ( SQLFAILED(rc) ) ! throw 0x200; ! rc = SQLBindCol(hStmtUser, 2, SQL_C_TINYINT, &bPermissions, sizeof(bPermissions), &cbPermissions); ! if ( SQLFAILED(rc) ) ! throw 0x200; ! rc = SQLBindCol(hStmtUser, 3, SQL_C_TINYINT, &bHosts, sizeof(bHosts), &cbHosts); ! if ( SQLFAILED(rc) ) ! throw 0x200; ! while ( true ) { ! rc = SQLFetch(hStmtUser); ! if ( SQLFAILED(rc) ) break; ! // Check if the host matches the allowed hosts for this user ! // Need a new query handle.... ! hStmtPrivs = m_pDB->NewStmtHandle(); ! if ( hStmtPrivs == SQL_NULL_HANDLE ) ! throw 0x100; ! ! sprintf((char*)szQuery, "select hostmask, flags from %s_hosts where user_id=%ld;", m_pDB->Prefix(), iUserID); ! rc = SQLExecDirect(hStmtPrivs, szQuery, strlen((const char*)szQuery)); ! if ( SQLFAILED(rc) ) ! throw 0x300; ! ! SQLCHAR szHostmask[256]; ! BYTE bFlag; ! SQLINTEGER iHostLen, iFlagLen; ! rc = SQLBindCol(hStmtPrivs, 1, SQL_C_CHAR, &szHostmask[0], 255, &iHostLen); ! if ( SQLFAILED(rc) ) ! throw 0x300; ! rc = SQLBindCol(hStmtPrivs, 2, SQL_C_TINYINT, &bFlag, sizeof(SQL_C_TINYINT), &iFlagLen); ! if ( SQLFAILED(rc) ) ! throw 0x300; ! while( true ) { ! rc = SQLFetch(hStmtPrivs); ! if ( SQLFAILED(rc) ) ! break; ! if ( m_config.IsHostMatch(pszIP, pHost, (LPCTSTR) &szHostmask[0]) ) ! { ! // what do the flags say about this? ! if ( bFlag ) ! throw (int) bPermissions; ! throw -2; ! } } + // What are the default priv flags for this user? + if ( !bHosts ) + throw -2; + throw (int) bPermissions; } ! // Login failure ! status = -1; } ! catch (int e) ! { ! status = e; ! } ! catch (...) ! { ! } ! switch(status) ! { ! case -2: ! // Host not allowed ! SysMessage(_T("User %s not allowed to log in from host %s.\n"), pszID, pszIP); ! break; ! case -1: ! // Login failure ! SysMessage(_T("Unknown user %s.\n"), pszID); ! break; ! case 0: ! // No permissions ! SysMessage(_T("User %s has no read/write permissions by default.\n"), pszID); ! break; ! case 1: ! // Read only ! SysMessage(_T("User %s has read-only permissions by default.\n"), pszID); ! break; ! case 2: ! // Read/write ! SysMessage(_T("User %s has read/write permissions by default.\n"), pszID); ! break; ! default: ! // SQL Error ! SysMessage(_T("Login for user %s failed due to SQL Error.\n"), pszID); ! break; ! } ! if ( rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO && status > 0xFF) ! { ! // Format the last message ! SQLCHAR sSQLState[6]; ! SQLSMALLINT iRec = 1; ! SQLCHAR sSQLMessage[MAX_BUFFER]; ! SQLINTEGER iNative; ! SQLSMALLINT iBufLength = MAX_BUFFER; ! SQLSMALLINT iTextLength; ! memset(&sSQLState[0], 0x00, 6); ! memset(&sSQLMessage[0], 0x00, MAX_BUFFER); ! SQLSMALLINT iType; ! SQLHANDLE hHandle; ! switch(status) ! { ! case 0x100: ! // Error getting handle ! iType = SQL_HANDLE_DBC; ! hHandle = m_pDB->DbcHandle(); ! break; ! case 0x200: ! // Error with user statement ! iType = SQL_HANDLE_STMT; ! hHandle = hStmtUser; ! break; ! case 0x300: ! // Error with privs statement ! iType = SQL_HANDLE_STMT; ! hHandle = hStmtPrivs; ! break; ! } ! SQLGetDiagRec(iType, hHandle, iRec, sSQLState, &iNative, sSQLMessage, iBufLength, &iTextLength); ! if ( status == 0x100 ) ! SysMessage(_T("Error allocating statement handle.\n")); ! else ! SysMessage(_T("Error occurred while processing query '%s'.\n"), szQuery); ! SysMessage(_T("--%s. %s\n"), sSQLState, sSQLMessage); ! status = -4; ! } ! if ( hStmtUser != SQL_NULL_HANDLE ) ! SQLFreeHandle(SQL_HANDLE_STMT, hStmtUser); ! if ( hStmtPrivs != SQL_NULL_HANDLE ) ! SQLFreeHandle(SQL_HANDLE_STMT, hStmtPrivs); ! ! return status; } *************** *** 816,822 **** return -2; if (bWritePrivs) ! return 1; else ! return 0; } --- 912,918 ---- return -2; if (bWritePrivs) ! return 2; else ! return 1; } *************** *** 1018,1022 **** m_config.WriteXML(_T("axissvr.xml")); } ! if ( !m_config.UseDB() ) { m_pDB = new CDBConfig(m_config.DataSource().c_str(), m_config.User().c_str(), m_config.Password().c_str(), m_config.Prefix().c_str() ); --- 1114,1118 ---- m_config.WriteXML(_T("axissvr.xml")); } ! if ( m_config.UseDB() ) { m_pDB = new CDBConfig(m_config.DataSource().c_str(), m_config.User().c_str(), m_config.Password().c_str(), m_config.Prefix().c_str() ); Index: ServerObj.h =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/ServerObj.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** ServerObj.h 23 May 2003 15:38:29 -0000 1.2 --- ServerObj.h 16 Jun 2003 03:58:35 -0000 1.3 *************** *** 3,7 **** ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2002 * * This program is free software; you can redistribute it and/or modify --- 3,7 ---- ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify *************** *** 52,55 **** --- 52,61 ---- void ReloadConfig(); void SetGeometry(); + void DumpPackets(BOOL b) { m_bDumpPackets = b; } + #ifdef _DEBUG + BOOL DumpPackets() { return TRUE; } + #else + BOOL DumpPackets() { return m_bDumpPackets; } + #endif // We should make these protected! *************** *** 92,95 **** --- 98,102 ---- SOCKET m_sock; CDBConfig * m_pDB; + BOOL m_bDumpPackets; }; Index: StdAfx.cpp =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/StdAfx.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** StdAfx.cpp 23 May 2003 15:38:29 -0000 1.2 --- StdAfx.cpp 16 Jun 2003 03:58:35 -0000 1.3 *************** *** 3,7 **** ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2002 * * This program is free software; you can redistribute it and/or modify --- 3,7 ---- ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify Index: StdAfx.h =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/StdAfx.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** StdAfx.h 23 May 2003 15:38:29 -0000 1.2 --- StdAfx.h 16 Jun 2003 03:58:35 -0000 1.3 *************** *** 3,7 **** ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2002 * * This program is free software; you can redistribute it and/or modify --- 3,7 ---- ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify *************** *** 57,60 **** --- 57,63 ---- #define IDT_TIMER 6666 #define IDT_NIDTIP 6667 + + #define SQLFAILED(x) ( x != SQL_SUCCESS && x != SQL_SUCCESS_WITH_INFO ) + //{{AFX_INSERT_LOCATION}} |
From: Philip E. <pes...@us...> - 2003-06-16 03:42:34
|
Update of /cvsroot/sphere-axis/Axis/CC_Sphere In directory sc8-pr-cvs1:/tmp/cvs-serv5051 Modified Files: Commands.cs Log Message: Added XML comments to get rid of the annoying compiler warnings. Index: Commands.cs =================================================================== RCS file: /cvsroot/sphere-axis/Axis/CC_Sphere/Commands.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** Commands.cs 23 May 2003 05:44:46 -0000 1.2 --- Commands.cs 16 Jun 2003 03:42:31 -0000 1.3 *************** *** 42,52 **** --- 42,76 ---- public interface IClientCommands { + /// <summary> + /// Set an attribute to a value on a target + /// </summary> [DispId(1)]void Set(uint attribute, string arg, bool target); + /// <summary> + /// Send a command to the client + /// </summary> [DispId(2)]void SendCommand(uint command, string arg1, string arg2, bool target); + /// <summary> + /// Toggle a flag on a target + /// </summary> [DispId(3)]void Toggle(uint flag, bool target); + /// <summary> + /// Set the spawn parameters on a spawnbit + /// </summary> [DispId(4)]void SetSpawnInfo(string id, uint type, uint amount, uint timelo, uint timehi, uint distance, uint rate); + /// <summary> + /// Invoke the settings editor for this module + /// </summary> [DispId(5)]void InvokeSettingEditor(); + /// <summary> + /// Get the count of custom commands defined in this module + /// </summary> [DispId(6)]uint GetServerCommandCount(); + /// <summary> + /// Get the description for a custom command in this module + /// </summary> [DispId(7)]string GetServerCommandDescription(uint index); + /// <summary> + /// Invoke a custom command defined in this module + /// </summary> [DispId(8)]void InvokeServerCommand(uint index, string args); } |
From: Philip E. <pes...@us...> - 2003-06-13 21:19:47
|
Update of /cvsroot/sphere-axis/Axis/S_Sphere52 In directory sc8-pr-cvs1:/tmp/cvs-serv25954/S_Sphere52 Modified Files: ProfileEdit.cpp Log Message: no message Index: ProfileEdit.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/ProfileEdit.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** ProfileEdit.cpp 13 Jun 2003 19:58:09 -0000 1.3 --- ProfileEdit.cpp 13 Jun 2003 21:19:44 -0000 1.4 *************** *** 243,247 **** m_sBasePath = szCWD; } ! m_bRemoteSpawns.SetCheck(m_pCurrentProfile->RemoteSpawns() ? 1 : 0); m_sRemoteUser = m_pCurrentProfile->RemoteAccount(); m_sRemotePassword = m_pCurrentProfile->RemotePassword(); --- 243,250 ---- m_sBasePath = szCWD; } ! if ( m_pCurrentProfile->RemoteSpawns() || m_pCurrentProfile->ProfileType() == PROFILE_REMOTE ) ! m_bRemoteSpawns.SetCheck(1); ! else ! m_bRemoteSpawns.SetCheck(0); m_sRemoteUser = m_pCurrentProfile->RemoteAccount(); m_sRemotePassword = m_pCurrentProfile->RemotePassword(); |
From: Philip E. <pes...@us...> - 2003-06-13 21:19:47
|
Update of /cvsroot/sphere-axis/Axis In directory sc8-pr-cvs1:/tmp/cvs-serv25954 Modified Files: Drewsky.cpp Log Message: no message Index: Drewsky.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/Drewsky.cpp,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -r1.29 -r1.30 *** Drewsky.cpp 13 Jun 2003 14:52:41 -0000 1.29 --- Drewsky.cpp 13 Jun 2003 21:19:44 -0000 1.30 *************** *** 241,256 **** // Retrieve the selected profile info from the dialog DWORD dwInfo = profileDlg.GetSelectedInfo(); ! int iModule, iIndex; ! iModule = ( dwInfo && 0xFFFF0000 ) >> 16; ! iIndex = dwInfo && 0x0000FFFF; ! if ( iModule != -1 ) { ! COMConfig * pScripts = m_config.GetScriptModule(iModule); if ( pScripts != NULL ) { m_pScripts = new CScriptsWrapper(pScripts->m_sClsID); if ( m_pScripts->IsValid() ) ! m_pScripts->LoadScripts(iIndex); } } --- 241,256 ---- // Retrieve the selected profile info from the dialog DWORD dwInfo = profileDlg.GetSelectedInfo(); ! short sModule, sIndex; ! sModule = (short) (( dwInfo & 0xFFFF0000 ) >> 16); ! sIndex = (short) (dwInfo & 0x0000FFFF); ! if ( sModule != -1 ) { ! COMConfig * pScripts = m_config.GetScriptModule(sModule); if ( pScripts != NULL ) { m_pScripts = new CScriptsWrapper(pScripts->m_sClsID); if ( m_pScripts->IsValid() ) ! m_pScripts->LoadScripts(sIndex); } } |
From: Philip E. <pes...@us...> - 2003-06-13 19:58:14
|
Update of /cvsroot/sphere-axis/Axis/S_Sphere52 In directory sc8-pr-cvs1:/tmp/cvs-serv12938/S_Sphere52 Modified Files: ProfileEdit.cpp ProfileEdit.h S_Sphere52.rc Scripts.cpp Scripts.h Log Message: no message Index: ProfileEdit.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/ProfileEdit.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** ProfileEdit.cpp 13 Jun 2003 14:52:42 -0000 1.2 --- ProfileEdit.cpp 13 Jun 2003 19:58:09 -0000 1.3 *************** *** 73,77 **** DDX_Text(pDX, IDC_PROFILE_REMOTEPORT, m_sRemotePort); DDX_Text(pDX, IDC_PROFILE_REMOTETIMEOUT, m_sRemoteTimeout); ! DDX_Check(pDX, IDC_PROFILE_LOCAL, m_iProfileType); } --- 73,77 ---- DDX_Text(pDX, IDC_PROFILE_REMOTEPORT, m_sRemotePort); DDX_Text(pDX, IDC_PROFILE_REMOTETIMEOUT, m_sRemoteTimeout); ! DDX_Radio(pDX, IDC_PROFILE_LOCAL, m_iProfileType); } *************** *** 124,128 **** void CProfileEdit::OnBnClickedProfileScriptRefresh() { ! PopulateScripts(); } --- 124,128 ---- void CProfileEdit::OnBnClickedProfileScriptRefresh() { ! PopulateScripts(true); } *************** *** 210,213 **** --- 210,215 ---- void CProfileEdit::PopulateProfiles() { + m_lbProfiles.ResetContent(); + int iSel = -1; for ( int i = 0; i < Main->m_config.ProfileCount(); i++ ) { *************** *** 217,221 **** --- 219,226 ---- int index = m_lbProfiles.AddString(s); m_lbProfiles.SetItemDataPtr(index, (void*) pProfile); + if ( pProfile == m_pCurrentProfile ) + iSel = i; } + m_lbProfiles.SetCurSel(iSel); } *************** *** 265,269 **** } ! void CProfileEdit::PopulateScripts() { m_tcScripts.DeleteAllItems(); --- 270,274 ---- } ! void CProfileEdit::PopulateScripts(bool bPopulateRemote) { m_tcScripts.DeleteAllItems(); *************** *** 276,281 **** else { ! HTREEITEM hRoot = m_tcScripts.InsertItem(_T(""), m_iFolderIndex, m_iFolderIndex); ! ParseRemoteDirectory(_T("."), hRoot, m_saSelections); } } --- 281,292 ---- else { ! if ( bPopulateRemote ) ! { ! HTREEITEM hRoot = m_tcScripts.InsertItem(_T(""), m_iFolderIndex, m_iFolderIndex); ! Main->m_pAxis->SetAxisServerParameters(m_sSphereIP, _ttoi(m_sRemotePort), m_sRemoteUser, m_sRemotePassword, _ttoi(m_sRemoteTimeout)); ! Main->m_pAxis->Login(); ! ParseRemoteDirectory(_T("."), hRoot, m_saSelections); ! Main->m_pAxis->Logout(); ! } } } *************** *** 339,342 **** --- 350,354 ---- m_pCurrentProfile->ServerPort(_ttoi(m_sSpherePort)); m_pCurrentProfile->BaseDirectory(m_sBasePath); + m_pCurrentProfile->RemoteSpawns(m_bRemoteSpawns.GetCheck() ? true : false); m_pCurrentProfile->RemoteAccount(m_sRemoteUser); m_pCurrentProfile->RemotePassword(m_sRemotePassword); Index: ProfileEdit.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/ProfileEdit.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** ProfileEdit.h 13 Jun 2003 14:52:42 -0000 1.2 --- ProfileEdit.h 13 Jun 2003 19:58:09 -0000 1.3 *************** *** 77,81 **** void PopulateProfiles(); void PopulateValues(); ! void PopulateScripts(); void EnableEditWindows(BOOL bEnable); void UpdateValues(); --- 77,81 ---- void PopulateProfiles(); void PopulateValues(); ! void PopulateScripts(bool bParseRemote = false); void EnableEditWindows(BOOL bEnable); void UpdateValues(); Index: S_Sphere52.rc =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/S_Sphere52.rc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** S_Sphere52.rc 13 Jun 2003 14:52:42 -0000 1.4 --- S_Sphere52.rc 13 Jun 2003 19:58:09 -0000 1.5 *************** *** 111,116 **** IDD_PROFILE_EDIT DIALOGEX 0, 0, 299, 293 ! STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | ! WS_SYSMENU CAPTION "Profile Editor (Sphere 0.52)" FONT 8, "MS Shell Dlg", 400, 0, 0x1 --- 111,116 ---- IDD_PROFILE_EDIT DIALOGEX 0, 0, 299, 293 ! STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | ! WS_CAPTION | WS_SYSMENU CAPTION "Profile Editor (Sphere 0.52)" FONT 8, "MS Shell Dlg", 400, 0, 0x1 *************** *** 145,150 **** CONTROL "",IDC_PROFILE_FILES,"SysTreeView32",TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | TVS_CHECKBOXES | ! TVS_TRACKSELECT | TVS_NOSCROLL | WS_DISABLED | WS_BORDER | ! WS_TABSTOP,141,122,147,144 PUSHBUTTON "Refresh List",IDC_PROFILE_SCRIPT_REFRESH,226,107,61,13, WS_DISABLED --- 145,149 ---- CONTROL "",IDC_PROFILE_FILES,"SysTreeView32",TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | TVS_CHECKBOXES | ! WS_DISABLED | WS_BORDER | WS_TABSTOP,141,122,147,144 PUSHBUTTON "Refresh List",IDC_PROFILE_SCRIPT_REFRESH,226,107,61,13, WS_DISABLED Index: Scripts.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/Scripts.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** Scripts.cpp 12 Jun 2003 23:27:01 -0000 1.6 --- Scripts.cpp 13 Jun 2003 19:58:09 -0000 1.7 *************** *** 9,17 **** // CScripts ! CScripts * Main; CScripts::CScripts() { ! Main = this; m_config.LoadConfig(); m_pScripts = new CScriptsMain; --- 9,20 ---- // CScripts ! ! int CScripts::m_instance = -1; ! vector<CScripts*> CScripts::m_instances; CScripts::CScripts() { ! m_instance++; ! m_instances.push_back(this); m_config.LoadConfig(); m_pScripts = new CScriptsMain; *************** *** 26,29 **** --- 29,34 ---- if ( m_pAxis ) delete m_pAxis; + m_instances.pop_back(); + m_instance--; } *************** *** 46,51 **** psfOutput->WriteString(_T("//****************************************************************************\n")); CString csLine; - //csLine.Format(_T("// %s written by %s\n"), csFilename, Main->GetVersionTitle()); - //psfOutput->WriteString(csLine); CTime time; time = CTime::GetCurrentTime(); --- 51,54 ---- *************** *** 60,64 **** AFX_MANAGE_STATE(AfxGetStaticModuleState()); ! *count = (ULONG) Main->m_config.ProfileCount(); return S_OK; --- 63,67 ---- AFX_MANAGE_STATE(AfxGetStaticModuleState()); ! *count = (ULONG) m_config.ProfileCount(); return S_OK; *************** *** 69,73 **** AFX_MANAGE_STATE(AfxGetStaticModuleState()); ! CScriptProfile * pProfile = Main->m_config.GetProfile(index); if ( pProfile == NULL ) return S_FALSE; --- 72,76 ---- AFX_MANAGE_STATE(AfxGetStaticModuleState()); ! CScriptProfile * pProfile = m_config.GetProfile(index); if ( pProfile == NULL ) return S_FALSE; *************** *** 82,86 **** AFX_MANAGE_STATE(AfxGetStaticModuleState()); ! CScriptProfile * pProfile = Main->m_config.GetProfile(index); if ( pProfile == NULL ) return S_FALSE; --- 85,89 ---- AFX_MANAGE_STATE(AfxGetStaticModuleState()); ! CScriptProfile * pProfile = m_config.GetProfile(index); if ( pProfile == NULL ) return S_FALSE; Index: Scripts.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/Scripts.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** Scripts.h 12 Jun 2003 23:27:01 -0000 1.6 --- Scripts.h 13 Jun 2003 19:58:09 -0000 1.7 *************** *** 7,14 **** #include "ScriptsMain.h" #include "XMLConfig.h" - #define LOG Main->m_pAxis->Log - #define locale Main->m_pAxis // CScripts --- 7,14 ---- #include "ScriptsMain.h" #include "XMLConfig.h" + #include <vector> + using namespace std; // CScripts *************** *** 30,33 **** --- 30,35 ---- CXMLConfig m_config; + static vector<CScripts*> m_instances; + static int m_instance; CScripts(); *************** *** 145,147 **** OBJECT_ENTRY_AUTO(__uuidof(Scripts), CScripts) ! extern CScripts * Main; --- 147,151 ---- OBJECT_ENTRY_AUTO(__uuidof(Scripts), CScripts) ! #define Main CScripts::m_instances[CScripts::m_instance] ! #define LOG Main->m_pAxis->Log ! #define locale Main->m_pAxis |
From: Philip E. <pes...@us...> - 2003-06-13 19:58:13
|
Update of /cvsroot/sphere-axis/Axis/S_ScriptsBase In directory sc8-pr-cvs1:/tmp/cvs-serv12938/S_ScriptsBase Modified Files: AxisLibWrapper.cpp XMLBase.cpp Log Message: no message Index: AxisLibWrapper.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_ScriptsBase/AxisLibWrapper.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** AxisLibWrapper.cpp 23 May 2003 05:46:26 -0000 1.2 --- AxisLibWrapper.cpp 13 Jun 2003 19:58:08 -0000 1.3 *************** *** 47,94 **** void CAxisLibWrapper::SetAxisServerParameters(CString sIP, ULONG port, CString sUserid, CString sPassword, ULONG timeout) { } bool CAxisLibWrapper::Login() { ! return true; } void CAxisLibWrapper::Logout() { } bool CAxisLibWrapper::GetFileChecksum(CString sLocalFile, CString sRemoteFile, ULONG* checksum) { ! return true; } bool CAxisLibWrapper::GetDirectoryList(CString sPath, CStringArray *aFiles, CStringArray *aDirectories) { ! return true; } bool CAxisLibWrapper::GetRemoteFile(CString sRemote, CString sLocal) { ! return true; } bool CAxisLibWrapper::SendLocalFile(CString sLocal, CString sRemote) { ! return true; } bool CAxisLibWrapper::GetRemoteSpawnInfo(CStringArray* aInfo) { ! return true; } bool CAxisLibWrapper::GetRemoteServerPort(ULONG *port) { ! return true; } bool CAxisLibWrapper::StartRemoteServer() { ! return true; } --- 47,164 ---- void CAxisLibWrapper::SetAxisServerParameters(CString sIP, ULONG port, CString sUserid, CString sPassword, ULONG timeout) { + BSTR bIP = sIP.AllocSysString(); + BSTR bUser = sUserid.AllocSysString(); + BSTR bPassword = sPassword.AllocSysString(); + + m_pAxisServer->SetParameters(bIP, port, bUser, bPassword, timeout); } bool CAxisLibWrapper::Login() { ! VARIANT_BOOL b = m_pAxisServer->Login(); ! return b ? true : false; } void CAxisLibWrapper::Logout() { + m_pAxisServer->Logout(); } bool CAxisLibWrapper::GetFileChecksum(CString sLocalFile, CString sRemoteFile, ULONG* checksum) { ! BSTR bLocal = sLocalFile.AllocSysString(); ! BSTR bRemote = sRemoteFile.AllocSysString(); ! VARIANT_BOOL b = m_pAxisServer->GetFileChecksum(bLocal, bRemote, checksum); ! return b ? true : false; } bool CAxisLibWrapper::GetDirectoryList(CString sPath, CStringArray *aFiles, CStringArray *aDirectories) { ! BSTR bPath = sPath.AllocSysString(); ! BSTR files; ! BSTR directories; ! VARIANT_BOOL b = m_pAxisServer->GetDirectoryList(bPath, &files, &directories); ! if ( b ) ! { ! CString sFiles, sDirectories; ! #ifdef UNICODE ! sFiles.Format(_T("%s"), files); ! sDirectories.Format(_T("%s"), directories); ! #else ! sFiles.Format(_T("%S"), files); ! sDirectories.Format(_T("%S"), directories); ! #endif ! // Parse the files and directories ! int pos = 0; ! CString resToken = sFiles.Tokenize(_T(":"), pos); ! while ( resToken != _T("") ) ! { ! aFiles->Add(resToken); ! resToken = sFiles.Tokenize(_T(":"), pos); ! } ! pos = 0; ! resToken = sDirectories.Tokenize(_T(":"), pos); ! while ( resToken != _T("") ) ! { ! aDirectories->Add(resToken); ! resToken = sDirectories.Tokenize(_T(":"), pos); ! } ! } ! ! return b ? true : false; } bool CAxisLibWrapper::GetRemoteFile(CString sRemote, CString sLocal) { ! BSTR bRemote = sRemote.AllocSysString(); ! BSTR bLocal = sLocal.AllocSysString(); ! VARIANT_BOOL b = m_pAxisServer->GetRemoteFile(bRemote, bLocal); ! return b ? true : false; } bool CAxisLibWrapper::SendLocalFile(CString sLocal, CString sRemote) { ! BSTR bLocal = sLocal.AllocSysString(); ! BSTR bRemote = sRemote.AllocSysString(); ! VARIANT_BOOL b = m_pAxisServer->SendLocalFile(bLocal, bRemote); ! return b ? true : false; } bool CAxisLibWrapper::GetRemoteSpawnInfo(CStringArray* aInfo) { ! BSTR info; ! VARIANT_BOOL b = m_pAxisServer->GetSpawnInfo(&info); ! if ( b ) ! { ! CString sInfo; ! #ifdef UNICODE ! sInfo.Format(_T("%s"), info); ! #else ! sInfo.Format(_T("%S"), info); ! #endif ! int pos = 0; ! TCHAR lf[] = { 0x0a, 0x00 }; ! TCHAR cr[] = { 0x0d, 0x00 }; ! CString token = sInfo.Tokenize(lf, pos); ! while ( token != _T("") ) ! { ! aInfo->Add(token.SpanExcluding(cr)); ! token = sInfo.Tokenize(lf, pos); ! } ! } ! return b ? true : false; } bool CAxisLibWrapper::GetRemoteServerPort(ULONG *port) { ! VARIANT_BOOL b; ! m_pAxisServer->GetPort(port, &b); ! return b ? true : false; } bool CAxisLibWrapper::StartRemoteServer() { ! VARIANT_BOOL b = m_pAxisServer->StartRemoteServer(); ! return b ? true : false; } Index: XMLBase.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_ScriptsBase/XMLBase.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** XMLBase.cpp 23 May 2003 05:46:27 -0000 1.2 --- XMLBase.cpp 13 Jun 2003 19:58:08 -0000 1.3 *************** *** 79,85 **** c = sValue.Find("\n"); CString s = sValue.SpanExcluding("\n"); ! CString sValue = s.Trim(_T("\t")); ! if ( sValue.GetLength() > 0 ) ! p->Add(sValue); if ( c != -1 ) { --- 79,85 ---- c = sValue.Find("\n"); CString s = sValue.SpanExcluding("\n"); ! CString sNewValue = s.Trim(_T("\t")); ! if ( sNewValue.GetLength() > 0 ) ! p->Add(sNewValue); if ( c != -1 ) { |
From: Philip E. <pes...@us...> - 2003-06-13 19:58:12
|
Update of /cvsroot/sphere-axis/Axis In directory sc8-pr-cvs1:/tmp/cvs-serv12938 Modified Files: axis_enu.xml Log Message: no message Index: axis_enu.xml =================================================================== RCS file: /cvsroot/sphere-axis/Axis/axis_enu.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** axis_enu.xml 13 Jun 2003 14:52:41 -0000 1.4 --- axis_enu.xml 13 Jun 2003 19:58:08 -0000 1.5 *************** *** 390,394 **** <Item ID="1283" type="CONTROL" geometry="417,6,10,9">""</Item> <Item ID="1486" type="GROUPBOX" geometry="283,2,75,112">"Actions"</Item> ! <Item ID="1485" type="GROUPBOX" geometry="168,2,113,112">"Profiles"</Item> <Item ID="1039" type="CONTROL" geometry="7,99,103,11">"Make Windows Translucent"</Item> <Item ID="1429" type="CONTROL" geometry="143,100,24,11">""</Item> --- 390,394 ---- <Item ID="1283" type="CONTROL" geometry="417,6,10,9">""</Item> <Item ID="1486" type="GROUPBOX" geometry="283,2,75,112">"Actions"</Item> ! <Item ID="1485" type="GROUPBOX" geometry="168,2,113,112">"Script Modules"</Item> <Item ID="1039" type="CONTROL" geometry="7,99,103,11">"Make Windows Translucent"</Item> <Item ID="1429" type="CONTROL" geometry="143,100,24,11">""</Item> |
From: Philip E. <pes...@us...> - 2003-06-13 14:52:47
|
Update of /cvsroot/sphere-axis/Axis In directory sc8-pr-cvs1:/tmp/cvs-serv13341 Modified Files: Axis.rc axis_enu.xml Drewsky.cpp resource.h settingstab.cpp settingstab.h Log Message: no message Index: Axis.rc =================================================================== RCS file: /cvsroot/sphere-axis/Axis/Axis.rc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** Axis.rc 12 Jun 2003 03:15:30 -0000 1.4 --- Axis.rc 13 Jun 2003 14:52:39 -0000 1.5 *************** *** 645,687 **** CONTROL "Allow Multiple Instances of Axis",IDC_ALLOWMULTIPLE, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,91,116,10 ! LISTBOX IDC_REMOTEPROFILES,174,12,103,73,LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP ! PUSHBUTTON "New",IDC_RP_NEW,179,98,30,14 ! PUSHBUTTON "Edit",IDC_RP_EDIT,211,98,30,14 ! PUSHBUTTON "Delete",IDC_RP_DELETE,243,98,30,14 PUSHBUTTON "Close Axis",IDC_CLOSE,286,14,69,12 PUSHBUTTON "Reload Scripts",IDC_RELOAD_SCRIPTS,286,26,69,12 PUSHBUTTON "Close UO Client",IDC_CLOSE_CLIENT,286,38,69,12 ! PUSHBUTTON "GUI Script Editor",IDC_SCRIPTEDIT,286,50,69,12,WS_GROUP ! PUSHBUTTON "Raw Text Editor",IDC_RAWEDIT,286,62,69,12 ! PUSHBUTTON "Account Manager",IDC_ACCTEDIT,286,74,69,12 ! PUSHBUTTON "Additional Settings",IDC_ADDITIONALSETTINGS,286,86,69, 12 ! PUSHBUTTON "About Axis",IDC_ABOUTHOG,286,98,69,12 ! PUSHBUTTON "Static Tool",IDC_LAUNCH_STATIC_TOOL,362,6,46,13,NOT WS_VISIBLE ! PUSHBUTTON "Refresh Categories",IDC_REFRESHCATEGORIES,410,6,63,13 ! LTEXT "NPC Spawn",IDC_ST_SNPCCOLOR,373,21,40,8,NOT WS_GROUP ! LTEXT "Item Spawn",IDC_ST_SITEMCOLOR,429,21,38,8,NOT WS_GROUP CONTROL "",IDC_NPC_COLOR,"Static",SS_BLACKFRAME | SS_NOTIFY | ! SS_SUNKEN,361,21,10,9 CONTROL "",IDC_ITEM_COLOR,"Static",SS_BLACKFRAME | SS_NOTIFY | ! SS_SUNKEN,417,21,10,9 GROUPBOX "Actions",IDC_ST_GROUP_ACTIONS,283,2,75,112 ! GROUPBOX "Profiles",IDC_ST_GROUP_PROFILES,168,2,113,112 ! CONTROL "Make Windows Translucent",IDC_TRANSLUCENT,"Button", ! BS_AUTOCHECKBOX | WS_TABSTOP,7,99,103,11 CONTROL "",IDC_ALPHABLEND,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,143,100,24,11 - LTEXT "Opacity",IDC_OPACITY,117,99,25,11,SS_CENTERIMAGE - CONTROL "Always load this profile",IDC_AUTOLOADPROFILE,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,175,88,103,8 GROUPBOX "Commands",IDC_ST_GROUP_COMMANDS,359,66,114,48 ! LISTBOX IDC_COMMANDS,363,74,105,25,LBS_SORT | ! LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP ! PUSHBUTTON "Settings",IDC_CMDSETTINGS,427,100,41,11 ! GROUPBOX "Languages",IDC_ST_GROUP_LANGUAGES,360,31,113,35 ! LISTBOX IDC_LANGUAGES,364,38,105,25,LBS_SORT | ! LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP END --- 645,681 ---- CONTROL "Allow Multiple Instances of Axis",IDC_ALLOWMULTIPLE, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,91,116,10 ! CONTROL "Make Windows Translucent",IDC_TRANSLUCENT,"Button", ! BS_AUTOCHECKBOX | WS_TABSTOP,7,99,103,11 ! LTEXT "Opacity",IDC_OPACITY,117,99,25,11,SS_CENTERIMAGE ! LISTBOX IDC_REMOTEPROFILES,174,12,103,81,LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP ! PUSHBUTTON "Edit Profiles",IDC_RP_EDIT,222,96,54,14 PUSHBUTTON "Close Axis",IDC_CLOSE,286,14,69,12 PUSHBUTTON "Reload Scripts",IDC_RELOAD_SCRIPTS,286,26,69,12 PUSHBUTTON "Close UO Client",IDC_CLOSE_CLIENT,286,38,69,12 ! PUSHBUTTON "Raw Text Editor",IDC_RAWEDIT,286,50,69,12 ! PUSHBUTTON "Additional Settings",IDC_ADDITIONALSETTINGS,286,62,69, 12 ! PUSHBUTTON "About Axis",IDC_ABOUTHOG,286,74,69,12 ! PUSHBUTTON "Static Tool",IDC_LAUNCH_STATIC_TOOL,286,86,69,12,NOT WS_VISIBLE ! PUSHBUTTON "Refresh Categories",IDC_REFRESHCATEGORIES,286,98,69,12 CONTROL "",IDC_NPC_COLOR,"Static",SS_BLACKFRAME | SS_NOTIFY | ! SS_SUNKEN,361,6,10,9 ! LTEXT "NPC Spawn",IDC_ST_SNPCCOLOR,373,6,40,8,NOT WS_GROUP CONTROL "",IDC_ITEM_COLOR,"Static",SS_BLACKFRAME | SS_NOTIFY | ! SS_SUNKEN,417,6,10,9 ! LTEXT "Item Spawn",IDC_ST_SITEMCOLOR,429,6,38,8,NOT WS_GROUP ! LISTBOX IDC_LANGUAGES,364,31,105,27,LBS_SORT | ! LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP ! LISTBOX IDC_COMMANDS,363,74,105,25,LBS_SORT | ! LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP ! PUSHBUTTON "Settings",IDC_CMDSETTINGS,427,100,41,11 GROUPBOX "Actions",IDC_ST_GROUP_ACTIONS,283,2,75,112 ! GROUPBOX "Script Modules",IDC_ST_GROUP_PROFILES,168,2,113,112 CONTROL "",IDC_ALPHABLEND,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,143,100,24,11 GROUPBOX "Commands",IDC_ST_GROUP_COMMANDS,359,66,114,48 ! GROUPBOX "Languages",IDC_ST_GROUP_LANGUAGES,360,22,113,41 END Index: axis_enu.xml =================================================================== RCS file: /cvsroot/sphere-axis/Axis/axis_enu.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** axis_enu.xml 3 Jun 2003 16:43:12 -0000 1.3 --- axis_enu.xml 13 Jun 2003 14:52:41 -0000 1.4 *************** *** 376,396 **** <Item ID="1046" type="CONTROL" geometry="7,81,124,10">"Show Spawnpoints on Radar Map"</Item> <Item ID="1047" type="CONTROL" geometry="7,91,116,10">"Allow Multiple Instances of Axis"</Item> ! <Item ID="1001" type="PUSHBUTTON" geometry="179,98,30,14">"New"</Item> ! <Item ID="1002" type="PUSHBUTTON" geometry="211,98,30,14">"Edit"</Item> ! <Item ID="1003" type="PUSHBUTTON" geometry="243,98,30,14">"Delete"</Item> <Item ID="1123" type="PUSHBUTTON" geometry="286,14,69,12">"Close Axis"</Item> <Item ID="1124" type="PUSHBUTTON" geometry="286,26,69,12">"Reload Scripts"</Item> <Item ID="1125" type="PUSHBUTTON" geometry="286,38,69,12">"Close UO Client"</Item> ! <Item ID="1353" type="PUSHBUTTON" geometry="286,50,69,12">"GUI Script Editor"</Item> ! <Item ID="1016" type="PUSHBUTTON" geometry="286,62,69,12">"Raw Text Editor"</Item> ! <Item ID="1017" type="PUSHBUTTON" geometry="286,74,69,12">"Account Manager"</Item> ! <Item ID="1127" type="PUSHBUTTON" geometry="286,86,69,12">"Additional Settings"</Item> ! <Item ID="1126" type="PUSHBUTTON" geometry="286,98,69,12">"About Axis"</Item> ! <Item ID="1004" type="PUSHBUTTON" geometry="362,6,46,13">"Static Tool"</Item> ! <Item ID="1005" type="PUSHBUTTON" geometry="410,6,63,13">"Refresh Categories"</Item> ! <Item ID="1488" type="LTEXT" geometry="373,21,40,8">"NPC Spawn"</Item> ! <Item ID="1489" type="LTEXT" geometry="429,21,38,8">"Item Spawn"</Item> ! <Item ID="1282" type="CONTROL" geometry="361,21,10,9">""</Item> ! <Item ID="1283" type="CONTROL" geometry="417,21,10,9">""</Item> <Item ID="1486" type="GROUPBOX" geometry="283,2,75,112">"Actions"</Item> <Item ID="1485" type="GROUPBOX" geometry="168,2,113,112">"Profiles"</Item> --- 376,392 ---- <Item ID="1046" type="CONTROL" geometry="7,81,124,10">"Show Spawnpoints on Radar Map"</Item> <Item ID="1047" type="CONTROL" geometry="7,91,116,10">"Allow Multiple Instances of Axis"</Item> ! <Item ID="1002" type="PUSHBUTTON" geometry="222,96,54,14">"Edit Profiles"</Item> <Item ID="1123" type="PUSHBUTTON" geometry="286,14,69,12">"Close Axis"</Item> <Item ID="1124" type="PUSHBUTTON" geometry="286,26,69,12">"Reload Scripts"</Item> <Item ID="1125" type="PUSHBUTTON" geometry="286,38,69,12">"Close UO Client"</Item> ! <Item ID="1016" type="PUSHBUTTON" geometry="286,50,69,12">"Raw Text Editor"</Item> ! <Item ID="1127" type="PUSHBUTTON" geometry="286,62,69,12">"Additional Settings"</Item> ! <Item ID="1126" type="PUSHBUTTON" geometry="286,74,69,12">"About Axis"</Item> ! <Item ID="1004" type="PUSHBUTTON" geometry="286,86,69,12">"Static Tool"</Item> ! <Item ID="1005" type="PUSHBUTTON" geometry="286,98,69,12">"Refresh Categories"</Item> ! <Item ID="1488" type="LTEXT" geometry="373,6,40,8">"NPC Spawn"</Item> ! <Item ID="1489" type="LTEXT" geometry="429,6,40,8">"Item Spawn"</Item> ! <Item ID="1282" type="CONTROL" geometry="361,6,10,9">""</Item> ! <Item ID="1283" type="CONTROL" geometry="417,6,10,9">""</Item> <Item ID="1486" type="GROUPBOX" geometry="283,2,75,112">"Actions"</Item> <Item ID="1485" type="GROUPBOX" geometry="168,2,113,112">"Profiles"</Item> *************** *** 398,406 **** <Item ID="1429" type="CONTROL" geometry="143,100,24,11">""</Item> <Item ID="1767" type="LTEXT" geometry="117,99,25,11">"Opacity"</Item> - <Item ID="1040" type="CONTROL" geometry="175,88,103,8">"Always load this profile"</Item> <Item ID="1487" type="GROUPBOX" geometry="359,66,114,48">"Commands"</Item> <Item ID="1006" type="PUSHBUTTON" geometry="427,100,41,11">"Settings"</Item> ! <Item ID="1792" type="GROUPBOX" geometry="360,31,113,35">"Languages"</Item> ! <Item ID="1793" type="LISTBOX" geometry="364,38,105,25">""</Item> </Dialog> <Dialog ID="143" Caption="Spawn Message"> --- 394,402 ---- <Item ID="1429" type="CONTROL" geometry="143,100,24,11">""</Item> <Item ID="1767" type="LTEXT" geometry="117,99,25,11">"Opacity"</Item> <Item ID="1487" type="GROUPBOX" geometry="359,66,114,48">"Commands"</Item> + <Item ID="1032" type="LISTBOX" geometry="364,74,105,27">""</Item> <Item ID="1006" type="PUSHBUTTON" geometry="427,100,41,11">"Settings"</Item> ! <Item ID="1792" type="GROUPBOX" geometry="360,22,113,41">"Languages"</Item> ! <Item ID="1793" type="LISTBOX" geometry="364,31,105,27">""</Item> </Dialog> <Dialog ID="143" Caption="Spawn Message"> Index: Drewsky.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/Drewsky.cpp,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -r1.28 -r1.29 *** Drewsky.cpp 12 Jun 2003 03:15:30 -0000 1.28 --- Drewsky.cpp 13 Jun 2003 14:52:41 -0000 1.29 *************** *** 424,433 **** m_pcppAxisLogTab = NULL; // Need to do this so the log doesn't try to send to a bogus window when it closes. - if ( m_pAxisCOM ) - { - delete m_pAxisCOM; - m_pAxisCOM = NULL; - } - if ( m_pScripts ) { --- 424,427 ---- *************** *** 443,446 **** --- 437,446 ---- delete m_pLog; + + if ( m_pAxisCOM ) + { + delete m_pAxisCOM; + m_pAxisCOM = NULL; + } CoUninitialize(); Index: resource.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/resource.h,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -r1.51 -r1.52 *** resource.h 3 Jun 2003 16:43:12 -0000 1.51 --- resource.h 13 Jun 2003 14:52:42 -0000 1.52 *************** *** 2366,2369 **** --- 2366,2370 ---- #define IDC_SAVEACCTPWD 1794 #define IDC_NOEDITORS 1795 + #define IDC_ANIMATE1 1796 #define IDM_RC_START_LOGGING 32779 #define IDM_RC_STOP_LOGGING 32780 *************** *** 2402,2406 **** #define _APS_NEXT_RESOURCE_VALUE 686 #define _APS_NEXT_COMMAND_VALUE 32811 ! #define _APS_NEXT_CONTROL_VALUE 1796 #define _APS_NEXT_SYMED_VALUE 101 #endif --- 2403,2407 ---- #define _APS_NEXT_RESOURCE_VALUE 686 #define _APS_NEXT_COMMAND_VALUE 32811 ! #define _APS_NEXT_CONTROL_VALUE 1797 #define _APS_NEXT_SYMED_VALUE 101 #endif Index: settingstab.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/settingstab.cpp,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -r1.29 -r1.30 *** settingstab.cpp 12 Jun 2003 03:15:33 -0000 1.29 --- settingstab.cpp 13 Jun 2003 14:52:42 -0000 1.30 *************** *** 50,54 **** CSettingsTab::CSettingsTab() : CPropertyPage(CSettingsTab::IDD) - , m_bAutoLoadProfile(FALSE) { //{{AFX_DATA_INIT(CSettingsTab) --- 50,53 ---- *************** *** 91,97 **** //{{AFX_DATA_MAP(CSettingsTab) DDX_Control(pDX, IDC_LAUNCH_STATIC_TOOL, m_cbStaticLaunch); - DDX_Control(pDX, IDC_RP_NEW, m_cbRPNew); DDX_Control(pDX, IDC_RP_EDIT, m_cbRPEdit); - DDX_Control(pDX, IDC_RP_DELETE, m_cbRPDelete); DDX_Control(pDX, IDC_REMOTEPROFILES, m_clcRmtProfiles); DDX_Control(pDX, IDC_ITEM_COLOR, m_csItemColor); --- 90,94 ---- *************** *** 102,106 **** DDX_Control(pDX, IDC_SCALEPICS, m_cbScalePics); DDX_Control(pDX, IDC_ALPHABLEND, m_csAlphaBlend); - DDX_Control(pDX, IDC_AUTOLOADPROFILE, m_cbAutoLoadProfile); DDX_Control(pDX, IDC_COMMANDS, m_clbCommandModules); DDX_Control(pDX, IDC_SPAWN_MESSAGE, m_cbSpawnMessage); --- 99,102 ---- *************** *** 114,120 **** DDX_Control(pDX, IDC_RELOAD_SCRIPTS, m_cbReloadScripts); DDX_Control(pDX, IDC_CLOSE_CLIENT, m_cbCloseClient); - DDX_Control(pDX, IDC_SCRIPTEDIT, m_cbGUIEditor); DDX_Control(pDX, IDC_RAWEDIT, m_cbTextEditor); - DDX_Control(pDX, IDC_ACCTEDIT, m_cbAccountMgr); DDX_Control(pDX, IDC_ADDITIONALSETTINGS, m_cbMoreSettings); DDX_Control(pDX, IDC_ABOUTHOG, m_cbAboutAxis); --- 110,114 ---- *************** *** 140,144 **** DDX_Check(pDX, IDC_TRANSLUCENT, m_bTranslucentWindows); DDX_Slider(pDX, IDC_ALPHABLEND, m_iAlphaBlend); - DDX_Check(pDX, IDC_AUTOLOADPROFILE, m_bAutoLoadProfile); DDX_Control(pDX, IDC_ST_GROUP_LANGUAGES, m_sLanguages); DDX_Control(pDX, IDC_LANGUAGES, m_lbLanguages); --- 134,137 ---- *************** *** 158,169 **** ON_BN_CLICKED(IDC_NPC_COLOR, OnNpcColor) ON_WM_PAINT() - ON_BN_CLICKED(IDC_RP_NEW, OnRpNew) ON_BN_CLICKED(IDC_RP_EDIT, OnRpEdit) - ON_BN_CLICKED(IDC_RP_DELETE, OnRpDelete) ON_LBN_SELCHANGE(IDC_REMOTEPROFILES, OnSelchangeRemoteprofiles) ON_WM_SHOWWINDOW() - ON_BN_CLICKED(IDC_SCRIPTEDIT, OnScriptedit) ON_BN_CLICKED(IDC_RAWEDIT, OnRawedit) - ON_BN_CLICKED(IDC_ACCTEDIT, OnAcctedit) ON_BN_CLICKED(IDC_DIALOG_COLOR, OnDialogColor) ON_BN_CLICKED(IDC_TEXT_COLOR, OnTextColor) --- 151,158 ---- *************** *** 184,188 **** ON_BN_CLICKED(IDC_TRANSLUCENT, OnBnClickedTranslucent) ON_WM_HSCROLL() - ON_BN_CLICKED(IDC_AUTOLOADPROFILE, OnBnClickedAutoloadprofile) ON_LBN_SELCHANGE(IDC_LANGUAGES, OnLbnSelchangeLanguages) END_MESSAGE_MAP() --- 173,176 ---- *************** *** 195,244 **** CPropertyPage::OnInitDialog(); ! this->m_clcRmtProfiles.AddString(_T("< NONE >")); ! this->m_clcRmtProfiles.AddString(_T("< DEFAULT >")); ! // Read the existing local profiles from the registry ! HKEY hKey; ! LONG lStatus; ! lStatus = RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Menasoft\\GM Tools\\Local Profiles"), 0, KEY_ALL_ACCESS, &hKey); ! int iIndex = 0; ! if ( lStatus == ERROR_SUCCESS ) { ! while (lStatus == ERROR_SUCCESS) ! { ! TCHAR szBuffer[MAX_PATH]; ! DWORD dwSize = sizeof(szBuffer); ! lStatus = RegEnumKeyEx(hKey, iIndex, &szBuffer[0], &dwSize, 0, NULL, NULL, NULL); ! if (lStatus == ERROR_SUCCESS) ! { ! CString csProfile; ! csProfile.Format(_T("Local: %s"), szBuffer); ! this->m_clcRmtProfiles.AddString(csProfile); ! } ! iIndex++; ! } ! RegCloseKey(hKey); ! } ! // Read the existing remote profiles from the registry ! iIndex = 0; ! lStatus = RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Menasoft\\GM Tools\\Remote Profiles"), 0, KEY_ALL_ACCESS, &hKey); ! if ( lStatus == ERROR_SUCCESS ) ! { ! while (lStatus == ERROR_SUCCESS) ! { ! TCHAR szBuffer[MAX_PATH]; ! DWORD dwSize = sizeof(szBuffer); ! lStatus = RegEnumKeyEx(hKey, iIndex, &szBuffer[0], &dwSize, 0, NULL, NULL, NULL); ! if (lStatus == ERROR_SUCCESS) ! { ! CString csProfile; ! csProfile.Format(_T("Remote: %s"), szBuffer); ! this->m_clcRmtProfiles.AddString(csProfile); ! } ! iIndex++; ! } ! RegCloseKey(hKey); } - RefreshSystemInfo(); --- 183,193 ---- CPropertyPage::OnInitDialog(); ! for (int i = 0; i < Main->m_config.ScriptModuleCount(); i++ ) { ! COMConfig *p = Main->m_config.GetScriptModule(i); ! int index = m_clcRmtProfiles.AddString(p->m_sDescription); ! m_clcRmtProfiles.SetItemData(i, index); } RefreshSystemInfo(); *************** *** 259,263 **** m_csAlphaBlend.SetRange(0, 255); m_csAlphaBlend.EnableWindow(m_bTranslucentWindows); - m_bAutoLoadProfile = Main->m_config.AutoLoadProfile(); UpdateData(false); m_pDlgStaticTool = NULL; --- 208,211 ---- *************** *** 443,493 **** } - void CSettingsTab::OnRpNew() - { - CRemoteProfileDlg dlg; - if ( dlg.DoModal() != IDOK ) - return; - CString csKey, csRmtPwd, csPwd; - csPwd = Encrypt(dlg.m_csPwd); - int iTimeout = _tstoi(dlg.m_csReceiveTimeout); - int iRemoteSpawns = dlg.m_bRemoteSpawns ? 1 : 0; - if ( iTimeout < 1000 ) - iTimeout = 1000; - switch ( dlg.m_iProfile ) - { - case 0: - { - csKey.Format(_T("SOFTWARE\\Menasoft\\GM Tools\\Local Profiles\\%s"), dlg.m_csName); - - Main->PutRegistryString(_T("Username"), dlg.m_csUsername, HKEY_LOCAL_MACHINE, csKey); - Main->PutRegistryString(_T("Password"), csPwd, HKEY_LOCAL_MACHINE, csKey); - Main->PutRegistryString(_T("HoGPort"), dlg.m_csHogPort, HKEY_LOCAL_MACHINE, csKey); - Main->PutRegistryString(_T("ServerIP"), dlg.m_csIP, HKEY_LOCAL_MACHINE, csKey); - Main->PutRegistryString(_T("Port"), dlg.m_csTusPort, HKEY_LOCAL_MACHINE, csKey); - Main->PutRegistryString(_T("Root Directory"), dlg.m_csBaseDir, HKEY_LOCAL_MACHINE, csKey); - Main->PutRegistryDword(_T("ReceiveTimeout"), (DWORD) iTimeout, HKEY_LOCAL_MACHINE, csKey); - Main->PutRegistryDword(_T("Read Remote Spawnpoints"), (DWORD) iRemoteSpawns, HKEY_LOCAL_MACHINE, csKey); - } - break; - case 1: - { - csKey.Format(_T("SOFTWARE\\Menasoft\\GM Tools\\Remote Profiles\\%s"), dlg.m_csName); - - Main->PutRegistryString(_T("Username"), dlg.m_csUsername, HKEY_LOCAL_MACHINE, csKey); - Main->PutRegistryString(_T("Password"), csPwd, HKEY_LOCAL_MACHINE, csKey); - Main->PutRegistryString(_T("ServerIP"), dlg.m_csIP, HKEY_LOCAL_MACHINE, csKey); - Main->PutRegistryString(_T("HoGPort"), dlg.m_csHogPort, HKEY_LOCAL_MACHINE, csKey); - Main->PutRegistryString(_T("TUSPort"), dlg.m_csTusPort, HKEY_LOCAL_MACHINE, csKey); - Main->PutRegistryDword(_T("ReceiveTimeout"), (DWORD) iTimeout, HKEY_LOCAL_MACHINE, csKey); - } - break; - - } - CString csProfile; - csProfile.Format(_T("%s: %s"), dlg.m_iProfile == 0 ? _T("Local") : _T("Remote"), dlg.m_csName); - this->m_clcRmtProfiles.AddString(csProfile); - this->m_clcRmtProfiles.SelectString(-1, csProfile); - } - void CSettingsTab::OnRpEdit() { --- 391,394 ---- *************** *** 495,665 **** if ( iSel == -1 ) return; ! 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(_T("%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(_T("%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 = _tstoi(dlg.m_csReceiveTimeout); ! if ( iTimeout < 1000 ) ! iTimeout = 1000; ! ! CString csKey, csRmtPwd, csPwd; ! csPwd = Encrypt(dlg.m_csPwd); ! ! switch ( dlg.m_iProfile ) ! { ! case 0: ! { ! csKey.Format(_T("SOFTWARE\\Menasoft\\GM Tools\\Local Profiles\\%s"), dlg.m_csName); ! ! Main->PutRegistryString(_T("Username"), dlg.m_csUsername, HKEY_LOCAL_MACHINE, csKey); ! Main->PutRegistryString(_T("Password"), csPwd, HKEY_LOCAL_MACHINE, csKey); ! Main->PutRegistryString(_T("HoGPort"), dlg.m_csHogPort, HKEY_LOCAL_MACHINE, csKey); ! Main->PutRegistryString(_T("ServerIP"), dlg.m_csIP, HKEY_LOCAL_MACHINE, csKey); ! Main->PutRegistryString(_T("Port"), dlg.m_csTusPort, HKEY_LOCAL_MACHINE, csKey); ! Main->PutRegistryString(_T("Root Directory"), dlg.m_csBaseDir, HKEY_LOCAL_MACHINE, csKey); ! Main->PutRegistryDword(_T("ReceiveTimeout"), (DWORD) iTimeout, HKEY_LOCAL_MACHINE, csKey); ! Main->PutRegistryDword(_T("Read Remote Spawns"), (DWORD) iRemoteSpawns, HKEY_LOCAL_MACHINE, csKey); ! } ! break; ! case 1: ! { ! csKey.Format(_T("SOFTWARE\\Menasoft\\GM Tools\\Remote Profiles\\%s"), dlg.m_csName); ! ! Main->PutRegistryString(_T("Username"), dlg.m_csUsername, HKEY_LOCAL_MACHINE, csKey); ! Main->PutRegistryString(_T("Password"), csPwd, HKEY_LOCAL_MACHINE, csKey); ! Main->PutRegistryString(_T("ServerIP"), dlg.m_csIP, HKEY_LOCAL_MACHINE, csKey); ! Main->PutRegistryString(_T("HoGPort"), dlg.m_csHogPort, HKEY_LOCAL_MACHINE, csKey); ! Main->PutRegistryString(_T("TUSPort"), dlg.m_csTusPort, HKEY_LOCAL_MACHINE, csKey); ! Main->PutRegistryDword(_T("ReceiveTimeout"), (DWORD) iTimeout, HKEY_LOCAL_MACHINE, csKey); ! } ! break; ! } ! ! this->OnSelchangeRemoteprofiles(); ! } ! ! void CSettingsTab::OnRpDelete() ! { ! int iSel = this->m_clcRmtProfiles.GetCurSel(); ! if ( iSel == -1 ) ! return; ! CString csKey; ! CString csType; ! switch (Main->GetProfileType() ) ! { ! case PROFILE_NONE: ! case PROFILE_DEFAULT: ! AxisMessageBox(locale->String(IDS_SETTINGS_CANTDELETEPROFILE), MB_OK); ! return; ! case PROFILE_LOCAL: ! csType.Format(_T("Local Profiles")); ! break; ! case PROFILE_REMOTE: ! csType.Format(_T("Remote Profiles")); ! break; ! } ! csKey.Format(_T("SOFTWARE\\Menasoft\\GM Tools\\%s\\%s"), csType, Main->GetProfileString()); ! Main->DeleteRegistryKey(csKey); ! this->m_clcRmtProfiles.DeleteString( iSel ); ! Main->m_csUserID = _T(""); ! Main->m_csPassword = _T(""); ! Main->m_csSpherePort = _T(""); ! Main->m_csAxissvrPort = _T(""); ! Main->m_csServerIP = _T(""); ! Main->GetProfileString() = _T(""); ! Main->m_iReceiveTimeout = 60000; ! Main->m_dwRemoteSpawns = 0; ! } void CSettingsTab::OnSelchangeRemoteprofiles() { ! int iSel = this->m_clcRmtProfiles.GetCurSel(); ! // Clear out all of the values ! Main->m_csUserID = _T(""); ! Main->m_csPassword = _T(""); ! Main->m_csSpherePort = _T(""); ! Main->m_csAxissvrPort = _T(""); ! Main->m_csServerIP = _T(""); ! Main->GetProfileString() = _T(""); ! Main->m_iReceiveTimeout = 60000; ! Main->m_csRootDirectory = _T(""); ! Main->m_dwRemoteSpawns = 0; ! ! if ( iSel == -1 ) ! return; ! ! this->m_clcRmtProfiles.GetText( iSel, Main->m_config.LastProfile() ); ! switch ( Main->GetProfileType() ) ! { ! case PROFILE_NONE: ! case PROFILE_DEFAULT: ! this->m_cbRPDelete.EnableWindow(FALSE); ! this->m_cbRPEdit.EnableWindow(FALSE); ! break; ! case PROFILE_REMOTE: ! { ! CString csKey; ! csKey.Format(_T("SOFTWARE\\Menasoft\\GM Tools\\Remote Profiles\\%s"), Main->GetProfileString()); ! Main->m_csUserID = Main->GetRegistryString(_T("Username"), _T(""), HKEY_LOCAL_MACHINE, csKey); ! Main->m_csPassword = Main->GetRegistryString(_T("Password"), _T(""), HKEY_LOCAL_MACHINE, csKey); ! Main->m_csServerIP = Main->GetRegistryString(_T("ServerIP"), _T(""), HKEY_LOCAL_MACHINE, csKey); ! Main->m_csAxissvrPort = Main->GetRegistryString(_T("HogPort"), "4006", HKEY_LOCAL_MACHINE, csKey); ! Main->m_csSpherePort = Main->GetRegistryString(_T("TusPort"), "2593", HKEY_LOCAL_MACHINE, csKey); ! ! Main->m_iReceiveTimeout = (int) Main->GetRegistryDword(_T("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); ! break; ! case PROFILE_LOCAL: ! { ! CString csKey; ! csKey.Format(_T("SOFTWARE\\Menasoft\\GM Tools\\Local Profiles\\%s"), Main->GetProfileString()); ! Main->m_csUserID = Main->GetRegistryString(_T("Username"), _T(""), HKEY_LOCAL_MACHINE, csKey); ! Main->m_csPassword = Main->GetRegistryString(_T("Password"), _T(""), HKEY_LOCAL_MACHINE, csKey); ! Main->m_csServerIP = Main->GetRegistryString(_T("ServerIP"), _T(""), HKEY_LOCAL_MACHINE, csKey); ! Main->m_csAxissvrPort = Main->GetRegistryString(_T("HogPort"), _T("4006"), HKEY_LOCAL_MACHINE, csKey); ! Main->m_csSpherePort = Main->GetRegistryString(_T("Port"), _T("2593"), HKEY_LOCAL_MACHINE, csKey); ! Main->m_csRootDirectory = Main->GetRegistryString(_T("Root Directory"), _T(""), HKEY_LOCAL_MACHINE, csKey); ! Main->m_dwRemoteSpawns = Main->GetRegistryDword(_T("Read Remote Spawns"), 0, HKEY_LOCAL_MACHINE, csKey); ! ! Main->m_iReceiveTimeout = (int) Main->GetRegistryDword(_T("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); ! break; ! } ! //Main->PutRegistryString(_T("Script Profile"), Main->m_csProfile); } --- 396,409 ---- if ( iSel == -1 ) return; ! int i = m_clcRmtProfiles.GetItemData(iSel); ! COMConfig * p = Main->m_config.GetScriptModule(i); ! CScriptsWrapper * pScripts = new CScriptsWrapper(p->m_sClsID); ! pScripts->InvokeProfileEditor(-1); ! delete pScripts; } void CSettingsTab::OnSelchangeRemoteprofiles() { ! // Nothing to do, really } *************** *** 689,696 **** } - void CSettingsTab::OnScriptedit() - { - } - void CSettingsTab::OnRawedit() { --- 433,436 ---- *************** *** 715,722 **** } - void CSettingsTab::OnAcctedit() - { - } - void CSettingsTab::OnDialogColor() { --- 455,458 ---- *************** *** 852,861 **** } - void CSettingsTab::OnBnClickedAutoloadprofile() - { - UpdateData(); - Main->m_config.AutoLoadProfile(m_bAutoLoadProfile ? true : false); - } - void CSettingsTab::OnSelchangeCommandModules() { --- 588,591 ---- *************** *** 881,887 **** locale->LocalizeWindow(IDD, 0, NULL, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_LAUNCH_STATIC_TOOL, (CWnd*)&m_cbStaticLaunch, (CWnd*)this); - locale->LocalizeWindow(IDD, IDC_RP_NEW, (CWnd*)&m_cbRPNew, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_RP_EDIT, (CWnd*)&m_cbRPEdit, (CWnd*)this); - locale->LocalizeWindow(IDD, IDC_RP_DELETE, (CWnd*)&m_cbRPDelete, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_REMOTEPROFILES, (CWnd*)&m_clcRmtProfiles, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_ITEM_COLOR, (CWnd*)&m_csItemColor, (CWnd*)this); --- 611,615 ---- *************** *** 892,896 **** locale->LocalizeWindow(IDD, IDC_SCALEPICS, (CWnd*)&m_cbScalePics, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_ALPHABLEND, (CWnd*)&m_csAlphaBlend, (CWnd*)this); - locale->LocalizeWindow(IDD, IDC_AUTOLOADPROFILE, (CWnd*)&m_cbAutoLoadProfile, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_COMMANDS, (CWnd*)&m_clbCommandModules, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_SPAWN_MESSAGE, (CWnd*)&m_cbSpawnMessage, (CWnd*)this); --- 620,623 ---- *************** *** 904,910 **** locale->LocalizeWindow(IDD, IDC_RELOAD_SCRIPTS, (CWnd*)&m_cbReloadScripts, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_CLOSE_CLIENT, (CWnd*)&m_cbCloseClient, (CWnd*)this); - locale->LocalizeWindow(IDD, IDC_SCRIPTEDIT, (CWnd*)&m_cbGUIEditor, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_RAWEDIT, (CWnd*)&m_cbTextEditor, (CWnd*)this); - locale->LocalizeWindow(IDD, IDC_ACCTEDIT, (CWnd*)&m_cbAccountMgr, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_ADDITIONALSETTINGS, (CWnd*)&m_cbMoreSettings, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_ABOUTHOG, (CWnd*)&m_cbAboutAxis, (CWnd*)this); --- 631,635 ---- Index: settingstab.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/settingstab.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -r1.16 -r1.17 *** settingstab.h 12 Jun 2003 03:15:33 -0000 1.16 --- settingstab.h 13 Jun 2003 14:52:42 -0000 1.17 *************** *** 60,66 **** CStatic m_csTextColor; CStatic m_csDialogColor; - CButton m_cbRPNew; CButton m_cbRPEdit; - CButton m_cbRPDelete; CListBox m_clcRmtProfiles; CStatic m_csItemColor; --- 60,64 ---- *************** *** 85,89 **** CListBox m_clbCommandModules; CSliderCtrl m_csAlphaBlend; - CButton m_cbAutoLoadProfile; CButton m_cbSpawnMessage; CButton m_cbStartLauncher; --- 83,86 ---- *************** *** 96,102 **** CButton m_cbReloadScripts; CButton m_cbCloseClient; - CButton m_cbGUIEditor; CButton m_cbTextEditor; - CButton m_cbAccountMgr; CButton m_cbMoreSettings; CButton m_cbAboutAxis; --- 93,97 ---- |
From: Philip E. <pes...@us...> - 2003-06-13 14:52:47
|
Update of /cvsroot/sphere-axis/Axis/S_Sphere52 In directory sc8-pr-cvs1:/tmp/cvs-serv13341/S_Sphere52 Modified Files: ProfileEdit.cpp ProfileEdit.h S_Sphere52.rc ScriptsMain.cpp XMLConfig.cpp Log Message: no message Index: ProfileEdit.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/ProfileEdit.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** ProfileEdit.cpp 12 Jun 2003 23:27:01 -0000 1.1 --- ProfileEdit.cpp 13 Jun 2003 14:52:42 -0000 1.2 *************** *** 7,10 **** --- 7,11 ---- #include "ProfileEdit.h" #include <windowsx.h> + #include <direct.h> *************** *** 55,67 **** DDX_Control(pDX, IDCANCEL, m_bCancel); DDX_Control(pDX, IDC_PE_STATIC1, m_sStatic1); ! DDX_Control(pDX, IDC_PE_STATIC1, m_sStatic2); ! DDX_Control(pDX, IDC_PE_STATIC1, m_sStatic3); ! DDX_Control(pDX, IDC_PE_STATIC1, m_sStatic4); ! DDX_Control(pDX, IDC_PE_STATIC1, m_sStatic5); ! DDX_Control(pDX, IDC_PE_STATIC1, m_sStatic6); ! DDX_Control(pDX, IDC_PE_STATIC1, m_sStatic7); ! DDX_Control(pDX, IDC_PE_STATIC1, m_sStatic8); ! DDX_Control(pDX, IDC_PE_STATIC1, m_sStatic9); ! DDX_Control(pDX, IDC_PE_STATIC1, m_sStatic10); DDX_Text(pDX, IDC_PROFILE_NAME, m_sName); DDX_Text(pDX, IDC_PROFILE_SPHEREIP, m_sSphereIP); --- 56,68 ---- DDX_Control(pDX, IDCANCEL, m_bCancel); DDX_Control(pDX, IDC_PE_STATIC1, m_sStatic1); ! DDX_Control(pDX, IDC_PE_STATIC2, m_sStatic2); ! DDX_Control(pDX, IDC_PE_STATIC3, m_sStatic3); ! DDX_Control(pDX, IDC_PE_STATIC4, m_sStatic4); ! DDX_Control(pDX, IDC_PE_STATIC5, m_sStatic5); ! DDX_Control(pDX, IDC_PE_STATIC6, m_sStatic6); ! DDX_Control(pDX, IDC_PE_STATIC7, m_sStatic7); ! DDX_Control(pDX, IDC_PE_STATIC8, m_sStatic8); ! DDX_Control(pDX, IDC_PE_STATIC9, m_sStatic9); ! DDX_Control(pDX, IDC_PE_STATIC10, m_sStatic10); DDX_Text(pDX, IDC_PROFILE_NAME, m_sName); DDX_Text(pDX, IDC_PROFILE_SPHEREIP, m_sSphereIP); *************** *** 114,118 **** --- 115,122 ---- return; if ( AfxMessageBox(_T("Are you sure you want to delete this profile?"), MB_YESNO | MB_ICONQUESTION) == IDYES ) + { Main->m_config.DeleteProfile(m_pCurrentProfile); + m_pCurrentProfile = NULL; + } PopulateProfiles(); } *************** *** 167,171 **** void CProfileEdit::OnCancel() { ! Main->m_config.LoadConfig(); CDialog::OnCancel(); } --- 171,175 ---- void CProfileEdit::OnCancel() { ! // What do we do here? CDialog::OnCancel(); } *************** *** 228,231 **** --- 232,241 ---- m_sSpherePort.Format(_T("%ld"), m_pCurrentProfile->ServerPort()); m_sBasePath = m_pCurrentProfile->BaseDirectory(); + if ( m_sBasePath == _T("") ) + { + TCHAR szCWD[MAX_PATH]; + _tgetcwd(szCWD, MAX_PATH - 1); + m_sBasePath = szCWD; + } m_bRemoteSpawns.SetCheck(m_pCurrentProfile->RemoteSpawns() ? 1 : 0); m_sRemoteUser = m_pCurrentProfile->RemoteAccount(); *************** *** 233,237 **** m_sRemotePort.Format(_T("%ld"), m_pCurrentProfile->RemotePort()); m_sRemoteTimeout.Format(_T("%ld"), m_pCurrentProfile->RemoteTimeout()); ! PopulateScripts(); } else --- 243,247 ---- m_sRemotePort.Format(_T("%ld"), m_pCurrentProfile->RemotePort()); m_sRemoteTimeout.Format(_T("%ld"), m_pCurrentProfile->RemoteTimeout()); ! m_saSelections.Copy(m_pCurrentProfile->Files()); } else *************** *** 249,258 **** --- 259,282 ---- m_sRemoteTimeout = _T("60000"); m_tcScripts.DeleteAllItems(); + m_saSelections.RemoveAll(); } UpdateData(FALSE); + PopulateScripts(); } void CProfileEdit::PopulateScripts() { + m_tcScripts.DeleteAllItems(); + UpdateData(); + if ( m_iProfileType == 0 ) + { + HTREEITEM hRoot = m_tcScripts.InsertItem(m_sBasePath, m_iFolderIndex, m_iFolderIndex); + ParseDirectory(m_sBasePath, hRoot, m_saSelections); + } + else + { + HTREEITEM hRoot = m_tcScripts.InsertItem(_T(""), m_iFolderIndex, m_iFolderIndex); + ParseRemoteDirectory(_T("."), hRoot, m_saSelections); + } } *************** *** 320,331 **** m_pCurrentProfile->RemoteTimeout(_ttoi(m_sRemoteTimeout)); m_pCurrentProfile->ProfileType(m_iProfileType == 0 ? PROFILE_LOCAL : PROFILE_REMOTE); ! CStringArray sa; ! GetSelectedScripts(sa); ! m_pCurrentProfile->Files(sa); } void CProfileEdit::GetSelectedScripts(CStringArray &sa) { ! } --- 344,356 ---- m_pCurrentProfile->RemoteTimeout(_ttoi(m_sRemoteTimeout)); m_pCurrentProfile->ProfileType(m_iProfileType == 0 ? PROFILE_LOCAL : PROFILE_REMOTE); ! GetSelectedScripts(m_saSelections); ! m_pCurrentProfile->Files(m_saSelections); } void CProfileEdit::GetSelectedScripts(CStringArray &sa) { ! UpdateData(); ! HTREEITEM hRoot = m_tcScripts.GetRootItem(); ! GetSelections(hRoot, m_sBasePath, sa); } Index: ProfileEdit.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/ProfileEdit.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** ProfileEdit.h 12 Jun 2003 23:27:01 -0000 1.1 --- ProfileEdit.h 13 Jun 2003 14:52:42 -0000 1.2 *************** *** 22,26 **** virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - DECLARE_MESSAGE_MAP() public: --- 22,25 ---- *************** *** 74,77 **** --- 73,77 ---- afx_msg LRESULT OnTvCheckbox(WPARAM wp, LPARAM lp); afx_msg void OnNMClickProfileFiles(NMHDR *pNMHDR, LRESULT *pResult); + DECLARE_MESSAGE_MAP() void PopulateProfiles(); *************** *** 105,108 **** --- 105,109 ---- HICON m_hDocIcon; HICON m_hFolderIcon; + CStringArray m_saSelections; public: Index: S_Sphere52.rc =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/S_Sphere52.rc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** S_Sphere52.rc 12 Jun 2003 23:27:01 -0000 1.3 --- S_Sphere52.rc 13 Jun 2003 14:52:42 -0000 1.4 *************** *** 145,150 **** CONTROL "",IDC_PROFILE_FILES,"SysTreeView32",TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | TVS_CHECKBOXES | ! TVS_NOSCROLL | WS_DISABLED | WS_BORDER | WS_TABSTOP,141, ! 122,147,144 PUSHBUTTON "Refresh List",IDC_PROFILE_SCRIPT_REFRESH,226,107,61,13, WS_DISABLED --- 145,150 ---- CONTROL "",IDC_PROFILE_FILES,"SysTreeView32",TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | TVS_CHECKBOXES | ! TVS_TRACKSELECT | TVS_NOSCROLL | WS_DISABLED | WS_BORDER | ! WS_TABSTOP,141,122,147,144 PUSHBUTTON "Refresh List",IDC_PROFILE_SCRIPT_REFRESH,226,107,61,13, WS_DISABLED Index: ScriptsMain.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/ScriptsMain.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** ScriptsMain.cpp 11 Jun 2003 22:18:11 -0000 1.13 --- ScriptsMain.cpp 13 Jun 2003 14:52:42 -0000 1.14 *************** *** 77,81 **** void CScriptsMain::Unload() { ! LOG(locale->String(IDS_SCRIPTS_UNLOADING), locale->String(IDS_SCRIPTS_TSCRIPTS)); m_aDefs.RemoveAll(); UnloadItems(); --- 77,82 ---- void CScriptsMain::Unload() { ! if ( locale ) ! LOG(locale->String(IDS_SCRIPTS_UNLOADING), locale->String(IDS_SCRIPTS_TSCRIPTS)); m_aDefs.RemoveAll(); UnloadItems(); Index: XMLConfig.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/XMLConfig.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** XMLConfig.cpp 12 Jun 2003 23:27:01 -0000 1.3 --- XMLConfig.cpp 13 Jun 2003 14:52:42 -0000 1.4 *************** *** 484,488 **** void CXMLConfig::AddProfile(CScriptProfile * pNewProfile) { ! m_pProfiles.Add(pNewProfile); } --- 484,488 ---- void CXMLConfig::AddProfile(CScriptProfile * pNewProfile) { ! m_pProfiles.Add((void*)pNewProfile); } *************** *** 495,499 **** { m_pProfiles.RemoveAt(i); ! delete pProfile; return; } --- 495,499 ---- { m_pProfiles.RemoveAt(i); ! delete p; return; } *************** *** 509,511 **** --- 509,512 ---- delete pProfile; } + m_pProfiles.RemoveAll(); } |
From: Philip E. <pes...@us...> - 2003-06-12 23:27:04
|
Update of /cvsroot/sphere-axis/Axis/S_Sphere52 In directory sc8-pr-cvs1:/tmp/cvs-serv4716 Modified Files: Resource.h S_Sphere52.rc S_Sphere52.vcproj ScriptProfile.h Scripts.cpp Scripts.h XMLConfig.cpp XMLConfig.h Added Files: ProfileEdit.cpp ProfileEdit.h Log Message: Adding a profile editor. --- NEW FILE: ProfileEdit.cpp --- // ProfileEdit.cpp : implementation file // #include "stdafx.h" #include "S_Sphere52.h" #include "Scripts.h" #include "ProfileEdit.h" #include <windowsx.h> // CProfileEdit dialog IMPLEMENT_DYNAMIC(CProfileEdit, CDialog) CProfileEdit::CProfileEdit(CWnd* pParent /*=NULL*/) : CDialog(CProfileEdit::IDD, pParent) , m_iProfileType(0) { m_hFolderIcon = LoadIcon(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDI_FOLDER)); m_hDocIcon = LoadIcon(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDI_DOC)); m_ilIcons.Create(16, 16, ILC_MASK, 0, 1); m_iFolderIndex = m_ilIcons.Add(m_hFolderIcon); m_iDocIndex = m_ilIcons.Add(m_hDocIcon); m_pCurrentProfile = NULL; } CProfileEdit::~CProfileEdit() { } void CProfileEdit::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); DDX_Control(pDX, IDC_PROFILE_LIST, m_lbProfiles); DDX_Control(pDX, IDC_PROFILE_NEW, m_bNew); DDX_Control(pDX, IDC_PROFILE_EDIT, m_bEdit); DDX_Control(pDX, IDC_PROFILE_DELETE, m_bDelete); DDX_Control(pDX, IDC_PROFILE_SCRIPT_REFRESH, m_bRefresh); DDX_Control(pDX, IDC_PROFILE_LOCAL, m_bLocal); DDX_Control(pDX, IDC_PROFILE_REMOTE, m_bRemote); DDX_Control(pDX, IDC_PROFILE_SAVE, m_bSave); DDX_Control(pDX, IDC_PROFILE_DISCARD, m_bDiscard); DDX_Control(pDX, IDC_PROFILE_NAME, m_eName); DDX_Control(pDX, IDC_PROFILE_SPHEREIP, m_eSphereIP); DDX_Control(pDX, IDC_PROFILE_SPHEREPORT, m_eSpherePort); DDX_Control(pDX, IDC_PROFILE_BASEPATH, m_eBasePath); DDX_Control(pDX, IDC_PROFILE_REMOTESPAWNS, m_bRemoteSpawns); DDX_Control(pDX, IDC_PROFILE_REMOTEUSER, m_eRemoteUser); DDX_Control(pDX, IDC_PROFILE_REMOTEPWD, m_eRemotePassword); DDX_Control(pDX, IDC_PROFILE_REMOTEPORT, m_eRemotePort); DDX_Control(pDX, IDC_PROFILE_REMOTETIMEOUT, m_eRemoteTimeout); DDX_Control(pDX, IDC_PROFILE_FILES, m_tcScripts); DDX_Control(pDX, IDOK, m_bOK); DDX_Control(pDX, IDCANCEL, m_bCancel); DDX_Control(pDX, IDC_PE_STATIC1, m_sStatic1); DDX_Control(pDX, IDC_PE_STATIC1, m_sStatic2); DDX_Control(pDX, IDC_PE_STATIC1, m_sStatic3); DDX_Control(pDX, IDC_PE_STATIC1, m_sStatic4); DDX_Control(pDX, IDC_PE_STATIC1, m_sStatic5); DDX_Control(pDX, IDC_PE_STATIC1, m_sStatic6); DDX_Control(pDX, IDC_PE_STATIC1, m_sStatic7); DDX_Control(pDX, IDC_PE_STATIC1, m_sStatic8); DDX_Control(pDX, IDC_PE_STATIC1, m_sStatic9); DDX_Control(pDX, IDC_PE_STATIC1, m_sStatic10); DDX_Text(pDX, IDC_PROFILE_NAME, m_sName); DDX_Text(pDX, IDC_PROFILE_SPHEREIP, m_sSphereIP); DDX_Text(pDX, IDC_PROFILE_SPHEREPORT, m_sSpherePort); DDX_Text(pDX, IDC_PROFILE_BASEPATH, m_sBasePath); DDX_Text(pDX, IDC_PROFILE_REMOTEUSER, m_sRemoteUser); DDX_Text(pDX, IDC_PROFILE_REMOTEPWD, m_sRemotePassword); DDX_Text(pDX, IDC_PROFILE_REMOTEPORT, m_sRemotePort); DDX_Text(pDX, IDC_PROFILE_REMOTETIMEOUT, m_sRemoteTimeout); DDX_Check(pDX, IDC_PROFILE_LOCAL, m_iProfileType); } BEGIN_MESSAGE_MAP(CProfileEdit, CDialog) ON_BN_CLICKED(IDC_PROFILE_NEW, OnBnClickedProfileNew) ON_BN_CLICKED(IDC_PROFILE_EDIT, OnBnClickedProfileEdit) ON_BN_CLICKED(IDC_PROFILE_DELETE, OnBnClickedProfileDelete) ON_BN_CLICKED(IDC_PROFILE_SCRIPT_REFRESH, OnBnClickedProfileScriptRefresh) ON_BN_CLICKED(IDC_PROFILE_REMOTESPAWNS, OnBnClickedProfileRemotespawns) ON_BN_CLICKED(IDC_PROFILE_LOCAL, OnBnClickedProfileLocal) ON_BN_CLICKED(IDC_PROFILE_REMOTE, OnBnClickedProfileRemote) ON_LBN_SELCHANGE(IDC_PROFILE_LIST, OnLbnSelchangeProfileList) ON_BN_CLICKED(IDOK, OnBnClickedOk) ON_BN_CLICKED(IDCANCEL, OnBnClickedCancel) ON_BN_CLICKED(IDC_PROFILE_SAVE, OnBnClickedProfileSave) ON_BN_CLICKED(IDC_PROFILE_DISCARD, OnBnClickedProfileDiscard) ON_MESSAGE(WM_APP, OnTvCheckbox) ON_NOTIFY(NM_CLICK, IDC_PROFILE_FILES, OnNMClickProfileFiles) END_MESSAGE_MAP() // CProfileEdit message handlers void CProfileEdit::OnBnClickedProfileNew() { m_pCurrentProfile = NULL; EnableEditWindows(TRUE); } void CProfileEdit::OnBnClickedProfileEdit() { if ( m_lbProfiles.GetCurSel() == -1 || m_pCurrentProfile == NULL ) return; EnableEditWindows(TRUE); } void CProfileEdit::OnBnClickedProfileDelete() { if ( m_lbProfiles.GetCurSel() == -1 || m_pCurrentProfile == NULL ) return; if ( AfxMessageBox(_T("Are you sure you want to delete this profile?"), MB_YESNO | MB_ICONQUESTION) == IDYES ) Main->m_config.DeleteProfile(m_pCurrentProfile); PopulateProfiles(); } void CProfileEdit::OnBnClickedProfileScriptRefresh() { PopulateScripts(); } void CProfileEdit::OnBnClickedProfileRemotespawns() { if ( m_iProfileType == 0 ) OnBnClickedProfileLocal(); else OnBnClickedProfileRemote(); } void CProfileEdit::OnBnClickedProfileLocal() { BOOL b = m_bRemoteSpawns.GetCheck() ? TRUE : FALSE; m_eRemoteUser.EnableWindow(b); m_eRemotePassword.EnableWindow(b); m_eRemotePort.EnableWindow(b); m_eRemoteTimeout.EnableWindow(b); } void CProfileEdit::OnBnClickedProfileRemote() { m_eRemoteUser.EnableWindow(TRUE); m_eRemotePassword.EnableWindow(TRUE); m_eRemotePort.EnableWindow(TRUE); m_eRemoteTimeout.EnableWindow(TRUE); } BOOL CProfileEdit::OnInitDialog() { CDialog::OnInitDialog(); PopulateProfiles(); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void CProfileEdit::OnOK() { Main->m_config.SaveConfig(); CDialog::OnOK(); } void CProfileEdit::OnCancel() { Main->m_config.LoadConfig(); CDialog::OnCancel(); } void CProfileEdit::OnLbnSelchangeProfileList() { int iSel = m_lbProfiles.GetCurSel(); if ( iSel == -1 ) m_pCurrentProfile = NULL; else m_pCurrentProfile = (CScriptProfile*) m_lbProfiles.GetItemDataPtr(iSel); PopulateValues(); } void CProfileEdit::OnBnClickedOk() { OnOK(); } void CProfileEdit::OnBnClickedCancel() { OnCancel(); } void CProfileEdit::OnBnClickedProfileSave() { UpdateValues(); EnableEditWindows(FALSE); PopulateProfiles(); } void CProfileEdit::OnBnClickedProfileDiscard() { PopulateValues(); EnableEditWindows(FALSE); } void CProfileEdit::PopulateProfiles() { for ( int i = 0; i < Main->m_config.ProfileCount(); i++ ) { CScriptProfile * pProfile = Main->m_config.GetProfile(i); CString s; s.Format(_T("%s: %s"), pProfile->ProfileType() == PROFILE_LOCAL ? _T("Local") : _T("Remote"), pProfile->ProfileName()); int index = m_lbProfiles.AddString(s); m_lbProfiles.SetItemDataPtr(index, (void*) pProfile); } } void CProfileEdit::PopulateValues() { if ( m_pCurrentProfile ) { if ( m_pCurrentProfile->ProfileType() == PROFILE_LOCAL ) m_iProfileType = 0; else m_iProfileType = 1; m_sName = m_pCurrentProfile->ProfileName(); m_sSphereIP = m_pCurrentProfile->ServerHost(); m_sSpherePort.Format(_T("%ld"), m_pCurrentProfile->ServerPort()); m_sBasePath = m_pCurrentProfile->BaseDirectory(); m_bRemoteSpawns.SetCheck(m_pCurrentProfile->RemoteSpawns() ? 1 : 0); m_sRemoteUser = m_pCurrentProfile->RemoteAccount(); m_sRemotePassword = m_pCurrentProfile->RemotePassword(); m_sRemotePort.Format(_T("%ld"), m_pCurrentProfile->RemotePort()); m_sRemoteTimeout.Format(_T("%ld"), m_pCurrentProfile->RemoteTimeout()); PopulateScripts(); } else { // Clear out all of the values m_iProfileType = 0; m_sName = _T(""); m_sSphereIP = _T(""); m_sSpherePort = _T("2593"); m_sBasePath = _T(""); m_bRemoteSpawns.SetCheck(0); m_sRemoteUser = _T(""); m_sRemotePassword = _T(""); m_sRemotePort = _T("4006"); m_sRemoteTimeout = _T("60000"); m_tcScripts.DeleteAllItems(); } UpdateData(FALSE); } void CProfileEdit::PopulateScripts() { } void CProfileEdit::EnableEditWindows(BOOL bEnable) { // First, the main controls m_lbProfiles.EnableWindow(!bEnable); m_bOK.EnableWindow(!bEnable); m_bCancel.EnableWindow(!bEnable); m_bNew.EnableWindow(!bEnable); m_bEdit.EnableWindow(!bEnable); m_bDelete.EnableWindow(!bEnable); // Next, the edit controls m_bLocal.EnableWindow(bEnable); m_bRemote.EnableWindow(bEnable); m_eName.EnableWindow(bEnable); m_eSphereIP.EnableWindow(bEnable); m_eSpherePort.EnableWindow(bEnable); m_eBasePath.EnableWindow(bEnable); m_bRefresh.EnableWindow(bEnable); m_tcScripts.EnableWindow(bEnable); m_bRemoteSpawns.EnableWindow(bEnable); m_eRemoteUser.EnableWindow(bEnable); m_eRemotePassword.EnableWindow(bEnable); m_eRemotePort.EnableWindow(bEnable); m_eRemoteTimeout.EnableWindow(bEnable); m_bSave.EnableWindow(bEnable); m_bDiscard.EnableWindow(bEnable); if ( bEnable ) { // Some of these are really dependent on the profile if ( m_pCurrentProfile == NULL ) { m_eName.EnableWindow(TRUE); OnBnClickedProfileLocal(); } else { m_eName.EnableWindow(FALSE); if ( m_pCurrentProfile->ProfileType() ) OnBnClickedProfileLocal(); else OnBnClickedProfileRemote(); } } } void CProfileEdit::UpdateValues() { if ( m_pCurrentProfile == NULL ) { m_pCurrentProfile = new CScriptProfile; Main->m_config.AddProfile(m_pCurrentProfile); } UpdateData(); m_pCurrentProfile->ProfileName(m_sName); m_pCurrentProfile->ServerHost(m_sSphereIP); m_pCurrentProfile->ServerPort(_ttoi(m_sSpherePort)); m_pCurrentProfile->BaseDirectory(m_sBasePath); m_pCurrentProfile->RemoteAccount(m_sRemoteUser); m_pCurrentProfile->RemotePassword(m_sRemotePassword); m_pCurrentProfile->RemotePort(_ttoi(m_sRemotePort)); m_pCurrentProfile->RemoteTimeout(_ttoi(m_sRemoteTimeout)); m_pCurrentProfile->ProfileType(m_iProfileType == 0 ? PROFILE_LOCAL : PROFILE_REMOTE); CStringArray sa; GetSelectedScripts(sa); m_pCurrentProfile->Files(sa); } void CProfileEdit::GetSelectedScripts(CStringArray &sa) { } void CProfileEdit::ParseDirectory(LPCTSTR pszPath, HTREEITEM hNode, CStringArray &selections) { WIN32_FIND_DATA findData; memset(&findData, 0x00, sizeof(findData)); CString csTestFile; csTestFile.Format(_T("%s\\*"), pszPath); HANDLE hSearch = FindFirstFile(csTestFile, &findData); if ( hSearch != INVALID_HANDLE_VALUE ) { BOOL bStatus = TRUE; while (bStatus) { if ( findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY ) { // Recurse this if ( _tcscmp(findData.cFileName, _T("..")) == 0 || _tcscmp(findData.cFileName, _T(".")) == 0 ) { // Ignore this one } else { HTREEITEM hBranch = m_tcScripts.InsertItem(findData.cFileName, m_iFolderIndex, m_iFolderIndex, hNode); CString csNewPath; csNewPath.Format(_T("%s\\%s"), pszPath, findData.cFileName); ParseDirectory(csNewPath, hBranch, selections); } } else { CString csFileName = findData.cFileName; if ( csFileName.Right(4).CompareNoCase(_T(".scp")) == 0) { CString csFullPath; csFullPath.Format(_T("%s\\%s"), pszPath, findData.cFileName); HTREEITEM hNewItem = m_tcScripts.InsertItem(findData.cFileName, m_iDocIndex, m_iDocIndex, hNode); if ( IsSelected(selections, csFullPath ) ) m_tcScripts.SetCheck(hNewItem); } } bStatus = FindNextFile(hSearch, &findData); } FindClose(hSearch); } } void CProfileEdit::ParseRemoteDirectory(LPCTSTR pszPath, HTREEITEM hNode, CStringArray &selections) { CStringArray csaFiles, csaDirectories; Main->m_pAxis->GetDirectoryList(pszPath, &csaFiles, &csaDirectories); int i; for ( i = 0; i <= csaDirectories.GetUpperBound(); i++ ) { if ( csaDirectories.GetAt(i) == _T(".") || csaDirectories.GetAt(i) == _T("..") ) continue; HTREEITEM hBranch = m_tcScripts.InsertItem(csaDirectories.GetAt(i), m_iFolderIndex, m_iFolderIndex, hNode); CString csNewPath; csNewPath.Format(_T("%s\\%s"), pszPath, csaDirectories.GetAt(i)); if ( csNewPath.Find(_T(".\\")) == 0 ) csNewPath = csNewPath.Mid(2); ParseRemoteDirectory(csNewPath, hBranch, selections); } for ( i = 0; i <= csaFiles.GetUpperBound(); i++ ) { if ( csaFiles.GetAt(i).Right(4).CompareNoCase(_T(".scp")) == 0 ) { CString csFullPath; csFullPath.Format(_T("%s\\%s"), pszPath, csaFiles.GetAt(i)); if ( csFullPath.Find(_T(".\\")) == 0 ) csFullPath = csFullPath.Mid(2); HTREEITEM hNewItem = m_tcScripts.InsertItem(csaFiles.GetAt(i), m_iDocIndex, m_iDocIndex, hNode); if ( IsSelected(selections, csFullPath) ) m_tcScripts.SetCheck(hNewItem); } } } void CProfileEdit::GetSelections(HTREEITEM hNode, CString csRootDir, CStringArray &selections) { HTREEITEM hChild = m_tcScripts.GetNextItem(hNode, TVGN_CHILD); while (hChild != NULL ) { CString csPath; if ( csRootDir != _T("") ) csPath = csRootDir + _T("\\") + m_tcScripts.GetItemText(hChild); else csPath = m_tcScripts.GetItemText(hChild); if ( m_tcScripts.ItemHasChildren(hChild) ) GetSelections(hChild, csPath, selections); else { // This is a script file if ( m_tcScripts.GetCheck(hChild) ) selections.Add(csPath); } hChild = m_tcScripts.GetNextItem(hChild, TVGN_NEXT); } } bool CProfileEdit::IsSelected(CStringArray &selections, CString csFile) { for ( int i = 0; i <= selections.GetUpperBound(); i++ ) { if ( csFile == selections.GetAt(i) ) return true; } return false; } void CProfileEdit::CheckChildren(HTREEITEM hNode, int check) { HTREEITEM hChild = m_tcScripts.GetNextItem(hNode, TVGN_CHILD); while (hChild != NULL ) { if ( m_tcScripts.ItemHasChildren(hChild) ) CheckChildren(hChild, check); m_tcScripts.SetCheck(hChild, check); hChild = m_tcScripts.GetNextItem(hChild, TVGN_NEXT); } } LRESULT CProfileEdit::OnTvCheckbox(WPARAM wp, LPARAM lp) { // CTreeCtrl & tree = GetDlgItem(wp); -- if we have multiple trees HTREEITEM hItem = (HTREEITEM) lp; int checked = (m_tcScripts.GetItemState(hItem, TVIS_STATEIMAGEMASK) >> 12) - 1; CheckChildren(hItem, checked); return 0; } void CProfileEdit::OnNMClickProfileFiles(NMHDR *pNMHDR, LRESULT *pResult) { DWORD dw = GetMessagePos(); // retrieve mouse cursor position when msg was sent CPoint p(GET_X_LPARAM(dw), GET_Y_LPARAM(dw)); // ..and put into point structure m_tcScripts.ScreenToClient(&p); // make coords local to tree client area UINT htFlags = 0; HTREEITEM it = m_tcScripts.HitTest(p, &htFlags); // See where the click was on if (it != NULL && htFlags==TVHT_ONITEMSTATEICON) { // the check box was hit. // we just post a message PostMessage(WM_APP, pNMHDR->idFrom, (LPARAM) it); } *pResult = 0; } --- NEW FILE: ProfileEdit.h --- #pragma once #include "afxwin.h" #include "afxcmn.h" #include "resource.h" #include "ScriptProfile.h" // CProfileEdit dialog class CProfileEdit : public CDialog { DECLARE_DYNAMIC(CProfileEdit) public: CProfileEdit(CWnd* pParent = NULL); // standard constructor virtual ~CProfileEdit(); // Dialog Data enum { IDD = IDD_PROFILE_EDIT }; protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support DECLARE_MESSAGE_MAP() public: protected: virtual void OnOK(); virtual void OnCancel(); CListBox m_lbProfiles; CButton m_bNew; CButton m_bEdit; CButton m_bDelete; CButton m_bRefresh; CButton m_bLocal; CButton m_bRemote; CButton m_bSave; CButton m_bDiscard; CEdit m_eName; CEdit m_eSphereIP; CEdit m_eSpherePort; CEdit m_eBasePath; CButton m_bRemoteSpawns; CEdit m_eRemoteUser; CEdit m_eRemotePassword; CEdit m_eRemotePort; CEdit m_eRemoteTimeout; CTreeCtrl m_tcScripts; CButton m_bOK; CButton m_bCancel; CStatic m_sStatic1; CStatic m_sStatic2; CStatic m_sStatic3; CStatic m_sStatic4; CStatic m_sStatic5; CStatic m_sStatic6; CStatic m_sStatic7; CStatic m_sStatic8; CStatic m_sStatic9; CStatic m_sStatic10; afx_msg void OnBnClickedProfileNew(); afx_msg void OnBnClickedProfileEdit(); afx_msg void OnBnClickedProfileDelete(); afx_msg void OnBnClickedProfileScriptRefresh(); afx_msg void OnBnClickedProfileRemotespawns(); afx_msg void OnBnClickedProfileLocal(); afx_msg void OnBnClickedProfileRemote(); virtual BOOL OnInitDialog(); afx_msg void OnLbnSelchangeProfileList(); afx_msg void OnBnClickedOk(); afx_msg void OnBnClickedCancel(); afx_msg void OnBnClickedProfileSave(); afx_msg void OnBnClickedProfileDiscard(); afx_msg LRESULT OnTvCheckbox(WPARAM wp, LPARAM lp); afx_msg void OnNMClickProfileFiles(NMHDR *pNMHDR, LRESULT *pResult); void PopulateProfiles(); void PopulateValues(); void PopulateScripts(); void EnableEditWindows(BOOL bEnable); void UpdateValues(); void GetSelectedScripts(CStringArray &sa); void ParseDirectory(LPCTSTR pszPath, HTREEITEM hNode, CStringArray &pSelections); void ParseRemoteDirectory(LPCTSTR pszPath, HTREEITEM hNode, CStringArray &pSelections); bool IsSelected(CStringArray &pSelections, CString csFile); void GetSelections(HTREEITEM hNode, CString csRootDir, CStringArray &pSelections); void CheckChildren(HTREEITEM hNode, int check); CScriptProfile * m_pCurrentProfile; CString m_sName; CString m_sSphereIP; CString m_sSpherePort; CString m_sBasePath; CString m_sRemoteUser; CString m_sRemotePassword; CString m_sRemotePort; CString m_sRemoteTimeout; int m_iProfileType; CImageList m_ilIcons; int m_iFolderIndex; int m_iDocIndex; HICON m_hDocIcon; HICON m_hFolderIcon; public: }; Index: Resource.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/Resource.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** Resource.h 23 May 2003 05:46:54 -0000 1.2 --- Resource.h 12 Jun 2003 23:27:01 -0000 1.3 *************** *** 9,12 **** --- 9,46 ---- #define IDC_STATUS_MESSAGE 201 #define IDC_PROGBAR 202 + #define IDD_PROFILE_EDIT 202 + #define IDC_PROFILE_LIST 203 + #define IDC_PROFILE_PARMS 204 + #define IDI_DOC 204 + #define IDC_PE_STATIC1 205 + #define IDC_PROFILE_NEW 206 + #define IDC_PROFILE_EDIT 207 + #define IDC_PROFILE_DELETE 208 + #define IDC_PROFILE_NAME 209 + #define IDC_PROFILE_FILES 210 + #define IDC_PROFILE_LOCAL 211 + #define IDC_PROFILE_REMOTE 212 + #define IDC_PROFILE_SCRIPT_REFRESH 213 + #define IDC_PROFILE_SPHEREIP 214 + #define IDC_PROFILE_SPHEREPORT 215 + #define IDC_PROFILE_BASEPATH 216 + #define IDC_PROFILE_REMOTESPAWNS 217 + #define IDI_FOLDER 217 + #define IDC_PROFILE_REMOTEUSER 218 + #define IDI_DOC1 218 + #define IDC_PROFILE_REMOTEPWD 219 + #define IDC_PROFILE_REMOTEPORT 220 + #define IDC_PROFILE_REMOTETIMEOUT 221 + #define IDC_PE_STATIC2 222 + #define IDC_PE_STATIC3 223 + #define IDC_PE_STATIC4 224 + #define IDC_PE_STATIC5 225 + #define IDC_PE_STATIC6 226 + #define IDC_PE_STATIC7 227 + #define IDC_PE_STATIC8 228 + #define IDC_PE_STATIC9 229 + #define IDC_PE_STATIC10 230 + #define IDC_PROFILE_SAVE 231 + #define IDC_PROFILE_DISCARD 232 // Next default values for new objects *************** *** 14,20 **** #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS ! #define _APS_NEXT_RESOURCE_VALUE 202 #define _APS_NEXT_COMMAND_VALUE 32768 ! #define _APS_NEXT_CONTROL_VALUE 203 #define _APS_NEXT_SYMED_VALUE 104 #endif --- 48,54 ---- #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS ! #define _APS_NEXT_RESOURCE_VALUE 205 #define _APS_NEXT_COMMAND_VALUE 32768 ! #define _APS_NEXT_CONTROL_VALUE 232 #define _APS_NEXT_SYMED_VALUE 104 #endif Index: S_Sphere52.rc =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/S_Sphere52.rc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** S_Sphere52.rc 23 May 2003 05:46:54 -0000 1.2 --- S_Sphere52.rc 12 Jun 2003 23:27:01 -0000 1.3 *************** *** 101,110 **** IDD_FILEREAD_PROGRESS DIALOGEX 0, 0, 288, 28 ! STYLE DS_SETFONT | DS_NOFAILCREATE | WS_POPUP | WS_VISIBLE | WS_CAPTION CAPTION "Loading File" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN CTEXT "",IDC_STATUS_MESSAGE,7,3,274,8,SS_CENTERIMAGE ! CONTROL "",IDC_PROGBAR,"Static",SS_BLACKFRAME | SS_SUNKEN,7,14,274,10 END --- 101,168 ---- IDD_FILEREAD_PROGRESS DIALOGEX 0, 0, 288, 28 ! STYLE DS_SETFONT | DS_NOFAILCREATE | WS_POPUP | WS_VISIBLE | WS_CAPTION CAPTION "Loading File" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN CTEXT "",IDC_STATUS_MESSAGE,7,3,274,8,SS_CENTERIMAGE ! CONTROL "",IDC_PROGBAR,"Static",SS_BLACKFRAME | SS_SUNKEN,7,14, ! 274,10 ! END ! ! IDD_PROFILE_EDIT DIALOGEX 0, 0, 299, 293 ! STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | ! WS_SYSMENU ! CAPTION "Profile Editor (Sphere 0.52)" ! FONT 8, "MS Shell Dlg", 400, 0, 0x1 ! BEGIN ! LISTBOX IDC_PROFILE_LIST,7,18,230,78,LBS_SORT | ! LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP ! PUSHBUTTON "New",IDC_PROFILE_NEW,244,49,50,14 ! PUSHBUTTON "Edit",IDC_PROFILE_EDIT,244,65,50,14 ! PUSHBUTTON "Delete",IDC_PROFILE_DELETE,244,81,50,14 ! CONTROL "Local",IDC_PROFILE_LOCAL,"Button",BS_AUTORADIOBUTTON | ! WS_DISABLED | WS_GROUP | WS_TABSTOP,35,110,32,10 ! CONTROL "Remote",IDC_PROFILE_REMOTE,"Button",BS_AUTORADIOBUTTON | ! WS_DISABLED | WS_TABSTOP,83,110,41,10 ! EDITTEXT IDC_PROFILE_NAME,40,122,95,13,ES_AUTOHSCROLL | ! WS_DISABLED ! EDITTEXT IDC_PROFILE_SPHEREIP,50,138,85,13,ES_AUTOHSCROLL | ! WS_DISABLED ! EDITTEXT IDC_PROFILE_SPHEREPORT,60,155,75,13,ES_AUTOHSCROLL | ! ES_NUMBER | WS_DISABLED ! EDITTEXT IDC_PROFILE_BASEPATH,56,173,79,12,ES_AUTOHSCROLL | ! WS_DISABLED ! CONTROL "Get Remote Spawnpoints",IDC_PROFILE_REMOTESPAWNS,"Button", ! BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,14,191,122,12 ! EDITTEXT IDC_PROFILE_REMOTEUSER,67,207,68,12,ES_AUTOHSCROLL | ! WS_DISABLED ! EDITTEXT IDC_PROFILE_REMOTEPWD,76,221,59,12,ES_PASSWORD | ! ES_AUTOHSCROLL | WS_DISABLED ! EDITTEXT IDC_PROFILE_REMOTEPORT,73,235,62,12,ES_AUTOHSCROLL | ! ES_NUMBER | WS_DISABLED ! EDITTEXT IDC_PROFILE_REMOTETIMEOUT,86,249,49,12,ES_AUTOHSCROLL | ! ES_NUMBER | WS_DISABLED ! CONTROL "",IDC_PROFILE_FILES,"SysTreeView32",TVS_HASBUTTONS | ! TVS_HASLINES | TVS_LINESATROOT | TVS_CHECKBOXES | ! TVS_NOSCROLL | WS_DISABLED | WS_BORDER | WS_TABSTOP,141, ! 122,147,144 ! PUSHBUTTON "Refresh List",IDC_PROFILE_SCRIPT_REFRESH,226,107,61,13, ! WS_DISABLED ! PUSHBUTTON "Save Changes",IDC_PROFILE_SAVE,9,270,60,14,WS_DISABLED ! PUSHBUTTON "Discard Changes",IDC_PROFILE_DISCARD,229,270,60,14, ! WS_DISABLED ! DEFPUSHBUTTON "OK",IDOK,242,7,50,14 ! PUSHBUTTON "Cancel",IDCANCEL,242,24,50,14 ! LTEXT "User Defined Profiles",IDC_PE_STATIC1,9,8,227,10 ! GROUPBOX "Parameters",IDC_PROFILE_PARMS,7,100,285,186 ! LTEXT "Name",IDC_PE_STATIC3,15,123,23,11 ! LTEXT "Available Scripts",IDC_PE_STATIC2,145,111,68,8 ! LTEXT "Sphere IP",IDC_PE_STATIC4,14,140,32,8 ! LTEXT "Sphere Port",IDC_PE_STATIC5,14,157,39,8 ! LTEXT "Base Path",IDC_PE_STATIC6,14,175,33,8 ! LTEXT "Remote User",IDC_PE_STATIC7,14,209,46,9 ! LTEXT "Remote Password",IDC_PE_STATIC8,14,223,58,8 ! LTEXT "Remote Port",IDC_PE_STATIC9,14,237,41,8 ! LTEXT "Remote Timeout (ms)",IDC_PE_STATIC10,14,251,69,8 END *************** *** 123,131 **** RIGHTMARGIN, 179 TOPMARGIN, 7 ! BOTTOMMARGIN, 88 END END #endif // APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// --- 181,206 ---- RIGHTMARGIN, 179 TOPMARGIN, 7 ! END ! ! IDD_PROFILE_EDIT, DIALOG ! BEGIN ! LEFTMARGIN, 7 ! RIGHTMARGIN, 292 ! TOPMARGIN, 7 ! BOTTOMMARGIN, 286 END END #endif // APSTUDIO_INVOKED + + ///////////////////////////////////////////////////////////////////////////// + // + // Icon + // + + // Icon with lowest ID value placed first to ensure application icon + // remains consistent on all systems. + IDI_DOC ICON "res\\doc.ico" + IDI_FOLDER ICON "res\\folder.ico" ///////////////////////////////////////////////////////////////////////////// Index: S_Sphere52.vcproj =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/S_Sphere52.vcproj,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** S_Sphere52.vcproj 12 Jun 2003 04:56:59 -0000 1.6 --- S_Sphere52.vcproj 12 Jun 2003 23:27:01 -0000 1.7 *************** *** 38,46 **** Name="VCLinkerTool" IgnoreImportLibrary="TRUE" ! AdditionalDependencies="libxml2.lib comsvcs.lib ..\S_ScriptsBase\Debug\S_ScriptsBase.lib" ShowProgress="0" OutputFile="$(OutDir)/S_Sphere52.dll" LinkIncremental="2" ! AdditionalLibraryDirectories="../S_ScriptsBase/Debug" ModuleDefinitionFile=".\S_Sphere52.def" GenerateDebugInformation="TRUE" --- 38,46 ---- Name="VCLinkerTool" IgnoreImportLibrary="TRUE" ! AdditionalDependencies="libxml2.lib comsvcs.lib ../S_ScriptsBase/Debug\S_ScriptsBase.lib" ShowProgress="0" OutputFile="$(OutDir)/S_Sphere52.dll" LinkIncremental="2" ! AdditionalLibraryDirectories="" ModuleDefinitionFile=".\S_Sphere52.def" GenerateDebugInformation="TRUE" *************** *** 64,71 **** CommandLine="regsvr32 /s /c "$(TargetPath)""/> <Tool ! Name="VCPreBuildEventTool" ! CommandLine="copy ..\S_ScriptsBase\Debug\*.dll Debug"/> <Tool ! Name="VCPreLinkEventTool"/> <Tool Name="VCResourceCompilerTool" --- 64,71 ---- CommandLine="regsvr32 /s /c "$(TargetPath)""/> <Tool ! Name="VCPreBuildEventTool"/> <Tool ! Name="VCPreLinkEventTool" ! CommandLine="copy ..\S_ScriptsBase\Debug\*.dll debug"/> <Tool Name="VCResourceCompilerTool" *************** *** 178,181 **** --- 178,184 ---- </File> <File + RelativePath="ProfileEdit.cpp"> + </File> + <File RelativePath="Room.cpp"> </File> *************** *** 335,338 **** --- 338,344 ---- </File> <File + RelativePath="ProfileEdit.h"> + </File> + <File RelativePath="Resource.h"> </File> *************** *** 451,454 **** --- 457,466 ---- <File RelativePath="Scripts.rgs"> + </File> + <File + RelativePath="res\doc.ico"> + </File> + <File + RelativePath="res\folder.ico"> </File> </Filter> Index: ScriptProfile.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/ScriptProfile.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** ScriptProfile.h 23 May 2003 05:46:54 -0000 1.2 --- ScriptProfile.h 12 Jun 2003 23:27:01 -0000 1.3 *************** *** 45,49 **** void ServerHost(CString s) { m_sServerHost = s; } void ServerPort(int i) { m_iServerPort = i; } ! void Files(CStringArray sa) { m_sFiles.Copy(sa); } bool WriteXML(xmlDocPtr pDoc, xmlNodePtr pNode); --- 45,49 ---- void ServerHost(CString s) { m_sServerHost = s; } void ServerPort(int i) { m_iServerPort = i; } ! void Files(CStringArray &sa) { m_sFiles.Copy(sa); } bool WriteXML(xmlDocPtr pDoc, xmlNodePtr pNode); Index: Scripts.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/Scripts.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** Scripts.cpp 30 May 2003 20:06:14 -0000 1.5 --- Scripts.cpp 12 Jun 2003 23:27:01 -0000 1.6 *************** *** 5,8 **** --- 5,9 ---- #include "S_Sphere52App.h" #include "ScriptsMain.h" + #include "ProfileEdit.h" *************** *** 109,113 **** AFX_MANAGE_STATE(AfxGetStaticModuleState()); ! // TODO: Add your implementation code here return S_OK; --- 110,115 ---- AFX_MANAGE_STATE(AfxGetStaticModuleState()); ! CProfileEdit dlg; ! dlg.DoModal(); return S_OK; Index: Scripts.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/Scripts.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** Scripts.h 30 May 2003 20:06:14 -0000 1.5 --- Scripts.h 12 Jun 2003 23:27:01 -0000 1.6 *************** *** 9,14 **** - extern class CScripts * Main; - #define LOG Main->m_pAxis->Log #define locale Main->m_pAxis --- 9,12 ---- *************** *** 146,147 **** --- 144,147 ---- OBJECT_ENTRY_AUTO(__uuidof(Scripts), CScripts) + + extern CScripts * Main; Index: XMLConfig.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/XMLConfig.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** XMLConfig.cpp 23 May 2003 05:46:54 -0000 1.2 --- XMLConfig.cpp 12 Jun 2003 23:27:01 -0000 1.3 *************** *** 27,40 **** CXMLConfig::~CXMLConfig(void) { ! for ( int i = 0; i < m_pProfiles.GetCount(); i++ ) ! { ! CScriptProfile * pProfile = (CScriptProfile*) m_pProfiles.GetAt(i); ! if ( pProfile ) ! delete pProfile; ! } } bool CXMLConfig::LoadConfig() { if ( ! LoadFromXML() ) { --- 27,36 ---- CXMLConfig::~CXMLConfig(void) { ! CleanupProfiles(); } bool CXMLConfig::LoadConfig() { + CleanupProfiles(); if ( ! LoadFromXML() ) { *************** *** 484,486 **** --- 480,511 ---- else m_sLocaleFile = s; + } + + void CXMLConfig::AddProfile(CScriptProfile * pNewProfile) + { + m_pProfiles.Add(pNewProfile); + } + + void CXMLConfig::DeleteProfile(CScriptProfile * pProfile) + { + for ( int i = 0; i < m_pProfiles.GetCount(); i++ ) + { + CScriptProfile * p = (CScriptProfile *) m_pProfiles.GetAt(i); + if ( p == pProfile ) + { + m_pProfiles.RemoveAt(i); + delete pProfile; + return; + } + } + } + + void CXMLConfig::CleanupProfiles() + { + for ( int i = 0; i < m_pProfiles.GetCount(); i++ ) + { + CScriptProfile * pProfile = (CScriptProfile*) m_pProfiles.GetAt(i); + if ( pProfile ) + delete pProfile; + } } Index: XMLConfig.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/XMLConfig.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** XMLConfig.h 27 May 2003 04:26:31 -0000 1.3 --- XMLConfig.h 12 Jun 2003 23:27:01 -0000 1.4 *************** *** 26,29 **** --- 26,31 ---- CString LocaleFile() { return m_sLocaleFile; } void LocaleFile(CString s); + void AddProfile(CScriptProfile * pNewProfile); + void DeleteProfile(CScriptProfile * pProfile); protected: *************** *** 51,53 **** --- 53,56 ---- DWORD GetRegistryDword(HKEY hKey, CString sTag, DWORD dwDefault); void GetRegistryMultiSz(HKEY hKey, CString sTag, CStringArray& sa); + void CleanupProfiles(); }; |
From: Philip E. <pes...@us...> - 2003-06-12 23:27:04
|
Update of /cvsroot/sphere-axis/Axis/S_Sphere52/res In directory sc8-pr-cvs1:/tmp/cvs-serv4716/res Added Files: doc.ico folder.ico Log Message: Adding a profile editor. --- NEW FILE: doc.ico --- --- NEW FILE: folder.ico --- |
From: Philip E. <pes...@us...> - 2003-06-12 23:19:59
|
Update of /cvsroot/sphere-axis/Axis/S_Sphere52/res In directory sc8-pr-cvs1:/tmp/cvs-serv1985/res Log Message: Directory /cvsroot/sphere-axis/Axis/S_Sphere52/res added to the repository |
From: Philip E. <pes...@us...> - 2003-06-12 04:57:03
|
Update of /cvsroot/sphere-axis/Axis/Utilities In directory sc8-pr-cvs1:/tmp/cvs-serv25518/Utilities Modified Files: SendToUO.h Log Message: no message Index: SendToUO.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/Utilities/SendToUO.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** SendToUO.h 23 May 2003 05:47:27 -0000 1.2 --- SendToUO.h 12 Jun 2003 04:56:59 -0000 1.3 *************** *** 3,7 **** ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2002 * * This program is free software; you can redistribute it and/or modify --- 3,7 ---- ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify |
From: Philip E. <pes...@us...> - 2003-06-12 04:57:03
|
Update of /cvsroot/sphere-axis/Axis/S_Sphere52 In directory sc8-pr-cvs1:/tmp/cvs-serv25518/S_Sphere52 Modified Files: S_Sphere52.vcproj TObArray.h Removed Files: TObArray.cpp Log Message: no message Index: S_Sphere52.vcproj =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/S_Sphere52.vcproj,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** S_Sphere52.vcproj 11 Jun 2003 22:18:10 -0000 1.5 --- S_Sphere52.vcproj 12 Jun 2003 04:56:59 -0000 1.6 *************** *** 38,46 **** Name="VCLinkerTool" IgnoreImportLibrary="TRUE" ! AdditionalDependencies="libxml2.lib comsvcs.lib ../S_ScriptsBase/Debug\S_ScriptsBase.lib" ShowProgress="0" OutputFile="$(OutDir)/S_Sphere52.dll" LinkIncremental="2" ! AdditionalLibraryDirectories="" ModuleDefinitionFile=".\S_Sphere52.def" GenerateDebugInformation="TRUE" --- 38,46 ---- Name="VCLinkerTool" IgnoreImportLibrary="TRUE" ! AdditionalDependencies="libxml2.lib comsvcs.lib ..\S_ScriptsBase\Debug\S_ScriptsBase.lib" ShowProgress="0" OutputFile="$(OutDir)/S_Sphere52.dll" LinkIncremental="2" ! AdditionalLibraryDirectories="../S_ScriptsBase/Debug" ModuleDefinitionFile=".\S_Sphere52.def" GenerateDebugInformation="TRUE" *************** *** 64,71 **** CommandLine="regsvr32 /s /c "$(TargetPath)""/> <Tool ! Name="VCPreBuildEventTool"/> <Tool ! Name="VCPreLinkEventTool" ! CommandLine="copy ..\S_ScriptsBase\Debug\*.dll debug"/> <Tool Name="VCResourceCompilerTool" --- 64,71 ---- CommandLine="regsvr32 /s /c "$(TargetPath)""/> <Tool ! Name="VCPreBuildEventTool" ! CommandLine="copy ..\S_ScriptsBase\Debug\*.dll Debug"/> <Tool ! Name="VCPreLinkEventTool"/> <Tool Name="VCResourceCompilerTool" *************** *** 224,230 **** <File RelativePath="SpellDef.cpp"> - </File> - <File - RelativePath="TObArray.cpp"> </File> <File --- 224,227 ---- Index: TObArray.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/TObArray.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** TObArray.h 11 Jun 2003 22:18:11 -0000 1.3 --- TObArray.h 12 Jun 2003 04:56:59 -0000 1.4 *************** *** 6,49 **** { public: ! CTObArray(); ! ~CTObArray(); ! bool Write(CStdioFile &csfOutput); ! ! CString m_csBaseName; ! bool m_bHexIndex; ! DWORD m_dwIndexOffset; ! }; ! ! // Method definitions ! ! template <class ScriptPtrType> CTObArray<ScriptPtrType>::CTObArray() ! { ! m_bHexIndex = false; ! m_dwIndexOffset = 0; ! } ! template <class ScriptPtrType> CTObArray<ScriptPtrType>::~CTObArray() ! { ! this->RemoveAll(); ! } ! template <class ScriptPtrType> bool CTObArray<ScriptPtrType>::Write(CStdioFile &csfOutput) ! { ! CString csLine; ! for ( int i = 0; i < (int) this->GetSize(); i++ ) { ! CScriptBase * pObject = this->GetAt(i); ! if ( pObject ) { ! CString csLine; ! if ( m_bHexIndex ) ! csLine.Format(_T("[%s %4x]\n"), m_csBaseName, i + m_dwIndexOffset); ! else ! csLine.Format(_T("[%s %ld]\n"), m_csBaseName, i + m_dwIndexOffset); ! csfOutput.WriteString(csLine); ! pObject->Write(csfOutput); ! csfOutput.WriteString(_T("\n")); } } ! return true; ! } \ No newline at end of file --- 6,43 ---- { public: ! CTObArray() ! { ! m_bHexIndex = false; ! m_dwIndexOffset = 0; ! } ! ~CTObArray() ! { ! RemoveAll(); ! } ! bool Write(CStdioFile &csfOutput) { ! CString csLine; ! for ( int i = 0; i < (int) this->GetSize(); i++ ) { ! CScriptBase * pObject = this->GetAt(i); ! if ( pObject ) ! { ! CString csLine; ! if ( m_bHexIndex ) ! csLine.Format(_T("[%s %4x]\n"), m_csBaseName, i + m_dwIndexOffset); ! else ! csLine.Format(_T("[%s %ld]\n"), m_csBaseName, i + m_dwIndexOffset); ! csfOutput.WriteString(csLine); ! pObject->Write(csfOutput); ! csfOutput.WriteString(_T("\n")); ! } } + return true; } ! ! CString m_csBaseName; ! bool m_bHexIndex; ! DWORD m_dwIndexOffset; ! }; --- TObArray.cpp DELETED --- |
From: Philip E. <pes...@us...> - 2003-06-12 04:57:03
|
Update of /cvsroot/sphere-axis/Axis In directory sc8-pr-cvs1:/tmp/cvs-serv25518 Modified Files: Drewsky.vcproj Log Message: no message Index: Drewsky.vcproj =================================================================== RCS file: /cvsroot/sphere-axis/Axis/Drewsky.vcproj,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** Drewsky.vcproj 12 Jun 2003 03:15:31 -0000 1.5 --- Drewsky.vcproj 12 Jun 2003 04:56:59 -0000 1.6 *************** *** 342,348 **** </File> <File - RelativePath=".\FoodTypeEditDlg.cpp"> - </File> - <File RelativePath=".\GeneralTab.cpp"> </File> --- 342,345 ---- *************** *** 357,363 **** </File> <File - RelativePath=".\LootItemEditDlg.cpp"> - </File> - <File RelativePath=".\MacroDlg.cpp"> </File> --- 354,357 ---- *************** *** 387,393 **** </File> <File - RelativePath=".\ResourceEditDlg.cpp"> - </File> - <File RelativePath=".\RoofImage.cpp"> </File> --- 381,384 ---- *************** *** 477,486 **** </File> <File - RelativePath=".\VendItemDlg.cpp"> - </File> - <File - RelativePath=".\WeightedItemDlg.cpp"> - </File> - <File RelativePath="WorldItem.cpp"> </File> --- 468,471 ---- *************** *** 547,553 **** </File> <File - RelativePath=".\Area.h"> - </File> - <File RelativePath=".\AttrSelectionDlg.h"> </File> --- 532,535 ---- *************** *** 589,595 **** </File> <File - RelativePath=".\DefEditDlg.h"> - </File> - <File RelativePath=".\DrewskyPS.h"> </File> --- 571,574 ---- *************** *** 598,604 **** </File> <File - RelativePath=".\EditGraymapDlg.h"> - </File> - <File RelativePath=".\EditValue.h"> </File> --- 577,580 ---- *************** *** 613,631 **** </File> <File - RelativePath=".\FoodTypeEditDlg.h"> - </File> - <File RelativePath=".\GeneralTab.h"> </File> <File - RelativePath=".\ItemEditDlg.h"> - </File> - <File RelativePath=".\ItemGenTab.h"> </File> <File - RelativePath=".\ItemScriptEditDlg.h"> - </File> - <File RelativePath=".\ItemTweakTab.h"> </File> --- 589,598 ---- *************** *** 634,640 **** </File> <File - RelativePath=".\LootItemEditDlg.h"> - </File> - <File RelativePath=".\MacroDlg.h"> </File> --- 601,604 ---- *************** *** 646,670 **** </File> <File - RelativePath=".\NPCEditDlg.h"> - </File> - <File - RelativePath=".\NameEditDlg.h"> - </File> - <File - RelativePath=".\NewScriptObjectDlg.h"> - </File> - <File - RelativePath=".\NotoTitleEditDlg.h"> - </File> - <File - RelativePath=".\OreEditDlg.h"> - </File> - <File RelativePath=".\PlayerTweakTab.h"> </File> <File - RelativePath=".\PotionEdit.h"> - </File> - <File RelativePath="RegionSelectDlg.h"> </File> --- 610,616 ---- *************** *** 718,736 **** </File> <File - RelativePath=".\SkillDef.h"> - </File> - <File - RelativePath=".\SkillEditDlg.h"> - </File> - <File - RelativePath=".\SkillMenuEditDlg.h"> - </File> - <File - RelativePath=".\SkillTableEditDlg.h"> - </File> - <File - RelativePath=".\SpawnGroupEditDlg.h"> - </File> - <File RelativePath=".\SpawnList.h"> </File> --- 664,667 ---- *************** *** 742,757 **** </File> <File - RelativePath=".\SpellDef.h"> - </File> - <File - RelativePath=".\SpellEditDlg.h"> - </File> - <File RelativePath=".\SpellbookTweakDlg.h"> </File> <File - RelativePath=".\StatRateEditDlg.h"> - </File> - <File RelativePath=".\StaticArtCriteriaDlg.h"> </File> --- 673,679 ---- *************** *** 772,784 **** </File> <File - RelativePath=".\TemplateEditDlg.h"> - </File> - <File RelativePath=".\TravelTab.h"> </File> <File - RelativePath=".\TriggerEditDlg.h"> - </File> - <File RelativePath=".\TypeSelectionDlg.h"> </File> --- 694,700 ---- *************** *** 790,802 **** </File> <File - RelativePath=".\VendItemDlg.h"> - </File> - <File - RelativePath=".\WOPEditDlg.h"> - </File> - <File - RelativePath=".\WeightedItemDlg.h"> - </File> - <File RelativePath="WorldItem.h"> </File> --- 706,709 ---- *************** *** 809,815 **** <File RelativePath=".\drewsky.h"> - </File> - <File - RelativePath=".\tables.h"> </File> <File --- 716,719 ---- |
From: Philip E. <pes...@us...> - 2003-06-12 04:57:02
|
Update of /cvsroot/sphere-axis/Axis/S_ScriptsBase In directory sc8-pr-cvs1:/tmp/cvs-serv25518/S_ScriptsBase Modified Files: S_ScriptsBase.vcproj ScriptArray.h Removed Files: ScriptArray.cpp Log Message: no message Index: S_ScriptsBase.vcproj =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_ScriptsBase/S_ScriptsBase.vcproj,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** S_ScriptsBase.vcproj 2 Jun 2003 14:37:13 -0000 1.4 --- S_ScriptsBase.vcproj 12 Jun 2003 04:56:59 -0000 1.5 *************** *** 154,160 **** </File> <File - RelativePath="ScriptArray.cpp"> - </File> - <File RelativePath="ScriptBase.cpp"> </File> --- 154,157 ---- Index: ScriptArray.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_ScriptsBase/ScriptArray.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** ScriptArray.h 11 Jun 2003 22:18:12 -0000 1.4 --- ScriptArray.h 12 Jun 2003 04:56:59 -0000 1.5 *************** *** 10,188 **** { public: ! CScriptArray(); ! ~CScriptArray(); ! int Insert(ScriptPtrType pScript); ! int InsertAt(int index, ScriptPtrType pScript); ! int Find(CString csName); ! void Remove(ScriptPtrType pScript); ! void RemoveAll(); ! void RemoveAt(int index); ! int Add(ScriptPtrType pScript) { return Insert(pScript); } ! int SetAt(int index, ScriptPtrType pScript); ! size_t GetSize() { return m_members.size(); } ! size_t GetCount() { return GetSize(); } ! ScriptPtrType GetAt(int index); ! ScriptPtrType Get(CString csName); ! size_t GetUpperBound() { return m_members.size() - 1; } ! ScriptPtrType operator[](int i) { return m_members[i]; } ! protected: ! vector <ScriptPtrType> m_members; ! }; ! // Since we can't export templates from a DLL, we have to put this crap in the header. ! template <class ScriptPtrType> CScriptArray<ScriptPtrType>::CScriptArray() ! { ! } ! ! template <class ScriptPtrType> CScriptArray<ScriptPtrType>::~CScriptArray() ! { ! this->RemoveAll(); ! } ! ! template <class ScriptPtrType> int CScriptArray<ScriptPtrType>::Insert(ScriptPtrType pScript) ! { ! if ( pScript->m_csValue == _T("") ) { ! delete pScript; ! return -1; } ! if ( GetUpperBound() == -1 ) ! return InsertAt(0, pScript); ! int iLower = 0; ! int iUpper = (int) GetUpperBound(); ! int iIndex = 0; ! int iCompare = 0; ! while ( iLower <= iUpper ) ! { ! iIndex = (iUpper + iLower ) / 2; ! ScriptPtrType pTest = (ScriptPtrType) m_members[iIndex]; ! if ( pTest > pScript ) { ! iCompare = 0; ! iUpper = iIndex - 1; } ! else { ! iCompare = 1; ! iLower = iIndex + 1; } } - iIndex += iCompare; - return InsertAt(iIndex, pScript); - } ! template <class ScriptPtrType> int CScriptArray<ScriptPtrType>::Find(CString csName) ! { ! if ( m_members.empty() ) ! return -1; ! int iLower = 0; ! int iUpper = (int) this->GetUpperBound(); ! int iIndex = 0; ! while ( iLower <= iUpper ) ! { ! iIndex = (iUpper + iLower ) / 2; ! ScriptPtrType pTest = (ScriptPtrType) m_members[iIndex]; ! if ( pTest->m_csValue.CompareNoCase(csName) == 0 ) ! return iIndex; ! if ( pTest->m_csValue.CompareNoCase(csName) > 0 ) ! iUpper = iIndex - 1; ! else ! iLower = iIndex + 1; } - return -1; - } ! template <class ScriptPtrType> void CScriptArray<ScriptPtrType>::Remove(ScriptPtrType pScript) ! { ! vector<ScriptPtrType>::iterator p = m_members.find(m_members.begin(), m_members.end(), pScript); ! if ( p != m_members.end() ) { delete *p; m_members.erase(p); } - } ! template <class ScriptPtrType> void CScriptArray<ScriptPtrType>::RemoveAll() ! { ! vector<ScriptPtrType>::iterator p = m_members.begin(); ! while ( p != m_members.end() ) { ! delete *p; ! p++; } - m_members.erase(m_members.begin(), m_members.end()); - } ! template <class ScriptPtrType> ScriptPtrType CScriptArray<ScriptPtrType>::Get(CString csName) ! { ! int iIndex = Find(csName); ! if ( iIndex != -1 ) ! return GetAt(iIndex); ! else ! { ! // Try to look this up as a def ! DWORD dwDef = DefLookup(csName); ! if ( dwDef != 0 ) ! { ! CString csDef; ! csDef.Format(_T("%04x"), dwDef); ! iIndex = Find(csDef); ! if ( iIndex == -1 ) { ! csDef.Format(_T("0%04x"), dwDef); iIndex = Find(csDef); } - if ( iIndex != -1 ) - return GetAt(iIndex); } } - return NULL; - } ! template <class ScriptPtrType> int CScriptArray<ScriptPtrType>::InsertAt(int index, ScriptPtrType pScript) ! { ! if ( index < 0 ) ! return Insert(pScript); ! if ( index > (int) GetUpperBound() ) ! m_members.resize(index, NULL); ! vector<ScriptPtrType>::iterator p = m_members.begin(); ! p += index; ! ! if ( index == (int) GetUpperBound() ) ! m_members.push_back(pScript); ! else ! m_members.insert(p, pScript); ! return index; ! } ! ! template <class ScriptPtrType> int CScriptArray<ScriptPtrType>::SetAt(int index, ScriptPtrType pScript) ! { ! if ( index < 0 ) ! return Insert(pScript); ! if ( index > (int) GetUpperBound() ) ! return InsertAt(index, pScript); ! if ( m_members[index] != NULL ) ! delete m_members[index]; ! m_members[index] = pScript; ! return index; ! } ! ! template <class ScriptPtrType> ScriptPtrType CScriptArray<ScriptPtrType>::GetAt(int index) ! { ! if ( index < 0 || index > (int) GetUpperBound() ) ! return NULL; ! else ! return m_members[index]; ! } ! ! template <class ScriptPtrType> void CScriptArray<ScriptPtrType>::RemoveAt(int index) ! { ! if ( index < 0 || index > (int) GetUpperBound() ) ! return; ! vector<ScriptPtrType>::iterator p = m_members.begin(); ! p+= index; ! delete *p; ! m_members.erase(p); ! } --- 10,195 ---- { public: ! CScriptArray() ! { ! } ! ~CScriptArray() ! { ! RemoveAll(); ! } ! int Insert(ScriptPtrType pScript) ! { ! if ( pScript->m_csValue == _T("") ) ! { ! delete pScript; ! return -1; ! } ! if ( GetUpperBound() == -1 ) ! return InsertAt(0, pScript); ! int iLower = 0; ! int iUpper = (int) GetUpperBound(); ! int iIndex = 0; ! int iCompare = 0; ! while ( iLower <= iUpper ) ! { ! iIndex = (iUpper + iLower ) / 2; ! ScriptPtrType pTest = (ScriptPtrType) m_members[iIndex]; ! if ( pTest > pScript ) ! { ! iCompare = 0; ! iUpper = iIndex - 1; ! } ! else ! { ! iCompare = 1; ! iLower = iIndex + 1; ! } ! } ! iIndex += iCompare; ! return InsertAt(iIndex, pScript); ! } ! int InsertAt(int index, ScriptPtrType pScript) { ! if ( index < 0 ) ! return Insert(pScript); ! if ( index > (int) GetUpperBound() ) ! m_members.resize(index, NULL); ! vector<ScriptPtrType>::iterator p = m_members.begin(); ! p += index; ! ! if ( index == (int) GetUpperBound() ) ! m_members.push_back(pScript); ! else ! m_members.insert(p, pScript); ! return index; } ! ! int Find(CString csName) ! { ! if ( m_members.empty() ) ! return -1; ! int iLower = 0; ! int iUpper = (int) this->GetUpperBound(); ! int iIndex = 0; ! while ( iLower <= iUpper ) { ! iIndex = (iUpper + iLower ) / 2; ! ScriptPtrType pTest = (ScriptPtrType) m_members[iIndex]; ! if ( pTest->m_csValue.CompareNoCase(csName) == 0 ) ! return iIndex; ! if ( pTest->m_csValue.CompareNoCase(csName) > 0 ) ! iUpper = iIndex - 1; ! else ! iLower = iIndex + 1; } ! return -1; ! } ! ! void Remove(ScriptPtrType pScript) ! { ! vector<ScriptPtrType>::iterator p = m_members.find(m_members.begin(), m_members.end(), pScript); ! if ( p != m_members.end() ) { ! delete *p; ! m_members.erase(p); } } ! void RemoveAll() ! { ! vector<ScriptPtrType>::iterator p = m_members.begin(); ! while ( p != m_members.end() ) ! { ! delete *p; ! p++; ! } ! m_members.erase(m_members.begin(), m_members.end()); } ! void RemoveAt(int index) { + if ( index < 0 || index > (int) GetUpperBound() ) + return; + vector<ScriptPtrType>::iterator p = m_members.begin(); + p+= index; delete *p; m_members.erase(p); } ! int Add(ScriptPtrType pScript) ! { ! return Insert(pScript); ! } ! ! int SetAt(int index, ScriptPtrType pScript) { ! if ( index < 0 ) ! return Insert(pScript); ! if ( index > (int) GetUpperBound() ) ! return InsertAt(index, pScript); ! if ( m_members[index] != NULL ) ! delete m_members[index]; ! m_members[index] = pScript; ! return index; ! } ! ! size_t GetSize() ! { ! return m_members.size(); } ! size_t GetCount() ! { ! return GetSize(); ! } ! ! ScriptPtrType GetAt(int index) ! { ! if ( index < 0 || index > (int) GetUpperBound() ) ! return NULL; ! else ! return m_members[index]; ! } ! ! ScriptPtrType Get(CString csName) ! { ! int iIndex = Find(csName); ! if ( iIndex != -1 ) ! return GetAt(iIndex); ! else ! { ! // Try to look this up as a def ! DWORD dwDef = DefLookup(csName); ! if ( dwDef != 0 ) { ! CString csDef; ! csDef.Format(_T("%04x"), dwDef); iIndex = Find(csDef); + if ( iIndex == -1 ) + { + csDef.Format(_T("0%04x"), dwDef); + iIndex = Find(csDef); + } + if ( iIndex != -1 ) + return GetAt(iIndex); } } + return NULL; } ! size_t GetUpperBound() ! { ! return m_members.size() - 1; ! } ! ! ScriptPtrType operator[](int i) ! { ! return m_members[i]; ! } ! ! protected: ! vector <ScriptPtrType> m_members; ! }; ! --- ScriptArray.cpp DELETED --- |
Update of /cvsroot/sphere-axis/Axis In directory sc8-pr-cvs1:/tmp/cvs-serv24785 Modified Files: ABOUTDLG.CPP ABOUTDLG.H AREA.H Axis.rc AxisLog.cpp AxisLog.h AxisLogDlg.cpp AxisLogDlg.h ClientPatch.cpp ClientPatch.h common.h ConfigFile.h CScriptObjects.h Drewsky.cpp Drewsky.h Drewsky.vcproj EditorTab.cpp flagsbrainstab.cpp flagsbrainstab.h generaltab.h itemgentab.cpp itemtweaktab.cpp itemtweaktab.h MISCTAB.CPP playertweaktab.cpp playertweaktab.h RemoteConsole.h RemoteConsoleDlg.cpp RemoteConsoleDlg.h resourceeditdlg.cpp resourceeditdlg.h settingstab.cpp settingstab.h SkillDef.h SPAWNTAB.CPP SpellbookTweakDlg.cpp SpellDef.h StaticToolDlg.cpp StaticToolDlg.h TABLES.H todo.txt traveltab.cpp uoart.cpp uoart.h UOMul.cpp UOMul.h Added Files: UOStaticItem.cpp UOStaticItem.h WorldItem.cpp WorldItem.h Log Message: no message --- NEW FILE: UOStaticItem.cpp --- /* $Id: UOStaticItem.cpp,v 1.1 2003/06/12 03:15:35 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 * ********************************************************************** */ #include "stdafx.h" #include "uostaticitem.h" CUOStaticItem::CUOStaticItem() { m_dwBlockIndex = 0; memset(&m_blockData, 0x00, sizeof(tUOStaticRec)); m_bFlag = 0; } bool CUOStaticItem::Read(CFile &cfInput) { DWORD dwRead = cfInput.Read(&m_blockData, sizeof(tUOStaticRec)); return ( dwRead == sizeof(tUOStaticRec) ? true : false ); } --- NEW FILE: UOStaticItem.h --- /* $Id: UOStaticItem.h,v 1.1 2003/06/12 03:15:35 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 * ********************************************************************** */ #pragma once class CUOStaticItem { public: public: bool Read(CFile &cfInput); CUOStaticItem(); BYTE * GetDataPtr() { return (BYTE *) &m_dwBlockIndex; } DWORD m_dwBlockIndex; tUOStaticRec m_blockData; BYTE m_bFlag; }; --- NEW FILE: WorldItem.cpp --- /* $Id: WorldItem.cpp,v 1.1 2003/06/12 03:15:35 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 * ********************************************************************** */ #include "stdafx.h" #include "worlditem.h" CWorldItem::~CWorldItem(void) { } CWorldItem::CWorldItem(void) { m_bStaticFlag = 0; m_csBaseID = _T(""); m_wArtID = 0; m_dwSerial = 0; m_wColor = 0; m_dwMore1 = 0; m_dwMore2 = 0; m_wMoreX = 0; m_wMoreY = 0; m_bMoreZ = 0; m_bLayer = 0; m_dwContainer = 0; m_dwAttr = 0; m_wAmount = 0; m_pX = 0; m_pY = 0; m_pZ = 0; m_csName = _T(""); m_dwTimer = 0; m_dwItemType = 0; m_wRegionFlags = 0; } DWORD CWorldItem::GetMapBlock() { int XBlock, YBlock; XBlock = m_pX / 8; YBlock = m_pY / 8; return ( XBlock * 512 + YBlock ); } BYTE CWorldItem::GetBlockX() { return ( m_pX % 8 ); } BYTE CWorldItem::GetBlockY() { return ( m_pY % 8 ); } --- NEW FILE: WorldItem.h --- /* $Id: WorldItem.h,v 1.1 2003/06/12 03:15:35 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 * ********************************************************************** */ #pragma once class CWorldItem { public: CWorldItem(void); ~CWorldItem(void); BYTE GetBlockY(); BYTE GetBlockX(); DWORD GetMapBlock(); BYTE m_bStaticFlag; CString m_csBaseID; WORD m_wArtID; DWORD m_dwSerial; WORD m_wColor; DWORD m_dwMore1; DWORD m_dwMore2; WORD m_wMoreX; WORD m_wMoreY; BYTE m_bMoreZ; BYTE m_bLayer; DWORD m_dwContainer; DWORD m_dwAttr; WORD m_wAmount; WORD m_pX; WORD m_pY; BYTE m_pZ; CString m_csName; DWORD m_dwTimer; DWORD m_dwItemType; WORD m_wRegionFlags; int m_iScriptsIndex; }; Index: ABOUTDLG.CPP =================================================================== RCS file: /cvsroot/sphere-axis/Axis/ABOUTDLG.CPP,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** ABOUTDLG.CPP 23 May 2003 05:30:35 -0000 1.8 --- ABOUTDLG.CPP 12 Jun 2003 03:15:29 -0000 1.9 *************** *** 3,7 **** ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2002 * * This program is free software; you can redistribute it and/or modify --- 3,7 ---- ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify Index: ABOUTDLG.H =================================================================== RCS file: /cvsroot/sphere-axis/Axis/ABOUTDLG.H,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** ABOUTDLG.H 23 May 2003 05:30:36 -0000 1.7 --- ABOUTDLG.H 12 Jun 2003 03:15:29 -0000 1.8 *************** *** 3,7 **** ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2002 * * This program is free software; you can redistribute it and/or modify --- 3,7 ---- ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify Index: AREA.H =================================================================== RCS file: /cvsroot/sphere-axis/Axis/AREA.H,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** AREA.H 23 May 2003 05:30:36 -0000 1.7 --- AREA.H 12 Jun 2003 03:15:29 -0000 1.8 *************** *** 3,7 **** ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2002 * * This program is free software; you can redistribute it and/or modify --- 3,7 ---- ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify Index: Axis.rc =================================================================== RCS file: /cvsroot/sphere-axis/Axis/Axis.rc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** Axis.rc 3 Jun 2003 16:43:11 -0000 1.3 --- Axis.rc 12 Jun 2003 03:15:30 -0000 1.4 *************** *** 90,94 **** ICON IDR_MAINFRAME,IDC_AB_ICON,11,13,20,20 LTEXT "Static",IDC_ABOUTTITLE,40,7,171,8,SS_NOPREFIX ! LTEXT "© 1998-2002 Philip A. Esterle + parts © 2002 Adron", IDC_COPYRIGHT,40,18,168,8 DEFPUSHBUTTON "OK",IDOK,217,7,32,14,WS_GROUP --- 90,94 ---- ICON IDR_MAINFRAME,IDC_AB_ICON,11,13,20,20 LTEXT "Static",IDC_ABOUTTITLE,40,7,171,8,SS_NOPREFIX ! LTEXT "© 1998-2003 Philip A. Esterle + parts © 2002 Adron", IDC_COPYRIGHT,40,18,168,8 DEFPUSHBUTTON "OK",IDOK,217,7,32,14,WS_GROUP Index: AxisLog.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/AxisLog.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** AxisLog.cpp 3 Jun 2003 16:43:12 -0000 1.8 --- AxisLog.cpp 12 Jun 2003 03:15:30 -0000 1.9 *************** *** 3,7 **** ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2002 * * This program is free software; you can redistribute it and/or modify --- 3,7 ---- ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify Index: AxisLog.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/AxisLog.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** AxisLog.h 23 May 2003 05:30:36 -0000 1.4 --- AxisLog.h 12 Jun 2003 03:15:30 -0000 1.5 *************** *** 3,7 **** ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2002 * * This program is free software; you can redistribute it and/or modify --- 3,7 ---- ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify Index: AxisLogDlg.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/AxisLogDlg.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** AxisLogDlg.cpp 3 Jun 2003 16:43:12 -0000 1.3 --- AxisLogDlg.cpp 12 Jun 2003 03:15:30 -0000 1.4 *************** *** 3,7 **** ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2002 * * This program is free software; you can redistribute it and/or modify --- 3,7 ---- ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify Index: AxisLogDlg.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/AxisLogDlg.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** AxisLogDlg.h 3 Jun 2003 16:43:12 -0000 1.2 --- AxisLogDlg.h 12 Jun 2003 03:15:30 -0000 1.3 *************** *** 3,7 **** ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2002 * * This program is free software; you can redistribute it and/or modify --- 3,7 ---- ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify Index: ClientPatch.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/ClientPatch.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** ClientPatch.cpp 23 May 2003 05:30:36 -0000 1.11 --- ClientPatch.cpp 12 Jun 2003 03:15:30 -0000 1.12 *************** *** 3,7 **** ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2002 * * This program is free software; you can redistribute it and/or modify --- 3,7 ---- ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify Index: ClientPatch.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/ClientPatch.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** ClientPatch.h 1 May 2002 03:33:09 -0000 1.8 --- ClientPatch.h 12 Jun 2003 03:15:30 -0000 1.9 *************** *** 3,7 **** ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2002 * * This program is free software; you can redistribute it and/or modify --- 3,7 ---- ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify Index: common.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/common.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -r1.15 -r1.16 *** common.h 11 Jun 2003 23:43:38 -0000 1.15 --- common.h 12 Jun 2003 03:15:30 -0000 1.16 *************** *** 1011,1015 **** DWORD m_dwAge; }; - */ class CUOStaticItem --- 1011,1014 ---- *************** *** 1025,1028 **** --- 1024,1028 ---- }; + */ Index: ConfigFile.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/ConfigFile.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** ConfigFile.h 1 May 2002 03:33:09 -0000 1.3 --- ConfigFile.h 12 Jun 2003 03:15:30 -0000 1.4 *************** *** 3,7 **** ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2002 * * This program is free software; you can redistribute it and/or modify --- 3,7 ---- ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify Index: CScriptObjects.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/CScriptObjects.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** CScriptObjects.h 23 May 2003 05:30:36 -0000 1.6 --- CScriptObjects.h 12 Jun 2003 03:15:30 -0000 1.7 *************** *** 3,7 **** ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2002 * * This program is free software; you can redistribute it and/or modify --- 3,7 ---- ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify Index: Drewsky.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/Drewsky.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -r1.27 -r1.28 *** Drewsky.cpp 11 Jun 2003 23:43:38 -0000 1.27 --- Drewsky.cpp 12 Jun 2003 03:15:30 -0000 1.28 *************** *** 250,256 **** if ( pScripts != NULL ) { ! m_pScriptsA = new CScriptsWrapper(pScripts->m_sClsID); ! if ( m_pScriptsA->IsValid() ) ! m_pScriptsA->LoadScripts(iIndex); } } --- 250,256 ---- if ( pScripts != NULL ) { ! m_pScripts = new CScriptsWrapper(pScripts->m_sClsID); ! if ( m_pScripts->IsValid() ) ! m_pScripts->LoadScripts(iIndex); } } *************** *** 430,437 **** } ! if ( m_pScriptsA ) { ! delete m_pScriptsA; ! m_pScriptsA = NULL; } --- 430,437 ---- } ! if ( m_pScripts ) { ! delete m_pScripts; ! m_pScripts = NULL; } Index: Drewsky.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/Drewsky.h,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -r1.19 -r1.20 *** Drewsky.h 11 Jun 2003 23:43:38 -0000 1.19 --- Drewsky.h 12 Jun 2003 03:15:31 -0000 1.20 *************** *** 71,75 **** CAxisCOMWrapper * m_pAxisCOM; ! CScriptsWrapper * m_pScriptsA; CCommandsWrapper * m_pCommands; --- 71,75 ---- CAxisCOMWrapper * m_pAxisCOM; ! CScriptsWrapper * m_pScripts; CCommandsWrapper * m_pCommands; Index: Drewsky.vcproj =================================================================== RCS file: /cvsroot/sphere-axis/Axis/Drewsky.vcproj,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** Drewsky.vcproj 11 Jun 2003 23:43:38 -0000 1.4 --- Drewsky.vcproj 12 Jun 2003 03:15:31 -0000 1.5 *************** *** 474,477 **** --- 474,480 ---- </File> <File + RelativePath="UOStaticItem.cpp"> + </File> + <File RelativePath=".\VendItemDlg.cpp"> </File> *************** *** 480,483 **** --- 483,489 ---- </File> <File + RelativePath="WorldItem.cpp"> + </File> + <File RelativePath=".\WorldMapDlg.cpp"> </File> *************** *** 781,784 **** --- 787,793 ---- </File> <File + RelativePath="UOStaticItem.h"> + </File> + <File RelativePath=".\VendItemDlg.h"> </File> *************** *** 788,791 **** --- 797,803 ---- <File RelativePath=".\WeightedItemDlg.h"> + </File> + <File + RelativePath="WorldItem.h"> </File> <File Index: EditorTab.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/EditorTab.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** EditorTab.cpp 3 Jun 2003 16:43:12 -0000 1.7 --- EditorTab.cpp 12 Jun 2003 03:15:31 -0000 1.8 *************** *** 161,165 **** AssignButtons(); ! int count = Main->m_pScriptsA->GetEditorCount(); if ( count ) { --- 161,165 ---- AssignButtons(); ! int count = Main->m_pScripts->GetEditorCount(); if ( count ) { *************** *** 168,172 **** { CButton * pButton = (CButton *) m_buttons.GetAt(i); ! pButton->SetWindowText(Main->m_pScriptsA->GetEditorDescription(i)); pButton->ShowWindow(SW_SHOW); } --- 168,172 ---- { CButton * pButton = (CButton *) m_buttons.GetAt(i); ! pButton->SetWindowText(Main->m_pScripts->GetEditorDescription(i)); pButton->ShowWindow(SW_SHOW); } *************** *** 219,398 **** void CEditorTab::OnEditor1() { ! Main->m_pScriptsA->InvokeEditor(1); } void CEditorTab::OnEditor2() { ! Main->m_pScriptsA->InvokeEditor(2); } void CEditorTab::OnEditor3() { ! Main->m_pScriptsA->InvokeEditor(3); } void CEditorTab::OnEditor4() { ! Main->m_pScriptsA->InvokeEditor(4); } void CEditorTab::OnEditor5() { ! Main->m_pScriptsA->InvokeEditor(5); } void CEditorTab::OnEditor6() { ! Main->m_pScriptsA->InvokeEditor(6); } void CEditorTab::OnEditor7() { ! Main->m_pScriptsA->InvokeEditor(7); } void CEditorTab::OnEditor8() { ! Main->m_pScriptsA->InvokeEditor(8); } void CEditorTab::OnEditor9() { ! Main->m_pScriptsA->InvokeEditor(9); } void CEditorTab::OnEditor10() { ! Main->m_pScriptsA->InvokeEditor(10); } void CEditorTab::OnEditor11() { ! Main->m_pScriptsA->InvokeEditor(11); } void CEditorTab::OnEditor12() { ! Main->m_pScriptsA->InvokeEditor(12); } void CEditorTab::OnEditor13() { ! Main->m_pScriptsA->InvokeEditor(13); } void CEditorTab::OnEditor14() { ! Main->m_pScriptsA->InvokeEditor(14); } void CEditorTab::OnEditor15() { ! Main->m_pScriptsA->InvokeEditor(15); } void CEditorTab::OnEditor16() { ! Main->m_pScriptsA->InvokeEditor(16); } void CEditorTab::OnEditor17() { ! Main->m_pScriptsA->InvokeEditor(17); } void CEditorTab::OnEditor18() { ! Main->m_pScriptsA->InvokeEditor(18); } void CEditorTab::OnEditor19() { ! Main->m_pScriptsA->InvokeEditor(19); } void CEditorTab::OnEditor20() { ! Main->m_pScriptsA->InvokeEditor(20); } void CEditorTab::OnEditor21() { ! Main->m_pScriptsA->InvokeEditor(21); } void CEditorTab::OnEditor22() { ! Main->m_pScriptsA->InvokeEditor(22); } void CEditorTab::OnEditor23() { ! Main->m_pScriptsA->InvokeEditor(23); } void CEditorTab::OnEditor24() { ! Main->m_pScriptsA->InvokeEditor(24); } void CEditorTab::OnEditor25() { ! Main->m_pScriptsA->InvokeEditor(25); } void CEditorTab::OnEditor26() { ! Main->m_pScriptsA->InvokeEditor(26); } void CEditorTab::OnEditor27() { ! Main->m_pScriptsA->InvokeEditor(27); } void CEditorTab::OnEditor28() { ! Main->m_pScriptsA->InvokeEditor(28); } void CEditorTab::OnEditor29() { ! Main->m_pScriptsA->InvokeEditor(29); } void CEditorTab::OnEditor30() { ! Main->m_pScriptsA->InvokeEditor(30); } void CEditorTab::OnEditor31() { ! Main->m_pScriptsA->InvokeEditor(31); } void CEditorTab::OnEditor32() { ! Main->m_pScriptsA->InvokeEditor(32); } void CEditorTab::OnEditor33() { ! Main->m_pScriptsA->InvokeEditor(33); } void CEditorTab::OnEditor34() { ! Main->m_pScriptsA->InvokeEditor(34); } void CEditorTab::OnEditor35() { ! Main->m_pScriptsA->InvokeEditor(35); } void CEditorTab::OnEditor36() { ! Main->m_pScriptsA->InvokeEditor(36); } --- 219,398 ---- void CEditorTab::OnEditor1() { ! Main->m_pScripts->InvokeEditor(1); } void CEditorTab::OnEditor2() { ! Main->m_pScripts->InvokeEditor(2); } void CEditorTab::OnEditor3() { ! Main->m_pScripts->InvokeEditor(3); } void CEditorTab::OnEditor4() { ! Main->m_pScripts->InvokeEditor(4); } void CEditorTab::OnEditor5() { ! Main->m_pScripts->InvokeEditor(5); } void CEditorTab::OnEditor6() { ! Main->m_pScripts->InvokeEditor(6); } void CEditorTab::OnEditor7() { ! Main->m_pScripts->InvokeEditor(7); } void CEditorTab::OnEditor8() { ! Main->m_pScripts->InvokeEditor(8); } void CEditorTab::OnEditor9() { ! Main->m_pScripts->InvokeEditor(9); } void CEditorTab::OnEditor10() { ! Main->m_pScripts->InvokeEditor(10); } void CEditorTab::OnEditor11() { ! Main->m_pScripts->InvokeEditor(11); } void CEditorTab::OnEditor12() { ! Main->m_pScripts->InvokeEditor(12); } void CEditorTab::OnEditor13() { ! Main->m_pScripts->InvokeEditor(13); } void CEditorTab::OnEditor14() { ! Main->m_pScripts->InvokeEditor(14); } void CEditorTab::OnEditor15() { ! Main->m_pScripts->InvokeEditor(15); } void CEditorTab::OnEditor16() { ! Main->m_pScripts->InvokeEditor(16); } void CEditorTab::OnEditor17() { ! Main->m_pScripts->InvokeEditor(17); } void CEditorTab::OnEditor18() { ! Main->m_pScripts->InvokeEditor(18); } void CEditorTab::OnEditor19() { ! Main->m_pScripts->InvokeEditor(19); } void CEditorTab::OnEditor20() { ! Main->m_pScripts->InvokeEditor(20); } void CEditorTab::OnEditor21() { ! Main->m_pScripts->InvokeEditor(21); } void CEditorTab::OnEditor22() { ! Main->m_pScripts->InvokeEditor(22); } void CEditorTab::OnEditor23() { ! Main->m_pScripts->InvokeEditor(23); } void CEditorTab::OnEditor24() { ! Main->m_pScripts->InvokeEditor(24); } void CEditorTab::OnEditor25() { ! Main->m_pScripts->InvokeEditor(25); } void CEditorTab::OnEditor26() { ! Main->m_pScripts->InvokeEditor(26); } void CEditorTab::OnEditor27() { ! Main->m_pScripts->InvokeEditor(27); } void CEditorTab::OnEditor28() { ! Main->m_pScripts->InvokeEditor(28); } void CEditorTab::OnEditor29() { ! Main->m_pScripts->InvokeEditor(29); } void CEditorTab::OnEditor30() { ! Main->m_pScripts->InvokeEditor(30); } void CEditorTab::OnEditor31() { ! Main->m_pScripts->InvokeEditor(31); } void CEditorTab::OnEditor32() { ! Main->m_pScripts->InvokeEditor(32); } void CEditorTab::OnEditor33() { ! Main->m_pScripts->InvokeEditor(33); } void CEditorTab::OnEditor34() { ! Main->m_pScripts->InvokeEditor(34); } void CEditorTab::OnEditor35() { ! Main->m_pScripts->InvokeEditor(35); } void CEditorTab::OnEditor36() { ! Main->m_pScripts->InvokeEditor(36); } Index: flagsbrainstab.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/flagsbrainstab.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** flagsbrainstab.cpp 11 Jun 2003 23:43:38 -0000 1.12 --- flagsbrainstab.cpp 12 Jun 2003 03:15:31 -0000 1.13 *************** *** 748,761 **** this->m_ccbSkills.ResetContent(); ! if ( Main->m_pScriptsA && Main->m_pScriptsA->IsValid() ) { ! for ( int i = 0; i < (int) Main->m_pScriptsA->GetSkillCount(); i++ ) { ! CString sKey = Main->m_pScriptsA->GetSkillName(i); m_ccbSkills.AddString(sKey); } ! for ( i = 0; i < (int) Main->m_pScriptsA->GetBrainCount(); i++ ) { ! CString sBrain = Main->m_pScriptsA->GetBrainDescription(i); m_ccbBrains.AddString(sBrain); } --- 748,761 ---- this->m_ccbSkills.ResetContent(); ! if ( Main->m_pScripts && Main->m_pScripts->IsValid() ) { ! for ( int i = 0; i < (int) Main->m_pScripts->GetSkillCount(); i++ ) { ! CString sKey = Main->m_pScripts->GetSkillName(i); m_ccbSkills.AddString(sKey); } ! for ( i = 0; i < (int) Main->m_pScripts->GetBrainCount(); i++ ) { ! CString sBrain = Main->m_pScripts->GetBrainDescription(i); m_ccbBrains.AddString(sBrain); } Index: flagsbrainstab.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/flagsbrainstab.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** flagsbrainstab.h 23 May 2003 05:30:37 -0000 1.5 --- flagsbrainstab.h 12 Jun 2003 03:15:31 -0000 1.6 *************** *** 3,7 **** ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2002 * * This program is free software; you can redistribute it and/or modify --- 3,7 ---- ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify Index: generaltab.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/generaltab.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** generaltab.h 23 May 2003 05:30:37 -0000 1.5 --- generaltab.h 12 Jun 2003 03:15:31 -0000 1.6 *************** *** 3,7 **** ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2002 * * This program is free software; you can redistribute it and/or modify --- 3,7 ---- ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify Index: itemgentab.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/itemgentab.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -r1.22 -r1.23 *** itemgentab.cpp 11 Jun 2003 23:43:38 -0000 1.22 --- itemgentab.cpp 12 Jun 2003 03:15:32 -0000 1.23 *************** *** 310,315 **** continue; CString sDescription, sID; ! sDescription = Main->m_pScriptsA->GetItemDescription(iIndex); ! sID = Main->m_pScriptsA->GetItemID(iIndex); m_clcItems.InsertItem(iCount, sDescription, 0); m_clcItems.SetItemText(iCount, 1, sID); --- 310,315 ---- continue; CString sDescription, sID; ! sDescription = Main->m_pScripts->GetItemDescription(iIndex); ! sID = Main->m_pScripts->GetItemID(iIndex); m_clcItems.InsertItem(iCount, sDescription, 0); m_clcItems.SetItemText(iCount, 1, sID); *************** *** 329,336 **** CString sDesc1, sDesc2; ! sID1 = Main->m_pScriptsA->GetItemID(lParam1); ! sID2 = Main->m_pScriptsA->GetItemID(lParam2); ! sDesc1 = Main->m_pScriptsA->GetItemDescription(lParam1); ! sDesc2 = Main->m_pScriptsA->GetItemDescription(lParam2); if (lParamSort == 0) --- 329,336 ---- CString sDesc1, sDesc2; ! sID1 = Main->m_pScripts->GetItemID(lParam1); ! sID2 = Main->m_pScripts->GetItemID(lParam2); ! sDesc1 = Main->m_pScripts->GetItemDescription(lParam1); ! sDesc2 = Main->m_pScripts->GetItemDescription(lParam2); if (lParamSort == 0) *************** *** 419,429 **** int index = m_clcItems.GetItemData(iSelIndex); CString sColor, sDispID; ! sColor = Main->m_pScriptsA->GetCharacterColor(index); ! sDispID = Main->m_pScriptsA->GetCharacterDispID(index); { if (Main->m_config.DrawItems()) { m_Display.SetArtIndex(ahextoi(sDispID)); ! m_Display.SetArtColor((WORD)Main->m_pScriptsA->EvaluateDef(sColor)); } } --- 419,429 ---- int index = m_clcItems.GetItemData(iSelIndex); CString sColor, sDispID; ! sColor = Main->m_pScripts->GetCharacterColor(index); ! sDispID = Main->m_pScripts->GetCharacterDispID(index); { if (Main->m_config.DrawItems()) { m_Display.SetArtIndex(ahextoi(sDispID)); ! m_Display.SetArtColor((WORD)Main->m_pScripts->EvaluateDef(sColor)); } } *************** *** 558,562 **** bool bFound = false; int iStart, iEnd; ! int iTotal = Main->m_pScriptsA->GetItemCount(); if ( bPrevious ) { --- 558,562 ---- bool bFound = false; int iStart, iEnd; ! int iTotal = Main->m_pScripts->GetItemCount(); if ( bPrevious ) { *************** *** 614,618 **** CString sID; // Compare IDs ! sID = Main->m_pScriptsA->GetItemID(index); if ( sID.Find(m_csSearchValue) != -1 ) return true; --- 614,618 ---- CString sID; // Compare IDs ! sID = Main->m_pScripts->GetItemID(index); if ( sID.Find(m_csSearchValue) != -1 ) return true; *************** *** 622,626 **** CString sDescription; // Compare Descriptions ! sDescription = Main->m_pScriptsA->GetItemDescription(index); if ( sDescription.Find(m_csSearchValue) != -1 ) return true; --- 622,626 ---- CString sDescription; // Compare Descriptions ! sDescription = Main->m_pScripts->GetItemDescription(index); if ( sDescription.Find(m_csSearchValue) != -1 ) return true; *************** *** 812,826 **** progress.SetWindowText(_T("Categorizing...")); progress.m_csMessage.SetWindowText(locale->String(IDS_CATITEMS)); ! progress.SetRange32(0, Main->m_pScriptsA->GetItemCount()); progress.SetPos(0); m_pCategories = new CCategoryTree; ! if ( Main->m_pScriptsA && Main->m_pScriptsA->IsValid() ) { ! for ( int i = 0; i < (int) Main->m_pScriptsA->GetItemCount(); i++ ) { ! if ( Main->m_pScriptsA->ItemDontCategorize(i) ) continue; CString sCategory; ! sCategory = Main->m_pScriptsA->GetItemCategory(i); if ( sCategory == _T("") ) sCategory = _T("<none>"); --- 812,826 ---- progress.SetWindowText(_T("Categorizing...")); progress.m_csMessage.SetWindowText(locale->String(IDS_CATITEMS)); ! progress.SetRange32(0, Main->m_pScripts->GetItemCount()); progress.SetPos(0); m_pCategories = new CCategoryTree; ! if ( Main->m_pScripts && Main->m_pScripts->IsValid() ) { ! for ( int i = 0; i < (int) Main->m_pScripts->GetItemCount(); i++ ) { ! if ( Main->m_pScripts->ItemDontCategorize(i) ) continue; CString sCategory; ! sCategory = Main->m_pScripts->GetItemCategory(i); if ( sCategory == _T("") ) sCategory = _T("<none>"); Index: itemtweaktab.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/itemtweaktab.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** itemtweaktab.cpp 3 Jun 2003 21:28:50 -0000 1.10 --- itemtweaktab.cpp 12 Jun 2003 03:15:32 -0000 1.11 *************** *** 3,7 **** ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2002 * * This program is free software; you can redistribute it and/or modify --- 3,7 ---- ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify *************** *** 360,367 **** // Load the Combo Box of Item Types. ! if ( Main->m_pScriptsA && Main->m_pScriptsA->IsValid() && Main->m_pScriptsA->GetTypeCount() ) { ! for ( int i = 0; i < (int) Main->m_pScriptsA->GetTypeCount(); i++ ) ! m_ccItemTypes.AddString(Main->m_pScriptsA->GetTypeDescription(i)); } else --- 360,367 ---- // Load the Combo Box of Item Types. ! if ( Main->m_pScripts && Main->m_pScripts->IsValid() && Main->m_pScripts->GetTypeCount() ) { ! for ( int i = 0; i < (int) Main->m_pScripts->GetTypeCount(); i++ ) ! m_ccItemTypes.AddString(Main->m_pScripts->GetTypeDescription(i)); } else *************** *** 663,681 **** void CItemTweakTab::SetAttributeCaptions() { ! m_cbIdentified.SetWindowText(Main->m_pScriptsA->GetItemAttributeDescription(0)); ! m_cbDecay.SetWindowText(Main->m_pScriptsA->GetItemAttributeDescription(1)); ! m_cbNewbie.SetWindowText(Main->m_pScriptsA->GetItemAttributeDescription(2)); ! m_cbMoveAlways.SetWindowText(Main->m_pScriptsA->GetItemAttributeDescription(3)); ! m_cbMoveNever.SetWindowText(Main->m_pScriptsA->GetItemAttributeDescription(4)); ! m_cbMagic.SetWindowText(Main->m_pScriptsA->GetItemAttributeDescription(5)); ! m_cbOwnedByTown.SetWindowText(Main->m_pScriptsA->GetItemAttributeDescription(6)); ! m_cbInvisible.SetWindowText(Main->m_pScriptsA->GetItemAttributeDescription(7)); ! m_cbCursed.SetWindowText(Main->m_pScriptsA->GetItemAttributeDescription(8)); ! m_cbDamned.SetWindowText(Main->m_pScriptsA->GetItemAttributeDescription(9)); ! m_cbBlessed.SetWindowText(Main->m_pScriptsA->GetItemAttributeDescription(10)); ! m_cbSacred.SetWindowText(Main->m_pScriptsA->GetItemAttributeDescription(11)); ! m_cbForSale.SetWindowText(Main->m_pScriptsA->GetItemAttributeDescription(12)); ! m_cbStolen.SetWindowText(Main->m_pScriptsA->GetItemAttributeDescription(13)); ! m_cbCanDecay.SetWindowText(Main->m_pScriptsA->GetItemAttributeDescription(14)); ! m_cbStatic.SetWindowText(Main->m_pScriptsA->GetItemAttributeDescription(15)); } --- 663,681 ---- void CItemTweakTab::SetAttributeCaptions() { ! m_cbIdentified.SetWindowText(Main->m_pScripts->GetItemAttributeDescription(0)); ! m_cbDecay.SetWindowText(Main->m_pScripts->GetItemAttributeDescription(1)); ! m_cbNewbie.SetWindowText(Main->m_pScripts->GetItemAttributeDescription(2)); ! m_cbMoveAlways.SetWindowText(Main->m_pScripts->GetItemAttributeDescription(3)); ! m_cbMoveNever.SetWindowText(Main->m_pScripts->GetItemAttributeDescription(4)); ! m_cbMagic.SetWindowText(Main->m_pScripts->GetItemAttributeDescription(5)); ! m_cbOwnedByTown.SetWindowText(Main->m_pScripts->GetItemAttributeDescription(6)); ! m_cbInvisible.SetWindowText(Main->m_pScripts->GetItemAttributeDescription(7)); ! m_cbCursed.SetWindowText(Main->m_pScripts->GetItemAttributeDescription(8)); ! m_cbDamned.SetWindowText(Main->m_pScripts->GetItemAttributeDescription(9)); ! m_cbBlessed.SetWindowText(Main->m_pScripts->GetItemAttributeDescription(10)); ! m_cbSacred.SetWindowText(Main->m_pScripts->GetItemAttributeDescription(11)); ! m_cbForSale.SetWindowText(Main->m_pScripts->GetItemAttributeDescription(12)); ! m_cbStolen.SetWindowText(Main->m_pScripts->GetItemAttributeDescription(13)); ! m_cbCanDecay.SetWindowText(Main->m_pScripts->GetItemAttributeDescription(14)); ! m_cbStatic.SetWindowText(Main->m_pScripts->GetItemAttributeDescription(15)); } Index: itemtweaktab.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/itemtweaktab.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** itemtweaktab.h 3 Jun 2003 21:28:50 -0000 1.6 --- itemtweaktab.h 12 Jun 2003 03:15:33 -0000 1.7 *************** *** 3,7 **** ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2002 * * This program is free software; you can redistribute it and/or modify --- 3,7 ---- ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify Index: MISCTAB.CPP =================================================================== RCS file: /cvsroot/sphere-axis/Axis/MISCTAB.CPP,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -r1.30 -r1.31 *** MISCTAB.CPP 11 Jun 2003 23:43:38 -0000 1.30 --- MISCTAB.CPP 12 Jun 2003 03:15:33 -0000 1.31 *************** *** 900,916 **** this->m_ccSpellList.ResetContent(); ! if ( Main->m_pScriptsA && Main->m_pScriptsA->IsValid() ) { // Fill the spells list ! for ( int i = 0; i < (int) Main->m_pScriptsA->GetSpellCount(); i++ ) { ! CString sSpell = Main->m_pScriptsA->GetSpellName(i); int index = m_ccSpellList.AddString(sSpell); m_ccSpellList.SetItemData(index, i); } // Fill the music list ! for ( i = 0; i < (int) Main->m_pScriptsA->GetMidiCount(); i++ ) { ! CString s = Main->m_pScriptsA->GetMidiName(i); int index = m_ccbMusicList.AddString(s); m_ccbMusicList.SetItemData(index, i); --- 900,916 ---- this->m_ccSpellList.ResetContent(); ! if ( Main->m_pScripts && Main->m_pScripts->IsValid() ) { // Fill the spells list ! for ( int i = 0; i < (int) Main->m_pScripts->GetSpellCount(); i++ ) { ! CString sSpell = Main->m_pScripts->GetSpellName(i); int index = m_ccSpellList.AddString(sSpell); m_ccSpellList.SetItemData(index, i); } // Fill the music list ! for ( i = 0; i < (int) Main->m_pScripts->GetMidiCount(); i++ ) { ! CString s = Main->m_pScripts->GetMidiName(i); int index = m_ccbMusicList.AddString(s); m_ccbMusicList.SetItemData(index, i); *************** *** 951,956 **** void CMiscTab::OnRconsole() { ! if ( Main->m_pScriptsA && Main->m_pScriptsA->IsValid() ) ! Main->m_pScriptsA->InvokeRemoteConsole(); } --- 951,956 ---- void CMiscTab::OnRconsole() { ! if ( Main->m_pScripts && Main->m_pScripts->IsValid() ) ! Main->m_pScripts->InvokeRemoteConsole(); } *************** *** 1077,1081 **** // Export all objects here into a file. CWaitCursor hourglass; ! if ( Main->m_pScriptsA && Main->m_pScriptsA->IsValid() ) { // Back up any existing file --- 1077,1081 ---- // Export all objects here into a file. CWaitCursor hourglass; ! if ( Main->m_pScripts && Main->m_pScripts->IsValid() ) { // Back up any existing file *************** *** 1093,1097 **** e->Delete(); } ! Main->m_pScriptsA->ExportCategories(_T("axiscats.scp")); } } --- 1093,1097 ---- e->Delete(); } ! Main->m_pScripts->ExportCategories(_T("axiscats.scp")); } } Index: playertweaktab.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/playertweaktab.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** playertweaktab.cpp 23 May 2003 05:30:37 -0000 1.6 --- playertweaktab.cpp 12 Jun 2003 03:15:33 -0000 1.7 *************** *** 3,7 **** ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2002 * * This program is free software; you can redistribute it and/or modify --- 3,7 ---- ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify Index: playertweaktab.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/playertweaktab.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** playertweaktab.h 23 May 2003 05:30:37 -0000 1.5 --- playertweaktab.h 12 Jun 2003 03:15:33 -0000 1.6 *************** *** 3,7 **** ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2002 * * This program is free software; you can redistribute it and/or modify --- 3,7 ---- ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify Index: RemoteConsole.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/RemoteConsole.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** RemoteConsole.h 1 May 2002 03:33:10 -0000 1.4 --- RemoteConsole.h 12 Jun 2003 03:15:33 -0000 1.5 *************** *** 3,7 **** ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2002 * * This program is free software; you can redistribute it and/or modify --- 3,7 ---- ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify Index: RemoteConsoleDlg.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/RemoteConsoleDlg.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** RemoteConsoleDlg.cpp 23 May 2003 05:30:37 -0000 1.14 --- RemoteConsoleDlg.cpp 12 Jun 2003 03:15:33 -0000 1.15 *************** *** 3,7 **** ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2002 * * This program is free software; you can redistribute it and/or modify --- 3,7 ---- ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify Index: RemoteConsoleDlg.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/RemoteConsoleDlg.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** RemoteConsoleDlg.h 23 May 2003 05:30:37 -0000 1.7 --- RemoteConsoleDlg.h 12 Jun 2003 03:15:33 -0000 1.8 *************** *** 3,7 **** ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2002 * * This program is free software; you can redistribute it and/or modify --- 3,7 ---- ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify Index: resourceeditdlg.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/resourceeditdlg.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** resourceeditdlg.cpp 23 May 2003 05:30:38 -0000 1.4 --- resourceeditdlg.cpp 12 Jun 2003 03:15:33 -0000 1.5 *************** *** 3,7 **** ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2002 * * This program is free software; you can redistribute it and/or modify --- 3,7 ---- ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify Index: resourceeditdlg.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/resourceeditdlg.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** resourceeditdlg.h 1 May 2002 03:33:11 -0000 1.3 --- resourceeditdlg.h 12 Jun 2003 03:15:33 -0000 1.4 *************** *** 3,7 **** ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2002 * * This program is free software; you can redistribute it and/or modify --- 3,7 ---- ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify Index: settingstab.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/settingstab.cpp,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -r1.28 -r1.29 *** settingstab.cpp 11 Jun 2003 23:43:39 -0000 1.28 --- settingstab.cpp 12 Jun 2003 03:15:33 -0000 1.29 *************** *** 64,73 **** m_bAllowMultiple = FALSE; m_pDlgStaticTool = NULL; - m_pAcctDlg = NULL; //}}AFX_DATA_INIT m_pDlgStaticTool = NULL; - m_pAcctDlg = NULL; m_pRawEditDlg = NULL; - m_pGUIEditDlg = NULL; m_bTranslucentWindows = FALSE; m_iAlphaBlend = 0; --- 64,70 ---- *************** *** 81,89 **** delete m_pDlgStaticTool; } - if ( m_pAcctDlg ) - { - m_pAcctDlg->DestroyWindow(); - delete m_pAcctDlg; - } if ( m_pRawEditDlg ) { --- 78,81 ---- *************** *** 91,99 **** delete m_pRawEditDlg; } - if ( m_pGUIEditDlg ) - { - m_pGUIEditDlg->DestroyWindow(); - delete m_pGUIEditDlg; - } } --- 83,86 ---- *************** *** 704,725 **** void CSettingsTab::OnScriptedit() { - if ( m_pGUIEditDlg != NULL ) - { - if ( m_pGUIEditDlg->m_bIsActive ) - { - m_pGUIEditDlg->ShowWindow(SW_RESTORE); - return; - } - else - { - delete m_pGUIEditDlg; - m_pGUIEditDlg = NULL; - } - } - - m_pGUIEditDlg = new CItemScriptEditDlg; - m_pGUIEditDlg->Create(IDD_ITEMSCRIPT_EDIT_DLG, this); - Main->SetLayeredWindow(m_pGUIEditDlg->GetSafeHwnd()); - m_pGUIEditDlg->ShowWindow(SW_SHOW); } --- 691,694 ---- *************** *** 748,763 **** void CSettingsTab::OnAcctedit() { - if ( m_pAcctDlg && !m_pAcctDlg->IsWindowVisible() ) - { - m_pAcctDlg->DestroyWindow(); - delete m_pAcctDlg; - m_pAcctDlg = NULL; - } - if ( m_pAcctDlg == NULL ) - { - m_pAcctDlg = new CAccountDlg; - m_pAcctDlg->Create(IDD_ACCOUNT_DLG, (CWnd *)this); - } - m_pAcctDlg->ShowWindow(SW_SHOW); } --- 717,720 ---- Index: settingstab.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/settingstab.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -r1.15 -r1.16 *** settingstab.h 23 May 2003 05:30:38 -0000 1.15 --- settingstab.h 12 Jun 2003 03:15:33 -0000 1.16 *************** *** 52,58 **** BOOL m_bDeleteStaticTool; class CStaticToolDlg * m_pDlgStaticTool; - class CAccountDlg * m_pAcctDlg; class CScriptEditDlg * m_pRawEditDlg; - class CItemScriptEditDlg * m_pGUIEditDlg; // Dialog Data --- 52,56 ---- Index: SkillDef.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/SkillDef.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** SkillDef.h 23 May 2003 05:30:38 -0000 1.4 --- SkillDef.h 12 Jun 2003 03:15:33 -0000 1.5 *************** *** 3,7 **** ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2002 * * This program is free software; you can redistribute it and/or modify --- 3,7 ---- ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify Index: SPAWNTAB.CPP =================================================================== RCS file: /cvsroot/sphere-axis/Axis/SPAWNTAB.CPP,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -r1.21 -r1.22 *** SPAWNTAB.CPP 11 Jun 2003 23:43:39 -0000 1.21 --- SPAWNTAB.CPP 12 Jun 2003 03:15:34 -0000 1.22 *************** *** 156,160 **** int iSelIndex = this->m_clcCreatures.GetNextItem(-1, LVNI_SELECTED); int index = m_clcCreatures.GetItemData(iSelIndex); ! if ( Main->m_pScriptsA->CharacterSpawnOnly(index) ) { // We can only spawn this guy. --- 156,160 ---- int iSelIndex = this->m_clcCreatures.GetNextItem(-1, LVNI_SELECTED); int index = m_clcCreatures.GetItemData(iSelIndex); ! if ( Main->m_pScripts->CharacterSpawnOnly(index) ) { // We can only spawn this guy. *************** *** 255,260 **** continue; CString sDescription, sID; ! sDescription = Main->m_pScriptsA->GetCharacterDescription(iIndex); ! sID = Main->m_pScriptsA->GetCharacterID(iIndex); m_clcCreatures.InsertItem(iCount, sDescription, 0); m_clcCreatures.SetItemText(iCount, 1, sID); --- 255,260 ---- continue; CString sDescription, sID; ! sDescription = Main->m_pScripts->GetCharacterDescription(iIndex); ! sID = Main->m_pScripts->GetCharacterID(iIndex); m_clcCreatures.InsertItem(iCount, sDescription, 0); m_clcCreatures.SetItemText(iCount, 1, sID); *************** *** 277,284 **** CString sDesc1, sDesc2; ! sID1 = Main->m_pScriptsA->GetCharacterID(lParam1); ! sID2 = Main->m_pScriptsA->GetCharacterID(lParam2); ! sDesc1 = Main->m_pScriptsA->GetCharacterDescription(lParam1); ! sDesc2 = Main->m_pScriptsA->GetCharacterDescription(lParam2); if (lParamSort == 0) --- 277,284 ---- CString sDesc1, sDesc2; ! sID1 = Main->m_pScripts->GetCharacterID(lParam1); ! sID2 = Main->m_pScripts->GetCharacterID(lParam2); ! sDesc1 = Main->m_pScripts->GetCharacterDescription(lParam1); ! sDesc2 = Main->m_pScripts->GetCharacterDescription(lParam2); if (lParamSort == 0) *************** *** 356,363 **** CString sColor, sDispID; ! sColor = Main->m_pScriptsA->GetCharacterColor(index); ! sDispID = Main->m_pScriptsA->GetCharacterDispID(index); ! m_Display.SetArtColor((WORD) Main->m_pScriptsA->EvaluateDef(sColor)); if ( sDispID != _T("") ) m_Display.SetArtIndex((WORD) ahextoi(sDispID)); --- 356,363 ---- CString sColor, sDispID; ! sColor = Main->m_pScripts->GetCharacterColor(index); ! sDispID = Main->m_pScripts->GetCharacterDispID(index); ! m_Display.SetArtColor((WORD) Main->m_pScripts->EvaluateDef(sColor)); if ( sDispID != _T("") ) m_Display.SetArtIndex((WORD) ahextoi(sDispID)); *************** *** 381,385 **** m_ctcNPC.DeleteAllItems(); ! if ( Main->m_pScriptsA->IsValid() ) FillCategoryNode(m_pCategories, NULL); } --- 381,385 ---- m_ctcNPC.DeleteAllItems(); ! if ( Main->m_pScripts->IsValid() ) FillCategoryNode(m_pCategories, NULL); } *************** *** 506,510 **** bool bFound = false; int iStart, iEnd; ! int iTotal = Main->m_pScriptsA->GetCharacterCount(); if ( bPrevious ) { --- 506,510 ---- bool bFound = false; int iStart, iEnd; ! int iTotal = Main->m_pScripts->GetCharacterCount(); if ( bPrevious ) { *************** *** 562,566 **** CString sID; // Compare IDs ! sID = Main->m_pScriptsA->GetCharacterID(index); if ( sID.Find(m_csSearchValue) != -1 ) return true; --- 562,566 ---- CString sID; // Compare IDs ! sID = Main->m_pScripts->GetCharacterID(index); if ( sID.Find(m_csSearchValue) != -1 ) return true; *************** *** 570,574 **** CString sDescription; // Compare Descriptions ! sDescription = Main->m_pScriptsA->GetCharacterDescription(index); if ( sDescription.Find(m_csSearchValue) != -1 ) return true; --- 570,574 ---- CString sDescription; // Compare Descriptions ! sDescription = Main->m_pScripts->GetCharacterDescription(index); if ( sDescription.Find(m_csSearchValue) != -1 ) return true; *************** *** 708,722 **** progress.SetWindowText(_T("Categorizing...")); progress.m_csMessage.SetWindowText(locale->String(IDS_CATNPCS)); ! progress.SetRange32(0, Main->m_pScriptsA->GetCharacterCount()); progress.SetPos(0); m_pCategories = new CCategoryTree; ! if ( Main->m_pScriptsA && Main->m_pScriptsA->IsValid() ) { ! for ( int i = 0; i < (int) Main->m_pScriptsA->GetCharacterCount(); i++ ) { ! if ( Main->m_pScriptsA->CharacterDontCategorize(i) ) continue; CString sCategory; ! sCategory = Main->m_pScriptsA->GetCharacterCategory(i); if ( sCategory == _T("") ) sCategory = _T("<none>"); --- 708,722 ---- progress.SetWindowText(_T("Categorizing...")); progress.m_csMessage.SetWindowText(locale->String(IDS_CATNPCS)); ! progress.SetRange32(0, Main->m_pScripts->GetCharacterCount()); progress.SetPos(0); m_pCategories = new CCategoryTree; ! if ( Main->m_pScripts && Main->m_pScripts->IsValid() ) { ! for ( int i = 0; i < (int) Main->m_pScripts->GetCharacterCount(); i++ ) { ! if ( Main->m_pScripts->CharacterDontCategorize(i) ) continue; CString sCategory; ! sCategory = Main->m_pScripts->GetCharacterCategory(i); if ( sCategory == _T("") ) sCategory = _T("<none>"); Index: SpellbookTweakDlg.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/SpellbookTweakDlg.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** SpellbookTweakDlg.cpp 11 Jun 2003 23:43:39 -0000 1.4 --- SpellbookTweakDlg.cpp 12 Jun 2003 03:15:34 -0000 1.5 *************** *** 172,180 **** } // Loop through the spells and insert them into the proper place ! if ( Main->m_pScriptsA && Main->m_pScriptsA->IsValid() ) { ! for ( int i = 0; i < (int) Main->m_pScriptsA->GetSpellCount(); i++ ) { ! CString sName = Main->m_pScriptsA->GetSpellName(i); int circle = (i - 1) / 8; if ( circle < 0 ) --- 172,180 ---- } // Loop through the spells and insert them into the proper place ! if ( Main->m_pScripts && Main->m_pScripts->IsValid() ) { ! for ( int i = 0; i < (int) Main->m_pScripts->GetSpellCount(); i++ ) { ! CString sName = Main->m_pScripts->GetSpellName(i); int circle = (i - 1) / 8; if ( circle < 0 ) Index: SpellDef.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/SpellDef.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** SpellDef.h 23 May 2003 05:30:38 -0000 1.5 --- SpellDef.h 12 Jun 2003 03:15:34 -0000 1.6 *************** *** 3,7 **** ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2002 * * This program is free software; you can redistribute it and/or modify --- 3,7 ---- ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify Index: StaticToolDlg.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/StaticToolDlg.cpp,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -r1.37 -r1.38 *** StaticToolDlg.cpp 3 Jun 2003 16:58:46 -0000 1.37 --- StaticToolDlg.cpp 12 Jun 2003 03:15:34 -0000 1.38 *************** *** 476,480 **** patch.blockData.bY = pItem->GetBlockY(); patch.blockData.bZ = (BYTE) pItem->m_pZ; ! patch.blockData.wArtID = pItem->m_wArtID ? pItem->m_wArtID : (WORD) Main->m_pScriptsA->EvaluateDef(pItem->m_csBaseID); if ( patch.blockData.wArtID == 0 ) continue; --- 476,480 ---- patch.blockData.bY = pItem->GetBlockY(); patch.blockData.bZ = (BYTE) pItem->m_pZ; ! patch.blockData.wArtID = pItem->m_wArtID ? pItem->m_wArtID : (WORD) Main->m_pScripts->EvaluateDef(pItem->m_csBaseID); if ( patch.blockData.wArtID == 0 ) continue; *************** *** 977,981 **** else { ! if ( (WORD) Main->m_pScriptsA->EvaluateDef(pItem->m_csBaseID) == wArtID ) return false; } --- 977,981 ---- else { ! if ( (WORD) Main->m_pScripts->EvaluateDef(pItem->m_csBaseID) == wArtID ) return false; } *************** *** 994,998 **** else { ! if ( (WORD) Main->m_pScriptsA->EvaluateDef(pItem->m_csBaseID) == wArtID ) return true; } --- 994,998 ---- else { ! if ( (WORD) Main->m_pScripts->EvaluateDef(pItem->m_csBaseID) == wArtID ) return true; } *************** *** 1038,1056 **** void CStaticToolDlg::LoadWorldfile() { ! Main->m_pScriptsA->SetWorldItemFile(m_csWorldFile); ! if ( Main->m_pScriptsA->ReloadWorldItemFile() == 0 ) { // Populate the list with the information from the script module ! for ( int i = 0; i < (int) Main->m_pScriptsA->GetWorldItemCount(); i++ ) { CWorldItem * pItem = new CWorldItem; ! pItem->m_csBaseID = Main->m_pScriptsA->GetWorldItemDispID(i); ! pItem->m_dwFileOffset = i; // Use the offset value to store the index from the scripts module. pItem->m_bStaticFlag = false; ! pItem->m_csName = Main->m_pScriptsA->GetWorldItemName(i); ! pItem->m_dwAttr = Main->m_pScriptsA->GetWorldItemAttributes(i); ! pItem->m_dwItemType = Main->m_pScriptsA->GetWorldItemType(i); ! pItem->m_dwSerial = Main->m_pScriptsA->GetWorldItemUID(i); ! pItem->m_wColor = (WORD) Main->m_pScriptsA->EvaluateDef(Main->m_pScriptsA->GetWorldItemColor(i)); // Get the coords as well if ( m_pWorldItemList.IsEmpty() ) --- 1038,1056 ---- void CStaticToolDlg::LoadWorldfile() { ! Main->m_pScripts->SetWorldItemFile(m_csWorldFile); ! if ( Main->m_pScripts->ReloadWorldItemFile() == 0 ) { // Populate the list with the information from the script module ! for ( int i = 0; i < (int) Main->m_pScripts->GetWorldItemCount(); i++ ) { CWorldItem * pItem = new CWorldItem; ! pItem->m_csBaseID = Main->m_pScripts->GetWorldItemDispID(i); ! pItem->m_iScriptsIndex = i; pItem->m_bStaticFlag = false; ! pItem->m_csName = Main->m_pScripts->GetWorldItemName(i); ! pItem->m_dwAttr = Main->m_pScripts->GetWorldItemAttributes(i); ! pItem->m_dwItemType = Main->m_pScripts->GetWorldItemType(i); ! pItem->m_dwSerial = Main->m_pScripts->GetWorldItemUID(i); ! pItem->m_wColor = (WORD) Main->m_pScripts->EvaluateDef(Main->m_pScripts->GetWorldItemColor(i)); // Get the coords as well if ( m_pWorldItemList.IsEmpty() ) *************** *** 1573,1577 **** { // Load the name from the mulfiles. ! DWORD idx = Main->m_pScriptsA->EvaluateDef(pItem->m_csBaseID); if ( idx != 0 ) { --- 1573,1577 ---- { // Load the name from the mulfiles. ! DWORD idx = Main->m_pScripts->EvaluateDef(pItem->m_csBaseID); if ( idx != 0 ) { *************** *** 1913,1917 **** CWorldItem * pItem = (CWorldItem *) m_pWorldItemList.GetNext(pos); if ( pItem && pItem->m_bStaticFlag ) ! m_Preview.AddPreviewItem(pItem->m_wArtID ? pItem->m_wArtID : (WORD) Main->m_pScriptsA->EvaluateDef(pItem->m_csBaseID), pItem->m_pX, pItem->m_pY, pItem->m_pZ, pItem->m_wColor); } pos = m_pPatchItemList.GetHeadPosition(); --- 1913,1917 ---- CWorldItem * pItem = (CWorldItem *) m_pWorldItemList.GetNext(pos); if ( pItem &&... [truncated message content] |
Update of /cvsroot/sphere-axis/Axis In directory sc8-pr-cvs1:/tmp/cvs-serv17971 Modified Files: AdditionalSettingsDlg.cpp AdditionalSettingsDlg.h common.cpp common.h Drewsky.cpp Drewsky.h Drewsky.vcproj drewskyps.cpp editgraymapdlg.h flagsbrainstab.cpp itemgentab.cpp itemgentab.h MISCTAB.CPP remoteconnection.cpp remoteconnection.h RemoteConsole.cpp RemoteFileDlg.cpp RemoteFileDlg.h ScriptEditDlg.cpp serverconfigdlg.cpp settingstab.cpp SPAWNTAB.CPP SpellbookTweakDlg.cpp StaticToolDlg.h Stdafx.cpp STDAFX.H traveltab.cpp traveltab.h Log Message: Removing script object classes from Axis. Index: AdditionalSettingsDlg.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/AdditionalSettingsDlg.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** AdditionalSettingsDlg.cpp 23 May 2003 05:30:40 -0000 1.10 --- AdditionalSettingsDlg.cpp 11 Jun 2003 23:43:37 -0000 1.11 *************** *** 361,369 **** // Remote profile CString csKey = _T("SOFTWARE\\Menasoft\\GM Tools\\Remote Profiles\\") + csProfile.Mid(8); - CRemoteConnection remote(csProfile.Mid(8)); CStringArray csaSelectedScripts; Main->GetRegistryMultiSz(_T("Selected Scripts"), &csaSelectedScripts, HKEY_LOCAL_MACHINE, csKey); HTREEITEM hRoot = m_ctcScripts.InsertItem(_T("")); ! ParseRemoteDirectory(_T(".") , hRoot, &csaSelectedScripts, &remote); } } --- 361,368 ---- // Remote profile CString csKey = _T("SOFTWARE\\Menasoft\\GM Tools\\Remote Profiles\\") + csProfile.Mid(8); CStringArray csaSelectedScripts; Main->GetRegistryMultiSz(_T("Selected Scripts"), &csaSelectedScripts, HKEY_LOCAL_MACHINE, csKey); HTREEITEM hRoot = m_ctcScripts.InsertItem(_T("")); ! ParseRemoteDirectory(_T(".") , hRoot, &csaSelectedScripts); } } *************** *** 585,592 **** } ! void CAdditionalSettingsDlg::ParseRemoteDirectory(LPCTSTR pszPath, HTREEITEM hNode, CStringArray * pSelections, CRemoteConnection * pRemote) { CStringArray csaFiles, csaDirectories; ! pRemote->GetDirectory(pszPath, &csaFiles, &csaDirectories); int i; for ( i = 0; i <= csaDirectories.GetUpperBound(); i++ ) --- 584,591 ---- } ! void CAdditionalSettingsDlg::ParseRemoteDirectory(LPCTSTR pszPath, HTREEITEM hNode, CStringArray * pSelections) { CStringArray csaFiles, csaDirectories; ! Main->m_pAxisCOM->GetDirectoryList(pszPath, &csaFiles, &csaDirectories); int i; for ( i = 0; i <= csaDirectories.GetUpperBound(); i++ ) *************** *** 599,603 **** if ( csNewPath.Find(_T(".\\")) == 0 ) csNewPath = csNewPath.Mid(2); ! ParseRemoteDirectory(csNewPath, hBranch, pSelections, pRemote); } for ( i = 0; i <= csaFiles.GetUpperBound(); i++ ) --- 598,602 ---- if ( csNewPath.Find(_T(".\\")) == 0 ) csNewPath = csNewPath.Mid(2); ! ParseRemoteDirectory(csNewPath, hBranch, pSelections); } for ( i = 0; i <= csaFiles.GetUpperBound(); i++ ) Index: AdditionalSettingsDlg.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/AdditionalSettingsDlg.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** AdditionalSettingsDlg.h 23 May 2003 05:30:40 -0000 1.8 --- AdditionalSettingsDlg.h 11 Jun 2003 23:43:38 -0000 1.9 *************** *** 31,36 **** // - #include "RemoteConnection.h" - ///////////////////////////////////////////////////////////////////////////// // CAdditionalSettingsDlg dialog --- 31,34 ---- *************** *** 112,116 **** HICON m_hFolderIcon; void ParseDirectory(LPCTSTR pszPath, HTREEITEM hNode, CStringArray * pSelections); ! void ParseRemoteDirectory(LPCTSTR pszPath, HTREEITEM hNode, CStringArray * pSelections, CRemoteConnection * pRemote); bool IsSelected(CStringArray * pSelections, CString csFile); void UpdateProfile(); --- 110,114 ---- HICON m_hFolderIcon; void ParseDirectory(LPCTSTR pszPath, HTREEITEM hNode, CStringArray * pSelections); ! void ParseRemoteDirectory(LPCTSTR pszPath, HTREEITEM hNode, CStringArray * pSelections); bool IsSelected(CStringArray * pSelections, CString csFile); void UpdateProfile(); Index: common.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/common.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -r1.23 -r1.24 *** common.cpp 23 May 2003 05:30:40 -0000 1.23 --- common.cpp 11 Jun 2003 23:43:38 -0000 1.24 *************** *** 3,7 **** ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2002 * * This program is free software; you can redistribute it and/or modify --- 3,7 ---- ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify *************** *** 25,32 **** #include "stdafx.h" #include "common.h" ! #include "citem.h" ! #include "cnpc.h" ! #include "cscriptobjects.h" ! #include "remoteconnection.h" #include <direct.h> --- 25,29 ---- #include "stdafx.h" #include "common.h" ! #include "drewsky.h" #include <direct.h> *************** *** 583,587 **** }; ! CIntRange::CIntRange() { --- 580,584 ---- }; ! /* CIntRange::CIntRange() { *************** *** 1057,1060 **** --- 1054,1059 ---- } + */ + CMessage::CMessage() { *************** *** 1241,1244 **** --- 1240,1244 ---- } + /* CAccount::CAccount() { *************** *** 2640,2643 **** --- 2640,2645 ---- } + */ + int FindTable( const TCHAR * pFind, const TCHAR * const * ppTable, int iCount, int iElemSize ) { *************** *** 2677,2680 **** --- 2679,2683 ---- } + /* DWORD DefLookup(CString csValue) { *************** *** 2811,2814 **** --- 2814,2819 ---- } + */ + bool UpdateFiles(CString csNewFile, CString csOldFile, CString csRemoteFile, CString csRemoteKey) { *************** *** 2817,2820 **** --- 2822,2826 ---- if ( Main->GetProfileType() == PROFILE_REMOTE ) { + /* bStatus = ReplaceFiles( csNewFile, csRemoteFile ); if ( bStatus ) *************** *** 2824,2827 **** --- 2830,2834 ---- rc.SendCustomFile( csRemoteKey, csRemoteFile ); } + */ } else *************** *** 3011,3014 **** --- 3018,3022 ---- HINSTANCE hResInstance = NULL; + /* CString CStringVector::GetAt(int index) { *************** *** 3180,3182 **** return; ! } \ No newline at end of file --- 3188,3191 ---- return; ! } ! */ \ No newline at end of file Index: common.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/common.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** common.h 23 May 2003 05:30:40 -0000 1.14 --- common.h 11 Jun 2003 23:43:38 -0000 1.15 *************** *** 3,7 **** ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2002 * * This program is free software; you can redistribute it and/or modify --- 3,7 ---- ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify *************** *** 34,37 **** --- 34,41 ---- extern HINSTANCE hResInstance; + #ifndef MAX_BUFFER + #define MAX_BUFFER 4096 + #endif + #define GETNONWHITESPACE( pStr ) while ( pStr[0] == ' ' || pStr[0] == '\t' ) pStr ++; *************** *** 561,564 **** --- 565,569 ---- }; + /* class CScriptBase *************** *** 762,766 **** bool m_bNoIndex; }; ! class CMessage { --- 767,771 ---- bool m_bNoIndex; }; ! */ class CMessage { *************** *** 795,799 **** void Write( CFile * pFile ); }; ! class CTrigger : public CScriptBase { --- 800,804 ---- void Write( CFile * pFile ); }; ! /* class CTrigger : public CScriptBase { *************** *** 1006,1009 **** --- 1011,1015 ---- DWORD m_dwAge; }; + */ class CUOStaticItem *************** *** 1020,1035 **** --- 1026,1046 ---- }; + // Utility functions int parseRange(const TCHAR * pszStr, bool bMinMax); float fParseRange(const TCHAR * pszStr, bool bMinMax); + /* CCategory * FindCategory(CPtrList * pPtrList, CString csName, bool bCreate = true); CSubsection * FindSubsection(CCategory * pCategory, CString csName, bool bCreate = true); CCategorizedScriptBase * FindItem(CSubsection * pSubsection, CString csName, bool bCreate); + */ int FindTable( const TCHAR * pFind, const TCHAR * const * ppTable, int iCount, int iElemSize = sizeof(const TCHAR *)); DWORD ahextoi( const TCHAR * pszStr ); DWORD DefLookup(CString csValue); + /* CString NumToDef( DWORD dwID ); CString ItemLookup(CPtrList * pCategoryList, DWORD dwID); CString NPCLookup(CPtrList * pCategoryList, DWORD dwID); + */ bool UpdateFiles(CString csNewFile, CString csOldFile, CString csRemoteFile, CString csRemoteKey); bool IsDef(CString csValue); Index: Drewsky.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/Drewsky.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -r1.26 -r1.27 *** Drewsky.cpp 3 Jun 2003 16:43:12 -0000 1.26 --- Drewsky.cpp 11 Jun 2003 23:43:38 -0000 1.27 *************** *** 27,31 **** #include "stdafx.h" #include "resource.h" - #include "area.h" #include "drewsky.h" #include "DrewskyPS.h" --- 27,30 ---- *************** *** 208,212 **** { // Not a problem....just can't load scripts - m_pScriptsOld = NULL; } else --- 207,210 ---- *************** *** 410,415 **** CDrewskyApp::~CDrewskyApp() { - if ( m_pScriptsOld ) - delete m_pScriptsOld; delete m_pcppGeneralTab; delete m_pcppTravelTab; --- 408,411 ---- *************** *** 840,846 **** { m_config.Save(); - if ( m_pScriptsOld ) - delete m_pScriptsOld; - m_pScriptsOld = NULL; return CWinApp::ExitInstance(); } --- 836,839 ---- Index: Drewsky.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/Drewsky.h,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -r1.18 -r1.19 *** Drewsky.h 3 Jun 2003 16:43:12 -0000 1.18 --- Drewsky.h 11 Jun 2003 23:43:38 -0000 1.19 *************** *** 3,7 **** ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2002 * * This program is free software; you can redistribute it and/or modify --- 3,7 ---- ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify *************** *** 37,42 **** #include "resource.h" // main symbols - #include "CScriptObjects.h" // Added by ClassView - #include "GeneralTab.h" #include "TravelTab.h" --- 37,40 ---- *************** *** 52,56 **** #include "EditorTab.h" #include "CommandTab.h" - #include "RemoteConnection.h" #include "ChooseProfileDlg.h" #include "AxisLogDlg.h" --- 50,53 ---- *************** *** 91,95 **** void GetRegistryMultiSz(CString csValue, CStringArray * pStrings, HKEY hMainKey = HKEY_LOCAL_MACHINE, CString csSubKey = _T("SOFTWARE\\Menasoft\\GM Tools")); void SetDialogColors(); - CScriptObjects * m_pScriptsOld; bool FindInstance(); CDrewskyApp(); --- 88,91 ---- Index: Drewsky.vcproj =================================================================== RCS file: /cvsroot/sphere-axis/Axis/Drewsky.vcproj,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** Drewsky.vcproj 27 May 2003 04:26:30 -0000 1.3 --- Drewsky.vcproj 11 Jun 2003 23:43:38 -0000 1.4 *************** *** 282,291 **** </File> <File - RelativePath=".\AccountDlg.cpp"> - </File> - <File - RelativePath=".\AddDestination.cpp"> - </File> - <File RelativePath=".\AddServer.cpp"> </File> --- 282,285 ---- *************** *** 297,303 **** </File> <File - RelativePath=".\Area.cpp"> - </File> - <File RelativePath=".\AttrSelectionDlg.cpp"> </File> --- 291,294 ---- *************** *** 315,327 **** </File> <File - RelativePath=".\CItem.cpp"> - </File> - <File - RelativePath=".\CNPC.cpp"> - </File> - <File - RelativePath=".\CScriptObjects.cpp"> - </File> - <File RelativePath="CategoryTree.cpp"> </File> --- 306,309 ---- *************** *** 342,351 **** </File> <File - RelativePath=".\ConfigFile.cpp"> - </File> - <File - RelativePath=".\DefEditDlg.cpp"> - </File> - <File RelativePath=".\DrewskyPS.cpp"> </File> --- 324,327 ---- *************** *** 354,360 **** </File> <File - RelativePath=".\EditGraymapDlg.cpp"> - </File> - <File RelativePath=".\EditValue.cpp"> </File> --- 330,333 ---- *************** *** 375,387 **** </File> <File - RelativePath=".\ItemEditDlg.cpp"> - </File> - <File RelativePath=".\ItemGenTab.cpp"> </File> <File - RelativePath=".\ItemScriptEditDlg.cpp"> - </File> - <File RelativePath=".\ItemTweakTab.cpp"> </File> --- 348,354 ---- *************** *** 402,432 **** </File> <File - RelativePath=".\NPCEditDlg.cpp"> - </File> - <File - RelativePath=".\NameEditDlg.cpp"> - </File> - <File - RelativePath=".\NewScriptObjectDlg.cpp"> - </File> - <File - RelativePath=".\NotoTitleEditDlg.cpp"> - </File> - <File - RelativePath=".\OreEditDlg.cpp"> - </File> - <File RelativePath=".\PlayerTweakTab.cpp"> </File> <File - RelativePath=".\PotionEdit.cpp"> - </File> - <File - RelativePath="RegionSelectDlg.cpp"> - </File> - <File - RelativePath=".\RemoteConnection.cpp"> - </File> - <File RelativePath=".\RemoteConsole.cpp"> </File> --- 369,375 ---- *************** *** 468,486 **** </File> <File - RelativePath=".\SkillDef.cpp"> - </File> - <File - RelativePath=".\SkillEditDlg.cpp"> - </File> - <File - RelativePath=".\SkillMenuEditDlg.cpp"> - </File> - <File - RelativePath=".\SkillTableEditDlg.cpp"> - </File> - <File - RelativePath=".\SpawnGroupEditDlg.cpp"> - </File> - <File RelativePath=".\SpawnList.cpp"> </File> --- 411,414 ---- *************** *** 492,507 **** </File> <File - RelativePath=".\SpellDef.cpp"> - </File> - <File - RelativePath=".\SpellEditDlg.cpp"> - </File> - <File RelativePath=".\SpellbookTweakDlg.cpp"> </File> <File - RelativePath=".\StatRateEditDlg.cpp"> - </File> - <File RelativePath=".\StaticArtCriteriaDlg.cpp"> </File> --- 420,426 ---- *************** *** 546,558 **** </File> <File - RelativePath=".\TemplateEditDlg.cpp"> - </File> - <File RelativePath=".\TravelTab.cpp"> </File> <File - RelativePath=".\TriggerEditDlg.cpp"> - </File> - <File RelativePath=".\TypeSelectionDlg.cpp"> </File> --- 465,471 ---- *************** *** 564,570 **** </File> <File - RelativePath=".\WOPEditDlg.cpp"> - </File> - <File RelativePath=".\WeightedItemDlg.cpp"> </File> --- 477,480 ---- *************** *** 600,612 **** </File> <File - RelativePath="serverconfigdlg.cpp"> - </File> - <File RelativePath=".\settingstab.cpp"> </File> <File - RelativePath=".\tables.cpp"> - </File> - <File RelativePath=".\uoart.cpp"> </File> --- 510,516 ---- *************** *** 653,662 **** <File RelativePath=".\AxisLogDlg.h"> - </File> - <File - RelativePath=".\CItem.h"> - </File> - <File - RelativePath=".\CNPC.h"> </File> <File --- 557,560 ---- Index: drewskyps.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/drewskyps.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** drewskyps.cpp 3 Jun 2003 16:43:12 -0000 1.10 --- drewskyps.cpp 11 Jun 2003 23:43:38 -0000 1.11 *************** *** 26,30 **** #include "stdafx.h" - #include "area.h" #include "drewsky.h" #include "DrewskyPS.h" --- 26,29 ---- *************** *** 263,276 **** _tunlink( RMT_TRIGGER_FILE ); */ - if ( Main->GetProfileType() == PROFILE_NONE ) - return; - if ( Main->m_pScriptsOld ) - delete Main->m_pScriptsOld; - if ( Main->GetProfileType() != PROFILE_NONE ) - { - Main->m_pScriptsOld = new CScriptObjects; - Main->m_pScriptsOld->Unload(); - Main->m_pScriptsOld->LoadAll(); - } } void CDrewskyPS::OnMove(int x, int y) --- 262,265 ---- Index: editgraymapdlg.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/editgraymapdlg.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** editgraymapdlg.h 23 May 2003 05:30:37 -0000 1.5 --- editgraymapdlg.h 11 Jun 2003 23:43:38 -0000 1.6 *************** *** 3,7 **** ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2002 * * This program is free software; you can redistribute it and/or modify --- 3,7 ---- ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify Index: flagsbrainstab.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/flagsbrainstab.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** flagsbrainstab.cpp 29 May 2003 21:23:12 -0000 1.11 --- flagsbrainstab.cpp 11 Jun 2003 23:43:38 -0000 1.12 *************** *** 3,7 **** ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2002 * * This program is free software; you can redistribute it and/or modify --- 3,7 ---- ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify *************** *** 28,32 **** #include "drewsky.h" #include "FlagsBrainsTab.h" - #include "RemoteConnection.h" #include "SpawnMessageDlg.h" --- 28,31 ---- Index: itemgentab.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/itemgentab.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -r1.21 -r1.22 *** itemgentab.cpp 5 Jun 2003 14:49:54 -0000 1.21 --- itemgentab.cpp 11 Jun 2003 23:43:38 -0000 1.22 *************** *** 31,38 **** #include "SpawnMessageDlg.h" #include "FileReadProgress.h" - #include "ItemEditDlg.h" - #include "RemoteConnection.h" - #include "DefEditDlg.h" - #include "TemplateEditDlg.h" #include "SearchCritDlg.h" --- 31,34 ---- *************** *** 246,269 **** } int iSelIndex = this->m_clcItems.GetNextItem(-1, LVNI_SELECTED); - CDisplayedScriptBase * pObject = (CDisplayedScriptBase *) this->m_clcItems.GetItemData(iSelIndex); - if ( pObject ) - { - if ( pObject->m_bType == TYPE_ITEM ) - { - CItem item; - item.CopyBase(pObject); - item.Load(); - if ( item.m_csDef != _T("") ) - csValue = item.m_csDef; - } - else if ( pObject->m_bType == TYPE_TEMPLATE ) - { - CTemplate tpl; - tpl.CopyBase(pObject); - tpl.Load(); - if ( tpl.m_csDef != _T("") ) - csValue = tpl.m_csDef; - } - } int iAmount, iMinTime, iMaxTime, iMaxDist; --- 242,245 ---- *************** *** 533,539 **** return; } - CDisplayedScriptBase * pObject = (CDisplayedScriptBase *) this->m_clcItems.GetItemData(iSelIndex); - if ( !pObject ) - return; this->OnCreate(); --- 509,512 ---- Index: itemgentab.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/itemgentab.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** itemgentab.h 30 May 2003 20:06:12 -0000 1.8 --- itemgentab.h 11 Jun 2003 23:43:38 -0000 1.9 *************** *** 50,54 **** void SelectTreeItem(CString csParent, CString csChild); void FillCategoryTree(); - bool SaveItem(CItem *); void ItemEditor(bool bEditContext); static int iIDSort; --- 50,53 ---- Index: MISCTAB.CPP =================================================================== RCS file: /cvsroot/sphere-axis/Axis/MISCTAB.CPP,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -r1.29 -r1.30 *** MISCTAB.CPP 30 May 2003 20:06:12 -0000 1.29 --- MISCTAB.CPP 11 Jun 2003 23:43:38 -0000 1.30 *************** *** 38,42 **** #include "drewsky.h" #include "MiscTab.h" - #include "RemoteConnection.h" #include "winsvc.h" --- 38,41 ---- *************** *** 972,979 **** Main->m_pLog->Add(locale->String(IDS_MISC_SPHERESTART)); if ( Main->GetProfileType() == PROFILE_REMOTE ) ! { ! CRemoteConnection remote; ! remote.StartTUS(); ! } else { --- 971,975 ---- Main->m_pLog->Add(locale->String(IDS_MISC_SPHERESTART)); if ( Main->GetProfileType() == PROFILE_REMOTE ) ! Main->m_pAxisCOM->StartRemoteServer(); else { Index: remoteconnection.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/remoteconnection.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -r1.21 -r1.22 *** remoteconnection.cpp 23 May 2003 05:30:37 -0000 1.21 --- remoteconnection.cpp 11 Jun 2003 23:43:38 -0000 1.22 *************** *** 3,7 **** ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2002 * * This program is free software; you can redistribute it and/or modify --- 3,7 ---- ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify Index: remoteconnection.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/remoteconnection.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** remoteconnection.h 23 May 2003 05:30:37 -0000 1.5 --- remoteconnection.h 11 Jun 2003 23:43:38 -0000 1.6 *************** *** 3,7 **** ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2002 * * This program is free software; you can redistribute it and/or modify --- 3,7 ---- ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify Index: RemoteConsole.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/RemoteConsole.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** RemoteConsole.cpp 23 May 2003 05:30:37 -0000 1.11 --- RemoteConsole.cpp 11 Jun 2003 23:43:38 -0000 1.12 *************** *** 3,7 **** ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2002 * * This program is free software; you can redistribute it and/or modify --- 3,7 ---- ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify *************** *** 25,30 **** #include "stdafx.h" #include "RemoteConsole.h" - #include "RemoteConnection.h" #include "RemoteConsoleLoginDlg.h" --- 25,30 ---- #include "stdafx.h" + #include "drewsky.h" #include "RemoteConsole.h" #include "RemoteConsoleLoginDlg.h" Index: RemoteFileDlg.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/RemoteFileDlg.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** RemoteFileDlg.cpp 23 May 2003 05:30:38 -0000 1.7 --- RemoteFileDlg.cpp 11 Jun 2003 23:43:38 -0000 1.8 *************** *** 123,128 **** //m_csFilename.Replace(_T("\\"), _T("_")); //m_csFilename.Replace(_T("."), _T("-")); ! CRemoteConnection remote; ! remote.GetCustomFile(m_csRemoteFile, m_csFilename); } --- 123,127 ---- //m_csFilename.Replace(_T("\\"), _T("_")); //m_csFilename.Replace(_T("."), _T("-")); ! Main->m_pAxisCOM->GetRemoteFile(m_csRemoteFile, m_csFilename); } *************** *** 147,152 **** { CStringArray m_filelist, m_dirlist; ! CRemoteConnection remote; ! remote.GetDirectory(m_csPath, &m_filelist, &m_dirlist); m_clcList.DeleteAllItems(); for ( int i = 0; i < m_filelist.GetSize(); i++ ) --- 146,150 ---- { CStringArray m_filelist, m_dirlist; ! Main->m_pAxisCOM->GetDirectoryList(m_csPath, &m_filelist, &m_dirlist); m_clcList.DeleteAllItems(); for ( int i = 0; i < m_filelist.GetSize(); i++ ) Index: RemoteFileDlg.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/RemoteFileDlg.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** RemoteFileDlg.h 23 May 2003 05:30:38 -0000 1.4 --- RemoteFileDlg.h 11 Jun 2003 23:43:38 -0000 1.5 *************** *** 25,30 **** #define AFX_REMOTEFILEDLG_H__E95857F2_7E8C_4C67_B5AE_C3A9B9D5AB9A__INCLUDED_ - #include "RemoteConnection.h" - #if _MSC_VER > 1000 #pragma once --- 25,28 ---- Index: ScriptEditDlg.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/ScriptEditDlg.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** ScriptEditDlg.cpp 23 May 2003 05:30:38 -0000 1.7 --- ScriptEditDlg.cpp 11 Jun 2003 23:43:38 -0000 1.8 *************** *** 209,214 **** if ( Main->GetProfileType() == PROFILE_REMOTE ) { ! CRemoteConnection remote; ! remote.SendCustomFile(m_csRemoteName, m_csFilename); CFile::Remove(m_csFilename); } --- 209,213 ---- if ( Main->GetProfileType() == PROFILE_REMOTE ) { ! Main->m_pAxisCOM->SendLocalFile(m_csFilename, m_csRemoteName); CFile::Remove(m_csFilename); } Index: serverconfigdlg.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/serverconfigdlg.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** serverconfigdlg.cpp 23 May 2003 05:30:38 -0000 1.6 --- serverconfigdlg.cpp 11 Jun 2003 23:43:38 -0000 1.7 *************** *** 29,33 **** #include "ServerConfigDlg.h" #include "AddServer.h" - #include "RemoteConnection.h" #include "RemoteConsole.h" #include "EditValue.h" --- 29,32 ---- Index: settingstab.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/settingstab.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -r1.27 -r1.28 *** settingstab.cpp 23 May 2003 05:30:38 -0000 1.27 --- settingstab.cpp 11 Jun 2003 23:43:39 -0000 1.28 *************** *** 30,34 **** #include "SettingsTab.h" #include "AboutDlg.h" - #include "ServerConfigDlg.h" #include "DrewskyPS.h" #include "RemoteProfileDlg.h" --- 30,33 ---- *************** *** 867,873 **** { // Reload the categories - Main->m_pScriptsOld->RecategorizeItems(); - Main->m_pScriptsOld->RecategorizeLocations(); - Main->m_pScriptsOld->RecategorizeNPCs(); } --- 866,869 ---- Index: SPAWNTAB.CPP =================================================================== RCS file: /cvsroot/sphere-axis/Axis/SPAWNTAB.CPP,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -r1.20 -r1.21 *** SPAWNTAB.CPP 5 Jun 2003 14:49:54 -0000 1.20 --- SPAWNTAB.CPP 11 Jun 2003 23:43:39 -0000 1.21 *************** *** 39,46 **** #include "FileReadProgress.h" #include "SpawnMessageDlg.h" - #include "tables.h" - #include "NPCEditDlg.h" - #include "RemoteConnection.h" - #include "SpawnGroupEditDlg.h" #include "SearchCritDlg.h" --- 39,42 ---- Index: SpellbookTweakDlg.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/SpellbookTweakDlg.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** SpellbookTweakDlg.cpp 30 May 2003 20:06:13 -0000 1.3 --- SpellbookTweakDlg.cpp 11 Jun 2003 23:43:39 -0000 1.4 *************** *** 28,32 **** #include "drewsky.h" #include "SpellbookTweakDlg.h" - #include "SpellDef.h" #include <windowsx.h> // required for GET_X_LPARAM, GET_Y_LPARAM) --- 28,31 ---- Index: StaticToolDlg.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/StaticToolDlg.h,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -r1.23 -r1.24 *** StaticToolDlg.h 23 May 2003 05:30:38 -0000 1.23 --- StaticToolDlg.h 11 Jun 2003 23:43:39 -0000 1.24 *************** *** 90,94 **** void UpdateMapRegions(); void FillItemListControl(); ! bool TestItem(CWorldItem * pItem); void UpdateCriteriaWindow(); void LoadWorldfile(); --- 90,94 ---- void UpdateMapRegions(); void FillItemListControl(); ! //bool TestItem(CWorldItem * pItem); void UpdateCriteriaWindow(); void LoadWorldfile(); Index: Stdafx.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/Stdafx.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** Stdafx.cpp 23 May 2003 05:30:38 -0000 1.11 --- Stdafx.cpp 11 Jun 2003 23:43:39 -0000 1.12 *************** *** 28,33 **** #include "stdafx.h" #include "drewsky.h" - #include "CNPC.h" - #include "RemoteConnection.h" #include "RemoteConsole.h" #include "FileReadProgress.h" --- 28,31 ---- *************** *** 66,69 **** --- 64,68 ---- } + /* void LoadSpellTable(HWND hWnd) { *************** *** 165,168 **** --- 164,168 ---- return 0; } + */ void DrawSpectrum(CStatic * bmp, WORD wColor) *************** *** 256,259 **** --- 256,260 ---- } + /* bool CScriptUpdate::Write() { *************** *** 307,314 **** bInObject = false; } - if ( !Main->m_pScriptsOld->m_bNewFormat && !bWritten && csLine.Find(_T("[")) == 0 && csLine > m_csValue ) - bPassedIndex = true; - else - bPassedIndex = false; if ( csLine.Find(m_csValue) == 0 || bPassedIndex ) { --- 308,311 ---- *************** *** 336,339 **** --- 333,337 ---- return bStatus; } + */ DWORD BlendColors(WORD wBaseColor, WORD wAppliedColor, bool bBlendMode) Index: STDAFX.H =================================================================== RCS file: /cvsroot/sphere-axis/Axis/STDAFX.H,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** STDAFX.H 23 May 2003 05:30:38 -0000 1.14 --- STDAFX.H 11 Jun 2003 23:43:39 -0000 1.15 *************** *** 3,7 **** ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2002 * * This program is free software; you can redistribute it and/or modify --- 3,7 ---- ********************************************************************** ! * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify *************** *** 397,402 **** --- 397,405 ---- extern CString NumToDef( DWORD dwID ); #define GETNONWHITESPACE( pStr ) while ( pStr[0] == ' ' || pStr[0] == '\t' ) pStr ++; + + /* extern CCategorizedScriptBase * FindItem(CSubsection * pSubsection, CString csName, bool bCreate = true); extern CCategorizedScriptBase * FindArea(CPtrList * pList, CString csName, bool bCreate = true); + */ extern CString Encrypt(CString csValue); extern CString EncryptUO(CString csValue); Index: traveltab.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/traveltab.cpp,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -r1.40 -r1.41 *** traveltab.cpp 5 Jun 2003 14:49:54 -0000 1.40 --- traveltab.cpp 11 Jun 2003 23:43:39 -0000 1.41 *************** *** 29,37 **** #include "FileReadProgress.h" #include "TravelTab.h" - #include "AddDestination.h" #include "WorldMapDlg.h" - #include "RemoteConnection.h" #include "SpawnList.h" - #include "EditGraymapDlg.h" #include "MapCoordinatesDlg.h" #include "SearchCritDlg.h" --- 29,34 ---- *************** *** 59,63 **** m_bWorldMapCreated = false; m_bWorldMapVisible = false; - m_pEditDlg = NULL; m_bColorsLoaded = false; m_crosshairIndex = -1; --- 56,59 ---- *************** *** 68,76 **** CTravelTab::~CTravelTab() { - if ( m_pEditDlg ) - { - m_pEditDlg->DestroyWindow(); - delete m_pEditDlg; - } Unload(); } --- 64,67 ---- *************** *** 875,879 **** Main->SetLayeredWindow(m_dlgWorldMap.GetSafeHwnd()); m_dlgWorldMap.m_pTravelTab = this; - m_dlgWorldMap.m_pMapEditor = m_pEditDlg; m_bWorldMapCreated = true; } --- 866,869 ---- *************** *** 932,936 **** void CTravelTab::Find(CString csString, int iCrit, bool bSelect, bool bPrevious) { - CCategorizedScriptBase * pSelection = NULL; if ( csString != _T("") ) { --- 922,925 ---- Index: traveltab.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/traveltab.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** traveltab.h 29 May 2003 21:23:12 -0000 1.14 --- traveltab.h 11 Jun 2003 23:43:39 -0000 1.15 *************** *** 30,34 **** #include "WorldMapDlg.h" // Added by ClassView #include "FileReadProgress.h" - #include "EditGraymapDlg.h" #include "CategoryTree.h" #include "afxwin.h" --- 30,33 ---- *************** *** 50,54 **** void LoadScripts(); void Unload(); - CEditGraymapDlg * m_pEditDlg; CStringArray m_csaLocalSpawns; void GetSpawnpoints(); --- 49,52 ---- |
Update of /cvsroot/sphere-axis/Axis/S_Sphere52 In directory sc8-pr-cvs1:/tmp/cvs-serv18944/S_Sphere52 Modified Files: NPC.cpp S_Sphere52.vcproj ScriptsMain.cpp ScriptsMain.h ScriptTables.cpp ScriptTables.h SkillRootMenu.h TObArray.cpp TObArray.h Log Message: no message Index: NPC.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/NPC.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** NPC.cpp 10 Jun 2003 22:57:19 -0000 1.4 --- NPC.cpp 11 Jun 2003 22:18:10 -0000 1.5 *************** *** 496,503 **** for ( int i = 0; i < (int) Main->m_pScripts->m_tables.m_spells.GetSize(); i++) { ! CTSpellDef * pSpell = (CTSpellDef *) Main->m_pScripts->m_tables.m_spells.GetAt(i); ! if ( !pSpell ) ! continue; ! if ( pSpell->m_csName.CompareNoCase(csValue) == 0 ) { iSpell = i; --- 496,504 ---- for ( int i = 0; i < (int) Main->m_pScripts->m_tables.m_spells.GetSize(); i++) { ! CScriptBase * pSpellBase = Main->m_pScripts->m_tables.m_spells[i]; ! CTSpellDef spell; ! spell.CopyBase(pSpellBase); ! spell.Load(Main->m_pScripts->m_tables.m_spells.m_csBaseName); ! if ( spell.m_csName.CompareNoCase(csValue) == 0 ) { iSpell = i; Index: S_Sphere52.vcproj =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/S_Sphere52.vcproj,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** S_Sphere52.vcproj 3 Jun 2003 21:28:49 -0000 1.4 --- S_Sphere52.vcproj 11 Jun 2003 22:18:10 -0000 1.5 *************** *** 38,46 **** Name="VCLinkerTool" IgnoreImportLibrary="TRUE" ! AdditionalDependencies="libxml2.lib comsvcs.lib ..\S_ScriptsBase\Debug\S_ScriptsBase.lib" ShowProgress="0" OutputFile="$(OutDir)/S_Sphere52.dll" LinkIncremental="2" ! AdditionalLibraryDirectories="../S_ScriptsBase/Debug" ModuleDefinitionFile=".\S_Sphere52.def" GenerateDebugInformation="TRUE" --- 38,46 ---- Name="VCLinkerTool" IgnoreImportLibrary="TRUE" ! AdditionalDependencies="libxml2.lib comsvcs.lib ../S_ScriptsBase/Debug\S_ScriptsBase.lib" ShowProgress="0" OutputFile="$(OutDir)/S_Sphere52.dll" LinkIncremental="2" ! AdditionalLibraryDirectories="" ModuleDefinitionFile=".\S_Sphere52.def" GenerateDebugInformation="TRUE" *************** *** 64,71 **** CommandLine="regsvr32 /s /c "$(TargetPath)""/> <Tool ! Name="VCPreBuildEventTool" ! CommandLine="copy ..\S_ScriptsBase\Debug\*.dll Debug"/> <Tool ! Name="VCPreLinkEventTool"/> <Tool Name="VCResourceCompilerTool" --- 64,71 ---- CommandLine="regsvr32 /s /c "$(TargetPath)""/> <Tool ! Name="VCPreBuildEventTool"/> <Tool ! Name="VCPreLinkEventTool" ! CommandLine="copy ..\S_ScriptsBase\Debug\*.dll debug"/> <Tool Name="VCResourceCompilerTool" Index: ScriptsMain.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/ScriptsMain.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** ScriptsMain.cpp 11 Jun 2003 14:24:11 -0000 1.12 --- ScriptsMain.cpp 11 Jun 2003 22:18:11 -0000 1.13 *************** *** 78,138 **** { LOG(locale->String(IDS_SCRIPTS_UNLOADING), locale->String(IDS_SCRIPTS_TSCRIPTS)); - for ( int i = 0; i < (int) m_aDefs.GetSize(); i++ ) - { - CDef * pDef = (CDef *) m_aDefs.GetAt(i); - if ( pDef ) - delete pDef; - } m_aDefs.RemoveAll(); UnloadItems(); [...1312 lines suppressed...] } *************** *** 3465,3475 **** void CScriptsMain::CleanWorlditems() { ! vector<CScriptBase *>::iterator p = m_vWorlditems.begin(); ! while ( p != m_vWorlditems.end() ) ! { ! delete *p; ! p++; ! } ! m_vWorlditems.erase(m_vWorlditems.begin(), m_vWorlditems.end()); } --- 3288,3292 ---- void CScriptsMain::CleanWorlditems() { ! m_aWorldItems.RemoveAll(); } Index: ScriptsMain.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/ScriptsMain.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** ScriptsMain.h 4 Jun 2003 21:47:17 -0000 1.6 --- ScriptsMain.h 11 Jun 2003 22:18:11 -0000 1.7 *************** *** 3,6 **** --- 3,8 ---- #include "ConfigFile.h" #include "ScriptProfile.h" + #include "Def.h" + #include "Location.h" #include "FileReadProgress.h" *************** *** 132,157 **** #define TEMPLATE2_INDEX_BASE 500000 ! CScriptArray m_aItems; ! CScriptArray m_aNPCs; ! CScriptArray m_aDefs; ! CScriptArray m_aTemplates; ! CScriptArray m_aTemplates2; CScriptTables m_tables; CPtrList m_olAreas; ! CScriptArray m_aLocations; ! CScriptArray m_aNames; ! CScriptArray m_aWebpages; ! CScriptArray m_aSpeechBlocks; ! CScriptArray m_aRegionTrigs; ! CScriptArray m_aRegionResources; ! CScriptArray m_aRegionTypes; ! CScriptArray m_aRegionResourceTypes; ! CScriptArray m_aPlotTrigs; ! CScriptArray m_aTriggers; ! vector<CScriptBase*> m_vSpawns; ! vector<CScriptBase*> m_vWorlditems; CConfigFile m_config; - vector<CScriptBase *> m_vTeleporters; - vector<CScriptBase *> m_vMoongates; CString m_sWorldItemFile; --- 134,159 ---- #define TEMPLATE2_INDEX_BASE 500000 ! CScriptArray<CDisplayedScriptBase*> m_aItems; ! CScriptArray<CDisplayedScriptBase*> m_aNPCs; ! CScriptArray<CDef*> m_aDefs; ! CScriptArray<CCategorizedScriptBase*> m_aTemplates; ! CScriptArray<CCategorizedScriptBase*> m_aTemplates2; CScriptTables m_tables; CPtrList m_olAreas; ! CScriptArray<CLocation*> m_aLocations; ! CScriptArray<CScriptBase*> m_aNames; ! CScriptArray<CScriptBase*> m_aWebpages; ! CScriptArray<CScriptBase*> m_aSpeechBlocks; ! CScriptArray<CScriptBase*> m_aRegionTrigs; ! CScriptArray<CScriptBase*> m_aRegionResources; ! CScriptArray<CScriptBase*> m_aRegionTypes; ! CScriptArray<CScriptBase*> m_aRegionResourceTypes; ! CScriptArray<CScriptBase*> m_aPlotTrigs; ! CScriptArray<CScriptBase*> m_aTriggers; ! CScriptArray<CScriptBase*>m_aSpawns; ! CScriptArray<CScriptBase*>m_aWorldItems; ! CScriptArray<CScriptBase*>m_aTeleporters; ! CScriptArray<CScriptBase*>m_aMoongates; CConfigFile m_config; CString m_sWorldItemFile; Index: ScriptTables.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/ScriptTables.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** ScriptTables.cpp 10 Jun 2003 22:57:19 -0000 1.3 --- ScriptTables.cpp 11 Jun 2003 22:18:11 -0000 1.4 *************** *** 224,228 **** CTSkillClass * pSkillClass = new (CTSkillClass); pSkillClass->Read(csfTables); ! this->m_skillClasses.SetAtGrow(iIndex, pSkillClass); } break; --- 224,228 ---- CTSkillClass * pSkillClass = new (CTSkillClass); pSkillClass->Read(csfTables); ! this->m_skillClasses.SetAt(iIndex, pSkillClass); } break; *************** *** 231,235 **** CTSkillDef * pSkill = new (CTSkillDef); pSkill->Read(csfTables); ! this->m_skills.SetAtGrow(iIndex, pSkill); } break; --- 231,235 ---- CTSkillDef * pSkill = new (CTSkillDef); pSkill->Read(csfTables); ! this->m_skills.SetAt(iIndex, pSkill); } break; *************** *** 238,242 **** CTPotionDef * pPotion = new (CTPotionDef); pPotion->Read(csfTables); ! this->m_potions.SetAtGrow(iIndex, pPotion); } break; --- 238,242 ---- CTPotionDef * pPotion = new (CTPotionDef); pPotion->Read(csfTables); ! this->m_potions.SetAt(iIndex, pPotion); } break; *************** *** 245,249 **** CTSpellDef * pSpell = new (CTSpellDef); pSpell->Read(csfTables); ! this->m_spells.SetAtGrow(iIndex, pSpell); } break; --- 245,249 ---- CTSpellDef * pSpell = new (CTSpellDef); pSpell->Read(csfTables); ! this->m_spells.SetAt(iIndex, pSpell); } break; *************** *** 253,257 **** pSpawn->m_iIndex = ahextoi(csIndex); pSpawn->Read(csfTables); ! this->m_spawns.SetAtGrow(ahextoi(csIndex) - 0x8000, (CScriptBase *) pSpawn); } break; --- 253,257 ---- pSpawn->m_iIndex = ahextoi(csIndex); pSpawn->Read(csfTables); ! this->m_spawns.SetAt(ahextoi(csIndex) - 0x8000, pSpawn); } break; *************** *** 311,315 **** for ( i = 0; i < (int) m_starts.GetSize(); i++ ) { ! CScriptBase * pObject = (CScriptBase *) m_starts.GetAt(i); if ( pObject ) pObject->Write(csfOutput); --- 311,315 ---- for ( i = 0; i < (int) m_starts.GetSize(); i++ ) { ! CScriptBase * pObject = m_starts[i]; if ( pObject ) pObject->Write(csfOutput); *************** *** 320,324 **** for ( i = 0; i < (int) m_ores.GetSize(); i++ ) { ! CScriptBase * pObject = (CScriptBase *) m_ores.GetAt(i); if ( pObject ) pObject->Write(csfOutput); --- 320,324 ---- for ( i = 0; i < (int) m_ores.GetSize(); i++ ) { ! CScriptBase * pObject = m_ores[i]; if ( pObject ) pObject->Write(csfOutput); *************** *** 339,390 **** { LOG(locale->String(IDS_SCRIPTS_UNLOADING), locale->String(IDS_SCRIPTS_TTABLES)); - for ( int i = 0; i < (int) this->m_ores.GetSize(); i++ ) - { - CTOreDef * pOre = (CTOreDef *) this->m_ores.GetAt(i); - if ( pOre ) - delete pOre; - } this->m_ores.RemoveAll(); - for ( i = 0; i < (int) this->m_skillClasses.GetSize(); i++ ) - { - CTSkillClass * pSkillclass = (CTSkillClass *) this->m_skillClasses.GetAt(i); - if ( pSkillclass ) - delete pSkillclass; - } this->m_skillClasses.RemoveAll(); - for ( i = 0; i < (int) this->m_skills.GetSize(); i++ ) - { - CTSkillDef * pSkill = (CTSkillDef *) this->m_skills.GetAt(i); - if ( pSkill ) - delete pSkill; - } this->m_skills.RemoveAll(); - for ( i = 0; i < (int) this->m_potions.GetSize(); i++ ) - { - CTPotionDef * pPotion = (CTPotionDef *) this->m_potions.GetAt(i); - if ( pPotion ) - delete pPotion; - } this->m_potions.RemoveAll(); - for ( i = 0; i < (int) this->m_spells.GetSize(); i++ ) - { - CTSpellDef * pSpell = (CTSpellDef *) this->m_spells.GetAt(i); - if ( pSpell ) - delete pSpell; - } this->m_spells.RemoveAll(); - for ( i = 0; i < (int) this->m_spawns.GetSize(); i++ ) - { - CCategorizedScriptBase * pSpawn = (CCategorizedScriptBase *) this->m_spawns.GetAt(i); - if ( pSpawn ) - delete pSpawn; - } this->m_spawns.RemoveAll(); - for ( i = 0; i < (int) this->m_starts.GetSize(); i++ ) - { - CTStartLocation * pStart = (CTStartLocation * ) this->m_starts.GetAt(i); - if ( pStart ) - delete pStart; - } this->m_starts.RemoveAll(); this->m_blockEmail.RemoveAll(); --- 339,348 ---- *************** *** 392,396 **** this->m_notoTitles.RemoveAll(); this->m_obscene.RemoveAll(); ! for ( i = 0; i < 6; i++ ) this->m_pLevel[i].RemoveAll(); this->m_runes.RemoveAll(); --- 350,354 ---- this->m_notoTitles.RemoveAll(); this->m_obscene.RemoveAll(); ! for ( int i = 0; i < 6; i++ ) this->m_pLevel[i].RemoveAll(); this->m_runes.RemoveAll(); Index: ScriptTables.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/ScriptTables.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** ScriptTables.h 23 May 2003 05:46:54 -0000 1.2 --- ScriptTables.h 11 Jun 2003 22:18:11 -0000 1.3 *************** *** 20,31 **** CStringBlock m_Speech;; CAdvanceDef m_statAdvance[3]; ! CScriptArray m_starts; CStringBlock m_runes; ! CScriptArray m_ores; ! CTObArray m_skillClasses; ! CTObArray m_skills; ! CTObArray m_potions; ! CTObArray m_spells; ! CTObArray m_spawns; CStringBlock m_notoTitles; CStringBlock m_Sphere; --- 20,31 ---- CStringBlock m_Speech;; CAdvanceDef m_statAdvance[3]; ! CScriptArray<CScriptBase*> m_starts; CStringBlock m_runes; ! CScriptArray<CScriptBase*> m_ores; ! CTObArray<CScriptBase*> m_skillClasses; ! CTObArray<CScriptBase*> m_skills; ! CTObArray<CScriptBase*> m_potions; ! CTObArray<CScriptBase*> m_spells; ! CTObArray<CCategorizedScriptBase*> m_spawns; CStringBlock m_notoTitles; CStringBlock m_Sphere; Index: SkillRootMenu.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/SkillRootMenu.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** SkillRootMenu.h 23 May 2003 05:46:54 -0000 1.2 --- SkillRootMenu.h 11 Jun 2003 22:18:11 -0000 1.3 *************** *** 6,10 **** { public: ! CScriptArray m_oSubmenus; ~CSkillRootMenu(); }; --- 6,10 ---- { public: ! CScriptArray<CScriptBase*> m_oSubmenus; ~CSkillRootMenu(); }; Index: TObArray.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/TObArray.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** TObArray.cpp 10 Jun 2003 22:57:20 -0000 1.3 --- TObArray.cpp 11 Jun 2003 22:18:11 -0000 1.4 *************** *** 2,34 **** #include "tobarray.h" - CTObArray::CTObArray() - { - m_bHexIndex = false; - m_dwIndexOffset = 0; - } - - CTObArray::~CTObArray() - { - this->RemoveAll(); - } - - bool CTObArray::Write(CStdioFile &csfOutput) - { - CString csLine; - for ( int i = 0; i < (int) this->GetSize(); i++ ) - { - CScriptBase * pObject = (CScriptBase *) this->GetAt(i); - if ( pObject ) - { - CString csLine; - if ( m_bHexIndex ) - csLine.Format(_T("[%s %4x]\n"), m_csBaseName, i + m_dwIndexOffset); - else - csLine.Format(_T("[%s %ld]\n"), m_csBaseName, i + m_dwIndexOffset); - csfOutput.WriteString(csLine); - pObject->Write(csfOutput); - csfOutput.WriteString(_T("\n")); - } - } - return true; - } \ No newline at end of file --- 2,3 ---- Index: TObArray.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/TObArray.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** TObArray.h 23 May 2003 05:46:54 -0000 1.2 --- TObArray.h 11 Jun 2003 22:18:11 -0000 1.3 *************** *** 2,7 **** #include "stdafx.h" ! class CTObArray : ! public CScriptArray { public: --- 2,7 ---- #include "stdafx.h" ! template <class ScriptPtrType> class CTObArray : ! public CScriptArray<ScriptPtrType> { public: *************** *** 14,15 **** --- 14,49 ---- DWORD m_dwIndexOffset; }; + + // Method definitions + + template <class ScriptPtrType> CTObArray<ScriptPtrType>::CTObArray() + { + m_bHexIndex = false; + m_dwIndexOffset = 0; + } + + template <class ScriptPtrType> CTObArray<ScriptPtrType>::~CTObArray() + { + this->RemoveAll(); + } + + template <class ScriptPtrType> bool CTObArray<ScriptPtrType>::Write(CStdioFile &csfOutput) + { + CString csLine; + for ( int i = 0; i < (int) this->GetSize(); i++ ) + { + CScriptBase * pObject = this->GetAt(i); + if ( pObject ) + { + CString csLine; + if ( m_bHexIndex ) + csLine.Format(_T("[%s %4x]\n"), m_csBaseName, i + m_dwIndexOffset); + else + csLine.Format(_T("[%s %ld]\n"), m_csBaseName, i + m_dwIndexOffset); + csfOutput.WriteString(csLine); + pObject->Write(csfOutput); + csfOutput.WriteString(_T("\n")); + } + } + return true; + } \ No newline at end of file |
From: Philip E. <pes...@us...> - 2003-06-11 22:18:16
|
Update of /cvsroot/sphere-axis/Axis/S_ScriptsBase In directory sc8-pr-cvs1:/tmp/cvs-serv18944/S_ScriptsBase Modified Files: ScriptArray.cpp ScriptArray.h Log Message: no message Index: ScriptArray.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_ScriptsBase/ScriptArray.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** ScriptArray.cpp 11 Jun 2003 14:24:11 -0000 1.4 --- ScriptArray.cpp 11 Jun 2003 22:18:11 -0000 1.5 *************** *** 2,161 **** #include "scriptarray.h" - CScriptArray::CScriptArray() - { - } - - CScriptArray::~CScriptArray() - { - this->RemoveAll(); - } - - int CScriptArray::Insert(CScriptBase * pScript) - { - if ( pScript->m_csValue == _T("") ) - { - delete pScript; - return -1; - } - if ( GetUpperBound() == -1 ) - return InsertAt(0, pScript); - int iLower = 0; - int iUpper = (int) GetUpperBound(); - int iIndex = 0; - int iCompare = 0; - while ( iLower <= iUpper ) - { - iIndex = (iUpper + iLower ) / 2; - CScriptBase * pTest = m_members[iIndex]; - if ( pTest > pScript ) - { - iCompare = 0; - iUpper = iIndex - 1; - } - else - { - iCompare = 1; - iLower = iIndex + 1; - } - } - iIndex += iCompare; - return InsertAt(iIndex, pScript); - } - - int CScriptArray::Find(CString csName) - { - if ( m_members.empty() ) - return -1; - int iLower = 0; - int iUpper = (int) this->GetUpperBound(); - int iIndex = 0; - while ( iLower <= iUpper ) - { - iIndex = (iUpper + iLower ) / 2; - CScriptBase * pTest = m_members[iIndex]; - if ( pTest->m_csValue.CompareNoCase(csName) == 0 ) - return iIndex; - if ( pTest->m_csValue.CompareNoCase(csName) > 0 ) - iUpper = iIndex - 1; - else - iLower = iIndex + 1; - } - return -1; - } - - void CScriptArray::Remove(CScriptBase * pScript) - { - int iIndex = this->Find(pScript->m_csValue); - if ( iIndex != -1 ) - { - vector<CScriptBase*>::iterator p = m_members.begin(); - p+= iIndex; - if ( p != m_members.end() && *p != NULL ) - delete *p; - m_members.erase(p); - } - } - - void CScriptArray::RemoveAll() - { - for ( int i = 0; i < (int) GetUpperBound(); i++ ) - RemoveAt(i); - m_members.clear(); - } - - CScriptBase * CScriptArray::Get(CString csName) - { - int iIndex = Find(csName); - if ( iIndex != -1 ) - return GetAt(iIndex); - else - { - // Try to look this up as a def - DWORD dwDef = DefLookup(csName); - if ( dwDef != 0 ) - { - CString csDef; - csDef.Format(_T("%04x"), dwDef); - iIndex = Find(csDef); - if ( iIndex == -1 ) - { - csDef.Format(_T("0%04x"), dwDef); - iIndex = Find(csDef); - } - if ( iIndex != -1 ) - return GetAt(iIndex); - } - } - return NULL; - } - - int CScriptArray::InsertAt(int index, CScriptBase * pScript) - { - if ( index > (int) GetUpperBound() ) - m_members.resize(index + 1, NULL); - vector<CScriptBase*>::iterator p = m_members.begin(); - p += index; - - if ( index == (int) GetUpperBound() ) - *p = pScript; - else - m_members.insert(p, pScript); - return index; - } - - CScriptBase * CScriptArray::GetAt(int index) - { - if ( index > (int) GetUpperBound() ) - return NULL; - else - return m_members[index]; - } - - int CScriptArray::SetAtGrow(int index, CScriptBase * pScript) - { - if ( index > (int) GetUpperBound() ) - m_members.resize(index + 1, NULL); - vector<CScriptBase*>::iterator p = m_members.begin(); - p += index; - if ( p != m_members.end() && *p != NULL ) - { - delete *p; - m_members.erase(p); - } - if ( index == (int) GetUpperBound() ) - *p = pScript; - else - m_members.insert(p, pScript); - return index; - } - - void CScriptArray::RemoveAt(int index) - { - if ( index > (int) GetUpperBound() ) - return; - vector<CScriptBase*>::iterator p = m_members.begin(); - p+= index; - if ( *p != NULL ) - delete *p; - *p = NULL; - } \ No newline at end of file --- 2,3 ---- Index: ScriptArray.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_ScriptsBase/ScriptArray.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** ScriptArray.h 10 Jun 2003 22:57:20 -0000 1.3 --- ScriptArray.h 11 Jun 2003 22:18:12 -0000 1.4 *************** *** 7,30 **** using namespace std; ! class __declspec(dllexport) CScriptArray : public CScriptBase { public: CScriptArray(); ~CScriptArray(); ! int Insert(CScriptBase * pScript); ! int InsertAt(int index, CScriptBase * pScript); int Find(CString csName); ! void Remove(CScriptBase * pScript); void RemoveAll(); void RemoveAt(int index); ! int Add(CScriptBase * pScript) { return Insert(pScript); } ! int SetAtGrow(int index, CScriptBase * pScript); ! int SetAt(int index, CScriptBase * pScript) { return SetAtGrow(index, pScript); } size_t GetSize() { return m_members.size(); } size_t GetCount() { return GetSize(); } ! CScriptBase * GetAt(int index); ! CScriptBase * Get(CString csName); size_t GetUpperBound() { return m_members.size() - 1; } protected: ! vector <CScriptBase*> m_members; ! }; \ No newline at end of file --- 7,188 ---- using namespace std; ! template <class ScriptPtrType> class __declspec(dllexport) CScriptArray : public CScriptBase { public: CScriptArray(); ~CScriptArray(); ! int Insert(ScriptPtrType pScript); ! int InsertAt(int index, ScriptPtrType pScript); int Find(CString csName); ! void Remove(ScriptPtrType pScript); void RemoveAll(); void RemoveAt(int index); ! int Add(ScriptPtrType pScript) { return Insert(pScript); } ! int SetAt(int index, ScriptPtrType pScript); size_t GetSize() { return m_members.size(); } size_t GetCount() { return GetSize(); } ! ScriptPtrType GetAt(int index); ! ScriptPtrType Get(CString csName); size_t GetUpperBound() { return m_members.size() - 1; } + + ScriptPtrType operator[](int i) { return m_members[i]; } protected: ! vector <ScriptPtrType> m_members; ! }; ! ! // Since we can't export templates from a DLL, we have to put this crap in the header. ! ! template <class ScriptPtrType> CScriptArray<ScriptPtrType>::CScriptArray() ! { ! } ! ! template <class ScriptPtrType> CScriptArray<ScriptPtrType>::~CScriptArray() ! { ! this->RemoveAll(); ! } ! ! template <class ScriptPtrType> int CScriptArray<ScriptPtrType>::Insert(ScriptPtrType pScript) ! { ! if ( pScript->m_csValue == _T("") ) ! { ! delete pScript; ! return -1; ! } ! if ( GetUpperBound() == -1 ) ! return InsertAt(0, pScript); ! int iLower = 0; ! int iUpper = (int) GetUpperBound(); ! int iIndex = 0; ! int iCompare = 0; ! while ( iLower <= iUpper ) ! { ! iIndex = (iUpper + iLower ) / 2; ! ScriptPtrType pTest = (ScriptPtrType) m_members[iIndex]; ! if ( pTest > pScript ) ! { ! iCompare = 0; ! iUpper = iIndex - 1; ! } ! else ! { ! iCompare = 1; ! iLower = iIndex + 1; ! } ! } ! iIndex += iCompare; ! return InsertAt(iIndex, pScript); ! } ! ! template <class ScriptPtrType> int CScriptArray<ScriptPtrType>::Find(CString csName) ! { ! if ( m_members.empty() ) ! return -1; ! int iLower = 0; ! int iUpper = (int) this->GetUpperBound(); ! int iIndex = 0; ! while ( iLower <= iUpper ) ! { ! iIndex = (iUpper + iLower ) / 2; ! ScriptPtrType pTest = (ScriptPtrType) m_members[iIndex]; ! if ( pTest->m_csValue.CompareNoCase(csName) == 0 ) ! return iIndex; ! if ( pTest->m_csValue.CompareNoCase(csName) > 0 ) ! iUpper = iIndex - 1; ! else ! iLower = iIndex + 1; ! } ! return -1; ! } ! ! template <class ScriptPtrType> void CScriptArray<ScriptPtrType>::Remove(ScriptPtrType pScript) ! { ! vector<ScriptPtrType>::iterator p = m_members.find(m_members.begin(), m_members.end(), pScript); ! if ( p != m_members.end() ) ! { ! delete *p; ! m_members.erase(p); ! } ! } ! ! template <class ScriptPtrType> void CScriptArray<ScriptPtrType>::RemoveAll() ! { ! vector<ScriptPtrType>::iterator p = m_members.begin(); ! while ( p != m_members.end() ) ! { ! delete *p; ! p++; ! } ! m_members.erase(m_members.begin(), m_members.end()); ! } ! ! template <class ScriptPtrType> ScriptPtrType CScriptArray<ScriptPtrType>::Get(CString csName) ! { ! int iIndex = Find(csName); ! if ( iIndex != -1 ) ! return GetAt(iIndex); ! else ! { ! // Try to look this up as a def ! DWORD dwDef = DefLookup(csName); ! if ( dwDef != 0 ) ! { ! CString csDef; ! csDef.Format(_T("%04x"), dwDef); ! iIndex = Find(csDef); ! if ( iIndex == -1 ) ! { ! csDef.Format(_T("0%04x"), dwDef); ! iIndex = Find(csDef); ! } ! if ( iIndex != -1 ) ! return GetAt(iIndex); ! } ! } ! return NULL; ! } ! ! template <class ScriptPtrType> int CScriptArray<ScriptPtrType>::InsertAt(int index, ScriptPtrType pScript) ! { ! if ( index < 0 ) ! return Insert(pScript); ! if ( index > (int) GetUpperBound() ) ! m_members.resize(index, NULL); ! vector<ScriptPtrType>::iterator p = m_members.begin(); ! p += index; ! ! if ( index == (int) GetUpperBound() ) ! m_members.push_back(pScript); ! else ! m_members.insert(p, pScript); ! return index; ! } ! ! template <class ScriptPtrType> int CScriptArray<ScriptPtrType>::SetAt(int index, ScriptPtrType pScript) ! { ! if ( index < 0 ) ! return Insert(pScript); ! if ( index > (int) GetUpperBound() ) ! return InsertAt(index, pScript); ! if ( m_members[index] != NULL ) ! delete m_members[index]; ! m_members[index] = pScript; ! return index; ! } ! ! template <class ScriptPtrType> ScriptPtrType CScriptArray<ScriptPtrType>::GetAt(int index) ! { ! if ( index < 0 || index > (int) GetUpperBound() ) ! return NULL; ! else ! return m_members[index]; ! } ! ! template <class ScriptPtrType> void CScriptArray<ScriptPtrType>::RemoveAt(int index) ! { ! if ( index < 0 || index > (int) GetUpperBound() ) ! return; ! vector<ScriptPtrType>::iterator p = m_members.begin(); ! p+= index; ! delete *p; ! m_members.erase(p); ! } |
From: Philip E. <pes...@us...> - 2003-06-11 14:24:17
|
Update of /cvsroot/sphere-axis/Axis/S_ScriptsBase In directory sc8-pr-cvs1:/tmp/cvs-serv13074/S_ScriptsBase Modified Files: ScriptArray.cpp Log Message: no message Index: ScriptArray.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_ScriptsBase/ScriptArray.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** ScriptArray.cpp 10 Jun 2003 22:57:20 -0000 1.3 --- ScriptArray.cpp 11 Jun 2003 14:24:11 -0000 1.4 *************** *** 71,75 **** vector<CScriptBase*>::iterator p = m_members.begin(); p+= iIndex; ! if ( *p != NULL ) delete *p; m_members.erase(p); --- 71,75 ---- vector<CScriptBase*>::iterator p = m_members.begin(); p+= iIndex; ! if ( p != m_members.end() && *p != NULL ) delete *p; m_members.erase(p); *************** *** 79,89 **** void CScriptArray::RemoveAll() { ! while ( !m_members.empty() ) ! { ! vector<CScriptBase*>::iterator p = m_members.begin(); ! if ( *p != NULL ) ! delete *p; ! m_members.erase(p); ! } m_members.clear(); } --- 79,84 ---- void CScriptArray::RemoveAll() { ! for ( int i = 0; i < (int) GetUpperBound(); i++ ) ! RemoveAt(i); m_members.clear(); } *************** *** 118,126 **** { if ( index > (int) GetUpperBound() ) ! m_members.resize(index, NULL); vector<CScriptBase*>::iterator p = m_members.begin(); p += index; ! m_members.insert(p, pScript); return index; } --- 113,124 ---- { if ( index > (int) GetUpperBound() ) ! m_members.resize(index + 1, NULL); vector<CScriptBase*>::iterator p = m_members.begin(); p += index; ! if ( index == (int) GetUpperBound() ) ! *p = pScript; ! else ! m_members.insert(p, pScript); return index; } *************** *** 137,146 **** { if ( index > (int) GetUpperBound() ) ! m_members.resize(index, NULL); vector<CScriptBase*>::iterator p = m_members.begin(); p += index; ! if ( *p != NULL ) delete *p; ! *p = pScript; return index; } --- 135,150 ---- { if ( index > (int) GetUpperBound() ) ! m_members.resize(index + 1, NULL); vector<CScriptBase*>::iterator p = m_members.begin(); p += index; ! if ( p != m_members.end() && *p != NULL ) ! { delete *p; ! m_members.erase(p); ! } ! if ( index == (int) GetUpperBound() ) ! *p = pScript; ! else ! m_members.insert(p, pScript); return index; } |
From: Philip E. <pes...@us...> - 2003-06-11 14:24:16
|
Update of /cvsroot/sphere-axis/Axis/S_Sphere52 In directory sc8-pr-cvs1:/tmp/cvs-serv13074/S_Sphere52 Modified Files: ScriptsMain.cpp Log Message: no message Index: ScriptsMain.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/ScriptsMain.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** ScriptsMain.cpp 10 Jun 2003 22:57:19 -0000 1.11 --- ScriptsMain.cpp 11 Jun 2003 14:24:11 -0000 1.12 *************** *** 1247,1287 **** { case 0: ! { ! if ( (int) m_aPlotTrigs.GetUpperBound() < index ) ! m_aPlotTrigs.SetAtGrow(index, pTable); ! else ! { ! CStringBlock * pOldTable = (CStringBlock *) m_aPlotTrigs.GetAt(index); ! if ( pOldTable ) ! delete pOldTable; ! m_aPlotTrigs.SetAt(index, pTable); ! } ! } break; case 1: ! { ! if ( (int) m_aRegionTrigs.GetUpperBound() < index ) ! m_aRegionTrigs.SetAtGrow(index, pTable); ! else ! { ! CStringBlock * pOldTable = (CStringBlock *) m_aRegionTrigs.GetAt(index); ! if ( pOldTable ) ! delete pOldTable; ! m_aRegionTrigs.SetAt(index, pTable); ! } ! } break; case 2: ! { ! if ( (int) m_aTriggers.GetUpperBound() < index ) ! m_aTriggers.SetAtGrow(index, pTable); ! else ! { ! CStringBlock * pOldTable = (CStringBlock *) m_aTriggers.GetAt(index); ! if ( pOldTable ) ! delete pOldTable; ! m_aTriggers.SetAt(index, pTable); ! } ! } break; default: --- 1247,1257 ---- { case 0: ! m_aPlotTrigs.SetAt(index, pTable); break; case 1: ! m_aRegionTrigs.SetAt(index, pTable); break; case 2: ! m_aTriggers.SetAt(index, pTable); break; default: |
From: Philip E. <pes...@us...> - 2003-06-10 22:57:24
|
Update of /cvsroot/sphere-axis/Axis/S_ScriptsBase In directory sc8-pr-cvs1:/tmp/cvs-serv17039/S_ScriptsBase Modified Files: ScriptArray.cpp ScriptArray.h ScriptBase.cpp ScriptBase.h StringVector.cpp Log Message: no message Index: ScriptArray.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_ScriptsBase/ScriptArray.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** ScriptArray.cpp 23 May 2003 05:46:26 -0000 1.2 --- ScriptArray.cpp 10 Jun 2003 22:57:20 -0000 1.3 *************** *** 18,28 **** return -1; } int iLower = 0; ! int iUpper = (int) this->GetUpperBound(); ! if ( iUpper == -1 ) ! { ! this->InsertAt(0, pScript); ! return 0; ! } int iIndex = 0; int iCompare = 0; --- 18,25 ---- return -1; } + if ( GetUpperBound() == -1 ) + return InsertAt(0, pScript); int iLower = 0; ! int iUpper = (int) GetUpperBound(); int iIndex = 0; int iCompare = 0; *************** *** 30,35 **** { iIndex = (iUpper + iLower ) / 2; ! CCategorizedScriptBase * pTest = (CCategorizedScriptBase *) this->GetAt(iIndex); ! if ( pTest->m_csValue.CompareNoCase(pScript->m_csValue) > 0 ) { iCompare = 0; --- 27,32 ---- { iIndex = (iUpper + iLower ) / 2; ! CScriptBase * pTest = m_members[iIndex]; ! if ( pTest > pScript ) { iCompare = 0; *************** *** 43,53 **** } iIndex += iCompare; ! this->InsertAt(iIndex, (void *) pScript); ! return iIndex; } int CScriptArray::Find(CString csName) { ! if ( this->GetSize() == 0 ) return -1; int iLower = 0; --- 40,49 ---- } iIndex += iCompare; ! return InsertAt(iIndex, pScript); } int CScriptArray::Find(CString csName) { ! if ( m_members.empty() ) return -1; int iLower = 0; *************** *** 57,65 **** { iIndex = (iUpper + iLower ) / 2; ! CCategorizedScriptBase * pTest = (CCategorizedScriptBase *) this->GetAt(iIndex); ! CString csExisting = pTest->m_csValue; ! if ( csExisting.CompareNoCase(csName) == 0 ) return iIndex; ! if ( csExisting.CompareNoCase(csName) > 0 ) iUpper = iIndex - 1; else --- 53,60 ---- { iIndex = (iUpper + iLower ) / 2; ! CScriptBase * pTest = m_members[iIndex]; ! if ( pTest->m_csValue.CompareNoCase(csName) == 0 ) return iIndex; ! if ( pTest->m_csValue.CompareNoCase(csName) > 0 ) iUpper = iIndex - 1; else *************** *** 74,80 **** if ( iIndex != -1 ) { ! RemoveAt(iIndex); ! delete pScript; ! this->FreeExtra(); } } --- 69,77 ---- if ( iIndex != -1 ) { ! vector<CScriptBase*>::iterator p = m_members.begin(); ! p+= iIndex; ! if ( *p != NULL ) ! delete *p; ! m_members.erase(p); } } *************** *** 82,86 **** void CScriptArray::RemoveAll() { ! CPtrArray::RemoveAll(); } --- 79,90 ---- void CScriptArray::RemoveAll() { ! while ( !m_members.empty() ) ! { ! vector<CScriptBase*>::iterator p = m_members.begin(); ! if ( *p != NULL ) ! delete *p; ! m_members.erase(p); ! } ! m_members.clear(); } *************** *** 89,93 **** int iIndex = Find(csName); if ( iIndex != -1 ) ! return (CScriptBase *) GetAt(iIndex); else { --- 93,97 ---- int iIndex = Find(csName); if ( iIndex != -1 ) ! return GetAt(iIndex); else { *************** *** 105,112 **** } if ( iIndex != -1 ) ! return (CScriptBase *) GetAt(iIndex); } } return NULL; } --- 109,157 ---- } if ( iIndex != -1 ) ! return GetAt(iIndex); } } return NULL; + } + + int CScriptArray::InsertAt(int index, CScriptBase * pScript) + { + if ( index > (int) GetUpperBound() ) + m_members.resize(index, NULL); + vector<CScriptBase*>::iterator p = m_members.begin(); + p += index; + + m_members.insert(p, pScript); + return index; + } + + CScriptBase * CScriptArray::GetAt(int index) + { + if ( index > (int) GetUpperBound() ) + return NULL; + else + return m_members[index]; + } + int CScriptArray::SetAtGrow(int index, CScriptBase * pScript) + { + if ( index > (int) GetUpperBound() ) + m_members.resize(index, NULL); + vector<CScriptBase*>::iterator p = m_members.begin(); + p += index; + if ( *p != NULL ) + delete *p; + *p = pScript; + return index; + } + + void CScriptArray::RemoveAt(int index) + { + if ( index > (int) GetUpperBound() ) + return; + vector<CScriptBase*>::iterator p = m_members.begin(); + p+= index; + if ( *p != NULL ) + delete *p; + *p = NULL; } Index: ScriptArray.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_ScriptsBase/ScriptArray.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** ScriptArray.h 23 May 2003 05:46:26 -0000 1.2 --- ScriptArray.h 10 Jun 2003 22:57:20 -0000 1.3 *************** *** 3,8 **** #include "CategorizedScriptBase.h" #include "Expression.h" ! class __declspec(dllexport) CScriptArray : public CScriptBase, public CPtrArray { public: --- 3,11 ---- #include "CategorizedScriptBase.h" #include "Expression.h" + #include <vector> ! using namespace std; ! ! class __declspec(dllexport) CScriptArray : public CScriptBase { public: *************** *** 10,16 **** --- 13,30 ---- ~CScriptArray(); int Insert(CScriptBase * pScript); + int InsertAt(int index, CScriptBase * pScript); int Find(CString csName); void Remove(CScriptBase * pScript); void RemoveAll(); + void RemoveAt(int index); + int Add(CScriptBase * pScript) { return Insert(pScript); } + int SetAtGrow(int index, CScriptBase * pScript); + int SetAt(int index, CScriptBase * pScript) { return SetAtGrow(index, pScript); } + size_t GetSize() { return m_members.size(); } + size_t GetCount() { return GetSize(); } + CScriptBase * GetAt(int index); CScriptBase * Get(CString csName); + size_t GetUpperBound() { return m_members.size() - 1; } + protected: + vector <CScriptBase*> m_members; }; Index: ScriptBase.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_ScriptsBase/ScriptBase.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** ScriptBase.cpp 23 May 2003 05:46:26 -0000 1.2 --- ScriptBase.cpp 10 Jun 2003 22:57:20 -0000 1.3 *************** *** 163,165 **** csfInput.Close(); return bFound; ! } \ No newline at end of file --- 163,189 ---- csfInput.Close(); return bFound; ! } ! ! bool CScriptBase::operator>(CScriptBase a) ! { ! if ( m_csValue.CompareNoCase(a.m_csValue) > 0 ) ! return true; ! else ! return false; ! } ! ! bool CScriptBase::operator<(CScriptBase a) ! { ! if ( m_csValue.CompareNoCase(a.m_csValue) < 0 ) ! return true; ! else ! return false; ! } ! ! bool CScriptBase::operator==(CScriptBase a) ! { ! if ( m_csValue.CompareNoCase(a.m_csValue) == 0 ) ! return true; ! else ! return false; ! } Index: ScriptBase.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_ScriptsBase/ScriptBase.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** ScriptBase.h 23 May 2003 05:46:26 -0000 1.2 --- ScriptBase.h 10 Jun 2003 22:57:20 -0000 1.3 *************** *** 15,17 **** --- 15,22 ---- BYTE m_bType; DWORD m_dwFileOffset; + + bool operator>(CScriptBase a); + bool operator<(CScriptBase a); + bool operator==(CScriptBase a); }; + Index: StringVector.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_ScriptsBase/StringVector.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** StringVector.cpp 23 May 2003 05:46:26 -0000 1.2 --- StringVector.cpp 10 Jun 2003 22:57:20 -0000 1.3 *************** *** 10,18 **** if ( index > GetUpperBound() ) return _T(""); ! vector<CString>::iterator p = m_strings.begin(); ! int i = 0; ! while ( i++ < index ) ! p++; ! return *p; } --- 10,14 ---- if ( index > GetUpperBound() ) return _T(""); ! return m_strings[index]; } *************** *** 26,32 **** } vector <CString>::iterator p = m_strings.begin(); ! int i = 0; ! while ( i++ < index ) ! p++; m_strings.insert(p, s); return; --- 22,26 ---- } vector <CString>::iterator p = m_strings.begin(); ! p += index; m_strings.insert(p, s); return; *************** *** 38,44 **** return; vector <CString>::iterator p = m_strings.begin(); ! int i = 0; ! while ( i++ < index ) ! p++; m_strings.erase(p); return; --- 32,36 ---- return; vector <CString>::iterator p = m_strings.begin(); ! p += index; m_strings.erase(p); return; |