sphere-axis-commits Mailing List for Axis for Sphere (Page 6)
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-25 22:56:01
|
Update of /cvsroot/sphere-axis/Axis/S_Sphere52 In directory sc8-pr-cvs1:/tmp/cvs-serv4566/S_Sphere52 Modified Files: Def.cpp Def.h ScriptsMain.cpp ScriptsMain.h Log Message: no message Index: Def.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/Def.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** Def.cpp 23 May 2003 05:46:53 -0000 1.2 --- Def.cpp 25 Jun 2003 22:55:58 -0000 1.3 *************** *** 1,4 **** --- 1,5 ---- #include "StdAfx.h" #include "def.h" + #include "Scripts.h" CDef::CDef() *************** *** 82,84 **** --- 83,96 ---- } } + } + + DWORD DefLookup(const TCHAR *pszExp) + { + int iDef = Main->m_pScripts->m_aDefs.Find(pszExp); + if ( iDef != -1 ) + { + CDef * pDef = Main->m_pScripts->m_aDefs[iDef]; + return pDef->Evaluate() ; + } + return ahextoi(pszExp); } Index: Def.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/Def.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** Def.h 23 May 2003 05:46:53 -0000 1.2 --- Def.h 25 Jun 2003 22:55:58 -0000 1.3 *************** *** 2,5 **** --- 2,7 ---- #include "stdafx.h" + DWORD DefLookup(const TCHAR *pszExp); + class CDef : public CScriptBase Index: ScriptsMain.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/ScriptsMain.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -r1.18 -r1.19 *** ScriptsMain.cpp 25 Jun 2003 00:07:27 -0000 1.18 --- ScriptsMain.cpp 25 Jun 2003 22:55:58 -0000 1.19 *************** *** 2094,2100 **** m_vFiles[j] = sFile; } - this->m_bDeleteDialog = true; - DestroyProgressDialog(); - Main->m_pAxis->Logout(); } else --- 2094,2097 ---- *************** *** 2111,2114 **** --- 2108,2112 ---- } } + Main->m_pAxis->Logout(); // If Axiscats is defined, then load it if ( m_vFiles[File_AxisCats] != _T("") ) *************** *** 2144,2149 **** m_config.Read(); m_vFiles[File_Ini] = csLoadFile; for ( int i = File_World; i < File_QTY; i++ ) ! m_vFiles[i] = m_pszFiles[i]; } } --- 2142,2161 ---- m_config.Read(); m_vFiles[File_Ini] = csLoadFile; + CString sBasePath; + if ( m_config.m_sSCPBaseDir != _T("") ) + sBasePath = m_config.m_sSCPBaseDir; + else + sBasePath = cwd; + if ( sBasePath.Right(1) != _T('\\') ) + sBasePath.Append(_T("\\")); for ( int i = File_World; i < File_QTY; i++ ) ! { ! CString sFile; ! if ( sBasePath != _T("") ) ! sFile.Format(_T("%s%s"), sBasePath, m_pszFiles[i]); ! else ! sFile = m_pszFiles[i]; ! m_vFiles[i] = sFile; ! } } } *************** *** 2401,2411 **** { CDisplayedScriptBase * pItem = m_aItems[index]; ! if ( pItem != NULL ) ! { ! CString sCategory; ! sCategory = pItem->m_csCategory + _T("\\") + pItem->m_csSubsection; ! return sCategory; ! } ! return _T(""); } index -= (ULONG) m_aItems.GetCount(); --- 2413,2432 ---- { CDisplayedScriptBase * pItem = m_aItems[index]; ! if ( pItem == NULL ) ! return _T(""); ! CDisplayedScriptBase * pDupe = FindDupe(pItem, &m_aItems); ! CString sCat, sSub; ! sCat = pItem->m_csCategory; ! if ( sCat == _T("") && pDupe ) ! sCat = pDupe->m_csCategory; ! sSub = pItem->m_csSubsection; ! if ( sSub == _T("") && pDupe ) ! sSub = pDupe->m_csSubsection; ! CString s; ! if ( sCat == _T("") ) ! s.Format(_T("<uncategorized>\\%s"), pItem->m_csFilename); ! else ! s.Format(_T("%s\\%s"), sCat, sSub); ! return s; } index -= (ULONG) m_aItems.GetCount(); *************** *** 2417,2423 **** CString sCategory; sCategory = pTemplate->m_csCategory + _T("\\") + pTemplate->m_csSubsection; ! return sCategory; } ! return _T(""); } index -= (ULONG) m_aTemplates.GetCount(); --- 2438,2445 ---- CString sCategory; sCategory = pTemplate->m_csCategory + _T("\\") + pTemplate->m_csSubsection; ! if ( sCategory != _T("\\") ) ! return sCategory; } ! return pTemplate->m_csFilename; } index -= (ULONG) m_aTemplates.GetCount(); *************** *** 2429,2435 **** CString sCategory; sCategory = pTemplate->m_csCategory + _T("\\") + pTemplate->m_csSubsection; ! return sCategory; } ! return _T(""); } return _T(""); --- 2451,2458 ---- CString sCategory; sCategory = pTemplate->m_csCategory + _T("\\") + pTemplate->m_csSubsection; ! if ( sCategory != _T("\\") ) ! return sCategory; } ! return pTemplate->m_csFilename; } return _T(""); *************** *** 2441,2447 **** { CDisplayedScriptBase * pItem = m_aItems[index]; ! if ( pItem != NULL ) ! return pItem->m_csDescription; ! return _T(""); } index -= (ULONG) m_aItems.GetCount(); --- 2464,2478 ---- { CDisplayedScriptBase * pItem = m_aItems[index]; ! if ( pItem == NULL ) ! return _T(""); ! CDisplayedScriptBase * pDupe = FindDupe(pItem, &m_aItems); ! CString sSub = pItem->m_csSubsection; ! if ( sSub == _T("") && pDupe ) ! sSub = pDupe->m_csSubsection; ! CString s = pItem->m_csDescription; ! if ( s == _T("") && pDupe ) ! s = pDupe->m_csDescription; ! s.Replace(_T("@"), sSub); ! return s; } index -= (ULONG) m_aItems.GetCount(); *************** *** 2451,2455 **** if ( pTemplate != NULL ) return pTemplate->m_csDescription; ! return _T(""); } index -= (ULONG) m_aTemplates.GetCount(); --- 2482,2486 ---- if ( pTemplate != NULL ) return pTemplate->m_csDescription; ! return pTemplate->m_csValue; } index -= (ULONG) m_aTemplates.GetCount(); *************** *** 2459,2465 **** if ( pTemplate != NULL ) return pTemplate->m_csDescription; ! return _T(""); } ! return _T(""); } --- 2490,2496 ---- if ( pTemplate != NULL ) return pTemplate->m_csDescription; ! return pTemplate->m_csValue; } ! return _T("<unnamed>"); } *************** *** 2469,2478 **** { CDisplayedScriptBase * pItem = m_aItems[index]; ! if ( pItem != NULL ) ! if ( pItem->m_csDispID != _T("") ) ! return pItem->m_csDispID; ! else ! return pItem->m_csValue; ! return _T(""); } // Templates don't have a dispID --- 2500,2512 ---- { CDisplayedScriptBase * pItem = m_aItems[index]; ! if ( pItem == NULL ) ! return _T(""); ! CDisplayedScriptBase * pDupe = FindDupe(pItem, &m_aItems); ! if ( pItem->m_csDispID != _T("") ) ! return pItem->m_csDispID; ! if ( pDupe && pDupe->m_csDispID != _T("") ) ! return pDupe->m_csDispID; ! else ! return pItem->m_csValue; } // Templates don't have a dispID *************** *** 2485,2490 **** { CDisplayedScriptBase * pItem = m_aItems[index]; ! if ( pItem != NULL ) return pItem->m_csColor; return _T(""); } --- 2519,2529 ---- { CDisplayedScriptBase * pItem = m_aItems[index]; ! if ( pItem == NULL ) ! return _T(""); ! CDisplayedScriptBase * pDupe = FindDupe(pItem, &m_aItems); ! if ( pItem->m_csColor != _T("") ) return pItem->m_csColor; + if ( pDupe && pDupe->m_csColor != _T("") ) + return pDupe->m_csColor; return _T(""); } *************** *** 2532,2537 **** { CDisplayedScriptBase * pItem = m_aItems[index]; ! if ( pItem != NULL ) return pItem->m_bNoIndex; return false; } --- 2571,2581 ---- { CDisplayedScriptBase * pItem = m_aItems[index]; ! if ( pItem == NULL ) ! return true; ! CDisplayedScriptBase * pDupe = FindDupe(pItem, &m_aItems); ! if ( pItem->m_bNoIndex ) return pItem->m_bNoIndex; + if ( pDupe->m_bNoIndex ) + return pDupe->m_bNoIndex; return false; } *************** *** 3223,3225 **** } return -1; ! } \ No newline at end of file --- 3267,3289 ---- } return -1; ! } ! ! CDisplayedScriptBase * CScriptsMain::FindDupe(CDisplayedScriptBase * pScript, CScriptArray<CDisplayedScriptBase*> *array) ! { ! if ( pScript->m_csDupeItem == _T("" ) ) ! return NULL; ! int iDef = EvaluateDef(pScript->m_csDupeItem); ! int iDupe; ! if ( iDef == 0 ) ! iDupe = array->Find(pScript->m_csDupeItem); ! else ! { ! CString s; ! s.Format(_T("%04x"), iDef); ! iDupe = array->Find(s); ! } ! if ( iDupe == -1 ) ! return NULL; ! else ! return dynamic_cast<CDisplayedScriptBase *>(array->GetAt(iDupe)); ! } Index: ScriptsMain.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/ScriptsMain.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** ScriptsMain.h 25 Jun 2003 00:07:27 -0000 1.9 --- ScriptsMain.h 25 Jun 2003 22:55:58 -0000 1.10 *************** *** 317,319 **** --- 317,320 ---- vector<CString> m_vFiles; int MapFile(CString s); + CDisplayedScriptBase * FindDupe(CDisplayedScriptBase * pScript, CScriptArray<CDisplayedScriptBase*> *array); }; |
From: Philip E. <pes...@us...> - 2003-06-25 22:56:01
|
Update of /cvsroot/sphere-axis/Axis/S_ScriptsBase In directory sc8-pr-cvs1:/tmp/cvs-serv4566/S_ScriptsBase Modified Files: CategorizedScriptBase.cpp Expression.cpp Expression.h Log Message: no message Index: CategorizedScriptBase.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_ScriptsBase/CategorizedScriptBase.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** CategorizedScriptBase.cpp 27 May 2003 04:26:31 -0000 1.3 --- CategorizedScriptBase.cpp 25 Jun 2003 22:55:58 -0000 1.4 *************** *** 7,11 **** this->m_csCategory = _T(""); this->m_csSubsection = _T(""); ! this->m_csDescription = _T("<unnamed>"); this->m_bNoIndex = false; } --- 7,11 ---- this->m_csCategory = _T(""); this->m_csSubsection = _T(""); ! this->m_csDescription = _T(""); this->m_bNoIndex = false; } Index: Expression.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_ScriptsBase/Expression.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** Expression.cpp 23 May 2003 05:46:26 -0000 1.2 --- Expression.cpp 25 Jun 2003 22:55:58 -0000 1.3 *************** *** 167,173 **** } - DWORD DefLookup(const TCHAR *pszExp) - { - return 0; - } --- 167,169 ---- Index: Expression.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_ScriptsBase/Expression.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** Expression.h 23 May 2003 05:46:26 -0000 1.2 --- Expression.h 25 Jun 2003 22:55:58 -0000 1.3 *************** *** 1,5 **** #pragma once ! __declspec(dllexport) DWORD DefLookup(const TCHAR *pszExp); class __declspec(dllexport) CExpression --- 1,5 ---- #pragma once ! extern DWORD DefLookup(const TCHAR *pszExp); class __declspec(dllexport) CExpression |
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); }; |
From: Philip E. <pes...@us...> - 2003-06-23 19:02:17
|
Update of /cvsroot/sphere-axis/Axis/S_ScriptsBase In directory sc8-pr-cvs1:/tmp/cvs-serv15121/S_ScriptsBase Modified Files: MD5Hash.cpp Log Message: no message Index: MD5Hash.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_ScriptsBase/MD5Hash.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** MD5Hash.cpp 19 Jun 2003 05:59:58 -0000 1.2 --- MD5Hash.cpp 23 Jun 2003 19:02:14 -0000 1.3 *************** *** 6,10 **** using namespace std; ! #include "md5.h" using namespace CryptoPP; --- 6,10 ---- using namespace std; ! #include <cryptlib/md5.h> using namespace CryptoPP; |
From: Philip E. <pes...@us...> - 2003-06-23 14:46:45
|
Update of /cvsroot/sphere-axis/axissvr In directory sc8-pr-cvs1:/tmp/cvs-serv2155 Modified Files: AxisServer.vcproj DBConfig.cpp DBConfigDlg.cpp Log Message: no message Index: AxisServer.vcproj =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/AxisServer.vcproj,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** AxisServer.vcproj 19 Jun 2003 21:37:52 -0000 1.4 --- AxisServer.vcproj 23 Jun 2003 14:46:41 -0000 1.5 *************** *** 24,28 **** Name="VCCLCompilerTool" InlineFunctionExpansion="1" ! AdditionalIncludeDirectories="..\crypto51\" PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS" StringPooling="TRUE" --- 24,28 ---- Name="VCCLCompilerTool" InlineFunctionExpansion="1" ! AdditionalIncludeDirectories="" PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS" StringPooling="TRUE" *************** *** 81,85 **** Name="VCCLCompilerTool" Optimization="0" ! AdditionalIncludeDirectories="..\crypto51\" PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS" BasicRuntimeChecks="3" --- 81,85 ---- Name="VCCLCompilerTool" Optimization="0" ! AdditionalIncludeDirectories="" PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS" BasicRuntimeChecks="3" Index: DBConfig.cpp =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/DBConfig.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** DBConfig.cpp 17 Jun 2003 22:33:08 -0000 1.5 --- DBConfig.cpp 23 Jun 2003 14:46:41 -0000 1.6 *************** *** 26,30 **** #include "ServerObj.h" ! #include "md5.h" using namespace std; using namespace CryptoPP; --- 26,30 ---- #include "ServerObj.h" ! #include <cryptlib/md5.h> using namespace std; using namespace CryptoPP; Index: DBConfigDlg.cpp =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/DBConfigDlg.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** DBConfigDlg.cpp 17 Jun 2003 22:33:08 -0000 1.4 --- DBConfigDlg.cpp 23 Jun 2003 14:46:41 -0000 1.5 *************** *** 32,36 **** #include <sys/stat.h> ! #include "md5.h" using namespace CryptoPP; --- 32,36 ---- #include <sys/stat.h> ! #include <cryptlib/md5.h> using namespace CryptoPP; |
From: Philip E. <pes...@us...> - 2003-06-19 21:38:31
|
Update of /cvsroot/sphere-axis/Axis In directory sc8-pr-cvs1:/tmp/cvs-serv30029 Modified Files: Axis.sln Log Message: no message Index: Axis.sln =================================================================== RCS file: /cvsroot/sphere-axis/Axis/Axis.sln,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** Axis.sln 19 Jun 2003 19:13:36 -0000 1.8 --- Axis.sln 19 Jun 2003 21:38:28 -0000 1.9 *************** *** 14,19 **** Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AxisLib", "AxisLib\AxisLib.vcproj", "{A3262B43-56CE-4D79-83D3-0DB671456E28}" EndProject - Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cryptlib", "..\crypto51\cryptlib.vcproj", "{12FC5778-8916-4D2B-8F2E-B4A94ECE2186}" - EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "S_Sphere52", "S_Sphere52\S_Sphere52.vcproj", "{3ECDA872-C8AF-464E-80EE-3976E9DE72B2}" EndProject --- 14,17 ---- *************** *** 128,143 **** {A3262B43-56CE-4D79-83D3-0DB671456E28}.Unicode Release.ActiveCfg = Release|Win32 {A3262B43-56CE-4D79-83D3-0DB671456E28}.Unicode Release.Build.0 = Release|Win32 - {12FC5778-8916-4D2B-8F2E-B4A94ECE2186}.Debug.ActiveCfg = Debug|Win32 - {12FC5778-8916-4D2B-8F2E-B4A94ECE2186}.Debug.Build.0 = Debug|Win32 - {12FC5778-8916-4D2B-8F2E-B4A94ECE2186}.FIPS 140 Debug.ActiveCfg = FIPS 140 Debug|Win32 - {12FC5778-8916-4D2B-8F2E-B4A94ECE2186}.FIPS 140 Debug.Build.0 = FIPS 140 Debug|Win32 - {12FC5778-8916-4D2B-8F2E-B4A94ECE2186}.FIPS 140 Release.ActiveCfg = FIPS 140 Release|Win32 - {12FC5778-8916-4D2B-8F2E-B4A94ECE2186}.FIPS 140 Release.Build.0 = FIPS 140 Release|Win32 - {12FC5778-8916-4D2B-8F2E-B4A94ECE2186}.Release.ActiveCfg = Release|Win32 - {12FC5778-8916-4D2B-8F2E-B4A94ECE2186}.Release.Build.0 = Release|Win32 - {12FC5778-8916-4D2B-8F2E-B4A94ECE2186}.Unicode Debug.ActiveCfg = Debug|Win32 - {12FC5778-8916-4D2B-8F2E-B4A94ECE2186}.Unicode Debug.Build.0 = Debug|Win32 - {12FC5778-8916-4D2B-8F2E-B4A94ECE2186}.Unicode Release.ActiveCfg = Release|Win32 - {12FC5778-8916-4D2B-8F2E-B4A94ECE2186}.Unicode Release.Build.0 = Release|Win32 {3ECDA872-C8AF-464E-80EE-3976E9DE72B2}.Debug.ActiveCfg = Debug|Win32 {3ECDA872-C8AF-464E-80EE-3976E9DE72B2}.Debug.Build.0 = Debug|Win32 --- 126,129 ---- |
From: Philip E. <pes...@us...> - 2003-06-19 21:38:31
|
Update of /cvsroot/sphere-axis/Axis/S_ScriptsBase In directory sc8-pr-cvs1:/tmp/cvs-serv30029/S_ScriptsBase Modified Files: FileMap.cpp S_ScriptsBase.vcproj Log Message: no message Index: FileMap.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_ScriptsBase/FileMap.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** FileMap.cpp 18 Jun 2003 22:45:25 -0000 1.1 --- FileMap.cpp 19 Jun 2003 21:38:29 -0000 1.2 *************** *** 95,99 **** AddValue(pDoc, pRoot, _T("LastUpdate"), (void*)&m_tLastUpdate, XML_Int, 1); - TCHAR szXMLFile[MAX_PATH]; CString sFile = m_sLocalFilename; if ( sFile.Find(_T("\\")) != -1 ) --- 95,98 ---- *************** *** 101,106 **** else sFile.Insert(0, _T(".")); _stprintf(szXMLFile, sFile); ! xmlSaveFormatFileEnc(szXMLFile, pDoc, "UTF-8", 1); // Hide the file --- 100,118 ---- else sFile.Insert(0, _T(".")); + + TCHAR szXMLFile[MAX_PATH]; _stprintf(szXMLFile, sFile); ! SetFileAttributes(szXMLFile, FILE_ATTRIBUTE_NORMAL); ! ! //if ( (_tunlink(szXMLFile) == -1) && (errno == EACCES) ) ! //{ ! // TRACE(_T("Access denied while trying to delete file %s."), szXMLFile); ! //} ! ! if ( xmlSaveFormatFileEnc(szXMLFile, pDoc, "UTF-8", 1) == -1 ) ! { ! TRACE(_T("xmlSaveFormatFileEnc() failed for file %s.\n"), szXMLFile); ! return false; ! } // Hide the file Index: S_ScriptsBase.vcproj =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_ScriptsBase/S_ScriptsBase.vcproj,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** S_ScriptsBase.vcproj 19 Jun 2003 19:13:36 -0000 1.8 --- S_ScriptsBase.vcproj 19 Jun 2003 21:38:29 -0000 1.9 *************** *** 35,39 **** <Tool Name="VCLibrarianTool" ! AdditionalDependencies="..\..\crypto51\$(OutDir)\cryptlib.lib" OutputFile="$(OutDir)\$(ProjectName).lib" AdditionalLibraryDirectories=""/> --- 35,39 ---- <Tool Name="VCLibrarianTool" ! AdditionalDependencies="cryptlibd.lib" OutputFile="$(OutDir)\$(ProjectName).lib" AdditionalLibraryDirectories=""/> *************** *** 82,86 **** <Tool Name="VCLibrarianTool" ! AdditionalDependencies="..\..\crypto51\$(OutDir)\cryptlib.lib" OutputFile="$(OutDir)\$(ProjectName).lib" AdditionalLibraryDirectories=""/> --- 82,86 ---- <Tool Name="VCLibrarianTool" ! AdditionalDependencies="cryptlib.lib" OutputFile="$(OutDir)\$(ProjectName).lib" AdditionalLibraryDirectories=""/> |
From: Philip E. <pes...@us...> - 2003-06-19 21:38:31
|
Update of /cvsroot/sphere-axis/Axis/AxisLib In directory sc8-pr-cvs1:/tmp/cvs-serv30029/AxisLib Modified Files: AxisServerInterface.cpp Log Message: no message Index: AxisServerInterface.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/AxisLib/AxisServerInterface.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** AxisServerInterface.cpp 18 Jun 2003 22:45:25 -0000 1.4 --- AxisServerInterface.cpp 19 Jun 2003 21:38:29 -0000 1.5 *************** *** 385,388 **** --- 385,389 ---- } iLength = atoi((char*)szBuffer); + TRACE(_T("The incoming file has a length of %ld.\n"), iLength); if ( m_pProgress ) m_pProgress->SetRange(0, (ULONG) iLength); *************** *** 416,420 **** } iRead += rc; ! sMessage.Format(_T(IDS_REMOTE_RCVFILE), iRead, iLength, (TCHAR*)remoteFile); if ( m_pProgress ) { --- 417,421 ---- } iRead += rc; ! sMessage.Format(_T(IDS_REMOTE_RCVFILE), iRead, iLength, sRemote); if ( m_pProgress ) { *************** *** 425,428 **** --- 426,430 ---- char szAck[MAX_BUFFER]; sprintf(szAck, "%ld", rc); + TRACE(_T("Sending ack (%ld).\n"), rc); if ( Send((BYTE*)&szAck[0], (ULONG) strlen((char*)&szAck[0])) <= 0 ) { |
From: Philip E. <pes...@us...> - 2003-06-19 21:37:55
|
Update of /cvsroot/sphere-axis/axissvr In directory sc8-pr-cvs1:/tmp/cvs-serv29889 Modified Files: AxisServer.rc AxisServer.vcproj ClientObj.cpp ConfigDlg.cpp ConfigDlg.h resource.h ServerConfiguration.cpp ServerConfiguration.h ServerObj.h Log Message: Added option to dump incoming packets. Index: AxisServer.rc =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/AxisServer.rc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** AxisServer.rc 17 Jun 2003 22:33:08 -0000 1.4 --- AxisServer.rc 19 Jun 2003 21:37:52 -0000 1.5 *************** *** 169,175 **** BS_AUTOCHECKBOX | WS_TABSTOP,13,28,69,10 CONTROL "Allow multithreading",IDC_MULTITHREAD,"Button", ! BS_AUTOCHECKBOX | WS_TABSTOP,13,41,78,10 CONTROL "Readonly mode",IDC_READONLY,"Button",BS_AUTOCHECKBOX | ! WS_TABSTOP,13,54,65,10 EDITTEXT IDC_MAXCONNECTIONS,141,65,36,12,ES_AUTOHSCROLL | ES_NUMBER --- 169,175 ---- BS_AUTOCHECKBOX | WS_TABSTOP,13,28,69,10 CONTROL "Allow multithreading",IDC_MULTITHREAD,"Button", ! BS_AUTOCHECKBOX | WS_TABSTOP,13,38,78,10 CONTROL "Readonly mode",IDC_READONLY,"Button",BS_AUTOCHECKBOX | ! WS_TABSTOP,13,48,65,10 EDITTEXT IDC_MAXCONNECTIONS,141,65,36,12,ES_AUTOHSCROLL | ES_NUMBER *************** *** 197,201 **** LTEXT "Allowed file paths",IDC_STATIC,24,147,56,8 LTEXT "Allowed file extensions",IDC_STATIC,156,147,72,8 ! GROUPBOX "General Options",IDC_STATIC,7,7,174,96 GROUPBOX "File Options",IDC_STATIC,20,137,263,80 LTEXT "Denied Hosts",IDC_STATIC,24,230,44,8 --- 197,201 ---- LTEXT "Allowed file paths",IDC_STATIC,24,147,56,8 LTEXT "Allowed file extensions",IDC_STATIC,156,147,72,8 ! GROUPBOX "General Options",IDC_STATIC,7,7,187,102 GROUPBOX "File Options",IDC_STATIC,20,137,263,80 LTEXT "Denied Hosts",IDC_STATIC,24,230,44,8 *************** *** 208,216 **** EDITTEXT IDC_SPAWNREFRESHTIME,141,87,36,12,ES_AUTOHSCROLL | ES_NUMBER ! GROUPBOX "Security Options",IDC_STATIC,7,103,292,204 CONTROL "Use Database to specify individual user permissions", ! IDC_USEDB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,22,122, 178,10 ! PUSHBUTTON "Configure Database",IDC_CONFIGDB,205,120,74,16 END --- 208,218 ---- EDITTEXT IDC_SPAWNREFRESHTIME,141,87,36,12,ES_AUTOHSCROLL | ES_NUMBER ! GROUPBOX "Security Options",IDC_STATIC,7,112,292,195 CONTROL "Use Database to specify individual user permissions", ! IDC_USEDB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,22,125, 178,10 ! PUSHBUTTON "Configure Database",IDC_CONFIGDB,205,123,74,16 ! CONTROL "Dump Packets",IDC_DUMPPACKETS,"Button",BS_AUTOCHECKBOX | ! WS_TABSTOP,13,58,70,10 END Index: AxisServer.vcproj =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/AxisServer.vcproj,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** AxisServer.vcproj 19 Jun 2003 19:13:18 -0000 1.3 --- AxisServer.vcproj 19 Jun 2003 21:37:52 -0000 1.4 *************** *** 42,46 **** Name="VCLinkerTool" AdditionalOptions="/MACHINE:I386" ! AdditionalDependencies="libxml2.lib ..\crypto51\release\cryptlib.lib" OutputFile=".\Release/AxisServer.exe" LinkIncremental="1" --- 42,46 ---- Name="VCLinkerTool" AdditionalOptions="/MACHINE:I386" ! AdditionalDependencies="libxml2.lib cryptlib.lib" OutputFile=".\Release/AxisServer.exe" LinkIncremental="1" *************** *** 99,103 **** Name="VCLinkerTool" AdditionalOptions="/MACHINE:I386" ! AdditionalDependencies="libxml2.lib ..\crypto51\debug\cryptlib.lib" OutputFile=".\Debug/AxisServer.exe" LinkIncremental="2" --- 99,103 ---- Name="VCLinkerTool" AdditionalOptions="/MACHINE:I386" ! AdditionalDependencies="libxml2.lib cryptlibd.lib" OutputFile=".\Debug/AxisServer.exe" LinkIncremental="2" Index: ClientObj.cpp =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/ClientObj.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** ClientObj.cpp 19 Jun 2003 18:03:39 -0000 1.7 --- ClientObj.cpp 19 Jun 2003 21:37:52 -0000 1.8 *************** *** 132,135 **** --- 132,137 ---- sprintf((char*)szOutput, "%ld", lLength); Send(szOutput, strlen((char*)szOutput)); + char szInput[5]; + int iBytesSent; while (!feof(pFile)) { *************** *** 139,143 **** if ( iBytesRead ) { ! int iBytesSent = Send((BYTE*)bOutput, iBytesRead); #ifdef WIN32 Sleep(SLEEPTIME); --- 141,145 ---- if ( iBytesRead ) { ! iBytesSent = Send((BYTE*)bOutput, iBytesRead); #ifdef WIN32 Sleep(SLEEPTIME); *************** *** 145,149 **** sleep(SLEEPTIME/1000); #endif - char szInput[5]; memset(&szInput[0], 0x00, sizeof(szInput)); Receive((BYTE*)&szInput[0], sizeof(szInput)); --- 147,150 ---- *************** *** 157,161 **** } fclose(pFile); ! Send((BYTE*)szEOF, strlen(szEOF)); #ifdef WIN32 Sleep(SLEEPTIME); --- 158,162 ---- } fclose(pFile); ! iBytesSent = Send((BYTE*)szEOF, strlen(szEOF)); #ifdef WIN32 Sleep(SLEEPTIME); *************** *** 163,166 **** --- 164,176 ---- sleep(SLEEPTIME/1000); #endif + // Receive the final ack + memset(&szInput[0], 0x00, sizeof(szInput)); + Receive((BYTE*)&szInput[0], sizeof(szInput)); + if ( atoi(szInput) != iBytesSent ) + { + SysMessage(_T("Ack failed while sending file. %ld != %ld\n"), atoi(szInput), iBytesSent); + fclose(pFile); + return; + } memset( szOutput, 0x00, sizeof(szOutput) ); return; *************** *** 552,556 **** #endif } ! if ( m_pServer->DumpPackets() ) { BYTE outbuffer[MAX_BUFFER * 2 + 4]; --- 562,566 ---- #endif } ! if ( m_pServer->m_config.DumpPackets() ) { BYTE outbuffer[MAX_BUFFER * 2 + 4]; Index: ConfigDlg.cpp =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/ConfigDlg.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** ConfigDlg.cpp 17 Jun 2003 22:33:08 -0000 1.3 --- ConfigDlg.cpp 19 Jun 2003 21:37:52 -0000 1.4 *************** *** 58,61 **** --- 58,62 ---- DDX_Control(pDX, IDC_MULTITHREAD, m_bMultiThread); DDX_Control(pDX, IDC_READONLY, m_bReadonly); + DDX_Control(pDX, IDC_DUMPPACKETS, m_bDumpPackets); DDX_Control(pDX, IDC_MAXCONNECTIONS, m_eMaxConnections); DDX_Control(pDX, IDC_ALLOWEDPATHS, m_lAllowedPaths); *************** *** 192,195 **** --- 193,197 ---- m_cfgNew.UseService(m_bUseService.GetCheck()); m_cfgNew.UseThreads(m_bMultiThread.GetCheck()); + m_cfgNew.DumpPackets(m_bDumpPackets.GetCheck()); // Get the strings for the list boxes *************** *** 220,223 **** --- 222,226 ---- m_bUseService.SetCheck(m_cfgNew.UseService()); m_bMultiThread.SetCheck(m_cfgNew.UseThreads()); + m_bDumpPackets.SetCheck(m_cfgNew.DumpPackets()); if ( !m_cfgNew.UseDB() ) Index: ConfigDlg.h =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/ConfigDlg.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** ConfigDlg.h 17 Jun 2003 22:33:08 -0000 1.3 --- ConfigDlg.h 19 Jun 2003 21:37:52 -0000 1.4 *************** *** 63,66 **** --- 63,67 ---- CButton m_bMultiThread; CButton m_bReadonly; + CButton m_bDumpPackets; CEdit m_eMaxConnections; CListBox m_lAllowedPaths; Index: resource.h =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/resource.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** resource.h 23 May 2003 15:38:29 -0000 1.4 --- resource.h 19 Jun 2003 21:37:52 -0000 1.5 *************** *** 81,84 **** --- 81,86 ---- #define IDC_BUTTON4 1066 #define IDC_READWRITE 1067 + #define IDC_CHECK1 1068 + #define IDC_DUMPPACKETS 1068 #define ID_VIEW_FONTS 32771 #define ID_SERVER_STOP 32772 *************** *** 93,97 **** #define _APS_NEXT_RESOURCE_VALUE 136 #define _APS_NEXT_COMMAND_VALUE 32775 ! #define _APS_NEXT_CONTROL_VALUE 1068 #define _APS_NEXT_SYMED_VALUE 103 #endif --- 95,99 ---- #define _APS_NEXT_RESOURCE_VALUE 136 #define _APS_NEXT_COMMAND_VALUE 32775 ! #define _APS_NEXT_CONTROL_VALUE 1069 #define _APS_NEXT_SYMED_VALUE 103 #endif Index: ServerConfiguration.cpp =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/ServerConfiguration.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** ServerConfiguration.cpp 23 May 2003 15:38:29 -0000 1.2 --- ServerConfiguration.cpp 19 Jun 2003 21:37:52 -0000 1.3 *************** *** 29,32 **** --- 29,33 ---- m_bFontFlags = 0; m_bUseDB = FALSE; + m_bDumpPackets = FALSE; } *************** *** 272,275 **** --- 273,277 ---- m_bUseService = pSource->UseService(); m_bUseThreads = pSource->UseThreads(); + m_bDumpPackets = pSource->DumpPackets(); m_sFontName.assign(pSource->FontName()); *************** *** 376,379 **** --- 378,382 ---- ReadValue(pDoc, pRoot, _T("UseThreads"), (void*) &m_bUseThreads, 0); ReadValue(pDoc, pRoot, _T("ReadOnly"), (void*) &m_bReadOnly, 0); + ReadValue(pDoc, pRoot, _T("DumpPackets"), (void*) &m_bDumpPackets, 0); ReadValue(pDoc, pRoot, _T("SpawnRefreshTime"), (void*) &m_iSpawnRefreshtime, 5); ReadValue(pDoc, pRoot, _T("NTService"), (void*) &m_bUseService, 5); *************** *** 412,415 **** --- 415,419 ---- AddValue(pDoc, pRoot, _T("UseThreads"), (void*) &m_bUseThreads, 0); AddValue(pDoc, pRoot, _T("ReadOnly"), (void*) &m_bReadOnly, 0); + AddValue(pDoc, pRoot, _T("DumpPackets"), (void*) &m_bDumpPackets, 0); AddValue(pDoc, pRoot, _T("SpawnRefreshTime"), (void*) &m_iSpawnRefreshtime, 5); AddValue(pDoc, pRoot, _T("NTService"), (void*) &m_bUseService, 5); Index: ServerConfiguration.h =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/ServerConfiguration.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** ServerConfiguration.h 23 May 2003 15:38:29 -0000 1.2 --- ServerConfiguration.h 19 Jun 2003 21:37:52 -0000 1.3 *************** *** 94,97 **** --- 94,100 ---- virtual ~CServerConfiguration(); + void DumpPackets(BOOL b) { m_bDumpPackets = b; } + BOOL DumpPackets() { return m_bDumpPackets; } + protected: int m_iServerPort; *************** *** 99,102 **** --- 102,106 ---- BOOL m_bReadOnly; BOOL m_bUseThreads; + BOOL m_bDumpPackets; int m_iMaxConnections; int m_iReceiveTimeout; Index: ServerObj.h =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/ServerObj.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** ServerObj.h 16 Jun 2003 22:05:59 -0000 1.4 --- ServerObj.h 19 Jun 2003 21:37:52 -0000 1.5 *************** *** 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! --- 52,55 ---- |
From: Philip E. <pes...@us...> - 2003-06-19 19:13:38
|
Update of /cvsroot/sphere-axis/Axis/S_Sphere52 In directory sc8-pr-cvs1:/tmp/cvs-serv1774/S_Sphere52 Modified Files: S_Sphere52.vcproj Log Message: no message Index: S_Sphere52.vcproj =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/S_Sphere52.vcproj,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** S_Sphere52.vcproj 19 Jun 2003 05:59:58 -0000 1.9 --- S_Sphere52.vcproj 19 Jun 2003 19:13:36 -0000 1.10 *************** *** 37,41 **** <Tool Name="VCLinkerTool" ! RegisterOutput="FALSE" IgnoreImportLibrary="FALSE" AdditionalDependencies="libxml2.lib comsvcs.lib ..\S_ScriptsBase\Debug\S_ScriptsBase.lib" --- 37,41 ---- <Tool Name="VCLinkerTool" ! RegisterOutput="TRUE" IgnoreImportLibrary="FALSE" AdditionalDependencies="libxml2.lib comsvcs.lib ..\S_ScriptsBase\Debug\S_ScriptsBase.lib" *************** *** 85,89 **** ConfigurationType="2" UseOfMFC="2" ! UseOfATL="1" ATLMinimizesCRunTimeLibraryUsage="FALSE" CharacterSet="2"> --- 85,89 ---- ConfigurationType="2" UseOfMFC="2" ! UseOfATL="2" ATLMinimizesCRunTimeLibraryUsage="FALSE" CharacterSet="2"> *************** *** 106,112 **** Name="VCLinkerTool" IgnoreImportLibrary="TRUE" ! AdditionalDependencies=" libxml2.lib comsvcs.lib ..\S_ScriptsBase\Release\S_ScriptsBase.lib" OutputFile="$(OutDir)/S_Sphere52.dll" LinkIncremental="1" ModuleDefinitionFile=".\S_Sphere52.def" GenerateDebugInformation="TRUE" --- 106,113 ---- Name="VCLinkerTool" IgnoreImportLibrary="TRUE" ! AdditionalDependencies="libxml2.lib comsvcs.lib ..\S_ScriptsBase\Release\S_ScriptsBase.lib" OutputFile="$(OutDir)/S_Sphere52.dll" LinkIncremental="1" + IgnoreDefaultLibraryNames="" ModuleDefinitionFile=".\S_Sphere52.def" GenerateDebugInformation="TRUE" *************** *** 132,137 **** CommandLine="regsvr32 /s /c "$(TargetPath)""/> <Tool ! Name="VCPreBuildEventTool" ! CommandLine="copy ..\S_ScriptsBase\release\S_ScriptsBase.dll Release"/> <Tool Name="VCPreLinkEventTool"/> --- 133,137 ---- CommandLine="regsvr32 /s /c "$(TargetPath)""/> <Tool ! Name="VCPreBuildEventTool"/> <Tool Name="VCPreLinkEventTool"/> |
From: Philip E. <pes...@us...> - 2003-06-19 19:13:38
|
Update of /cvsroot/sphere-axis/Axis/S_ScriptsBase In directory sc8-pr-cvs1:/tmp/cvs-serv1774/S_ScriptsBase Modified Files: S_ScriptsBase.vcproj Log Message: no message Index: S_ScriptsBase.vcproj =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_ScriptsBase/S_ScriptsBase.vcproj,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** S_ScriptsBase.vcproj 19 Jun 2003 05:59:58 -0000 1.7 --- S_ScriptsBase.vcproj 19 Jun 2003 19:13:36 -0000 1.8 *************** *** 35,39 **** <Tool Name="VCLibrarianTool" ! OutputFile="$(OutDir)\$(ProjectName).lib"/> <Tool Name="VCMIDLTool" --- 35,41 ---- <Tool Name="VCLibrarianTool" ! AdditionalDependencies="..\..\crypto51\$(OutDir)\cryptlib.lib" ! OutputFile="$(OutDir)\$(ProjectName).lib" ! AdditionalLibraryDirectories=""/> <Tool Name="VCMIDLTool" *************** *** 58,62 **** OutputDirectory="Release" IntermediateDirectory="Release" ! ConfigurationType="2" UseOfMFC="2" CharacterSet="2"> --- 60,64 ---- OutputDirectory="Release" IntermediateDirectory="Release" ! ConfigurationType="4" UseOfMFC="2" CharacterSet="2"> *************** *** 66,69 **** --- 68,72 ---- InlineFunctionExpansion="1" OmitFramePointers="TRUE" + AdditionalIncludeDirectories="..\..\crypto51" PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;_USRDLL" StringPooling="TRUE" *************** *** 78,92 **** Name="VCCustomBuildTool"/> <Tool ! Name="VCLinkerTool" ! AdditionalDependencies="libxml2.lib comsvcs.lib" ! OutputFile="$(OutDir)/S_ScriptsBase.dll" ! LinkIncremental="1" ! ModuleDefinitionFile=".\S_ScriptsBase.def" ! GenerateDebugInformation="TRUE" ! SubSystem="2" ! OptimizeReferences="2" ! EnableCOMDATFolding="2" ! ImportLibrary="$(OutDir)/S_ScriptsBase.lib" ! TargetMachine="1"/> <Tool Name="VCMIDLTool" --- 81,88 ---- Name="VCCustomBuildTool"/> <Tool ! Name="VCLibrarianTool" ! AdditionalDependencies="..\..\crypto51\$(OutDir)\cryptlib.lib" ! OutputFile="$(OutDir)\$(ProjectName).lib" ! AdditionalLibraryDirectories=""/> <Tool Name="VCMIDLTool" *************** *** 106,111 **** <Tool Name="VCWebServiceProxyGeneratorTool"/> - <Tool - Name="VCWebDeploymentTool"/> </Configuration> </Configurations> --- 102,105 ---- |
From: Philip E. <pes...@us...> - 2003-06-19 19:13:38
|
Update of /cvsroot/sphere-axis/Axis In directory sc8-pr-cvs1:/tmp/cvs-serv1774 Modified Files: Axis.sln Log Message: no message Index: Axis.sln =================================================================== RCS file: /cvsroot/sphere-axis/Axis/Axis.sln,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** Axis.sln 19 Jun 2003 05:59:57 -0000 1.7 --- Axis.sln 19 Jun 2003 19:13:36 -0000 1.8 *************** *** 36,47 **** EndGlobalSection GlobalSection(ProjectDependencies) = postSolution ! {BFBB26A9-71A6-45FF-8C17-6E9EAEAAA4C3}.0 = {12FC5778-8916-4D2B-8F2E-B4A94ECE2186} ! {24511912-DBD6-4F14-8014-32E4F961C5D5}.0 = {4DB8875A-2964-4843-A469-879E1672A181} ! {24511912-DBD6-4F14-8014-32E4F961C5D5}.1 = {A3262B43-56CE-4D79-83D3-0DB671456E28} {24511912-DBD6-4F14-8014-32E4F961C5D5}.2 = {52C0CF6C-70BC-4A00-B25B-88782372914F} ! {24511912-DBD6-4F14-8014-32E4F961C5D5}.3 = {283AA9B4-58DF-42D2-8050-59F631661A1A} ! {24511912-DBD6-4F14-8014-32E4F961C5D5}.4 = {F592829A-6A02-43AF-A04F-CC81615805EF} {3ECDA872-C8AF-464E-80EE-3976E9DE72B2}.0 = {39ADE5E8-846A-4164-BBF2-A905CB3334BD} - {39ADE5E8-846A-4164-BBF2-A905CB3334BD}.0 = {12FC5778-8916-4D2B-8F2E-B4A94ECE2186} EndGlobalSection GlobalSection(ProjectConfiguration) = postSolution --- 36,45 ---- EndGlobalSection GlobalSection(ProjectDependencies) = postSolution ! {24511912-DBD6-4F14-8014-32E4F961C5D5}.0 = {F592829A-6A02-43AF-A04F-CC81615805EF} ! {24511912-DBD6-4F14-8014-32E4F961C5D5}.1 = {283AA9B4-58DF-42D2-8050-59F631661A1A} {24511912-DBD6-4F14-8014-32E4F961C5D5}.2 = {52C0CF6C-70BC-4A00-B25B-88782372914F} ! {24511912-DBD6-4F14-8014-32E4F961C5D5}.3 = {A3262B43-56CE-4D79-83D3-0DB671456E28} ! {24511912-DBD6-4F14-8014-32E4F961C5D5}.4 = {4DB8875A-2964-4843-A469-879E1672A181} {3ECDA872-C8AF-464E-80EE-3976E9DE72B2}.0 = {39ADE5E8-846A-4164-BBF2-A905CB3334BD} EndGlobalSection GlobalSection(ProjectConfiguration) = postSolution |
From: Philip E. <pes...@us...> - 2003-06-19 19:13:21
|
Update of /cvsroot/sphere-axis/axissvr In directory sc8-pr-cvs1:/tmp/cvs-serv1733 Modified Files: AxisServer.vcproj Log Message: no message Index: AxisServer.vcproj =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/AxisServer.vcproj,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** AxisServer.vcproj 23 May 2003 15:38:26 -0000 1.2 --- AxisServer.vcproj 19 Jun 2003 19:13:18 -0000 1.3 *************** *** 18,22 **** IntermediateDirectory=".\Release" ConfigurationType="1" ! UseOfMFC="1" ATLMinimizesCRunTimeLibraryUsage="FALSE" CharacterSet="0"> --- 18,22 ---- IntermediateDirectory=".\Release" ConfigurationType="1" ! UseOfMFC="2" ATLMinimizesCRunTimeLibraryUsage="FALSE" CharacterSet="0"> *************** *** 27,31 **** PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS" StringPooling="TRUE" ! RuntimeLibrary="0" EnableFunctionLevelLinking="TRUE" UsePrecompiledHeader="3" --- 27,31 ---- PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS" StringPooling="TRUE" ! RuntimeLibrary="2" EnableFunctionLevelLinking="TRUE" UsePrecompiledHeader="3" *************** *** 75,79 **** IntermediateDirectory=".\Debug" ConfigurationType="1" ! UseOfMFC="1" ATLMinimizesCRunTimeLibraryUsage="FALSE" CharacterSet="0"> --- 75,79 ---- IntermediateDirectory=".\Debug" ConfigurationType="1" ! UseOfMFC="2" ATLMinimizesCRunTimeLibraryUsage="FALSE" CharacterSet="0"> *************** *** 84,88 **** PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS" BasicRuntimeChecks="3" ! RuntimeLibrary="1" UsePrecompiledHeader="3" PrecompiledHeaderThrough="stdafx.h" --- 84,88 ---- PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS" BasicRuntimeChecks="3" ! RuntimeLibrary="3" UsePrecompiledHeader="3" PrecompiledHeaderThrough="stdafx.h" *************** *** 99,103 **** Name="VCLinkerTool" AdditionalOptions="/MACHINE:I386" ! AdditionalDependencies="libxml2.lib ..\crypto51\release\cryptlib.lib" OutputFile=".\Debug/AxisServer.exe" LinkIncremental="2" --- 99,103 ---- Name="VCLinkerTool" AdditionalOptions="/MACHINE:I386" ! AdditionalDependencies="libxml2.lib ..\crypto51\debug\cryptlib.lib" OutputFile=".\Debug/AxisServer.exe" LinkIncremental="2" |
From: Philip E. <pes...@us...> - 2003-06-19 18:03:42
|
Update of /cvsroot/sphere-axis/axissvr In directory sc8-pr-cvs1:/tmp/cvs-serv22545 Modified Files: ClientObj.cpp Log Message: no message Index: ClientObj.cpp =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/ClientObj.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** ClientObj.cpp 17 Jun 2003 22:33:08 -0000 1.6 --- ClientObj.cpp 19 Jun 2003 18:03:39 -0000 1.7 *************** *** 946,950 **** memcpy(&szArg[0], &szIn[4], (strlen((char*)szIn) - 4)); ! if ( !Command(szCmd, szArg) ) bQuit = TRUE; } --- 946,950 ---- memcpy(&szArg[0], &szIn[4], (strlen((char*)szIn) - 4)); ! if ( Command(szCmd, szArg) ) bQuit = TRUE; } |
From: Philip E. <pes...@us...> - 2003-06-19 18:03:25
|
Update of /cvsroot/sphere-axis/Axis/S_ScriptsBase In directory sc8-pr-cvs1:/tmp/cvs-serv22494/S_ScriptsBase Modified Files: AxisLibWrapper.cpp Log Message: no message Index: AxisLibWrapper.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_ScriptsBase/AxisLibWrapper.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** AxisLibWrapper.cpp 18 Jun 2003 22:45:25 -0000 1.5 --- AxisLibWrapper.cpp 19 Jun 2003 18:03:20 -0000 1.6 *************** *** 118,125 **** CFileMap m(sLocal, sRemote); ULONG checksum = 0; if ( m.Load() ) { // Compare the checksum from the last time we got this ! if ( GetFileChecksum(_T(""), sRemote, &checksum) && checksum == m.Checksum() ) // We have the latest version already return true; --- 118,126 ---- CFileMap m(sLocal, sRemote); ULONG checksum = 0; + GetFileChecksum(_T(""), sRemote, &checksum); if ( m.Load() ) { // Compare the checksum from the last time we got this ! if ( checksum == m.Checksum() ) // We have the latest version already return true; |
From: Philip E. <pes...@us...> - 2003-06-19 18:03:25
|
Update of /cvsroot/sphere-axis/Axis/S_Sphere52 In directory sc8-pr-cvs1:/tmp/cvs-serv22494/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.16 retrieving revision 1.17 diff -C2 -r1.16 -r1.17 *** ScriptsMain.cpp 19 Jun 2003 05:59:58 -0000 1.16 --- ScriptsMain.cpp 19 Jun 2003 18:03:20 -0000 1.17 *************** *** 2242,2245 **** --- 2242,2247 ---- if ( m_pProfile->ProfileType() == PROFILE_REMOTE ) { + Main->m_pAxis->SetAxisServerParameters(m_pProfile->ServerHost(), m_pProfile->RemotePort(), m_pProfile->RemoteAccount(), m_pProfile->RemotePassword(), m_pProfile->RemoteTimeout()); + Main->m_pAxis->Login(); CStringArray csaScripts; csaScripts.Copy(m_pProfile->Files()); *************** *** 2258,2261 **** --- 2260,2264 ---- this->m_bDeleteDialog = true; DestroyProgressDialog(); + Main->m_pAxis->Logout(); // We're done return; |
From: Philip E. <pes...@us...> - 2003-06-19 06:00:02
|
Update of /cvsroot/sphere-axis/Axis/S_Sphere52 In directory sc8-pr-cvs1:/tmp/cvs-serv14407/S_Sphere52 Modified Files: S_Sphere52.vcproj ScriptsMain.cpp Log Message: no message Index: S_Sphere52.vcproj =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/S_Sphere52.vcproj,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** S_Sphere52.vcproj 18 Jun 2003 22:45:25 -0000 1.8 --- S_Sphere52.vcproj 19 Jun 2003 05:59:58 -0000 1.9 *************** *** 17,21 **** ConfigurationType="2" UseOfMFC="2" ! UseOfATL="1" ATLMinimizesCRunTimeLibraryUsage="FALSE" CharacterSet="2"> --- 17,21 ---- ConfigurationType="2" UseOfMFC="2" ! UseOfATL="2" ATLMinimizesCRunTimeLibraryUsage="FALSE" CharacterSet="2"> *************** *** 23,27 **** Name="VCCLCompilerTool" Optimization="0" ! AdditionalIncludeDirectories="../S_ScriptsBase" PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG;_USRDLL;_MERGE_PROXYSTUB" MinimalRebuild="TRUE" --- 23,27 ---- Name="VCCLCompilerTool" Optimization="0" ! AdditionalIncludeDirectories="../../crypto51;../S_ScriptsBase" PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG;_USRDLL;_MERGE_PROXYSTUB" MinimalRebuild="TRUE" *************** *** 37,46 **** <Tool 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" --- 37,48 ---- <Tool Name="VCLinkerTool" ! RegisterOutput="FALSE" ! IgnoreImportLibrary="FALSE" ! AdditionalDependencies="libxml2.lib comsvcs.lib ..\S_ScriptsBase\Debug\S_ScriptsBase.lib" ShowProgress="0" OutputFile="$(OutDir)/S_Sphere52.dll" LinkIncremental="2" AdditionalLibraryDirectories="" + IgnoreAllDefaultLibraries="FALSE" ModuleDefinitionFile=".\S_Sphere52.def" GenerateDebugInformation="TRUE" *************** *** 66,71 **** Name="VCPreBuildEventTool"/> <Tool ! Name="VCPreLinkEventTool" ! CommandLine="copy ..\S_ScriptsBase\Debug\*.dll debug"/> <Tool Name="VCResourceCompilerTool" --- 68,72 ---- Name="VCPreBuildEventTool"/> <Tool ! Name="VCPreLinkEventTool"/> <Tool Name="VCResourceCompilerTool" Index: ScriptsMain.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/ScriptsMain.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -r1.15 -r1.16 *** ScriptsMain.cpp 18 Jun 2003 22:45:25 -0000 1.15 --- ScriptsMain.cpp 19 Jun 2003 05:59:58 -0000 1.16 *************** *** 2252,2256 **** { CString sFile; ! sFile.Format(_T("%s\\%s"), m_pProfile->ProfileName(), CMD5Hash::GetHash(csaScripts.GetAt(i))); Main->m_pAxis->GetRemoteFile(csaScripts.GetAt(i), sFile); } --- 2252,2257 ---- { CString sFile; ! CMD5Hash md5; ! sFile.Format(_T("%s\\%s"), m_pProfile->ProfileName(), md5.GetHash(csaScripts.GetAt(i))); Main->m_pAxis->GetRemoteFile(csaScripts.GetAt(i), sFile); } |
From: Philip E. <pes...@us...> - 2003-06-19 06:00:02
|
Update of /cvsroot/sphere-axis/Axis/S_ScriptsBase In directory sc8-pr-cvs1:/tmp/cvs-serv14407/S_ScriptsBase Modified Files: MD5Hash.cpp MD5Hash.h S_ScriptsBase.vcproj Log Message: no message Index: MD5Hash.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_ScriptsBase/MD5Hash.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** MD5Hash.cpp 18 Jun 2003 22:45:25 -0000 1.1 --- MD5Hash.cpp 19 Jun 2003 05:59:58 -0000 1.2 *************** *** 17,34 **** } ! CString CMD5Hash::GetHash(LPCTSTR pszText) { CryptoPP::MD5 md5; BYTE bMD5Data[16]; ! md5.CalculateDigest(bMD5Data, (const byte*) pszText, _tcslen(pszText)); ! TCHAR szMD5String[64]; memset(szMD5String, 0x00, sizeof(szMD5String)); for ( int m = 0; m < 16; m++ ) { ! TCHAR szByte[3]; ! _stprintf(szByte, _T("%02x"), bMD5Data[m]); ! _tcscat(szMD5String, szByte); } ! CString s(szMD5String); return s; } --- 17,51 ---- } ! CStringA CMD5Hash::GetHashA(LPCSTR pszText) { CryptoPP::MD5 md5; BYTE bMD5Data[16]; ! md5.CalculateDigest(bMD5Data, (const byte*) pszText, (int) strlen(pszText)); ! CHAR szMD5String[64]; memset(szMD5String, 0x00, sizeof(szMD5String)); for ( int m = 0; m < 16; m++ ) { ! CHAR szByte[3]; ! sprintf(szByte, "%02x", bMD5Data[m]); ! strcat(szMD5String, szByte); } ! CStringA s(szMD5String); ! return s; ! } ! ! CStringW CMD5Hash::GetHashW(LPWSTR pszText) ! { ! CryptoPP::MD5 md5; ! BYTE bMD5Data[16]; ! md5.CalculateDigest(bMD5Data, (const byte*) pszText, (int) wcslen(pszText)); ! WCHAR szMD5String[64]; ! memset(szMD5String, 0x00, sizeof(szMD5String)); ! for ( int m = 0; m < 16; m++ ) ! { ! WCHAR szByte[3]; ! swprintf(szByte, L"%02x", bMD5Data[m]); ! wcscat(szMD5String, szByte); ! } ! CStringW s(szMD5String); return s; } Index: MD5Hash.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_ScriptsBase/MD5Hash.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** MD5Hash.h 18 Jun 2003 22:45:25 -0000 1.1 --- MD5Hash.h 19 Jun 2003 05:59:58 -0000 1.2 *************** *** 1,5 **** #pragma once ! class CMD5Hash { public: --- 1,5 ---- #pragma once ! class __declspec(dllexport) CMD5Hash { public: *************** *** 7,10 **** ~CMD5Hash(void); ! static CString GetHash(LPCTSTR pszText); }; --- 7,16 ---- ~CMD5Hash(void); ! #ifdef _UNICODE ! #define GetHash GetHashW ! #else ! #define GetHash GetHashA ! #endif ! CStringA GetHashA(LPCSTR pszText); ! CStringW GetHashW(LPWSTR pszText); }; Index: S_ScriptsBase.vcproj =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_ScriptsBase/S_ScriptsBase.vcproj,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** S_ScriptsBase.vcproj 18 Jun 2003 22:45:25 -0000 1.6 --- S_ScriptsBase.vcproj 19 Jun 2003 05:59:58 -0000 1.7 *************** *** 15,19 **** OutputDirectory="Debug" IntermediateDirectory="Debug" ! ConfigurationType="2" UseOfMFC="2" CharacterSet="2"> --- 15,19 ---- OutputDirectory="Debug" IntermediateDirectory="Debug" ! ConfigurationType="4" UseOfMFC="2" CharacterSet="2"> *************** *** 21,25 **** Name="VCCLCompilerTool" Optimization="0" ! AdditionalIncludeDirectories="../../crypto51" PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG;_USRDLL" MinimalRebuild="TRUE" --- 21,25 ---- Name="VCCLCompilerTool" Optimization="0" ! AdditionalIncludeDirectories="..\..\crypto51" PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG;_USRDLL" MinimalRebuild="TRUE" *************** *** 34,47 **** Name="VCCustomBuildTool"/> <Tool ! Name="VCLinkerTool" ! AdditionalDependencies="libxml2.lib comsvcs.lib ..\..\crypto51\release\cryptlib.lib" ! ShowProgress="0" ! OutputFile="$(OutDir)/S_ScriptsBase.dll" ! LinkIncremental="2" ! ModuleDefinitionFile=".\S_ScriptsBase.def" ! GenerateDebugInformation="TRUE" ! SubSystem="2" ! ImportLibrary="$(OutDir)/S_ScriptsBase.lib" ! TargetMachine="1"/> <Tool Name="VCMIDLTool" --- 34,39 ---- Name="VCCustomBuildTool"/> <Tool ! Name="VCLibrarianTool" ! OutputFile="$(OutDir)\$(ProjectName).lib"/> <Tool Name="VCMIDLTool" *************** *** 61,66 **** <Tool Name="VCWebServiceProxyGeneratorTool"/> - <Tool - Name="VCWebDeploymentTool"/> </Configuration> <Configuration --- 53,56 ---- |
From: Philip E. <pes...@us...> - 2003-06-19 06:00:01
|
Update of /cvsroot/sphere-axis/Axis In directory sc8-pr-cvs1:/tmp/cvs-serv14407 Modified Files: Axis.sln Log Message: no message Index: Axis.sln =================================================================== RCS file: /cvsroot/sphere-axis/Axis/Axis.sln,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** Axis.sln 10 Jun 2003 22:57:18 -0000 1.6 --- Axis.sln 19 Jun 2003 05:59:57 -0000 1.7 *************** *** 43,46 **** --- 43,47 ---- {24511912-DBD6-4F14-8014-32E4F961C5D5}.4 = {F592829A-6A02-43AF-A04F-CC81615805EF} {3ECDA872-C8AF-464E-80EE-3976E9DE72B2}.0 = {39ADE5E8-846A-4164-BBF2-A905CB3334BD} + {39ADE5E8-846A-4164-BBF2-A905CB3334BD}.0 = {12FC5778-8916-4D2B-8F2E-B4A94ECE2186} EndGlobalSection GlobalSection(ProjectConfiguration) = postSolution |
From: Philip E. <pes...@us...> - 2003-06-18 22:45:28
|
Update of /cvsroot/sphere-axis/Axis/S_Sphere52 In directory sc8-pr-cvs1:/tmp/cvs-serv20089/S_Sphere52 Modified Files: ProfileEdit.cpp S_Sphere52.vcproj ScriptsMain.cpp ScriptsMain.h Log Message: no message Index: ProfileEdit.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/ProfileEdit.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** ProfileEdit.cpp 13 Jun 2003 21:19:44 -0000 1.4 --- ProfileEdit.cpp 18 Jun 2003 22:45:25 -0000 1.5 *************** *** 453,460 **** { 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); --- 453,466 ---- { CString csPath; ! CString sSelection = m_tcScripts.GetItemText(hChild); ! bool bFullPath; ! if ( sSelection.Find(_T("\\")) == -1 && sSelection.Find(_T("/")) == -1 ) ! bFullPath = false; else ! bFullPath = true; ! if ( csRootDir != _T("") && !bFullPath) ! csPath = csRootDir + _T("\\") + sSelection; ! else ! csPath = sSelection; if ( m_tcScripts.ItemHasChildren(hChild) ) GetSelections(hChild, csPath, selections); Index: S_Sphere52.vcproj =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/S_Sphere52.vcproj,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** S_Sphere52.vcproj 12 Jun 2003 23:27:01 -0000 1.7 --- S_Sphere52.vcproj 18 Jun 2003 22:45:25 -0000 1.8 *************** *** 38,42 **** Name="VCLinkerTool" IgnoreImportLibrary="TRUE" ! AdditionalDependencies="libxml2.lib comsvcs.lib ../S_ScriptsBase/Debug\S_ScriptsBase.lib" ShowProgress="0" OutputFile="$(OutDir)/S_Sphere52.dll" --- 38,42 ---- Name="VCLinkerTool" IgnoreImportLibrary="TRUE" ! AdditionalDependencies="libxml2.lib comsvcs.lib ../S_ScriptsBase/Debug/S_ScriptsBase.lib" ShowProgress="0" OutputFile="$(OutDir)/S_Sphere52.dll" Index: ScriptsMain.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/ScriptsMain.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** ScriptsMain.cpp 13 Jun 2003 14:52:42 -0000 1.14 --- ScriptsMain.cpp 18 Jun 2003 22:45:25 -0000 1.15 *************** *** 23,30 **** #include <direct.h> ! #include <vector> ! #include <algorithm> ! ! using namespace std; int CScriptsMain::m_iScriptSeq = 0; --- 23,27 ---- #include <direct.h> ! #include "MD5Hash.h" int CScriptsMain::m_iScriptSeq = 0; *************** *** 2249,2269 **** if ( csaScripts.GetSize() > 0 ) { ! // Load the specified scripts ! //this->m_bNewFormat = true; ! /* ! m_pRemote->SetDialog(m_pDlg); ! for ( int i = 0; i <= csaScripts.GetUpperBound(); i++ ) ! { ! m_pRemote->UpdateFile(csaScripts.GetAt(i)); ! CString csLocalFile; ! csLocalFile.Format(_T("%s\\%s"), Main->GetProfileString(), csaScripts.GetAt(i)); ! LoadFile(csLocalFile); } - */ - // Categorize everything - // Don't categorize stuff anymore. Let Axis take care of this. - // CategorizeLocations(); - // CategorizeItems(); - // CategorizeNPCs(); this->m_bDeleteDialog = true; DestroyProgressDialog(); --- 2246,2258 ---- if ( csaScripts.GetSize() > 0 ) { ! // Check for updates on the specified scripts ! // Make sure the directory for the remote profiles exists ! CreateDirectory(m_pProfile->ProfileName(), NULL); ! for ( int i = 0; i < csaScripts.GetSize(); i++ ) ! { ! CString sFile; ! sFile.Format(_T("%s\\%s"), m_pProfile->ProfileName(), CMD5Hash::GetHash(csaScripts.GetAt(i))); ! Main->m_pAxis->GetRemoteFile(csaScripts.GetAt(i), sFile); } this->m_bDeleteDialog = true; DestroyProgressDialog(); *************** *** 2271,2280 **** return; } - #ifdef _AXIS - m_pRemote->SetDialog(m_pDlg); - LOG( locale->String(IDS_SCRIPTS_GETUPDATES)); - m_pRemote->GetUpdates(); - bFoundScripts = true; - #endif } else --- 2260,2263 ---- *************** *** 2319,2330 **** this->LoadTriggers(); - // this->CategorizeItems(); - // this->CategorizeLocations(); - // this->CategorizeNPCs(); LOG( locale->String(IDS_SCRIPTS_FINISHEDLOADING)); - /* - if ( m_pRemote ) - m_pRemote->SetDialog(NULL); - */ m_bDeleteDialog = true; DestroyProgressDialog(); --- 2302,2306 ---- Index: ScriptsMain.h =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/ScriptsMain.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** ScriptsMain.h 11 Jun 2003 22:18:11 -0000 1.7 --- ScriptsMain.h 18 Jun 2003 22:45:25 -0000 1.8 *************** *** 8,11 **** --- 8,16 ---- #include "FileReadProgress.h" + #include <vector> + #include <algorithm> + + using namespace std; + #define INI_FILE _T("sphere.ini") #define WORLD_FILE _T("sphereworld.scp") |
From: Philip E. <pes...@us...> - 2003-06-18 22:45:28
|
Update of /cvsroot/sphere-axis/Axis/AxisLib In directory sc8-pr-cvs1:/tmp/cvs-serv20089/AxisLib Modified Files: AxisServerInterface.cpp Log Message: no message Index: AxisServerInterface.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/AxisLib/AxisServerInterface.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** AxisServerInterface.cpp 17 Jun 2003 22:32:51 -0000 1.3 --- AxisServerInterface.cpp 18 Jun 2003 22:45:25 -0000 1.4 *************** *** 295,299 **** { if ( bDirectories.Length() > 0 ) ! bDirectories.Append(':'); bDirectories.Append(sFile); } --- 295,299 ---- { if ( bDirectories.Length() > 0 ) ! bDirectories.Append('*'); bDirectories.Append(sFile); } *************** *** 301,305 **** { if ( bFiles.Length() > 0 ) ! bFiles.Append(':'); bFiles.Append(sFile); } --- 301,305 ---- { if ( bFiles.Length() > 0 ) ! bFiles.Append('*'); bFiles.Append(sFile); } |
From: Philip E. <pes...@us...> - 2003-06-18 22:45:28
|
Update of /cvsroot/sphere-axis/Axis/S_ScriptsBase In directory sc8-pr-cvs1:/tmp/cvs-serv20089/S_ScriptsBase Modified Files: AxisLibWrapper.cpp S_ScriptsBase.vcproj Added Files: FileMap.cpp FileMap.h MD5Hash.cpp MD5Hash.h Log Message: no message --- NEW FILE: FileMap.cpp --- #include "StdAfx.h" #include "filemap.h" CString CFileMap::m_sErrors = _T(""); int CFileMap::m_iErrorCount = 0; void CFileMap::xmlError(void *ctx, const char *msg, ...) { m_iErrorCount++; xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; CString s, message; va_list args; va_start(args, msg); s.FormatV(msg, args); va_end(args); s.Replace(_T('\t'), _T(' ')); if ( s.GetLength() > 0 ) m_sErrors += s; return; } CFileMap::CFileMap(void) { } CFileMap::~CFileMap(void) { } bool CFileMap::Load() { if ( m_sLocalFilename.GetLength() == 0 ) return false; TCHAR szXMLFile[MAX_PATH]; CString sFile = m_sLocalFilename; if ( sFile.Find(_T("\\")) != -1 ) sFile.Insert(sFile.ReverseFind(_T('\\')) + 1, _T(".")); else sFile.Insert(0, _T(".")); _stprintf(szXMLFile, sFile); xmlInitParser(); xmlParserCtxtPtr ctxt = xmlCreateFileParserCtxt(szXMLFile); if ( ctxt == NULL ) return false; xmlDoValidityCheckingDefaultValue = 1; xmlSetGenericErrorFunc(ctxt, &CFileMap::xmlError); m_iErrorCount = 0; m_sErrors = _T(""); xmlParseDocument(ctxt); xmlDocPtr pXMLDoc = ctxt->myDoc; int wellFormed = ctxt->wellFormed; if ( pXMLDoc == NULL ) return false; if ( !wellFormed ) { CString sMessage; sMessage.Format(_T("Unable to parse file %s. The XML Parser returned the following errors:\n%s"), szXMLFile, m_sErrors); AfxMessageBox(sMessage, MB_OK|MB_ICONEXCLAMATION); return false; } // Parse the file xmlNodePtr pRoot = FindNode(pXMLDoc, _T("FileMapping")); if ( pRoot != NULL ) { ReadValue(pRoot, _T("RemoteFile"), (void*)&m_sRemoteFilename, XML_String); ReadValue(pRoot, _T("Checksum"), (void*)&m_dwRemoteChecksum, XML_DWord); ReadValue(pRoot, _T("LastUpdate"), (void*)&m_tLastUpdate, XML_Int); } return true; } bool CFileMap::Save() { if ( m_sLocalFilename.GetLength() == 0 ) return false; xmlDocPtr pDoc = xmlNewDoc((const xmlChar*) _T("1.0")); CString sComments; sComments.Append(_T("Local<->Remote file mapping for use with AxisServer.\n")); sComments.Append(_T("DO NOT EDIT THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING!\n")); pDoc->children = xmlNewDocComment(pDoc, (const xmlChar*) LPCTSTR(sComments)); xmlNodePtr pRoot = xmlNewDocNode(pDoc, NULL, (const xmlChar*) _T("FileMapping"), NULL); xmlAddNextSibling(pDoc->children, pRoot); AddValue(pDoc, pRoot, _T("LocalFile"), (void*) &m_sLocalFilename, XML_String, 1); AddValue(pDoc, pRoot, _T("RemoteFile"), (void*)&m_sRemoteFilename, XML_String, 1); AddValue(pDoc, pRoot, _T("Checksum"), (void*)&m_dwRemoteChecksum, XML_DWord, 1); AddValue(pDoc, pRoot, _T("LastUpdate"), (void*)&m_tLastUpdate, XML_Int, 1); TCHAR szXMLFile[MAX_PATH]; CString sFile = m_sLocalFilename; if ( sFile.Find(_T("\\")) != -1 ) sFile.Insert(sFile.ReverseFind(_T('\\')) + 1, _T(".")); else sFile.Insert(0, _T(".")); _stprintf(szXMLFile, sFile); xmlSaveFormatFileEnc(szXMLFile, pDoc, "UTF-8", 1); // Hide the file SetFileAttributes(szXMLFile, FILE_ATTRIBUTE_HIDDEN); return true; } --- NEW FILE: FileMap.h --- #pragma once #include "XMLBase.h" #include <libxml/parser.h> #include <libxml/parserinternals.h> #include "time.h" class __declspec(dllexport) CFileMap : public CXMLBase { public: CFileMap(void); CFileMap(CString sLocal, CString sRemote, DWORD cs=0, time_t t=0) { LocalName(sLocal); RemoteName(sRemote); Checksum(cs); LastUpdate(t); } ~CFileMap(void); bool Load(); bool Save(); CString LocalName() { return m_sLocalFilename; } CString RemoteName() { return m_sRemoteFilename; } DWORD Checksum() { return m_dwRemoteChecksum; } time_t LastUpdate() { return m_tLastUpdate; } void LocalName(CString s) { m_sLocalFilename = s; } void RemoteName(CString s) { m_sRemoteFilename = s; } void Checksum(DWORD c) { m_dwRemoteChecksum = c; } void LastUpdate(time_t t) { m_tLastUpdate = t; } protected: static void xmlError(void *ctx, const char *msg, ...); static CString m_sErrors; static int m_iErrorCount; CString m_sLocalFilename; CString m_sRemoteFilename; DWORD m_dwRemoteChecksum; time_t m_tLastUpdate; }; --- NEW FILE: MD5Hash.cpp --- #include "StdAfx.h" #include "md5hash.h" #include <vector> #include <string> using namespace std; #include "md5.h" using namespace CryptoPP; CMD5Hash::CMD5Hash(void) { } CMD5Hash::~CMD5Hash(void) { } CString CMD5Hash::GetHash(LPCTSTR pszText) { CryptoPP::MD5 md5; BYTE bMD5Data[16]; md5.CalculateDigest(bMD5Data, (const byte*) pszText, _tcslen(pszText)); TCHAR szMD5String[64]; memset(szMD5String, 0x00, sizeof(szMD5String)); for ( int m = 0; m < 16; m++ ) { TCHAR szByte[3]; _stprintf(szByte, _T("%02x"), bMD5Data[m]); _tcscat(szMD5String, szByte); } CString s(szMD5String); return s; } --- NEW FILE: MD5Hash.h --- #pragma once class CMD5Hash { public: CMD5Hash(void); ~CMD5Hash(void); static CString GetHash(LPCTSTR pszText); }; Index: AxisLibWrapper.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_ScriptsBase/AxisLibWrapper.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** AxisLibWrapper.cpp 17 Jun 2003 22:32:51 -0000 1.4 --- AxisLibWrapper.cpp 18 Jun 2003 22:45:25 -0000 1.5 *************** *** 1,4 **** --- 1,5 ---- #include "StdAfx.h" #include "axislibwrapper.h" + #include "FileMap.h" using namespace AxisLib; *************** *** 75,106 **** bool CAxisLibWrapper::GetDirectoryList(CString sPath, CStringArray *aFiles, CStringArray *aDirectories) { ! BSTR bPath = sPath.AllocSysString(); ! BSTR files = ::SysAllocString( L"" ); ! BSTR directories = ::SysAllocString( L"" ); ! 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); } } --- 76,111 ---- bool CAxisLibWrapper::GetDirectoryList(CString sPath, CStringArray *aFiles, CStringArray *aDirectories) { ! _bstr_t bPath = sPath.AllocSysString(); ! _bstr_t files = ::SysAllocString( L"" ); ! _bstr_t directories = ::SysAllocString( L"" ); ! VARIANT_BOOL b = m_pAxisServer->GetDirectoryList(bPath, files.GetAddress(), directories.GetAddress()); if ( b ) { CString sFiles, sDirectories; #ifdef UNICODE ! if ( files.length() ) ! sFiles.Format(_T("%s"), files.GetBSTR()); ! if ( directories.length() ) ! sDirectories.Format(_T("%s"), directories.GetBSTR()); #else ! if ( files.length() ) ! sFiles.Format(_T("%S"), files.GetBSTR()); ! if ( directories.length() ) ! sDirectories.Format(_T("%S"), directories.GetBSTR()); #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); } } *************** *** 111,117 **** --- 116,140 ---- bool CAxisLibWrapper::GetRemoteFile(CString sRemote, CString sLocal) { + CFileMap m(sLocal, sRemote); + ULONG checksum = 0; + if ( m.Load() ) + { + // Compare the checksum from the last time we got this + if ( GetFileChecksum(_T(""), sRemote, &checksum) && checksum == m.Checksum() ) + // We have the latest version already + return true; + } + // Get the file + BSTR bRemote = sRemote.AllocSysString(); BSTR bLocal = sLocal.AllocSysString(); + VARIANT_BOOL b = m_pAxisServer->GetRemoteFile(bRemote, bLocal); + if ( b ) + { + m.Checksum(checksum); + m.LastUpdate(time(NULL)); + m.Save(); + } return b ? true : false; } Index: S_ScriptsBase.vcproj =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_ScriptsBase/S_ScriptsBase.vcproj,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** S_ScriptsBase.vcproj 12 Jun 2003 04:56:59 -0000 1.5 --- S_ScriptsBase.vcproj 18 Jun 2003 22:45:25 -0000 1.6 *************** *** 21,24 **** --- 21,25 ---- Name="VCCLCompilerTool" Optimization="0" + AdditionalIncludeDirectories="../../crypto51" PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG;_USRDLL" MinimalRebuild="TRUE" *************** *** 34,38 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="libxml2.lib comsvcs.lib" ShowProgress="0" OutputFile="$(OutDir)/S_ScriptsBase.dll" --- 35,39 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="libxml2.lib comsvcs.lib ..\..\crypto51\release\cryptlib.lib" ShowProgress="0" OutputFile="$(OutDir)/S_ScriptsBase.dll" *************** *** 142,145 **** --- 143,149 ---- </File> <File + RelativePath="FileMap.cpp"> + </File> + <File RelativePath="FloatRange.cpp"> </File> *************** *** 148,151 **** --- 152,158 ---- </File> <File + RelativePath="MD5Hash.cpp"> + </File> + <File RelativePath="S_ScriptsBase.cpp"> </File> *************** *** 209,216 **** --- 216,229 ---- </File> <File + RelativePath="FileMap.h"> + </File> + <File RelativePath="FloatRange.h"> </File> <File RelativePath="IntRange.h"> + </File> + <File + RelativePath="MD5Hash.h"> </File> <File |
From: Philip E. <pes...@us...> - 2003-06-17 22:33:15
|
Update of /cvsroot/sphere-axis/axissvr In directory sc8-pr-cvs1:/tmp/cvs-serv2800 Modified Files: AxisServer.rc ClientObj.cpp ConfigDlg.cpp ConfigDlg.h DBConfig.cpp DBConfig.h DBConfigDlg.cpp ServerObj.cpp Log Message: no message Index: AxisServer.rc =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/AxisServer.rc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** AxisServer.rc 16 Jun 2003 03:58:35 -0000 1.3 --- AxisServer.rc 17 Jun 2003 22:33:08 -0000 1.4 *************** *** 208,216 **** EDITTEXT IDC_SPAWNREFRESHTIME,141,87,36,12,ES_AUTOHSCROLL | ES_NUMBER ! GROUPBOX "Static",IDC_STATIC,7,103,292,204 CONTROL "Use Database to specify individual user permissions", IDC_USEDB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,22,122, 178,10 ! PUSHBUTTON "Configure Databasee",IDC_CONFIGDB,205,120,74,16 END --- 208,216 ---- EDITTEXT IDC_SPAWNREFRESHTIME,141,87,36,12,ES_AUTOHSCROLL | ES_NUMBER ! GROUPBOX "Security Options",IDC_STATIC,7,103,292,204 CONTROL "Use Database to specify individual user permissions", IDC_USEDB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,22,122, 178,10 ! PUSHBUTTON "Configure Database",IDC_CONFIGDB,205,120,74,16 END Index: ClientObj.cpp =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/ClientObj.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** ClientObj.cpp 17 Jun 2003 14:40:04 -0000 1.5 --- ClientObj.cpp 17 Jun 2003 22:33:08 -0000 1.6 *************** *** 501,505 **** { SysMessage(_T("Timeout exceeded while receiving data from socket %ld\n"), m_sock); ! break; } if ( rc > 0 ) --- 501,505 ---- { SysMessage(_T("Timeout exceeded while receiving data from socket %ld\n"), m_sock); ! return -3; } if ( rc > 0 ) *************** *** 683,686 **** --- 683,688 ---- p++; } + if ( iLen > 0 ) + Send((BYTE*)szBuffer, iLen); Send((BYTE*)szEOF, strlen(szEOF)); return; *************** *** 697,703 **** { // Error in the search ! TCHAR szTemp[MAX_PATH]; ! _stprintf(szTemp, _T("Invalid Path")); ! memcpy(&szBuffer[sizeof(int)], &szTemp[0], _tcsclen(szTemp) * sizeof(TCHAR)); } else --- 699,705 ---- { // Error in the search ! CHAR szTemp[MAX_PATH]; ! sprintf(szTemp, "Invalid Path"); ! memcpy(&szBuffer[sizeof(int)], &szTemp[0], strlen(szTemp)); } else *************** *** 713,717 **** iLen = 0; } ! TCHAR szTemp[MAX_PATH]; TCHAR szFullPath[MAX_PATH]; if ( _tcscmp(pszPathname, _T(".")) == 0 ) --- 715,719 ---- iLen = 0; } ! CHAR szTemp[MAX_PATH]; TCHAR szFullPath[MAX_PATH]; if ( _tcscmp(pszPathname, _T(".")) == 0 ) *************** *** 746,751 **** { memcpy(&szTemp[0], &(findData.dwFileAttributes), sizeof(int)); ! memcpy(&szTemp[4], findData.cFileName, _tcsclen(findData.cFileName) * sizeof(TCHAR)); ! memcpy(&szBuffer[iLen], &szTemp[0], _tcsclen(findData.cFileName) * sizeof(TCHAR) + sizeof(int)); iLen+= (_tcsclen(findData.cFileName) + sizeof(int) + 1); memset(&findData, 0x00, sizeof(findData)); --- 748,757 ---- { memcpy(&szTemp[0], &(findData.dwFileAttributes), sizeof(int)); ! #ifdef _UNICODE ! sprintf(&szTemp[4], "%S", findData.cFileName); ! #else ! sprintf(&szTemp[4], "%s", findData.cFileName); ! #endif ! memcpy(&szBuffer[iLen], &szTemp[0], _tcsclen(findData.cFileName) + sizeof(int)); iLen+= (_tcsclen(findData.cFileName) + sizeof(int) + 1); memset(&findData, 0x00, sizeof(findData)); *************** *** 846,852 **** else iType = 0x80; ! TCHAR szTemp[MAX_PATH]; memcpy(&szTemp[0], &(iType), sizeof(int)); ! memcpy(&szTemp[4], direntp->d_name, _tcsclen(direntp->d_name) * sizeof(TCHAR)); if ( iLen + _tcsclen(direntp->d_name) + sizeof(int) + 1 >= sizeof(szBuffer) ) { --- 852,862 ---- else iType = 0x80; ! CHAR szTemp[MAX_PATH]; memcpy(&szTemp[0], &(iType), sizeof(int)); ! #ifdef _UNICODE ! sprintf(&szTemp[4], "%S", direntp->d_name); ! #else ! sprintf(&szTemp[4], "%s", direntp->d_name); ! #endif if ( iLen + _tcsclen(direntp->d_name) + sizeof(int) + 1 >= sizeof(szBuffer) ) { *************** *** 855,859 **** iLen = 0; } ! memcpy(&szBuffer[iLen], &szTemp[0], _tcsclen(direntp->d_name) * sizeof(TCHAR) + sizeof(int)); iLen+= (_tcsclen(direntp->d_name) + sizeof(int) + 1); } --- 865,869 ---- iLen = 0; } ! memcpy(&szBuffer[iLen], &szTemp[0], _tcsclen(direntp->d_name) + sizeof(int)); iLen+= (_tcsclen(direntp->d_name) + sizeof(int) + 1); } *************** *** 1487,1496 **** { 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); --- 1497,1501 ---- { if ( UseDB() ) ! return m_pServer->m_pDB->Login(pszID, pszPassword, pszIP, pHost, m_iDBUserID); else return m_pServer->Login(pszID, pszPassword, pszIP, pHost); Index: ConfigDlg.cpp =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/ConfigDlg.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** ConfigDlg.cpp 23 May 2003 15:38:26 -0000 1.2 --- ConfigDlg.cpp 17 Jun 2003 22:33:08 -0000 1.3 *************** *** 89,92 **** --- 89,93 ---- ON_BN_CLICKED(IDC_USEDB, OnBnClickedUsedb) ON_BN_CLICKED(IDC_CONFIGDB, OnBnClickedConfigdb) + ON_BN_CLICKED(IDOK, OnBnClickedOk) END_MESSAGE_MAP() *************** *** 376,378 **** --- 377,384 ---- m_cfgNew.Prefix(sPrefix); } + } + + void CConfigDlg::OnBnClickedOk() + { + OnOK(); } Index: ConfigDlg.h =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/ConfigDlg.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** ConfigDlg.h 23 May 2003 15:38:26 -0000 1.2 --- ConfigDlg.h 17 Jun 2003 22:33:08 -0000 1.3 *************** *** 88,91 **** --- 88,92 ---- afx_msg void OnBnClickedUsedb(); afx_msg void OnBnClickedConfigdb(); + afx_msg void OnBnClickedOk(); }; Index: DBConfig.cpp =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/DBConfig.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** DBConfig.cpp 16 Jun 2003 22:05:59 -0000 1.4 --- DBConfig.cpp 17 Jun 2003 22:33:08 -0000 1.5 *************** *** 145,149 **** } ! int CDBConfig::Login(const TCHAR *pszUser, const TCHAR* pszPassword, const TCHAR* pszHost, HOSTENT * pHost, int *iUserID) { // Using access masks in a database --- 145,149 ---- } ! int CDBConfig::Login(const TCHAR *pszUser, const TCHAR* pszPassword, const TCHAR* pszHost, HOSTENT * pHost, int &iUserID) { // Using access masks in a database *************** *** 177,181 **** throw 0x200; SQLINTEGER cbID, cbPermissions, cbHosts; ! rc = SQLBindCol(hStmtUser, 1, SQL_C_SLONG, &iUserID, sizeof(iUserID), &cbID); if ( SQLFAILED(rc) ) throw 0x200; --- 177,181 ---- throw 0x200; SQLINTEGER cbID, cbPermissions, cbHosts; ! rc = SQLBindCol(hStmtUser, 1, SQL_C_SLONG, &iUserID, sizeof(int), &cbID); if ( SQLFAILED(rc) ) throw 0x200; *************** *** 318,323 **** SQLRETURN rc; SQLHANDLE hStmt = SQL_NULL_HANDLE; - SQLHANDLE hStmt2 = SQL_NULL_HANDLE; - BYTE bPermissions = 0; SQLCHAR szQuery[MAX_BUFFER]; memset(szQuery, 0x00, sizeof(szQuery)); --- 318,321 ---- *************** *** 326,345 **** // 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; --- 324,347 ---- // Value thrown is a flag // 0x100 -- Error on first handle // 0x010 -- Query is valid // 0x001 -- First Handle is valid ! // First get the files that don't use the default settings for this user hStmt = NewStmtHandle(); if ( hStmt == SQL_NULL_HANDLE ) throw 0x100; ! sprintf((char*)szQuery, "select t1.filename, t2.flags from %s_files as t1 left join %s_file_permissions as t2 on t1.id=t2.file_id where t2.file_id is not null and t2.user_id=%ld", Prefix(), Prefix(), userID); rc = SQLExecDirect(hStmt, szQuery, strlen((char*)szQuery)); if ( SQLFAILED(rc) ) throw 0x111; + CHAR szFilename[MAX_PATH]; + BYTE bPermissions; + SQLINTEGER cbFilename = sizeof(szFilename); SQLINTEGER cbPermissions = sizeof(bPermissions); ! rc = SQLBindCol(hStmt, 1, SQL_C_CHAR, szFilename, cbFilename, &cbFilename); ! if ( SQLFAILED(rc) ) ! throw 0x111; ! rc = SQLBindCol(hStmt, 2, SQL_C_TINYINT, &bPermissions, cbPermissions, &cbPermissions); if ( SQLFAILED(rc) ) throw 0x111; *************** *** 347,371 **** 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; --- 349,391 ---- while ( TRUE ) { rc = SQLFetch(hStmt); if ( SQLFAILED(rc) ) break; + switch ( bPermissions ) + { + 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", szFilename); + #else + _stprintf(tFile, "%s", szFilename); + #endif + s.assign(tFile); + v.push_back(s); + } + break; + default: + break; + } } ! // Now get the default file permissions for all other files ! sprintf((char*)szQuery, "select t1.filename, t3.default_file_permissions from %s_files as t1 left join %s_file_permissions as t2 on t1.id=t2.file_id, %s_users as t3 where t2.file_id is null and t3.id=%ld", Prefix(), Prefix(), Prefix(), userID); rc = SQLExecDirect(hStmt, szQuery, strlen((char*)szQuery)); if ( SQLFAILED(rc) ) throw 0x111; ! cbFilename = sizeof(szFilename); ! cbPermissions = sizeof(bPermissions); ! rc = SQLBindCol(hStmt, 1, SQL_C_CHAR, szFilename, cbFilename, &cbFilename); if ( SQLFAILED(rc) ) throw 0x111; ! rc = SQLBindCol(hStmt, 2, SQL_C_TINYINT, &bPermissions, cbPermissions, &cbPermissions); if ( SQLFAILED(rc) ) throw 0x111; *************** *** 375,408 **** 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: --- 395,400 ---- rc = SQLFetch(hStmt); if ( SQLFAILED(rc) ) break; ! switch ( bPermissions ) { case 0: *************** *** 416,422 **** TCHAR tFile[MAX_PATH]; #ifdef _UNICODE ! _stprintf(tFile, "%S", szFile); #else ! _stprintf(tFile, "%s", szFile); #endif s.assign(tFile); --- 408,414 ---- TCHAR tFile[MAX_PATH]; #ifdef _UNICODE ! _stprintf(tFile, "%S", szFilename); #else ! _stprintf(tFile, "%s", szFilename); #endif s.assign(tFile); *************** *** 432,436 **** catch (int i) { ! if ( i & 0x300 ) { // Format the last message --- 424,428 ---- catch (int i) { ! if ( i & 0x100 ) { // Format the last message *************** *** 444,453 **** 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); } --- 436,442 ---- 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); } *************** *** 458,467 **** } 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; --- 447,453 ---- Index: DBConfig.h =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/DBConfig.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** DBConfig.h 16 Jun 2003 22:05:59 -0000 1.4 --- DBConfig.h 17 Jun 2003 22:33:08 -0000 1.5 *************** *** 51,55 **** 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); --- 51,55 ---- 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); Index: DBConfigDlg.cpp =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/DBConfigDlg.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** DBConfigDlg.cpp 16 Jun 2003 03:58:35 -0000 1.3 --- DBConfigDlg.cpp 17 Jun 2003 22:33:08 -0000 1.4 *************** *** 778,810 **** BYTE bFlag = SQLGetDefaultFilePermissions(userID); SQLHANDLE hStmt = SQL_NULL_HANDLE; try { ! for (int i = 0; i < m_lFiles.GetItemCount(); i++ ) ! { ! SQLRETURN rc = SQLAllocHandle(SQL_HANDLE_STMT, m_hDbc, &hStmt); ! if ( SQLFAILED(rc) ) ! throw -1; ! CString sFilename = m_lFiles.GetItemText(i, 0); ! int fileID = SQLGetFileID(sFilename); ! SQLCHAR sQuery[4096]; ! sprintf((char*)sQuery, "select flags from %s_file_permissions where user_id=%d and file_id=%d", m_sPrefix, userID, fileID); ! rc = SQLExecDirect(hStmt, sQuery, strlen((char*)sQuery)); ! if ( SQLFAILED(rc) ) ! throw -1; ! BYTE bPermissions = bFlag; ! SQLINTEGER cbPermissions = sizeof(bPermissions); ! rc = SQLBindCol(hStmt, 1, SQL_C_STINYINT, &bPermissions, cbPermissions, &cbPermissions); ! if ( SQLFAILED(rc) ) ! throw -1; ! while ( TRUE ) ! { ! rc = SQLFetch(hStmt); ! if ( SQLFAILED(rc) ) ! break; ! } ! CString sPermissions; switch ( bPermissions ) { --- 778,823 ---- BYTE bFlag = SQLGetDefaultFilePermissions(userID); + // Populate the files with the default permisisons first + CString sPermissions; + switch ( bFlag ) + { + case 0: + sPermissions = _T("No Permissions"); break; + case 1: + sPermissions = _T("Read Only"); break; + case 2: + sPermissions = _T("Read/Write"); break; + } + for ( int i = 0; i < m_lFiles.GetItemCount(); i++ ) + m_lFiles.SetItemText(i, 1, sPermissions); + SQLHANDLE hStmt = SQL_NULL_HANDLE; try { ! SQLRETURN rc = SQLAllocHandle(SQL_HANDLE_STMT, m_hDbc, &hStmt); ! if ( SQLFAILED(rc) ) ! throw -1; ! CString sFilename = m_lFiles.GetItemText(i, 0); ! int fileID = SQLGetFileID(sFilename); ! SQLCHAR sQuery[4096]; ! sprintf((char*)sQuery, "select flags, file_id from %s_file_permissions where user_id=%d;", m_sPrefix, userID, fileID); ! rc = SQLExecDirect(hStmt, sQuery, strlen((char*)sQuery)); ! if ( SQLFAILED(rc) ) ! throw -1; ! BYTE bPermissions = bFlag; ! int iFileID; ! SQLINTEGER cbPermissions = sizeof(bPermissions); ! SQLINTEGER cbID = sizeof(iFileID); ! rc = SQLBindCol(hStmt, 1, SQL_C_STINYINT, &bPermissions, cbPermissions, &cbPermissions); ! if ( SQLFAILED(rc) ) ! throw -1; ! rc = SQLBindCol(hStmt, 2, SQL_C_SLONG, &iFileID, cbID, &cbID); ! if ( SQLFAILED(rc) ) ! throw -1; ! while ( TRUE ) ! { ! rc = SQLFetch(hStmt); switch ( bPermissions ) { *************** *** 816,823 **** sPermissions = _T("Read/Write"); break; } ! m_lFiles.SetItemText(i, 1, sPermissions); ! SQLFreeHandle(SQL_HANDLE_STMT, hStmt); ! hStmt = SQL_NULL_HANDLE; } } catch(...) --- 829,845 ---- sPermissions = _T("Read/Write"); break; } ! for ( int i = 0; i < m_lFiles.GetItemCount(); i++ ) ! { ! if ( m_lFiles.GetItemData(i) == iFileID ) ! { ! m_lFiles.SetItemText(i, 1, sPermissions); ! break; ! } ! } ! if ( SQLFAILED(rc) ) ! break; } + SQLFreeHandle(SQL_HANDLE_STMT, hStmt); + hStmt = SQL_NULL_HANDLE; } catch(...) Index: ServerObj.cpp =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/ServerObj.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** ServerObj.cpp 16 Jun 2003 22:05:59 -0000 1.4 --- ServerObj.cpp 17 Jun 2003 22:33:08 -0000 1.5 *************** *** 1044,1048 **** oldConfig.Copy(&m_config); ! newConfig.Read(_T("axissvr.cfg")); m_config.Copy(&newConfig); // We may need to bounce the server if we've changed the port --- 1044,1048 ---- oldConfig.Copy(&m_config); ! newConfig.ReadXML(_T("axissvr.xml")); m_config.Copy(&newConfig); // We may need to bounce the server if we've changed the port |
From: Philip E. <pes...@us...> - 2003-06-17 22:32:57
|
Update of /cvsroot/sphere-axis/Axis/S_ScriptsBase In directory sc8-pr-cvs1:/tmp/cvs-serv2665/S_ScriptsBase Modified Files: AxisLibWrapper.cpp Log Message: no message Index: AxisLibWrapper.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_ScriptsBase/AxisLibWrapper.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** AxisLibWrapper.cpp 13 Jun 2003 19:58:08 -0000 1.3 --- AxisLibWrapper.cpp 17 Jun 2003 22:32:51 -0000 1.4 *************** *** 76,81 **** { BSTR bPath = sPath.AllocSysString(); ! BSTR files; ! BSTR directories; VARIANT_BOOL b = m_pAxisServer->GetDirectoryList(bPath, &files, &directories); if ( b ) --- 76,81 ---- { BSTR bPath = sPath.AllocSysString(); ! BSTR files = ::SysAllocString( L"" ); ! BSTR directories = ::SysAllocString( L"" ); VARIANT_BOOL b = m_pAxisServer->GetDirectoryList(bPath, &files, &directories); if ( b ) |
From: Philip E. <pes...@us...> - 2003-06-17 22:32:54
|
Update of /cvsroot/sphere-axis/Axis/AxisLib In directory sc8-pr-cvs1:/tmp/cvs-serv2665/AxisLib Modified Files: AxisServerInterface.cpp Log Message: no message Index: AxisServerInterface.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/AxisLib/AxisServerInterface.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** AxisServerInterface.cpp 23 May 2003 05:44:27 -0000 1.2 --- AxisServerInterface.cpp 17 Jun 2003 22:32:51 -0000 1.3 *************** *** 158,161 **** --- 158,162 ---- Log(sMessage); AfxMessageBox(sMessage, MB_OK | MB_ICONSTOP); + Disconnect(); return FALSE; } *************** *** 224,234 **** return FALSE; - CComBSTR bFiles, bDirectories; - bFiles.Attach(*files); - bDirectories.Attach(*directories); - CString sMessage; sMessage.Format(_T(IDS_REMOTE_DIRLIST), (TCHAR*)path); Log(sMessage); if ( m_pProgress ) --- 225,232 ---- return FALSE; CString sMessage; sMessage.Format(_T(IDS_REMOTE_DIRLIST), (TCHAR*)path); Log(sMessage); + BOOL bStatus = TRUE; if ( m_pProgress ) *************** *** 275,315 **** iSize += iBytes; } ! if ( iSize == 0 ) { ! // We never got anything ! if ( pBuffer ) ! delete [] pBuffer; // We shouldn't ever get here, but just in case ! return FALSE; ! } ! // Parse the data we got from the remote server ! BYTE * ptr = pBuffer; ! ! while ( ptr < (pBuffer + iSize) ) ! { ! int iType; ! memcpy(&iType, ptr, sizeof(int)); ! ptr += sizeof(int); ! if ( iType != 0 ) { ! TCHAR szFile[MAX_PATH]; ! _stprintf(szFile, (TCHAR*)ptr); ! ptr += (_tcslen(szFile) + 1); ! CString sFile(szFile); ! if ( iType & FILE_ATTRIBUTE_DIRECTORY ) { ! if ( bDirectories.Length() > 0 ) ! bDirectories.Append(':'); ! bDirectories.Append(sFile); } else ! { ! if ( bFiles.Length() > 0 ) ! bFiles.Append(':'); ! bFiles.Append(sFile); ! } } - else - break; } if ( pBuffer ) --- 273,311 ---- iSize += iBytes; } ! CComBSTR bFiles, bDirectories; ! //bFiles.Attach(*files); ! //bDirectories.Attach(*directories); ! if ( iSize > 0 ) { ! // Parse the data we got from the remote server ! BYTE * ptr = pBuffer; ! while ( ptr < (pBuffer + iSize) ) { ! int iType; ! memcpy(&iType, ptr, sizeof(int)); ! ptr += sizeof(int); ! if ( iType != 0 ) { ! TCHAR szFile[MAX_PATH]; ! _stprintf(szFile, (TCHAR*)ptr); ! ptr += (_tcslen(szFile) + 1); ! CString sFile(szFile); ! if ( iType & FILE_ATTRIBUTE_DIRECTORY ) ! { ! if ( bDirectories.Length() > 0 ) ! bDirectories.Append(':'); ! bDirectories.Append(sFile); ! } ! else ! { ! if ( bFiles.Length() > 0 ) ! bFiles.Append(':'); ! bFiles.Append(sFile); ! } } else ! break; } } if ( pBuffer ) |