From: <ha...@us...> - 2002-09-16 21:27:22
|
Update of /cvsroot/decaldev/source/Decal In directory usw-pr-cvs1:/tmp/cvs-serv12500 Modified Files: ACHooks.cpp ACHooks.h Log Message: SendTell stuffages Index: ACHooks.cpp =================================================================== RCS file: /cvsroot/decaldev/source/Decal/ACHooks.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** ACHooks.cpp 30 Aug 2002 19:12:42 -0000 1.18 --- ACHooks.cpp 16 Sep 2002 21:27:17 -0000 1.19 *************** *** 9,12 **** --- 9,15 ---- void (*pfnUseItem)( DWORD, DWORD ) = NULL; void (*pfnMoveItemEx)( DWORD, DWORD, DWORD ) = NULL; + void (*pfnInternalStringDestructor)( qString * ) = NULL; + long (*pfnSendMessageToID)( qString *, long ) = NULL; + qString* (*pfnInternalStringConstructor)( qString *, long, char * ) = NULL; extern void ObjectDestroyedHook (); *************** *** 298,301 **** --- 301,331 ---- } } + + if( QueryMemLoc( _bstr_t( "InternalStringConstructor" ), &Val ) == S_OK) + { + m_bInternalStringConstructor = true; + m_lInternalStringConstructor = Val; + + pfnInternalStringConstructor = reinterpret_cast< qString *(*)(qString *, long, char *) >( Val ); + } + + if( QueryMemLoc( _bstr_t( "InternalStringDestructor" ), &Val ) == S_OK) + { + m_bInternalStringDestructor = true; + m_lInternalStringDestructor = Val; + + pfnInternalStringDestructor = reinterpret_cast< void(*)(qString *) >( Val ); + } + + if( QueryMemLoc( _bstr_t( "SendMessageToID" ), &Val ) == S_OK) + { + m_bSendMessageToID = true; + m_lSendMessageToID = Val; + + pfnSendMessageToID = reinterpret_cast< long(*)(qString *, long) >( Val ); + } + + if( m_bInternalStringConstructor && m_bInternalStringDestructor && m_bSendMessageToID ) + m_Hooks |= eSendTell; } *************** *** 1135,1138 **** --- 1165,1185 ---- *pVal = *( reinterpret_cast< long * >( m_lArea3DHeight ) ); + + return S_OK; + } + + STDMETHODIMP cACHooks::SendTell( long lPlayerID, BSTR Message ) + { + if( !(m_bInternalStringConstructor && m_bInternalStringDestructor && m_bSendMessageToID) ) + return S_FALSE; + + USES_CONVERSION; + char *Text = OLE2A( Message ); + + long retval; + qString Msg; + pfnInternalStringConstructor( &Msg, 0, Text ); + retval = pfnSendMessageToID( &Msg, lPlayerID ); + pfnInternalStringDestructor( &Msg ); return S_OK; Index: ACHooks.h =================================================================== RCS file: /cvsroot/decaldev/source/Decal/ACHooks.h,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** ACHooks.h 30 Aug 2002 10:46:09 -0000 1.17 --- ACHooks.h 16 Sep 2002 21:27:17 -0000 1.18 *************** *** 13,16 **** --- 13,24 ---- }; + // qString struct for internal client strings - this is all cynica_l's work + struct qString + { + void **vTable; + char *Data; + long MaximumLength; + }; + ///////////////////////////////////////////////////////////////////////////// // ACHooks *************** *** 117,120 **** --- 125,136 ---- long m_lFaceHeading; + bool m_bInternalStringConstructor; + bool m_bInternalStringDestructor; + bool m_bSendMessageToID; + + long m_lInternalStringConstructor; + long m_lInternalStringDestructor; + long m_lSendMessageToID; + public: STDMETHOD(MoveItemEx)(long lObjectID, long lDestinationID); *************** *** 152,155 **** --- 168,172 ---- STDMETHOD(get_Area3DHeight)(long *pVal); STDMETHOD(ItemIsKnown)(long lGUID, VARIANT_BOOL* pRetval) ; + STDMETHOD(SendTell)(long lPlayerID, BSTR Message); static cACHooks* s_pACHooks; |