本文整理汇总了C++中OutBuffer::SetLPS方法的典型用法代码示例。如果您正苦于以下问题:C++ OutBuffer::SetLPS方法的具体用法?C++ OutBuffer::SetLPS怎么用?C++ OutBuffer::SetLPS使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OutBuffer
的用法示例。
在下文中一共展示了OutBuffer::SetLPS方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MraAddContact
// Adds new contact
DWORD CMraProto::MraAddContact(MCONTACT hContact, DWORD dwContactFlag, DWORD dwGroupID, const CMStringA &szEmail, const CMStringW &wszCustomName, const CMStringA *szPhones, const CMString* wszAuthMessage)
{
if (szEmail.GetLength() <= 4 && !(dwContactFlag & CONTACT_FLAG_GROUP))
return 0;
dwContactFlag |= CONTACT_FLAG_UNICODE_NAME;
if (dwGroupID == -1)
dwGroupID = 0;
OutBuffer buf;
buf.SetUL(dwContactFlag);
buf.SetUL(dwGroupID);
buf.SetLPSLowerCase(szEmail);
buf.SetLPSW(wszCustomName);
buf.SetLPS((szPhones == NULL) ? "" : *szPhones);
// pack auth message
OutBuffer buf2;
buf2.SetUL(2);
buf2.SetLPSW(_T(""));//***deb possible nick here
buf2.SetLPSW((wszAuthMessage == NULL) ? _T("") : *wszAuthMessage);
buf.SetLPS(CMStringA(ptrA(mir_base64_encode(buf2.Data(), (int)buf2.Len()))));
buf.SetUL(0);
return MraSendQueueCMD(hSendQueueHandle, 0, hContact, ACKTYPE_ADDED, NULL, 0, MRIM_CS_ADD_CONTACT, buf.Data(), buf.Len());
}
示例2: MraProxy
// Соединение с прокси
DWORD CMraProto::MraProxy(const CMStringA &szEmail, DWORD dwIDRequest, DWORD dwDataType, const CMStringA &lpszData, const CMStringA &szAddresses, MRA_GUID mguidSessionID)
{
if (szEmail.GetLength() <= 4)
return 0;
OutBuffer buf;
buf.SetLPSLowerCase(szEmail);
buf.SetUL(dwIDRequest);
buf.SetUL(dwDataType);
buf.SetLPS(lpszData);
buf.SetLPS(szAddresses);
buf.SetGUID(mguidSessionID);
return MraSendCMD(MRIM_CS_PROXY, buf.Data(), buf.Len());
}
示例3: MraModifyContact
// change contact
DWORD CMraProto::MraModifyContact(MCONTACT hContact, DWORD *pdwID, DWORD *pdwContactFlag, DWORD *pdwGroupID, const CMStringA *pszEmail, const CMStringW *pwszCustomName, const CMStringA *pszPhones)
{
CMStringA szEmail, szPhones;
CMStringW wszNick, wszCustomName;
DWORD dwID, dwGroupID, dwContactFlag;
if (hContact)
GetContactBasicInfoW(hContact, &dwID, &dwGroupID, &dwContactFlag, NULL, NULL, &szEmail, &wszNick, &szPhones);
else
dwID = dwGroupID = dwContactFlag = 0;
if (pdwID) dwID = *pdwID;
if (dwID == -1)
return 0;
if (pszEmail) szEmail = *pszEmail;
if (pszPhones) szPhones = *pszPhones;
if (pdwGroupID) dwGroupID = *pdwGroupID;
if (pdwContactFlag) dwContactFlag = *pdwContactFlag;
if (pwszCustomName) wszCustomName = *pwszCustomName;
OutBuffer buf;
buf.SetUL(dwID);
buf.SetUL(dwContactFlag | CONTACT_FLAG_UNICODE_NAME);
buf.SetUL(dwGroupID);
buf.SetLPSLowerCase(szEmail);
buf.SetLPSW(wszCustomName);
buf.SetLPS(szPhones);
return MraSendQueueCMD(hSendQueueHandle, 0, hContact, ACKTYPE_ADDED, NULL, 0, MRIM_CS_MODIFY_CONTACT, buf.Data(), buf.Len());
}
示例4: MraChangeStatus
// change status
DWORD CMraProto::MraChangeStatus(DWORD dwStatus, const CMStringA &szStatusUri, const CMStringW &wszStatusTitle, const CMStringW &wszStatusDesc, DWORD dwFutureFlags)
{
OutBuffer buf;
buf.SetUL(dwStatus);
buf.SetLPS(szStatusUri);
buf.SetLPSW(wszStatusTitle);
buf.SetLPSW(wszStatusDesc);
buf.SetUL(dwFutureFlags);
return MraSendCMD(MRIM_CS_CHANGE_STATUS, buf.Data(), buf.Len());
}
示例5: MraFileTransferAck
// Ответ на отправку файлов
DWORD CMraProto::MraFileTransferAck(DWORD dwStatus, const CMStringA &szEmail, DWORD dwIDRequest, const CMStringA &szDescription)
{
if (szEmail.GetLength() <= 4)
return 0;
OutBuffer buf;
buf.SetUL(dwStatus);
buf.SetLPSLowerCase(szEmail);
buf.SetUL(dwIDRequest);
buf.SetLPS(szDescription);
return MraSendCMD(MRIM_CS_FILE_TRANSFER_ACK, buf.Data(), buf.Len());
}
示例6: MraFileTransfer
// Отправка файлов
DWORD CMraProto::MraFileTransfer(const CMStringA &szEmail, DWORD dwIDRequest, DWORD dwFilesTotalSize, const CMStringW &wszFiles, const CMStringA &szAddresses)
{
if (szEmail.GetLength() <= 4)
return 0;
CMStringA szFiles = wszFiles;
OutBuffer buf;
buf.SetLPSLowerCase(szEmail);
buf.SetUL(dwIDRequest);
buf.SetUL(dwFilesTotalSize);
buf.SetUL(sizeof(DWORD) * 5 + szFiles.GetLength() + wszFiles.GetLength()*sizeof(WCHAR) + szAddresses.GetLength());
buf.SetLPS(szFiles);
buf.SetUL(sizeof(DWORD) * 2 + wszFiles.GetLength()*sizeof(WCHAR));
buf.SetUL(1);
buf.SetLPSW(wszFiles);
buf.SetLPS(szAddresses);
return MraSendCMD(MRIM_CS_FILE_TRANSFER, buf.Data(), buf.Len());
}
示例7: MraGame
// Отправка файлов
DWORD CMraProto::MraGame(const CMStringA &szEmail, DWORD dwGameSessionID, DWORD dwGameMsg, DWORD dwGameMsgID, const CMStringA &szData)
{
if (szEmail.GetLength() <= 4)
return 0;
OutBuffer buf;
buf.SetLPSLowerCase(szEmail);
buf.SetUL(dwGameSessionID);
buf.SetUL(dwGameMsg);
buf.SetUL(dwGameMsgID);
buf.SetUL(_time32(NULL));
buf.SetLPS(szData);
return MraSendCMD(MRIM_CS_GAME, buf.Data(), buf.Len());
}
示例8: MraSMSW
// Отправка SMS
DWORD CMraProto::MraSMSW(MCONTACT hContact, const CMStringA &lpszPhone, const CMStringW &lpwszMessage)
{
CMStringA szPhoneLocal = "+" + CopyNumber(lpszPhone);
OutBuffer buf;
buf.SetUL(0);
buf.SetLPS(szPhoneLocal);
buf.SetLPSW(lpwszMessage);
/* Save phone number for ack notify after send. */
LPBYTE lpbData = (LPBYTE)mir_calloc(lpszPhone.GetLength() + sizeof(size_t));
if (NULL == lpbData)
return (0);
memcpy(lpbData, lpszPhone, lpszPhone.GetLength());
return MraSendQueueCMD(hSendQueueHandle, 0, hContact, ICQACKTYPE_SMS, lpbData, lpszPhone.GetLength(), MRIM_CS_SMS, buf.Data(), buf.Len());
}
示例9: MraSendCMD
// Авторизация
DWORD CMraProto::MraLogin2W(const CMStringA &szLogin, const CMStringA &szPassword, DWORD dwStatus, const CMStringA &szStatusUri, CMStringW &wszStatusTitle, CMStringW &wszStatusDesc, DWORD dwFutureFlags, CMStringA &szUserAgentFormatted, CMStringA &szUserAgent)
{
if (wszStatusTitle.GetLength() > STATUS_TITLE_MAX) wszStatusTitle.Truncate(STATUS_TITLE_MAX);
if (wszStatusDesc.GetLength() > STATUS_DESC_MAX) wszStatusDesc.Truncate(STATUS_DESC_MAX);
if (szUserAgentFormatted.GetLength() > USER_AGENT_MAX) szUserAgentFormatted.Truncate(USER_AGENT_MAX);
if (szUserAgent.GetLength() > MAX_CLIENT_DESCRIPTION) szUserAgent.Truncate(MAX_CLIENT_DESCRIPTION);
OutBuffer buf;
buf.SetLPS(szLogin);
buf.SetLPS(szPassword);
buf.SetUL(dwStatus);
buf.SetLPS(szStatusUri);
buf.SetLPSW(wszStatusTitle);
buf.SetLPSW(wszStatusDesc);
buf.SetUL(dwFutureFlags);
buf.SetLPS(szUserAgentFormatted);
buf.SetLPS("ru");
buf.SetLPS("");
buf.SetLPS("");
buf.SetLPS(szUserAgent);// LPS client description /max 256
return MraSendCMD(MRIM_CS_LOGIN2, buf.Data(), buf.Len());
}
示例10: MraMessage
DWORD CMraProto::MraMessage(BOOL bAddToQueue, MCONTACT hContact, DWORD dwAckType, DWORD dwFlags, const CMStringA &szEmail, const CMStringW &lpwszMessage, LPBYTE lpbMultiChatData, size_t dwMultiChatDataSize)
{
debugLogA("Sending message: flags %08x, to '%S', message '%S'\n", dwFlags, szEmail, lpwszMessage);
DWORD dwRet = 0;
LPSTR lpszMessageConverted = (LPSTR)lpwszMessage.GetString();
LPSTR lpszMessageRTF = NULL;
size_t dwMessageConvertedSize = lpwszMessage.GetLength()*sizeof(WCHAR), dwMessageRTFSize = 0;
if (MraIsMessageFlashAnimation(lpwszMessage))
dwFlags |= MESSAGE_FLAG_FLASH;
// pack auth message
if (dwFlags & MESSAGE_FLAG_AUTHORIZE) {
OutBuffer buf;
buf.SetUL(2);
buf.SetLPSW(_T(""));//***deb possible nick here
buf.SetLPSW(lpwszMessage);
lpszMessageConverted = mir_base64_encode(buf.Data(), (int)buf.Len());
dwMessageConvertedSize = mir_strlen(lpszMessageConverted);
}
// messages with Flash
else if (dwFlags & MESSAGE_FLAG_FLASH) {
dwFlags |= MESSAGE_FLAG_RTF;
CMStringA lpszBuf(mir_u2a(lpwszMessage));
OutBuffer buf;
buf.SetUL(4);
buf.SetLPS(lpszBuf);// сообщение что у собеседника плохая версия :)
buf.SetUL(4);
buf.SetUL(getDword("RTFBackgroundColour", MRA_DEFAULT_RTF_BACKGROUND_COLOUR));
buf.SetLPS(lpszBuf);// сам мульт ANSI
buf.SetLPSW(lpwszMessage);// сам мульт UNICODE
DWORD dwBufSize = DWORD(buf.Len() + 128);
lpszBuf.Truncate(dwBufSize);
if (compress2((LPBYTE)(LPCSTR)lpszBuf, &dwBufSize, buf.Data(), (int)buf.Len(), Z_BEST_COMPRESSION) == Z_OK) {
lpszMessageRTF = mir_base64_encode((LPBYTE)(LPCSTR)lpszBuf, dwBufSize);
dwMessageRTFSize = mir_strlen(lpszMessageRTF);
}
}
// standart message
else if ((dwFlags & (MESSAGE_FLAG_CONTACT | MESSAGE_FLAG_NOTIFY | MESSAGE_FLAG_SMS)) == 0) {
// Only if message is simple text message or RTF or ALARM
if (dwFlags & MESSAGE_FLAG_RTF) { // add RFT part
CMStringA lpbRTFData; lpbRTFData.Truncate(lpwszMessage.GetLength() * 16 + 4096);
if (!MraConvertToRTFW(lpwszMessage, lpbRTFData)) {
DWORD dwBackColour = getDword("RTFBackgroundColour", MRA_DEFAULT_RTF_BACKGROUND_COLOUR);
OutBuffer buf;
buf.SetUL(2);
buf.SetLPS(lpbRTFData);
buf.SetUL(4);
buf.SetUL(dwBackColour);
DWORD dwRTFDataSize = lpbRTFData.GetLength();
if (compress2((LPBYTE)(LPCSTR)lpbRTFData, &dwRTFDataSize, buf.Data(), (int)buf.Len(), Z_BEST_COMPRESSION) == Z_OK) {
lpszMessageRTF = mir_base64_encode((LPBYTE)(LPCSTR)lpbRTFData, dwRTFDataSize);
dwMessageRTFSize = mir_strlen(lpszMessageRTF);
}
}
}
}
if (lpszMessageRTF == NULL || dwMessageRTFSize == 0) dwFlags &= ~(MESSAGE_FLAG_RTF | MESSAGE_FLAG_FLASH);
if (lpbMultiChatData == NULL || dwMultiChatDataSize == 0) dwFlags &= ~MESSAGE_FLAG_MULTICHAT;
OutBuffer buf;
buf.SetUL(dwFlags);
buf.SetLPSLowerCase(szEmail);
buf.SetLPS(CMStringA(lpszMessageConverted, (int)dwMessageConvertedSize));
buf.SetLPS(lpszMessageRTF);
if (dwFlags & MESSAGE_FLAG_MULTICHAT)
buf.SetLPS(CMStringA((LPSTR)lpbMultiChatData, (int)dwMultiChatDataSize));
if (bAddToQueue)
dwRet = MraSendQueueCMD(hSendQueueHandle, 0, hContact, dwAckType, NULL, 0, MRIM_CS_MESSAGE, buf.Data(), buf.Len());
else
dwRet = MraSendCMD(MRIM_CS_MESSAGE, buf.Data(), buf.Len());
return dwRet;
}
示例11: MraWPRequestW
// Поиск контакта
HANDLE CMraProto::MraWPRequestW(MCONTACT hContact, DWORD dwAckType, DWORD dwRequestFlags, const CMStringA &szUser, const CMStringA &szDomain, const CMStringW &wszNickName, const CMStringW &wszFirstName, const CMStringW &wszLastName, DWORD dwSex, DWORD dwDate1, DWORD dwDate2, DWORD dwCityID, DWORD dwZodiak, DWORD dwBirthdayMonth, DWORD dwBirthdayDay, DWORD dwCountryID, DWORD dwOnline)
{
OutBuffer buf;
CMStringA tmp;
if (GetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_USER)) { buf.SetUL(MRIM_CS_WP_REQUEST_PARAM_USER); buf.SetLPSLowerCase(szUser); }
if (GetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_DOMAIN)) { buf.SetUL(MRIM_CS_WP_REQUEST_PARAM_DOMAIN); buf.SetLPSLowerCase(szDomain); }
if (GetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_NICKNAME)) { buf.SetUL(MRIM_CS_WP_REQUEST_PARAM_NICKNAME); buf.SetLPSW(wszNickName); }
if (GetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_FIRSTNAME)) { buf.SetUL(MRIM_CS_WP_REQUEST_PARAM_FIRSTNAME); buf.SetLPSW(wszFirstName); }
if (GetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_LASTNAME)) { buf.SetUL(MRIM_CS_WP_REQUEST_PARAM_LASTNAME); buf.SetLPSW(wszLastName); }
if (GetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_SEX)) {
tmp.Format("%lu", dwSex);
buf.SetUL(MRIM_CS_WP_REQUEST_PARAM_SEX);
buf.SetLPS(tmp);
}
if (GetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_DATE1)) {
tmp.Format("%lu", dwDate1);
buf.SetUL(MRIM_CS_WP_REQUEST_PARAM_DATE1);
buf.SetLPS(tmp);
}
if (GetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_DATE2)) {
tmp.Format("%lu", dwDate2);
buf.SetUL(MRIM_CS_WP_REQUEST_PARAM_DATE2);
buf.SetLPS(tmp);
}
if (GetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_CITY_ID)) {
tmp.Format("%lu", dwCityID);
buf.SetUL(MRIM_CS_WP_REQUEST_PARAM_CITY_ID);
buf.SetLPS(tmp);
}
if (GetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_ZODIAC)) {
tmp.Format("%lu", dwZodiak);
buf.SetUL(MRIM_CS_WP_REQUEST_PARAM_ZODIAC);
buf.SetLPS(tmp);
}
if (GetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_BIRTHDAY_MONTH)) {
tmp.Format("%lu", dwBirthdayMonth);
buf.SetUL(MRIM_CS_WP_REQUEST_PARAM_BIRTHDAY_MONTH);
buf.SetLPS(tmp);
}
if (GetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_BIRTHDAY_DAY)) {
tmp.Format("%lu", dwBirthdayDay);
buf.SetUL(MRIM_CS_WP_REQUEST_PARAM_BIRTHDAY_DAY);
buf.SetLPS(tmp);
}
if (GetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_COUNTRY_ID)) {
tmp.Format("%lu", dwCountryID);
buf.SetUL(MRIM_CS_WP_REQUEST_PARAM_COUNTRY_ID);
buf.SetLPS(tmp);
}
if (GetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_ONLINE)) {
tmp.Format("%lu", dwOnline);
buf.SetUL(MRIM_CS_WP_REQUEST_PARAM_ONLINE);
buf.SetLPS(tmp);
}
return (HANDLE)MraSendQueueCMD(hSendQueueHandle, dwRequestFlags, hContact, dwAckType, NULL, 0, MRIM_CS_WP_REQUEST, buf.Data(), buf.Len());
}