[Sphere-axis-commits] CVS: Axis/S_Sphere52 S_Sphere52.rc,1.5,1.6 ScriptsMain.cpp,1.17,1.18 ScriptsMa
Brought to you by:
pesterle
From: Philip E. <pes...@us...> - 2003-06-25 00:07:30
|
Update of /cvsroot/sphere-axis/Axis/S_Sphere52 In directory sc8-pr-cvs1:/tmp/cvs-serv3108/S_Sphere52 Modified Files: S_Sphere52.rc ScriptsMain.cpp ScriptsMain.h Log Message: no message Index: S_Sphere52.rc =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/S_Sphere52.rc,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** S_Sphere52.rc 13 Jun 2003 19:58:09 -0000 1.5 --- S_Sphere52.rc 25 Jun 2003 00:07:27 -0000 1.6 *************** *** 28,46 **** // ! 1 TEXTINCLUDE BEGIN ! "resource.h\0" END ! 2 TEXTINCLUDE BEGIN ! "#include ""afxres.h""\r\n" ! "\0" END ! 3 TEXTINCLUDE BEGIN ! "1 TYPELIB ""S_Sphere52.tlb""\r\n" ! "\0" END --- 28,46 ---- // ! 1 TEXTINCLUDE BEGIN ! "resource.h\0" END ! 2 TEXTINCLUDE BEGIN ! "#include ""afxres.h""\r\n" ! "\0" END ! 3 TEXTINCLUDE BEGIN ! "1 TYPELIB ""S_Sphere52.tlb""\r\n" ! "\0" END *************** *** 54,87 **** VS_VERSION_INFO VERSIONINFO ! FILEVERSION 1,0,0,1 ! PRODUCTVERSION 1,0,0,1 ! FILEFLAGSMASK 0x3fL #ifdef _DEBUG ! FILEFLAGS 0x1L #else ! FILEFLAGS 0x0L #endif ! FILEOS 0x4L ! FILETYPE 0x2L ! FILESUBTYPE 0x0L ! BEGIN ! BLOCK "StringFileInfo" ! BEGIN ! BLOCK "040904B0" ! BEGIN ! VALUE "CompanyName", "TODO: <Company name>" ! VALUE "FileDescription", "TODO: <File description>" ! VALUE "FileVersion", "1.0.0.1" ! VALUE "LegalCopyright", "TODO: (c) <Company name>. All rights reserved." ! VALUE "InternalName", "S_Sphere52.dll" ! VALUE "OriginalFilename", "S_Sphere52.dll" ! VALUE "ProductName", "TODO: <Product name>" ! VALUE "ProductVersion", "1.0.0.1" ! END ! END ! BLOCK "VarFileInfo" ! BEGIN ! VALUE "Translation", 0x409, 1200 ! END END --- 54,87 ---- VS_VERSION_INFO VERSIONINFO ! FILEVERSION 1, 0, 0, 1 ! PRODUCTVERSION 1.0.0.1 ! FILEFLAGSMASK 0x3fL #ifdef _DEBUG ! FILEFLAGS 0x1L #else ! FILEFLAGS 0x0L #endif ! FILEOS 0x4L ! FILETYPE 0x2L ! FILESUBTYPE 0x0L ! BEGIN ! BLOCK "StringFileInfo" ! BEGIN ! BLOCK "040904B0" ! BEGIN ! VALUE "CompanyName", "" ! VALUE "FileDescription", "Scripts module for Sphere 0.52" ! VALUE "FileVersion", "1, 0, 0, 1" ! VALUE "LegalCopyright", "Copyright Philip Esterle 2002-2003" ! VALUE "InternalName", "S_Sphere52.dll" ! VALUE "OriginalFilename", "S_Sphere52.dll" ! VALUE "ProductName", "S_Sphere52" ! VALUE "ProductVersion", "1.0.0.1" ! END ! END ! BLOCK "VarFileInfo" ! BEGIN ! VALUE "Translation", 0x409, 1200 ! END END *************** *** 105,167 **** 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_VISIBLE | ! 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 | ! 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 --- 105,167 ---- 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_VISIBLE | ! 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 | ! 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 *************** *** 173,192 **** #ifdef APSTUDIO_INVOKED ! GUIDELINES DESIGNINFO BEGIN ! IDD_FILEREAD_PROGRESS, DIALOG ! BEGIN ! LEFTMARGIN, 7 ! RIGHTMARGIN, 179 ! TOPMARGIN, 7 ! END ! ! IDD_PROFILE_EDIT, DIALOG ! BEGIN ! LEFTMARGIN, 7 ! RIGHTMARGIN, 292 ! TOPMARGIN, 7 ! BOTTOMMARGIN, 286 ! END END #endif // APSTUDIO_INVOKED --- 173,192 ---- #ifdef APSTUDIO_INVOKED ! GUIDELINES DESIGNINFO ! BEGIN ! IDD_FILEREAD_PROGRESS, DIALOG ! BEGIN ! LEFTMARGIN, 7 ! RIGHTMARGIN, 179 ! TOPMARGIN, 7 ! END ! ! IDD_PROFILE_EDIT, DIALOG BEGIN ! LEFTMARGIN, 7 ! RIGHTMARGIN, 292 ! TOPMARGIN, 7 ! BOTTOMMARGIN, 286 ! END END #endif // APSTUDIO_INVOKED *************** *** 208,214 **** // ! STRINGTABLE BEGIN ! IDS_PROJNAME "S_Sphere52" END --- 208,214 ---- // ! STRINGTABLE BEGIN ! IDS_PROJNAME "S_Sphere52" END Index: ScriptsMain.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/ScriptsMain.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -r1.17 -r1.18 *** ScriptsMain.cpp 19 Jun 2003 18:03:20 -0000 1.17 --- ScriptsMain.cpp 25 Jun 2003 00:07:27 -0000 1.18 *************** *** 27,30 **** --- 27,62 ---- int CScriptsMain::m_iScriptSeq = 0; + const char * CScriptsMain::m_pszFiles [] = + { + INI_FILE, + WORLD_FILE, + ACCT_FILE, + MAP_FILE, + NPC_FILE, + ITEM_FILE, + DEFS_FILE, + TEMPLATE_FILE, + TABLE_FILE, + NAME_FILE, + SPEECH_FILE, + SKILL_FILE, + MAGIC_FILE, + TRIGGER_FILE, + LOC_FILE, + USER_LOC_FILE, + USER_NPC_FILE, + USER_ITEM_FILE, + USER_DEFS_FILE, + USER_TEMPLATE_FILE, + USER_TABLE_FILE, + USER_NAME_FILE, + USER_SPEECH_FILE, + USER_SKILL_FILE, + USER_MAGIC_FILE, + USER_MAP_FILE, + USER_TRIGGER_FILE, + AXISCATS_FILE, + }; + CScriptsMain::CScriptsMain() { *************** *** 127,142 **** CString csScpPath = GetScriptPath(); CreateProgressDialog(); - // Grab the custom file from the remote server if necessary. - #ifdef _AXIS - if (m_pProfile->ProfileType() == PROFILE_REMOTE) - { - CFileStatus st; - if ( !CFile::GetStatus(RMT_DEFS_FILE, st) ) - { - if (m_pRemote && m_pRemote->IsValid()) - m_pRemote->GetCustomFile(_T("graydefs")); - } - } - #endif CString csMessage; --- 159,162 ---- *************** *** 151,179 **** case 0: // This is the regular file ! if ( m_pProfile->ProfileType() == PROFILE_REMOTE || csScpPath == _T("") ) ! csFilename = DEFS_FILE; ! else ! csFilename.Format(_T("%s%s"), csScpPath, DEFS_FILE); break; case 1: // This is the custom file ! if ( m_pProfile->ProfileType() == PROFILE_REMOTE ) ! csFilename.Format(_T("%s\\%s"), Main->GetProfileString(), RMT_DEFS_FILE); ! else if ( csScpPath == _T("") ) ! csFilename = USER_DEFS_FILE; ! else ! csFilename.Format(_T("%s%s"), csScpPath, USER_DEFS_FILE); break; } if ( !csfDefs.Open(csFilename, CFile::modeRead | CFile::shareDenyNone)) { - if ( csFilename.Find(_T("\\")) == -1 ) - { - CString csTemp = csFilename; - TCHAR szPath[MAX_PATH]; - memset(&szPath[0], 0x00, sizeof(szPath) ); - _tgetcwd(&szPath[0], sizeof(szPath)); - csFilename.Format(_T("%s\\%s"), szPath, csFilename); - } LOG(locale->String(IDS_SCRIPTS_CANTOPEN), csFilename); break; --- 171,185 ---- case 0: // This is the regular file ! csFilename = m_vFiles[File_Defs]; break; case 1: // This is the custom file ! csFilename = m_vFiles[File_Defs2]; break; } + if ( csFilename == _T("") ) + continue; if ( !csfDefs.Open(csFilename, CFile::modeRead | CFile::shareDenyNone)) { LOG(locale->String(IDS_SCRIPTS_CANTOPEN), csFilename); break; *************** *** 255,271 **** LoadDefs(); - // Grab the custom file from the remote server if necessary. - if (m_pProfile->ProfileType() == PROFILE_REMOTE) - { - CFileStatus st; - if ( !CFile::GetStatus(RMT_ITEM_FILE, st) ) - { - /* - if (m_pRemote->IsValid()) - m_pRemote->GetCustomFile(_T("grayitem2")); - */ - } - } - CString csMessage; DWORD j = 0; --- 261,264 ---- *************** *** 279,307 **** case 0: // This is the regular file ! if ( m_pProfile->ProfileType() == PROFILE_REMOTE || csScpPath == _T("") ) ! csFilename = ITEM_FILE; ! else ! csFilename.Format(_T("%s%s"), csScpPath, ITEM_FILE); break; case 1: // This is the custom file ! if ( m_pProfile->ProfileType() == PROFILE_REMOTE ) ! csFilename.Format(_T("%s\\%s"), Main->GetProfileString(), RMT_ITEM_FILE); ! else if ( csScpPath == _T("") ) ! csFilename = USER_ITEM_FILE; ! else ! csFilename.Format(_T("%s%s"), csScpPath, USER_ITEM_FILE); break; } if ( !csfItems.Open(csFilename, CFile::modeRead | CFile::shareDenyNone)) { - if ( csFilename.Find(_T("\\")) == -1 ) - { - CString csTemp = csFilename; - TCHAR szPath[MAX_PATH]; - memset(&szPath[0], 0x00, sizeof(szPath) ); - _tgetcwd(&szPath[0], sizeof(szPath)); - csFilename.Format(_T("%s\\%s"), szPath, csFilename); - } LOG(locale->String(IDS_SCRIPTS_CANTOPEN), csFilename); break; --- 272,286 ---- case 0: // This is the regular file ! csFilename = m_vFiles[File_Item]; break; case 1: // This is the custom file ! csFilename = m_vFiles[File_Item2]; break; } + if ( csFilename == _T("") ) + continue; if ( !csfItems.Open(csFilename, CFile::modeRead | CFile::shareDenyNone)) { LOG(locale->String(IDS_SCRIPTS_CANTOPEN), csFilename); break; *************** *** 400,411 **** if ( m_bNPCsLoaded ) return; ! /* ! if ( m_bNewFormat ) ! return; ! */ LOG(locale->String(IDS_SCRIPTS_LOADING), locale->String(IDS_SCRIPTS_TNPCS)); CWaitCursor hourglass; CString csScpPath = GetScriptPath(); - CreateProgressDialog(); if ( !m_bDefsLoaded ) --- 379,386 ---- if ( m_bNPCsLoaded ) return; ! LOG(locale->String(IDS_SCRIPTS_LOADING), locale->String(IDS_SCRIPTS_TNPCS)); CWaitCursor hourglass; CString csScpPath = GetScriptPath(); if ( !m_bDefsLoaded ) *************** *** 414,429 **** LoadTables(); ! // Grab the custom file from the remote server if necessary. ! #ifdef _AXIS ! if (m_pProfile->ProfileType() == PROFILE_REMOTE) ! { ! CFileStatus st; ! if ( !CFile::GetStatus(RMT_NPC_FILE, st) ) ! { ! if (m_pRemote->IsValid()) ! m_pRemote->GetCustomFile(_T("graychar2")); ! } ! } ! #endif CString csMessage; DWORD j = 0; --- 389,394 ---- LoadTables(); ! CreateProgressDialog(); ! CString csMessage; DWORD j = 0; *************** *** 436,465 **** { case 0: ! // This is the regular file ! if ( m_pProfile->ProfileType() == PROFILE_REMOTE || csScpPath == _T("") ) ! csFilename = NPC_FILE; ! else ! csFilename.Format(_T("%s%s"), csScpPath, NPC_FILE); break; case 1: ! // This is the custom file ! if ( m_pProfile->ProfileType() == PROFILE_REMOTE ) ! csFilename.Format(_T("%s\\%s"), Main->GetProfileString(), RMT_NPC_FILE); ! else if ( csScpPath == _T("") ) ! csFilename = USER_NPC_FILE; ! else ! csFilename.Format(_T("%s%s"), csScpPath, USER_NPC_FILE); break; } if ( !csfChars.Open(csFilename, CFile::modeRead | CFile::shareDenyNone) ) { - if ( csFilename.Find(_T("\\")) == -1 ) - { - CString csTemp = csFilename; - TCHAR szPath[MAX_PATH]; - memset(&szPath[0], 0x00, sizeof(szPath) ); - _tgetcwd(&szPath[0], sizeof(szPath)); - csFilename.Format(_T("%s\\%s"), szPath, csFilename); - } LOG(locale->String(IDS_SCRIPTS_CANTOPEN), csFilename); break; --- 401,414 ---- { case 0: ! csFilename = m_vFiles[File_NPC]; break; case 1: ! csFilename = m_vFiles[File_NPC2]; break; } + if ( csFilename == _T("") ) + continue; if ( !csfChars.Open(csFilename, CFile::modeRead | CFile::shareDenyNone) ) { LOG(locale->String(IDS_SCRIPTS_CANTOPEN), csFilename); break; *************** *** 557,564 **** if ( m_bTemplatesLoaded ) return; ! /* ! if ( m_bNewFormat ) ! return; ! */ LOG(locale->String(IDS_SCRIPTS_LOADING), locale->String(IDS_SCRIPTS_TTEMPLATES)); CWaitCursor hourglass; --- 506,510 ---- if ( m_bTemplatesLoaded ) return; ! LOG(locale->String(IDS_SCRIPTS_LOADING), locale->String(IDS_SCRIPTS_TTEMPLATES)); CWaitCursor hourglass; *************** *** 570,585 **** LoadDefs(); - // Grab the custom file from the remote server if necessary. - #ifdef _AXIS - if (m_pProfile->ProfileType() == PROFILE_REMOTE) - { - CFileStatus st; - if ( !CFile::GetStatus(RMT_TEMPLATE_FILE, st) ) - { - if (m_pRemote->IsValid()) - m_pRemote->GetCustomFile(_T("graytemplate")); - } - } - #endif CString csMessage; DWORD j = 0; --- 516,519 ---- *************** *** 592,621 **** { case 0: ! // This is the regular file ! if ( m_pProfile->ProfileType() == PROFILE_REMOTE || csScpPath == _T("") ) ! csFilename = TEMPLATE_FILE; ! else ! csFilename.Format(_T("%s%s"), csScpPath, TEMPLATE_FILE); break; case 1: ! // This is the custom file ! if ( m_pProfile->ProfileType() == PROFILE_REMOTE ) ! csFilename.Format(_T("%s\\%s"), Main->GetProfileString(), RMT_TEMPLATE_FILE); ! else if ( csScpPath == _T("") ) ! csFilename = m_pProfile->ProfileType() == PROFILE_REMOTE ? RMT_TEMPLATE_FILE : USER_TEMPLATE_FILE; ! else ! csFilename.Format(_T("%s%s"), csScpPath, USER_TEMPLATE_FILE); break; } if ( !csfTemplates.Open(csFilename, CFile::modeRead | CFile::shareDenyNone)) { - if ( csFilename.Find(_T("\\")) == -1 ) - { - CString csTemp = csFilename; - TCHAR szPath[MAX_PATH]; - memset(&szPath[0], 0x00, sizeof(szPath) ); - _tgetcwd(&szPath[0], sizeof(szPath)); - csFilename.Format(_T("%s\\%s"), szPath, csFilename); - } LOG(locale->String(IDS_SCRIPTS_CANTOPEN), csFilename); break; --- 526,539 ---- { case 0: ! csFilename = m_vFiles[File_Templates]; break; case 1: ! csFilename = m_vFiles[File_Templates2]; break; } + if ( csFilename == _T("") ) + break; if ( !csfTemplates.Open(csFilename, CFile::modeRead | CFile::shareDenyNone)) { LOG(locale->String(IDS_SCRIPTS_CANTOPEN), csFilename); break; *************** *** 739,746 **** CreateProgressDialog(); CString csFilename; ! if ( m_pProfile->ProfileType() == PROFILE_REMOTE || GetScriptPath() == _T("") ) ! csFilename = TABLE_FILE; ! else ! csFilename.Format(_T("%s%s"), GetScriptPath(), TABLE_FILE); this->LoadFile(csFilename); m_bTablesLoaded = true; --- 657,663 ---- CreateProgressDialog(); CString csFilename; ! csFilename = m_vFiles[File_Tables]; ! if ( csFilename == _T("") ) ! return; this->LoadFile(csFilename); m_bTablesLoaded = true; *************** *** 759,767 **** if ( m_bMapLoaded ) return; ! /* ! if ( m_bNewFormat ) ! // We should have already loaded this stuff when we loaded all of the scripts. ! return; ! */ LOG(locale->String(IDS_SCRIPTS_LOADING), locale->String(IDS_SCRIPTS_TMAP)); CWaitCursor hourglass; --- 676,680 ---- if ( m_bMapLoaded ) return; ! LOG(locale->String(IDS_SCRIPTS_LOADING), locale->String(IDS_SCRIPTS_TMAP)); CWaitCursor hourglass; *************** *** 775,789 **** LoadTriggers(); - #ifdef _AXIS - if (m_pProfile->ProfileType() == PROFILE_REMOTE) - { - CFileStatus st; - if ( !CFile::GetStatus(RMT_MAP_FILE, st) ) - { - if (m_pRemote->IsValid()) - m_pRemote->GetCustomFile(_T("graymap")); - } - } - #endif CString csMessage; CString csFilename; --- 688,691 ---- *************** *** 798,827 **** case 0: // This is the regular file ! if ( m_pProfile->ProfileType() == PROFILE_REMOTE || csScpPath == _T("") ) ! csFilename = MAP_FILE; ! else ! csFilename.Format(_T("%s%s"), csScpPath, MAP_FILE); break; case 1: // This is the custom file ! if ( m_pProfile->ProfileType() == PROFILE_REMOTE ) ! csFilename.Format(_T("%s\\%s"), Main->GetProfileString(), RMT_MAP_FILE); ! else if ( csScpPath == _T("") ) ! csFilename = USER_MAP_FILE; ! else ! csFilename.Format(_T("%s%s"), csScpPath, USER_MAP_FILE); break; } if (!csfMapfile.Open(csFilename, CFile::modeRead | CFile::shareDenyNone)) { - if ( csFilename.Find(_T("\\")) == -1 ) - { - CString csTemp = csFilename; - TCHAR szPath[MAX_PATH]; - memset(&szPath[0], 0x00, sizeof(szPath) ); - _tgetcwd(&szPath[0], sizeof(szPath)); - csFilename.Format(_T("%s\\%s"), szPath, csFilename); - } LOG(locale->String(IDS_SCRIPTS_CANTOPEN), csFilename); continue; --- 700,715 ---- case 0: // This is the regular file ! csFilename = m_vFiles[File_Map]; break; case 1: // This is the custom file ! csFilename = m_vFiles[File_Map2]; break; } + if ( csFilename == _T("") ) + continue; if (!csfMapfile.Open(csFilename, CFile::modeRead | CFile::shareDenyNone)) { LOG(locale->String(IDS_SCRIPTS_CANTOPEN), csFilename); continue; *************** *** 1039,1046 **** if ( m_bTriggersLoaded ) return; ! /* ! if ( m_bNewFormat ) ! return; ! */ LOG(locale->String(IDS_SCRIPTS_LOADING), locale->String(IDS_SCRIPTS_TTRIGGERS)); CWaitCursor hourglass; --- 927,931 ---- if ( m_bTriggersLoaded ) return; ! LOG(locale->String(IDS_SCRIPTS_LOADING), locale->String(IDS_SCRIPTS_TTRIGGERS)); CWaitCursor hourglass; *************** *** 1049,1063 **** m_pDlg->m_csMessage.SetWindowText(locale->String(IDS_INITSTORAGE)); - if (m_pProfile->ProfileType() == PROFILE_REMOTE) - { - CFileStatus st; - if ( !CFile::GetStatus(RMT_TRIGGER_FILE, st) ) - { - /* - if (m_pRemote->IsValid()) - m_pRemote->GetCustomFile(_T("graytrig")); - */ - } - } CString csMessage; CString csFilename; --- 934,937 ---- *************** *** 1071,1101 **** { case 0: ! // This is the regular file ! if ( m_pProfile->ProfileType() == PROFILE_REMOTE || csScpPath == _T("") ) ! csFilename = TRIGGER_FILE; ! else ! csFilename.Format(_T("%s%s"), csScpPath, TRIGGER_FILE); break; case 1: ! // This is the custom file ! if ( m_pProfile->ProfileType() == PROFILE_REMOTE ) ! csFilename.Format(_T("%s\\%s"), Main->GetProfileString(), RMT_TRIGGER_FILE); ! else if ( csScpPath == _T("") ) ! csFilename = m_pProfile->ProfileType() == PROFILE_REMOTE ? RMT_TRIGGER_FILE : USER_TRIGGER_FILE; ! else ! csFilename.Format(_T("%s%s"), csScpPath, USER_TRIGGER_FILE); break; } ! if (!csfTrigfile.Open(csFilename, CFile::modeRead | CFile::shareDenyNone)) { - if ( csFilename.Find(_T("\\")) == -1 ) - { - CString csTemp = csFilename; - TCHAR szPath[MAX_PATH]; - memset(&szPath[0], 0x00, sizeof(szPath) ); - _tgetcwd(&szPath[0], sizeof(szPath)); - csFilename.Format(_T("%s\\%s"), szPath, csFilename); - } LOG(locale->String(IDS_SCRIPTS_CANTOPEN), csFilename); break; --- 945,958 ---- { case 0: ! csFilename = m_vFiles[File_Trigger]; break; case 1: ! csFilename = m_vFiles[File_Trigger2]; break; } ! if ( csFilename == _T("") ) ! continue; if (!csfTrigfile.Open(csFilename, CFile::modeRead | CFile::shareDenyNone)) { LOG(locale->String(IDS_SCRIPTS_CANTOPEN), csFilename); break; *************** *** 1165,1172 **** if ( m_bLocationsLoaded ) return; - /* - if ( m_bNewFormat ) - return; - */ LOG(locale->String(IDS_SCRIPTS_LOADING), locale->String(IDS_SCRIPTS_TLOCATIONS)); CWaitCursor hourglass; --- 1022,1025 ---- *************** *** 1183,1187 **** CStdioFile csfLocs; CString sFilename; ! sFilename.Format(_T("%s\\%s"), m_pProfile->BaseDirectory(), i ? USER_LOC_FILE : LOC_FILE); if ( !csfLocs.Open( sFilename, CFile::modeRead | CFile::shareDenyNone) ) { --- 1036,1050 ---- CStdioFile csfLocs; CString sFilename; ! switch ( i ) ! { ! case 0: ! sFilename = m_vFiles[File_Loc]; ! break; ! case 1: ! sFilename = m_vFiles[File_Loc2]; ! break; ! } ! if ( sFilename == _T("") ) ! continue; if ( !csfLocs.Open( sFilename, CFile::modeRead | CFile::shareDenyNone) ) { *************** *** 1273,1280 **** if ( m_bNamesLoaded ) return; ! /* ! if ( m_bNewFormat ) ! return; ! */ LOG(locale->String(IDS_SCRIPTS_LOADING), locale->String(IDS_SCRIPTS_TNAMES)); CWaitCursor hourglass; --- 1136,1140 ---- if ( m_bNamesLoaded ) return; ! LOG(locale->String(IDS_SCRIPTS_LOADING), locale->String(IDS_SCRIPTS_TNAMES)); CWaitCursor hourglass; *************** *** 1284,1319 **** m_pDlg->m_csMessage.SetWindowText(locale->String(IDS_INITSTORAGE)); - #ifdef _AXIS - if (m_pProfile->ProfileType() == PROFILE_REMOTE) - { - CFileStatus st; - if ( !CFile::GetStatus(RMT_NAME_FILE, st) ) - { - if (m_pRemote->IsValid()) - m_pRemote->GetCustomFile(_T("grayname")); - } - } - #endif CString csMessage; ! CString csFilename; DWORD j = 0; CStdioFile csfNames; ! if ( m_pProfile->ProfileType() == PROFILE_REMOTE ) ! csFilename.Format(_T("%s\\%s"), Main->GetProfileString(), RMT_NAME_FILE); ! else if ( csScpPath == _T("") ) ! csFilename = NAME_FILE; ! else ! csFilename.Format(_T("%s%s"), csScpPath, NAME_FILE); if ( !csfNames.Open(csFilename, CFile::modeRead | CFile::shareDenyNone) ) { - if ( csFilename.Find(_T("\\")) == -1 ) - { - CString csTemp = csFilename; - TCHAR szPath[MAX_PATH]; - memset(&szPath[0], 0x00, sizeof(szPath) ); - _tgetcwd(&szPath[0], sizeof(szPath)); - csFilename.Format(_T("%s\\%s"), szPath, csFilename); - } LOG(locale->String(IDS_SCRIPTS_CANTOPEN), csFilename); return; --- 1144,1156 ---- m_pDlg->m_csMessage.SetWindowText(locale->String(IDS_INITSTORAGE)); CString csMessage; ! CString csFilename = m_vFiles[File_Name]; DWORD j = 0; CStdioFile csfNames; ! if ( csFilename == _T("")) ! return; if ( !csfNames.Open(csFilename, CFile::modeRead | CFile::shareDenyNone) ) { LOG(locale->String(IDS_SCRIPTS_CANTOPEN), csFilename); return; *************** *** 1410,1417 **** if ( m_bSpeechLoaded ) return; ! /* ! if ( m_bNewFormat ) ! return; ! */ LOG(locale->String(IDS_SCRIPTS_LOADING), locale->String(IDS_SCRIPTS_TSPEECH)); CWaitCursor hourglass; --- 1247,1251 ---- if ( m_bSpeechLoaded ) return; ! LOG(locale->String(IDS_SCRIPTS_LOADING), locale->String(IDS_SCRIPTS_TSPEECH)); CWaitCursor hourglass; *************** *** 1421,1435 **** m_pDlg->m_csMessage.SetWindowText(locale->String(IDS_INITSTORAGE)); - #ifdef _AXIS - if (m_pProfile->ProfileType() == PROFILE_REMOTE) - { - CFileStatus st; - if ( !CFile::GetStatus(RMT_SPEECH_FILE, st) ) - { - if (m_pRemote->IsValid()) - m_pRemote->GetCustomFile(_T("grayspee")); - } - } - #endif CString csMessage; CString csFilename; --- 1255,1258 ---- *************** *** 1437,1490 **** CStdioFile csfSpeech; ! if ( m_pProfile->ProfileType() == PROFILE_REMOTE ) ! csFilename.Format(_T("%s\\%s"), Main->GetProfileString(), RMT_SPEECH_FILE); ! else if ( csScpPath == _T("") ) ! csFilename = SPEECH_FILE; ! else ! csFilename.Format(_T("%s%s"), csScpPath, SPEECH_FILE); ! if ( !csfSpeech.Open(csFilename, CFile::modeRead | CFile::shareDenyNone) ) { ! if ( csFilename.Find(_T("\\")) == -1 ) { ! CString csTemp = csFilename; ! TCHAR szPath[MAX_PATH]; ! memset(&szPath[0], 0x00, sizeof(szPath) ); ! _tgetcwd(&szPath[0], sizeof(szPath)); ! csFilename.Format(_T("%s\\%s"), szPath, csFilename); } - LOG(locale->String(IDS_SCRIPTS_CANTOPEN), csFilename); - return; - } ! csMessage.Format(locale->String(IDS_READINGFILE), csFilename); ! m_pDlg->m_csMessage.SetWindowText(csMessage); ! m_pDlg->SetPos(0); ! m_pDlg->SetRange32(0, (DWORD)csfSpeech.GetLength()); ! ! BOOL bStatus = TRUE; ! while (bStatus) ! { ! CString csLine; ! DWORD dwOffset = (DWORD)csfSpeech.GetPosition(); ! bStatus = csfSpeech.ReadString(csLine); ! if ( !bStatus ) ! break; ! if ( csLine.Find(_T("[")) != -1 ) { ! CScriptBase * pBlock = new (CScriptBase); ! if ( pBlock ) { ! CString csID = csLine.Mid(csLine.Find(_T("[")) + 1); ! csID =csID.SpanExcluding(_T("]")); ! pBlock->m_csValue = csID; ! pBlock->m_dwFileOffset = dwOffset; ! pBlock->m_csFilename = csFilename; ! bStatus = pBlock->Read(csfSpeech); ! this->m_aSpeechBlocks.Add(pBlock); ! m_pDlg->SetPos((int)csfSpeech.GetPosition()); } } } - csfSpeech.Close(); this->m_bSpeechLoaded = true; } --- 1260,1321 ---- CStdioFile csfSpeech; ! for ( int i = 0; i < 2; i++ ) { ! switch ( i ) { ! case 0: ! csFilename = m_vFiles[File_Speech]; ! break; ! case 1: ! csFilename = m_vFiles[File_Speech2]; ! break; ! } ! if ( csFilename == _T("") ) ! continue; ! if ( !csfSpeech.Open(csFilename, CFile::modeRead | CFile::shareDenyNone) ) ! { ! if ( csFilename.Find(_T("\\")) == -1 ) ! { ! CString csTemp = csFilename; ! TCHAR szPath[MAX_PATH]; ! memset(&szPath[0], 0x00, sizeof(szPath) ); ! _tgetcwd(&szPath[0], sizeof(szPath)); ! csFilename.Format(_T("%s\\%s"), szPath, csFilename); ! } ! LOG(locale->String(IDS_SCRIPTS_CANTOPEN), csFilename); ! continue; } ! csMessage.Format(locale->String(IDS_READINGFILE), csFilename); ! m_pDlg->m_csMessage.SetWindowText(csMessage); ! m_pDlg->SetPos(0); ! m_pDlg->SetRange32(0, (DWORD)csfSpeech.GetLength()); ! ! BOOL bStatus = TRUE; ! while (bStatus) { ! CString csLine; ! DWORD dwOffset = (DWORD)csfSpeech.GetPosition(); ! bStatus = csfSpeech.ReadString(csLine); ! if ( !bStatus ) ! break; ! if ( csLine.Find(_T("[")) != -1 ) { ! CScriptBase * pBlock = new (CScriptBase); ! if ( pBlock ) ! { ! CString csID = csLine.Mid(csLine.Find(_T("[")) + 1); ! csID =csID.SpanExcluding(_T("]")); ! pBlock->m_csValue = csID; ! pBlock->m_dwFileOffset = dwOffset; ! pBlock->m_csFilename = csFilename; ! bStatus = pBlock->Read(csfSpeech); ! this->m_aSpeechBlocks.Add(pBlock); ! m_pDlg->SetPos((int)csfSpeech.GetPosition()); ! } } } + csfSpeech.Close(); } this->m_bSpeechLoaded = true; } *************** *** 2240,2243 **** --- 2071,2076 ---- CreateProgressDialog(); m_bDeleteDialog = false; + m_vFiles.erase(m_vFiles.begin(), m_vFiles.end()); + m_vFiles.resize(File_QTY); if ( m_pProfile->ProfileType() == PROFILE_REMOTE ) { *************** *** 2257,2265 **** sFile.Format(_T("%s\\%s"), m_pProfile->ProfileName(), md5.GetHash(csaScripts.GetAt(i))); Main->m_pAxis->GetRemoteFile(csaScripts.GetAt(i), sFile); } this->m_bDeleteDialog = true; DestroyProgressDialog(); Main->m_pAxis->Logout(); ! // We're done return; } --- 2090,2120 ---- sFile.Format(_T("%s\\%s"), m_pProfile->ProfileName(), md5.GetHash(csaScripts.GetAt(i))); Main->m_pAxis->GetRemoteFile(csaScripts.GetAt(i), sFile); + int j = MapFile(csaScripts.GetAt(i)); + if ( j != -1 ) + m_vFiles[j] = sFile; } this->m_bDeleteDialog = true; DestroyProgressDialog(); Main->m_pAxis->Logout(); ! } ! else ! { ! // Check for updates of the files we know we need to get ! CreateDirectory(m_pProfile->ProfileName(), NULL); ! for ( int i = File_Map; i < File_QTY; i++ ) ! { ! CString sFile; ! CMD5Hash md5; ! sFile.Format(_T("%s\\%s"), m_pProfile->ProfileName(), md5.GetHash(m_pszFiles[i])); ! Main->m_pAxis->GetRemoteFile(m_pszFiles[i], sFile); ! m_vFiles[i] = sFile; ! } ! } ! // If Axiscats is defined, then load it ! if ( m_vFiles[File_AxisCats] != _T("") ) ! { ! LoadFile(m_vFiles[File_AxisCats]); ! LoadFile(m_vFiles[File_Loc]); ! LoadFile(m_vFiles[File_Loc2]); return; } *************** *** 2275,2298 **** // Load the specified scripts for ( int i = 0; i <= csaScripts.GetUpperBound(); i++ ) ! LoadFile(csaScripts.GetAt(i)); ! // Categorize everything ! // CategorizeLocations(); ! // CategorizeItems(); ! // CategorizeNPCs(); ! this->m_bDeleteDialog = true; ! DestroyProgressDialog(); ! // We're done ! return; } - // Load the INI file first - LOG( locale->String(IDS_SCRIPTS_READINGINI)); - csLoadFile.Format(_T("%s\\%s"), cwd, INI_FILE); - m_tables.m_Sphere.m_csFilename = csLoadFile; - m_config.m_sSCPBaseDir = cwd; - m_config.Read(); } - - // If this is a remote profile, we should check for updates first - this->LoadDefs(); this->LoadItems(); --- 2130,2151 ---- // Load the specified scripts for ( int i = 0; i <= csaScripts.GetUpperBound(); i++ ) ! { ! int j = MapFile(csaScripts.GetAt(i)); ! if ( j != -1 ) ! m_vFiles[j] = csaScripts.GetAt(i); ! } ! } ! else ! { ! LOG( locale->String(IDS_SCRIPTS_READINGINI)); ! csLoadFile.Format(_T("%s\\%s"), cwd, INI_FILE); ! m_tables.m_Sphere.m_csFilename = csLoadFile; ! m_config.m_sSCPBaseDir = cwd; ! m_config.Read(); ! m_vFiles[File_Ini] = csLoadFile; ! for ( int i = File_World; i < File_QTY; i++ ) ! m_vFiles[i] = m_pszFiles[i]; } } this->LoadDefs(); this->LoadItems(); *************** *** 3358,3359 **** --- 3211,3225 ---- } + int CScriptsMain::MapFile(CString s) + { + CString file = s; + file.MakeLower(); + for ( int i = 0; i < File_QTY; i++ ) + { + CString cmp = m_pszFiles[i]; + cmp.MakeLower(); + if ( file.Find(cmp) != -1 ) + return i; + } + return -1; + } \ No newline at end of file Index: ScriptsMain.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/ScriptsMain.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** ScriptsMain.h 18 Jun 2003 22:45:25 -0000 1.8 --- ScriptsMain.h 25 Jun 2003 00:07:27 -0000 1.9 *************** *** 70,73 **** --- 70,74 ---- #define RMT_ACCU_FILE _T("sphereaccu.rmt") #define RMT_ACCT_FILE _T("sphereacct.rmt") + #define AXISCATS_FILE _T("axiscats.scp") #define PROFILE_UNDEFINED -1 *************** *** 279,281 **** --- 280,319 ---- void CleanSpawnpoints(); void CleanWorlditems(); + + enum Files + { + File_Ini, + File_World, + File_Account, + File_Map, + File_NPC, + File_Item, + File_Defs, + File_Templates, + File_Tables, + File_Name, + File_Speech, + File_Skill, + File_Magic, + File_Trigger, + File_Loc, + File_Loc2, + File_NPC2, + File_Item2, + File_Defs2, + File_Templates2, + File_Table2, + File_Name2, + File_Speech2, + File_Skill2, + File_Magic2, + File_Map2, + File_Trigger2, + File_AxisCats, + File_QTY + }; + + static const char * m_pszFiles [File_QTY]; + vector<CString> m_vFiles; + int MapFile(CString s); }; |