Index: MUSHclient.rc =================================================================== RCS file: /cvs/mushclient/MUSHclient.rc,v retrieving revision 1.236 retrieving revision 1.237 diff -c -r1.236 -r1.237 *** MUSHclient.rc 25 Jul 2009 01:35:57 -0000 1.236 --- MUSHclient.rc 28 Aug 2009 21:11:32 -0000 1.237 *************** *** 75,82 **** // VS_VERSION_INFO VERSIONINFO ! FILEVERSION 4,0,43,0 ! PRODUCTVERSION 4,0,43,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L --- 75,82 ---- // VS_VERSION_INFO VERSIONINFO ! FILEVERSION 4,0,44,0 ! PRODUCTVERSION 4,0,44,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L *************** *** 94,107 **** VALUE "Comments", "MUSHclient - a client program for playing MUD games\0" VALUE "CompanyName", "Gammon Software Solutions\0" VALUE "FileDescription", "MUSHclient\0" ! VALUE "FileVersion", "4.43\0" VALUE "InternalName", "MUSHCLIENT\0" VALUE "LegalCopyright", "Copyright © 2009 Gammon Software Solutions\0" VALUE "LegalTrademarks", "\0" VALUE "OriginalFilename", "MUSHCLIENT.EXE\0" VALUE "PrivateBuild", "\0" VALUE "ProductName", "MUSHclient\0" ! VALUE "ProductVersion", "4.43\0" VALUE "SpecialBuild", "\0" END END --- 94,107 ---- VALUE "Comments", "MUSHclient - a client program for playing MUD games\0" VALUE "CompanyName", "Gammon Software Solutions\0" VALUE "FileDescription", "MUSHclient\0" ! VALUE "FileVersion", "4.44\0" VALUE "InternalName", "MUSHCLIENT\0" VALUE "LegalCopyright", "Copyright © 2009 Gammon Software Solutions\0" VALUE "LegalTrademarks", "\0" VALUE "OriginalFilename", "MUSHCLIENT.EXE\0" VALUE "PrivateBuild", "\0" VALUE "ProductName", "MUSHclient\0" ! VALUE "ProductVersion", "4.44\0" VALUE "SpecialBuild", "\0" END END Index: PluginsDlg.cpp =================================================================== RCS file: /cvs/mushclient/PluginsDlg.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -c -r1.24 -r1.25 *** PluginsDlg.cpp 6 Jul 2009 05:58:56 -0000 1.24 --- PluginsDlg.cpp 29 Nov 2009 02:05:55 -0000 1.25 *************** *** 519,540 **** return; } // end of using inbuilt notepad ! HINSTANCE hInst = ShellExecute (Frame, _T("open"), m_pDoc->m_strScriptEditor, ! CFormat ("\"%s\"", (LPCTSTR) strName), ! NULL, SW_SHOWNORMAL); ! ! if ((long) hInst <= 32) ! { ! ::UMessageBox(TFormat ("Unable to edit the plugin file %s.", ! (LPCTSTR) strName), ! MB_ICONEXCLAMATION); ! return; ! } ! ! ! // bring editor to the front ! if (m_pDoc && !m_pDoc->m_strEditorWindowName.IsEmpty ()) ! SendToFront (m_pDoc->m_strEditorWindowName); } // end of CPluginsDlg::EditPlugin --- 519,525 ---- return; } // end of using inbuilt notepad ! m_pDoc->EditFileWithEditor (strName); } // end of CPluginsDlg::EditPlugin *************** *** 697,716 **** continue; } // end of using inbuilt notepad ! HINSTANCE hInst = ShellExecute (Frame, _T("open"), m_pDoc->m_strScriptEditor, ! CFormat ("\"%s\"", (LPCTSTR) strName), ! NULL, SW_SHOWNORMAL); ! ! if ((long) hInst <= 32) ! ::UMessageBox(TFormat ("Unable to edit the plugin state file %s.", ! (LPCTSTR) strName), ! MB_ICONEXCLAMATION); ! else ! { ! // bring editor to the front ! if (m_pDoc && !m_pDoc->m_strEditorWindowName.IsEmpty ()) ! SendToFront (m_pDoc->m_strEditorWindowName); ! } } // end of loop --- 682,688 ---- continue; } // end of using inbuilt notepad ! m_pDoc->EditFileWithEditor (strName); } // end of loop Index: configuration.cpp =================================================================== RCS file: /cvs/mushclient/configuration.cpp,v retrieving revision 1.50 retrieving revision 1.51 diff -c -r1.50 -r1.51 *** configuration.cpp 21 Jun 2008 04:43:53 -0000 1.50 --- configuration.cpp 29 Nov 2009 02:05:55 -0000 1.51 *************** *** 76,82 **** "chat", // 23 }; ! static DelayDebugMsg (const char * sPhase, int iWhich) { CString msg; if (iWhich < 1 || iWhich > NUMITEMS (sConfigPhase)) --- 76,82 ---- "chat", // 23 }; ! static void DelayDebugMsg (const char * sPhase, int iWhich) { CString msg; if (iWhich < 1 || iWhich > NUMITEMS (sConfigPhase)) Index: doc.cpp =================================================================== RCS file: /cvs/mushclient/doc.cpp,v retrieving revision 1.269 retrieving revision 1.271 diff -c -r1.269 -r1.271 *** doc.cpp 8 Jul 2009 04:10:49 -0000 1.269 --- doc.cpp 29 Nov 2009 02:05:55 -0000 1.271 *************** *** 82,87 **** --- 82,116 ---- int gdoccount = 0; + //#include + // From: mstcpip.h + /* Argument structure for SIO_KEEPALIVE_VALS */ + + struct tcp_keepalive { + ULONG onoff; + ULONG keepalivetime; + ULONG keepaliveinterval; + }; + + // + // New WSAIoctl Options + // + #define SIO_RCVALL _WSAIOW(IOC_VENDOR,1) + #define SIO_RCVALL_MCAST _WSAIOW(IOC_VENDOR,2) + #define SIO_RCVALL_IGMPMCAST _WSAIOW(IOC_VENDOR,3) + #define SIO_KEEPALIVE_VALS _WSAIOW(IOC_VENDOR,4) + #define SIO_ABSORB_RTRALERT _WSAIOW(IOC_VENDOR,5) + #define SIO_UCAST_IF _WSAIOW(IOC_VENDOR,6) + #define SIO_LIMIT_BROADCASTS _WSAIOW(IOC_VENDOR,7) + #define SIO_INDEX_BIND _WSAIOW(IOC_VENDOR,8) + #define SIO_INDEX_MCASTIF _WSAIOW(IOC_VENDOR,9) + #define SIO_INDEX_ADD_MCAST _WSAIOW(IOC_VENDOR,10) + #define SIO_INDEX_DEL_MCAST _WSAIOW(IOC_VENDOR,11) + // SIO_UDP_CONNRESET _WSAIOW(IOC_VENDOR,12) + #define SIO_RCVALL_MCAST_IF _WSAIOW(IOC_VENDOR,13) + #define SIO_RCVALL_IF _WSAIOW(IOC_VENDOR,14) + + ///////////////////////////////////////////////////////////////////////////// // CMUSHclientDoc *************** *** 987,992 **** --- 1016,1030 ---- // BOOL bLinger = TRUE; // m_pSocket->SetSockOpt (SO_DONTLINGER, &bLinger, sizeof bLinger); + + // see: http://www.gammon.com.au/forum/?id=9848 + if (m_bSendKeepAlives) + { + DWORD dwBytesReturned; + tcp_keepalive keepaliveData = {1, 60 * 1000 * 2, 6000}; // every 2 minutes + WSAIoctl (m_pSocket->m_hSocket, SIO_KEEPALIVE_VALS, &keepaliveData, sizeof (keepaliveData), NULL, 0, &dwBytesReturned, NULL, NULL); + } + BOOL bStatus = m_pSocket->AsyncSelect (); int iStatus = 0; *************** *** 1062,1069 **** void CMUSHclientDoc::ProcessPendingRead() { ReceiveMsg(); - if (m_pSocket == NULL) - return; } // SendMsg sends a message (command) to the MUD. --- 1100,1105 ---- *************** *** 1280,1285 **** --- 1316,1325 ---- if (count == SOCKET_ERROR) { + // don't delete the socket if we are already closing it + if (m_iConnectPhase == eConnectDisconnecting) + return; + if (m_pSocket) m_pSocket->OnClose (GetLastError ()); *************** *** 8028,8030 **** --- 8068,8100 ---- m_strSpecialFontName.Empty (); } + + + // edit with specified editor, replacing %file by actual name + void CMUSHclientDoc::EditFileWithEditor (CString strName) + { + + CString strArgument = m_strScriptEditorArgument; + + if (strArgument.IsEmpty ()) + strArgument = "%file"; // default + + // replace %file + strArgument.Replace ("%file", strName); + + HINSTANCE hInst = ShellExecute (Frame, _T("open"), m_strScriptEditor, + CFormat ("\"%s\"", (LPCTSTR) strArgument), // quote argument + NULL, SW_SHOWNORMAL); + + if ((long) hInst <= 32) + ::UMessageBox(TFormat ("Unable to edit file %s.", + (LPCTSTR) strName), + MB_ICONEXCLAMATION); + else + { + // bring editor to the front + if (!m_strEditorWindowName.IsEmpty ()) + SendToFront (m_strEditorWindowName); + } + + } Index: doc.h =================================================================== RCS file: /cvs/mushclient/doc.h,v retrieving revision 1.288 retrieving revision 1.290 diff -c -r1.288 -r1.290 *** doc.h 9 Aug 2009 05:37:57 -0000 1.288 --- doc.h 29 Nov 2009 02:05:55 -0000 1.290 *************** *** 21,28 **** // New versions - things to change ! #define THISVERSION 443 // Step 1. ! const CString MUSHCLIENT_VERSION = "4.43"; // Step 2. // Step 3. Don't forget VERSION resource in Resources tab // Step 4. Remember: README.TXT --- 21,28 ---- // New versions - things to change ! #define THISVERSION 444 // Step 1. ! const CString MUSHCLIENT_VERSION = "4.44"; // Step 2. // Step 3. Don't forget VERSION resource in Resources tab // Step 4. Remember: README.TXT *************** *** 578,583 **** --- 578,584 ---- CString m_notes; CString m_new_activity_sound; CString m_strScriptEditor; + CString m_strScriptEditorArgument; CString m_strLogFilePreamble; CString m_strSpeedWalkFiller; *************** *** 836,841 **** --- 837,843 ---- unsigned short m_iAutoResizeMinimumLines; // command window minimum number of lines unsigned short m_iAutoResizeMaximumLines; // command window maximum number of lines unsigned short m_bDoNotAddMacrosToCommandHistory; // macros not into command history + unsigned short m_bSendKeepAlives; // set the socket option SO_KEEPALIVE on the TCP/IP connections // end of stuff saved to disk ************************************************************** *************** *** 2019,2024 **** --- 2021,2028 ---- const size_t Length, const bool bAlpha); + void EditFileWithEditor (CString strName); + // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CMUSHclientDoc) Index: methods.cpp =================================================================== RCS file: /cvs/mushclient/methods.cpp,v retrieving revision 1.265 retrieving revision 1.266 diff -c -r1.265 -r1.266 *** methods.cpp 6 Jul 2009 21:35:01 -0000 1.265 --- methods.cpp 29 Nov 2009 02:05:55 -0000 1.266 *************** *** 1345,1364 **** return; } // end of using inbuilt notepad ! HINSTANCE hInst = ShellExecute (Frame, _T("open"), m_strScriptEditor, ! CFormat ("\"%s\"", (LPCTSTR) m_strScriptFilename), ! NULL, SW_SHOWNORMAL); - if ((long) hInst <= 32) - { - ::TMessageBox("Unable to edit the script file.", - MB_ICONEXCLAMATION); - return; - } - - // bring editor to the front - if (!m_strEditorWindowName.IsEmpty ()) - SendToFront (m_strEditorWindowName); } --- 1345,1352 ---- return; } // end of using inbuilt notepad ! EditFileWithEditor (m_strScriptFilename); } *************** *** 7176,7182 **** timer_item->bEnabled = true; timer_item->bOneShot = true; timer_item->bTemporary = true; ! timer_item->bActiveWhenClosed = false; timer_item->iSendTo = SendTo; --- 7164,7170 ---- timer_item->bEnabled = true; timer_item->bOneShot = true; timer_item->bTemporary = true; ! timer_item->bActiveWhenClosed = true; timer_item->iSendTo = SendTo; *************** *** 12102,12108 **** // we need to create a DirectSoundBuffer // Set up bd structure for a static secondary buffer. bd.dwSize = sizeof( bd ) ; ! bd.dwFlags = DSBCAPS_CTRLDEFAULT | DSBCAPS_STATIC ; // Buffer size retrieved from the mmckinfo structure for the data // portion of the wav bd.dwBufferBytes = mmckinfoSubchunk.cksize ; --- 12090,12096 ---- // we need to create a DirectSoundBuffer // Set up bd structure for a static secondary buffer. bd.dwSize = sizeof( bd ) ; ! bd.dwFlags = (DSBCAPS_CTRLPAN | DSBCAPS_CTRLVOLUME | DSBCAPS_CTRLFREQUENCY) | DSBCAPS_STATIC ; // Buffer size retrieved from the mmckinfo structure for the data // portion of the wav bd.dwBufferBytes = mmckinfoSubchunk.cksize ; Index: mushclient.hlp =================================================================== RCS file: /cvs/mushclient/mushclient.hlp,v retrieving revision 1.110 retrieving revision 1.111 diff -c -r1.110 -r1.111 Binary files /tmp/cvsjg2LWt and /tmp/cvse3wz1Y differ Index: mushclient.hpj =================================================================== RCS file: /cvs/mushclient/mushclient.hpj,v retrieving revision 1.4 retrieving revision 1.5 diff -c -r1.4 -r1.5 *** mushclient.hpj 11 Jun 2008 01:13:04 -0000 1.4 --- mushclient.hpj 29 Nov 2009 02:06:05 -0000 1.5 *************** *** 60,66 **** [MAP] #include ! #include E:\Program Files\Microsoft Visual Studio\VC98\MFC\Include\Afxhelp.hm [WINDOWS] main="",,27904,(r14876671),(r12632256),f2 --- 60,66 ---- [MAP] #include ! #include ..\..\Program Files\Microsoft Visual Studio\VC98\MFC\Include\Afxhelp.hm [WINDOWS] main="",,27904,(r14876671),(r12632256),f2 Index: prefspropertypages.cpp =================================================================== RCS file: /cvs/mushclient/prefspropertypages.cpp,v retrieving revision 1.111 retrieving revision 1.112 diff -c -r1.111 -r1.112 *** prefspropertypages.cpp 6 Jul 2009 05:58:57 -0000 1.111 --- prefspropertypages.cpp 29 Nov 2009 02:06:05 -0000 1.112 *************** *** 6811,6848 **** void CPrefsP17::OnEditScript() { ! if (m_ctlEditScriptWithNotepad.GetCheck ()) ! { ! CTextDocument * pNewDoc = ! (CTextDocument *) App.OpenDocumentFile (m_strScriptFilename); ! ! if (pNewDoc) { ! pNewDoc->SetTheFont (); ! pNewDoc->m_pRelatedWorld = m_doc; ! pNewDoc->m_iUniqueDocumentNumber = m_doc->m_iUniqueDocumentNumber; ! } ! else ! ::TMessageBox("Unable to edit the script file.", ! MB_ICONEXCLAMATION); ! return; ! } // end of using inbuilt notepad ! ! HINSTANCE hInst = ShellExecute (Frame, _T("open"), m_strScriptEditor, ! CFormat ("\"%s\"", (LPCTSTR) m_strScriptFilename), ! NULL, SW_SHOWNORMAL); ! ! if ((long) hInst <= 32) ! { ! ::TMessageBox("Unable to edit the script file.", ! MB_ICONEXCLAMATION); ! return; ! } - // bring editor to the front - if (m_doc && !m_doc->m_strEditorWindowName.IsEmpty ()) - SendToFront (m_doc->m_strEditorWindowName); - } --- 6811,6835 ---- void CPrefsP17::OnEditScript() { ! if (m_ctlEditScriptWithNotepad.GetCheck ()) { ! CTextDocument * pNewDoc = ! (CTextDocument *) App.OpenDocumentFile (m_strScriptFilename); ! ! if (pNewDoc) ! { ! pNewDoc->SetTheFont (); ! pNewDoc->m_pRelatedWorld = m_doc; ! pNewDoc->m_iUniqueDocumentNumber = m_doc->m_iUniqueDocumentNumber; ! } ! else ! ::TMessageBox("Unable to edit the script file.", ! MB_ICONEXCLAMATION); ! return; ! } // end of using inbuilt notepad ! ! m_doc->EditFileWithEditor (m_strScriptFilename); } Index: scriptingoptions.cpp =================================================================== RCS file: /cvs/mushclient/scriptingoptions.cpp,v retrieving revision 1.56 retrieving revision 1.57 diff -c -r1.56 -r1.57 *** scriptingoptions.cpp 29 Jun 2008 00:04:24 -0000 1.56 --- scriptingoptions.cpp 29 Nov 2009 02:06:05 -0000 1.57 *************** *** 150,155 **** --- 150,156 ---- {"send_file_commented_softcode", false, O(m_bFileCommentedSoftcode)}, {"send_file_delay", 0, O(m_nFileDelay), 0, 100000}, {"send_file_delay_per_lines", 1, O(m_nFileDelayPerLines), 1, 100000}, + {"send_keep_alives", 0, O(m_bSendKeepAlives)}, {"send_mxp_afk_response", true, O(m_bSendMXP_AFK_Response)}, {"show_bold", false, O(m_bShowBold), 0, 0, OPT_UPDATE_VIEWS | OPT_UPDATE_OUTPUT_FONT}, {"show_connect_disconnect", true, O(m_bShowConnectDisconnect)}, *************** *** 246,251 **** --- 247,253 ---- {"proxy_password", "", A(m_strProxyPassword), OPT_PASSWORD | OPT_PLUGIN_CANNOT_RW}, {"recall_line_preamble", "", A(m_strRecallLinePreamble), OPT_KEEP_SPACES}, {"script_editor", "notepad", A(m_strScriptEditor)}, + {"script_editor_argument", "%file", A(m_strScriptEditorArgument)}, {"script_filename", "", A(m_strScriptFilename)}, {"script_language", "lua", A(m_strLanguage)}, {"script_prefix", "", A(m_strScriptPrefix)}, Index: worldsock.cpp =================================================================== RCS file: /cvs/mushclient/worldsock.cpp,v retrieving revision 1.9 retrieving revision 1.11 diff -c -r1.9 -r1.11 *** worldsock.cpp 19 Jun 2008 07:15:55 -0000 1.9 --- worldsock.cpp 29 Nov 2009 02:06:05 -0000 1.11 *************** *** 82,87 **** --- 82,89 ---- m_pDoc->m_iConnectPhase = eConnectDisconnecting; + m_pDoc->ProcessPendingRead(); // pull in any outstanding data (see http://www.gammon.com.au/forum/?id=9696) + m_pDoc->UpdateAllViews (NULL); m_pDoc->MXP_Off (true); // turn off MXP now *************** *** 139,148 **** CTimeSpan ts = CTime::GetCurrentTime() - m_pDoc->m_tConnectTime; CString strDuration = TFormat ("--- Connected for %i day%s, %i hour%s, %i minute%s, %i second%s. ---", ! PLURAL (ts.GetDays()), ! PLURAL (ts.GetHours()), ! PLURAL (ts.GetMinutes()), ! PLURAL (ts.GetSeconds())); m_pDoc->Note (strDuration); --- 141,150 ---- CTimeSpan ts = CTime::GetCurrentTime() - m_pDoc->m_tConnectTime; CString strDuration = TFormat ("--- Connected for %i day%s, %i hour%s, %i minute%s, %i second%s. ---", ! PLURAL ((long) ts.GetDays()), ! PLURAL ((long) ts.GetHours()), ! PLURAL ((long) ts.GetMinutes()), ! PLURAL ((long) ts.GetSeconds())); m_pDoc->Note (strDuration); Index: install/mushclient.nsi =================================================================== RCS file: /cvs/mushclient/install/mushclient.nsi,v retrieving revision 1.69 retrieving revision 1.70 diff -c -r1.69 -r1.70 *** install/mushclient.nsi 25 Jul 2009 01:35:58 -0000 1.69 --- install/mushclient.nsi 28 Aug 2009 21:11:32 -0000 1.70 *************** *** 314,319 **** --- 314,320 ---- File "..\lua\re.lua" File "..\lua\mw.lua" File "..\lua\movewindow.lua" + File "..\lua\alphanum.lua" ; Set output path to the scripts subdirectory. SetOutPath $INSTDIR\scripts *************** *** 452,457 **** --- 453,459 ---- Delete "$INSTDIR\lua\re.lua" Delete "$INSTDIR\lua\mw.lua" Delete "$INSTDIR\lua\movewindow.lua" + Delete "$INSTDIR\lua\alphanum.lua" ; spell checker stuff Delete "$INSTDIR\spellchecker.lua" Index: install/readme.txt =================================================================== RCS file: /cvs/mushclient/install/readme.txt,v retrieving revision 1.194 retrieving revision 1.196 diff -c -r1.194 -r1.196 *** install/readme.txt 9 Aug 2009 21:12:54 -0000 1.194 --- install/readme.txt 29 Nov 2009 02:06:05 -0000 1.196 *************** *** 1,7 **** ! MUSHclient version 4.43 ======================= ! Monday, 10th August, 2009 Author: Nick Gammon Web support: http://www.gammon.com.au/forum/ --- 1,7 ---- ! MUSHclient version 4.44 ======================= ! Sunday, 29th November, 2009 Author: Nick Gammon Web support: http://www.gammon.com.au/forum/