本文整理汇总了C++中PHeadSetB函数的典型用法代码示例。如果您正苦于以下问题:C++ PHeadSetB函数的具体用法?C++ PHeadSetB怎么用?C++ PHeadSetB使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PHeadSetB函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: memset
void TNotice::SendToUser(int aIndex, LPSTR szMsg, ...)
{
#ifdef GS_UNICODE
unsigned char szTempMsg[4096]={0};
#endif
va_list pArguments;
#ifdef GS_UNICODE
memset(this->m_pNotice.szNoticeMessage , 0, sizeof(this->m_pNotice.szNoticeMessage ));
#endif
va_start(pArguments, szMsg);
#ifdef GS_UNICODE
vsprintf((char*)szTempMsg, (char*)szMsg, pArguments);
#else
vsprintf_s(this->m_Notice.Notice, (char*)szMsg, pArguments);
#endif
va_end(pArguments);
#ifdef GS_UNICODE
MultiByteToWideChar( 1258, 0, (char*)szTempMsg, strlen((char*)szTempMsg), (unsigned short*)this->m_pNotice.szNoticeMessage, sizeof(this->m_pNotice.szNoticeMessage) );
this->m_pNotice.szNoticeMessage[254]=0;
this->m_pNotice.szNoticeMessage[255]=0;
PHeadSetB( &this->m_pNotice.PacketHeader, 0x0D, wcslen((unsigned short*)this->m_pNotice.szNoticeMessage )*2+0x12);
#else
PHeadSetB((LPBYTE)&this->m_Notice, 0x0D, strlen(this->m_Notice.Notice) + sizeof(PMSG_NOTICE) - sizeof(this->m_Notice.Notice) + 1);
#endif
DataSend(aIndex, (LPBYTE)&this->m_Notice , this->m_Notice.h.size );
}
示例2: GetTickCount
void CRingAttackEvent::ProcState_Closed()
{
int iTICK_MSEC = GetTickCount() - this->m_iTIME_TICK_COUNT;
if ( iTICK_MSEC >= 1000 )
{
this->m_iTIME_MSEC_REMAIN -= iTICK_MSEC;
this->m_iTIME_TICK_COUNT = GetTickCount();
if ( this->m_bDoEvent )
{
if ( this->m_iTIME_MSEC_REMAIN <= (this->m_iTIME_MIN_OPEN * 60 * 1000 ) &&
this->m_iTIME_MSEC_REMAIN > 0 &&
(this->m_iTIME_MSEC_REMAIN / 60000 ) != this->m_iTIME_NOTIFY_COUNT )
{
this->m_iTIME_NOTIFY_COUNT = this->m_iTIME_MSEC_REMAIN / 60000;
if ( (this->m_iTIME_NOTIFY_COUNT+1) == 3 )
{
AllSendServerMsg("The White Wizard and his minions are starting to assemble!");
PMSG_ANS_CL_EFFECT pMsg;
PHeadSetB((LPBYTE)&pMsg, 0x9E, sizeof(pMsg));
pMsg.wEffectNum = 0;
DataSendAll((LPBYTE)&pMsg, pMsg.h.size);
LogAdd("[Ring Event] - Before 3 minutes - Advertise");
}
}
}
}
if ( this->m_iTIME_MSEC_REMAIN <= 0 )
{
AllSendServerMsg("The White Wizard and his Orcs have invaded us!");
PMSG_ANS_CL_EFFECT pMsg;
PHeadSetB((LPBYTE)&pMsg, 0x9E, sizeof(pMsg));
pMsg.wEffectNum = 1;
DataSendAll((LPBYTE)&pMsg, pMsg.h.size);
if ( this->m_bDoEvent )
{
this->SetState(2);
}
else
{
this->SetState(0);
}
LogAdd("[Ring Event] - Event Started");
}
}
示例3: GCDamageSend
void GCDamageSend(int aIndex,int TargetIndex,int AttackDamage,int MSBFlag,int MSBDamage,int iShieldDamage)
{
PMSG_ATTACKRESULT pResult;
#if (IS_PROTOCOL_JPN == 0)
PHeadSetB((LPBYTE)&pResult,0x11,sizeof(pResult)); // (1.03P 1.03.16 main)
#else
PHeadSetB((LPBYTE)&pResult,0xDC,sizeof(pResult)); // (1.03K 1.03.11 main)
#endif
pResult.NumberH = SET_NUMBERH(TargetIndex);
pResult.NumberL = SET_NUMBERL(TargetIndex);
pResult.DamageH = SET_NUMBERH(AttackDamage);
pResult.DamageL = SET_NUMBERL(AttackDamage);
pResult.btShieldDamageH = SET_NUMBERH(iShieldDamage);
pResult.btShieldDamageL = SET_NUMBERL(iShieldDamage);
if(MSBFlag != false)
{
pResult.NumberH &= 0x7F;
pResult.NumberH |= 0x80;
}
pResult.DamageType = MSBDamage;
OBJECTSTRUCT * gObj = (OBJECTSTRUCT*)OBJECT_POINTER(aIndex);
OBJECTSTRUCT * gTarg = (OBJECTSTRUCT*)OBJECT_POINTER(TargetIndex);
pResult.Life = gTarg->Life;
pResult.MaxLife = gTarg->MaxLife + gTarg->AddLife;
pResult.X = gTarg->X;
pResult.Y = gTarg->Y;
if(gTarg->Type == OBJECT_MONSTER)
{
pResult.Life = gTarg->Life;
pResult.MaxLife = gTarg->MaxLife + gTarg->AddLife;
}
if(gTarg->Type == OBJECT_USER)
{
DataSend(TargetIndex, (LPBYTE)&pResult, pResult.h.size);
}
if(gObj->Type == OBJECT_USER)
{
DataSend(aIndex, (LPBYTE)&pResult, pResult.h.size);
}
lpGCDamageSend(aIndex, TargetIndex, AttackDamage, MSBFlag, MSBDamage, iShieldDamage);
}
示例4: EGAnsEnterDoubleGoer
void EGAnsEnterDoubleGoer(LPBYTE aRecv,int aIndex)
{
LPMSG_DOUBLEGOER_REQ_ENTER_EVENT lpMsg = (LPMSG_DOUBLEGOER_REQ_ENTER_EVENT)aRecv;
PMSG_DOUBLEGOER_ANS_ENTER_EVENT pMsg;
PHeadSetB((LPBYTE)&pMsg,0x40,sizeof(pMsg));
pMsg.btPos = lpMsg->btPos;
pMsg.aIndex = lpMsg->aIndex;
pMsg.iResult = 0;
char szQuery[512];
wsprintf(szQuery,"SELECT DATEDIFF(mi,getdate(),NEXT_EVENT) as LeftHour FROM DG_ROOM WHERE CHAR_NAME = '%s' AND NEXT_EVENT > getdate()",lpMsg->szName);
if( g_EventDB.Exec(szQuery) != FALSE )
{
if( g_EventDB.Fetch() != SQL_NO_DATA )
{
pMsg.iResult = g_EventDB.GetInt("LeftHour");
}
}
else
{
pMsg.iResult = -1;
}
g_EventDB.Clear();
DataSend(aIndex,(LPBYTE)&pMsg,sizeof(pMsg));
}
示例5: EGAnsPCBangUpdateUser
void EGAnsPCBangUpdateUser(LPBYTE aRecv,int aIndex)
{
PMSG_PCBANGUSER_SENDINFO* lpMsg = (PMSG_PCBANGUSER_SENDINFO*)aRecv;
PMSG_PCBANGUSER_SENDINFO pMsg;
char szAccountId[MAX_IDSTRING+1];
memcpy(szAccountId,lpMsg->szAccountID,MAX_IDSTRING);
szAccountId[MAX_IDSTRING] = '\0';
PHeadSetB((LPBYTE)&pMsg,0x24,sizeof(pMsg));
pMsg.aIndex = lpMsg->aIndex;
pMsg.Point = lpMsg->Point;
pMsg.btResult = 0;
char szQuery[256];
sprintf(szQuery,"UPDATE PCBANG_USER SET pcbang_points = %d WHERE pcbang_id = '%s'",
lpMsg->Point,szAccountId);
if( g_EventDB.Exec(szQuery) == TRUE )
{
pMsg.btResult = TRUE;
}
g_EventDB.Clear();
DataSend(aIndex,(LPBYTE)&pMsg,sizeof(pMsg));
}
示例6: EGAnsPCBangUserConnect
void EGAnsPCBangUserConnect(LPBYTE aRecv,int aIndex)
{
PMSG_PCBANGUSER_CONNECT* lpMsg = (PMSG_PCBANGUSER_CONNECT*)aRecv;
char szAccountId[MAX_IDSTRING+1];
szAccountId[MAX_IDSTRING] = '\0';
memcpy(szAccountId,lpMsg->szAccountID,MAX_IDSTRING);
char szQuery[256];
sprintf(szQuery,"SELECT pcbang_id,pcbang_points FROM PCBANG_USER WHERE pcbang_id = '%s'",szAccountId);
PMSG_PCBANG_USERDATA_GETINFO pMsg ={0};
PHeadSetB((LPBYTE)&pMsg,0x23,sizeof(pMsg));
pMsg.aIndex = lpMsg->aIndex;
pMsg.Points = 0;
if( g_EventDB.Exec(szQuery) == TRUE )
{
if( g_EventDB.Fetch() != SQL_NO_DATA )
{
pMsg.Points = g_EventDB.GetInt("pcbang_points");
}
else
{
g_EventDB.Clear();
sprintf(szQuery,"INSERT INTO PCBANG_USER (pcbang_id,pcbang_points,reset_date) VALUES ('%s',0,getdate()+7)",szAccountId);
g_EventDB.Exec(szQuery);
}
}
g_EventDB.Clear();
DataSend(aIndex,(LPBYTE)&pMsg,sizeof(pMsg));
}
示例7: PHeadSetB
void CRingMonsterHerd::SendEventGiftWinner(int iIndex, int iGiftKind)
{
if ( gObjIsConnected(iIndex) == FALSE )
{
return;
}
if ( gObj[iIndex].UseEventServer != FALSE )
{
return;
}
gObj[iIndex].UseEventServer = TRUE;
PMSG_REQ_REG_RINGGIFT pMsg;
PHeadSetB((LPBYTE)&pMsg, GMSG_BEATTACK, sizeof(pMsg));
pMsg.iINDEX = iIndex;
memcpy(pMsg.szUID, gObj[iIndex].AccountID, MAX_ACCOUNT_LEN);
pMsg.szUID[MAX_ACCOUNT_LEN+1] = 0; // #error Remove the +1 to avoid problems
pMsg.btGiftKind = iGiftKind;
DataSendEventChip((PCHAR)&pMsg, sizeof(pMsg));
LogAddTD("[Ring Event] [%s][%s] Request to Register Gift - Gift Kind (%d)",
gObj[iIndex].AccountID, gObj[iIndex].Name, iGiftKind);
}
示例8: BroadCastMessage
void BroadCastMessage(BroadCastMessageInfo* lpResult)
{
if( strlen(lpResult->Text) < 2 )
{
return;
}
switch(lpResult->Type)
{
case 0:
{
AllSendServerMsg(&lpResult->Text[1]);
}
break;
case 1:
{
USER_REQ_POST lpInfo = { 0 };
PHeadSetB((LPBYTE)&lpInfo, 0, sizeof(lpInfo));
lpInfo.h.headcode = 2;
lpInfo.chatmsg[0] = '!';
memcpy(lpInfo.id, lpResult->Sender, 10);
strcat(lpInfo.chatmsg, lpResult->Text);
DataSendAll((LPBYTE)&lpInfo, sizeof(lpInfo));
}
break;
}
}
示例9: DGGetWarehouseList
void DGGetWarehouseList(LPSDHP_GETWAREHOUSEDB lpMsg,int aIndex)
{
char szAccountID[MAX_IDSTRING+1] = {0};
memcpy(szAccountID,lpMsg->AccountID,MAX_IDSTRING);
SDHP_GETWAREHOUSEDB_SAVE pResult;
PHeadSetW((LPBYTE)&pResult, 0x08, sizeof(pResult));
memcpy(pResult.AccountID, szAccountID, MAX_IDSTRING);
pResult.aIndex = lpMsg->aIndex;
if( GetWarehouseData(szAccountID,&pResult) == FALSE )
{
CreateWarehouseData(szAccountID);
SDHP_GETWAREHOUSEDB_RESULT pMsg;
PHeadSetB((LPBYTE)&pMsg, 0x10, sizeof(pMsg));
pMsg.aIndex = lpMsg->aIndex;
memcpy(pMsg.AccountID, szAccountID, 10);
DataSend(aIndex, (LPBYTE)&pMsg, pMsg.h.size);
return;
}
DataSend(aIndex,(LPBYTE)&pResult,sizeof( pResult ));
}
示例10: PHeadSetB
void cVipSystem::BuyItem(LPOBJ lpObj, int IDNumber)
{
if(IDNumber >= 0 && IDNumber <= (this->ItemsCount-1))
{
BOOL IfBuy = FALSE;
PMSG_BUYRESULT pResult;
PHeadSetB((LPBYTE)&pResult, 0x32, sizeof(pResult));
if(this->Shop[IDNumber].Cost < lpObj->VipMoney)
{
pResult.Result = gObjShopBuyInventoryInsertItem(lpObj->m_Index,this->m_item[IDNumber]);
if ( pResult.Result != 0xFF )
{
lpObj->AccountExtraInfoModified = 1;
ItemByteConvert((LPBYTE)&pResult.ItemInfo, this->m_item[IDNumber]);
DataSend(lpObj->m_Index, (LPBYTE)&pResult, pResult.h.size);
lpObj->VipMoney -= this->Shop[IDNumber].Cost;
IfBuy = TRUE;
}else
{
GCServerMsgStringSend(lMsg.Get(MSGGET(14, 58)),lpObj->m_Index, 0x01);
}
}
//Log
if(IfBuy == TRUE)
{
LogAddTD("[VIPShop] BuyItem [%s][%s] Item {%d %d} Cost: %d",lpObj->AccountID,lpObj->Name,this->Shop[IDNumber].Type,this->Shop[IDNumber].Index,this->Shop[IDNumber].Cost);
} else
{
LogAddTD("[VIPShop] Attempt to BuyItem [%s][%s] Item {%d %d} Cost: %d",lpObj->AccountID,lpObj->Name,this->Shop[IDNumber].Type,this->Shop[IDNumber].Index,this->Shop[IDNumber].Cost);
}
}
}
示例11: MuItemShopGiftBuyRecv
void MuItemShopGiftBuyRecv(cExtraServer * sManager, int aIndex, SDHP_MUITEMSHOPGIFTBUY * aRecv)
{
//OutputDebugString("ItemSerialCreateRecv\n");
SDHP_MUITEMSHOPGIFTBUY pResult = {0};
int Serial2 = 0;
// ----
PHeadSetB((LPBYTE)&pResult, SCFExDB_GSRecv_CShopDataGiftRecv, sizeof(pResult));
// ----
sManager->db.ExecQuery("EXEC TT_GetMuShopItemSerial");
sManager->db.Fetch();
// ----
Serial2 = sManager->db.GetResult(0);
// ----
sManager->db.Close();
// ----
strcpy(pResult.AccountID,aRecv->AccountID);
pResult.m_Serial2 = Serial2;
pResult.aIndex = aRecv->aIndex;
pResult.ItemID = aRecv->ItemID;
pResult.ID1 = aRecv->ID1;
pResult.ID2 = aRecv->ID2;
strcpy(pResult.Name,aRecv->Name);
strcpy(pResult.Msg,aRecv->Msg);
// ----
sManager->DataSend(aIndex, (unsigned char*)&pResult, pResult.h.size);
}
示例12: GCUseBuffEffect
void GCUseBuffEffect(LPOBJ lpObj, BYTE btEffectIndex, BYTE btEffectUseOption, WORD wOptionType, WORD wEffectType, int iLeftTime)
{
PMSG_SEND_BUFF_ICON pMsg;
PHeadSetB((LPBYTE)&pMsg, 0x2D, sizeof(PMSG_SEND_BUFF_ICON));
pMsg.btEffectIndex = btEffectIndex;
pMsg.byEffectOption = btEffectUseOption;
pMsg.wOptionType = wOptionType;
pMsg.wEffectType = wEffectType;
pMsg.iLeftTime = iLeftTime;
if ( lpObj->Type == OBJ_USER )
{
DataSend(lpObj->m_Index, (LPBYTE)&pMsg, pMsg.h.size);
}
if(btEffectUseOption == 0)
{
GCStateInfoSend(lpObj, 1, btEffectIndex);
}
else
{
GCStateInfoSend(lpObj, 0, btEffectIndex);
}
}
示例13: GJReqMapSvrMove
void GJReqMapSvrMove(int iIndex, WORD wDesMapSvrCode, WORD wMapNumber, BYTE btX, BYTE btY)
{
PMSG_REQ_MAPSVRMOVE pMsg;
if ( gObjIsConnected(iIndex) == PLAYER_EMPTY )
{
LogAddC(2, "[MapServerMng] Packet Error GJ [0x7A] - User not Connected : %d", iIndex);
}
else
{
PHeadSetB((LPBYTE)&pMsg, 0x7A, sizeof(PMSG_REQ_MAPSVRMOVE));
pMsg.iIndex = iIndex;
memcpy(pMsg.szAccountID , gObj[iIndex].AccountID, sizeof( pMsg.szAccountID)-1);
pMsg.szAccountID[10] = 0;
memcpy(pMsg.szCharName, gObj[iIndex].Name, sizeof( pMsg.szCharName)-1);
pMsg.szCharName[10] = 0;
pMsg.wCurMapSvrCode = gGameServerCode;
pMsg.wDstMapSvrCode = wDesMapSvrCode;
pMsg.wMapNumber = wMapNumber;
pMsg.btX = btX;
pMsg.btY = btY;
wsJServerCli.DataSend((char*)&pMsg, pMsg.h.size);
}
}
示例14: JGPGetCharList
void JGPGetCharList(LPSDHP_GETCHARLIST lpMsg,int aIndex)
{
char cBUFFER[10000]={0};
LPSDHP_CHARLISTCOUNT pCount = (LPSDHP_CHARLISTCOUNT)(cBUFFER);
LPSDHP_CHARLIST pCL = (LPSDHP_CHARLIST)(cBUFFER + sizeof(SDHP_CHARLISTCOUNT));
char szAccountID[MAX_IDSTRING+1];
memcpy(szAccountID,lpMsg->Id,MAX_IDSTRING);
szAccountID[MAX_IDSTRING] = 0;
PMSG_ANS_SUMMONER_CREATE pMsg;
PHeadSetB((LPBYTE)&pMsg,0x72,sizeof(pMsg));
memcpy(pMsg.szAccount,szAccountID,MAX_IDSTRING);
pMsg.Number = lpMsg->Number;
pMsg.Result = GetSummonerCreate(&pMsg,szAccountID);
DataSend(aIndex,(LPBYTE)&pMsg,sizeof(pMsg));
pCount->Number = lpMsg->Number;
lstrcpy(pCount->AccountId,szAccountID);
pCount->Count = GetCharList(szAccountID,pCount,pCL);
PHeadSetW((LPBYTE)pCount, 0x01, sizeof(SDHP_CHARLISTCOUNT) + sizeof(SDHP_CHARLIST) * pCount->Count);
DataSend(aIndex,(LPBYTE)&cBUFFER,sizeof(SDHP_CHARLISTCOUNT) + sizeof(SDHP_CHARLIST) * pCount->Count);
}
示例15: SCNoUpdateSend
void SCNoUpdateSend(int aIndex)
{
PMSG_DEFRESULT pMsg={0};
PHeadSetB((LPBYTE)&pMsg, 2, sizeof(pMsg));
pMsg.result = 0;
DataSend(aIndex, (LPBYTE)&pMsg, pMsg.h.size);
ObjDel(aIndex);
}