Пример #1
0
void CCashShop::GCCashPoint(LPOBJ lpObj, DWORD dwCashPoint)
{
	if ( !gObjIsAccontConnect(lpObj->m_Index, lpObj->AccountID))
	{
		LogAddC(2, lMsg.Get(MSGGET(1, 175)), lpObj->AccountID, lpObj->m_Index);
		return;
	}

	PMSG_ANS_CASHPOINT pMsg;

	PHeadSubSetB((LPBYTE)&pMsg, 0xF5, 0x04, sizeof(PMSG_ANS_CASHPOINT));
	lpObj->m_wCashPoint = dwCashPoint;
	pMsg.iCashPoint = dwCashPoint;

	if ( dwCashPoint < 0 )
		return;

	DataSend(lpObj->m_Index, (LPBYTE)&pMsg, pMsg.head.size);


	PMSG_RECGETCASHPOINT pMsg2;

	PHeadSubSetB((LPBYTE)&pMsg2, 0xD0, 0x16, sizeof(PMSG_RECGETCASHPOINT));

	pMsg2.m_iMyCashPoint = dwCashPoint;


	DataSend(lpObj->m_Index, (LPBYTE)&pMsg2, pMsg2.h.size);
}
Пример #2
0
BOOL CCashShop::CGCashShopOpen(LPOBJ lpObj, PMSG_REQ_CASHSHOPOPEN * lpMsg)
{
	BYTE btResult = 0;

	if ( this->bCashItemListReload == TRUE )
	{
		btResult = 6;
	}

	if ( g_bConnectShopServer == TRUE && g_bShopServerConnectState == FALSE )
	{
		btResult = 6;
	}

	if ( !gObjIsAccontConnect(lpObj->m_Index, lpObj->AccountID))
	{
		LogAddC(2, lMsg.Get(MSGGET(1, 175)), lpObj->AccountID, lpObj->m_Index);
		return FALSE;
	}

	if ( lpObj->Connected <= PLAYER_LOGGED || lpObj->CloseCount != -1 )
		return FALSE;

	if ( lpMsg->btShopOpenType == 1 )
	{
		if ( lpObj->m_IfState.use > 0 )
		{
			btResult = 8;
		}

		if ( btResult == 0 )
		{
			lpObj->m_IfState.use = 1;
			lpObj->m_IfState.type = 19;
			lpObj->m_IfState.state = 1;
			this->CGCashPoint(lpObj);
		}
	}
	else if ( lpMsg->btShopOpenType == 0 )
	{
		lpObj->m_IfState.use = 0;
		lpObj->m_IfState.type = 0;
		lpObj->m_IfState.state = 0;
	}

	PMSG_ANS_CASHSHOPOPEN pMsg;

	pMsg.btResult = btResult;

	PHeadSubSetB((LPBYTE)&pMsg, 0xF5, 0x02, sizeof(PMSG_ANS_CASHSHOPOPEN));

	DataSend(lpObj->m_Index, (LPBYTE)&pMsg, pMsg.head.size);

	return TRUE;
}
Пример #3
0
void ConnectEx::SendGame(int UserIndex)
{
	/*if(		g_License.GetLicenseID() != Customer::Zeon
		&&	g_License.GetLicenseID() != Customer::Refinery
		&&	g_License.GetLicenseID() != Customer::Bereznuk
		&&	g_License.GetLicenseID() != Customer::Reedlan
		&&	g_License.GetLicenseID() != Customer::MUAngel
		&&	g_License.GetLicenseID() != Customer::MUAngel2
		&&	g_License.GetLicenseID() != Customer::White
		&&	g_License.GetLicenseID() != Customer::White2 
		&&  g_License.GetLicenseID() != Customer::drynea 
		&&  g_License.GetLicenseID() != Customer::virnet )
	{
		return;
	}*/
	// ----
	gObj[UserIndex].m_ConnectEx = false;
	DataServerGetCharListRequest(UserIndex);
	// ----
	if ( !PacketCheckTime2(&gObj[UserIndex]))
	{
		return;
	}
	// ----
	if ( !gObjIsAccontConnect(UserIndex, gObj[UserIndex].AccountID))
	{
		return;
	}
	// ----
	if ( gObj[UserIndex].Connected == PLAYER_PLAYING )
	{
		return;
	}
	// ----
	gObj[UserIndex].bEnableDelCharacter = FALSE;
	// ----
	char _name[MAX_ACCOUNT_LEN+1];
	SDHP_DBCHARINFOREQUEST pCRequest;
	// ----
	PHeadSetB((LPBYTE)&pCRequest, 0x06, sizeof(pCRequest));
	memset(_name, 0, MAX_ACCOUNT_LEN);
	memcpy(_name, gObj[UserIndex].Name, MAX_ACCOUNT_LEN);
	BuxConvert(_name, MAX_ACCOUNT_LEN);
	memcpy(pCRequest.Name, _name, MAX_ACCOUNT_LEN);
	strcpy(pCRequest.AccountID, gObj[UserIndex].AccountID);
	pCRequest.Number = UserIndex;
	// ----
	cDBSMng.Send((char*)&pCRequest, pCRequest.h.size);
}
Пример #4
0
void GJPUserDisconnectRecv( SDHP_BILLKILLUSER * lpMsg)
{
    char szId[11];
    szId[10]=0;
    int number;

    memcpy( szId, lpMsg->Id , sizeof( lpMsg->Id ) );
    number = lpMsg->Number;

    if ( gObjIsAccontConnect(number, szId ) == 0 )
    {
        return;
    }

    GCServerMsgStringSend("You are currently being disconnected. Please check your account credits.", number, 0 );
    gObjUserKill(number);
}
Пример #5
0
void GJPUserKillRecv(SDHP_BILLKILLUSER * lpMsg)
{
    char szId[11];
    int number;
    szId[10] = 0;

    memcpy(szId, lpMsg->Id , sizeof(lpMsg->Id) );
    number = lpMsg->Number;

    if (gObjIsAccontConnect(number, szId) == 0 )
    {
        return;
    }

    GCServerMsgStringSend("Your account is expired. You will exit the game automatically.", number, 0);
    gObjUserKill(number);
}
Пример #6
0
void GJPUserDisconnectRecv( SDHP_BILLKILLUSER * lpMsg)
{
	char szId[11];
	szId[10]=0;
	int number;

	memcpy( szId, lpMsg->Id , sizeof( lpMsg->Id ) );
	number = lpMsg->Number;

	if ( gObjIsAccontConnect(number, szId ) == 0 )
	{
		return;
	}

	GCServerMsgStringSend(lMsg.Get( MSGGET(6, 67) ), number, 0 );
	//gObjUserKill(number);
	CloseClient(number);
}
Пример #7
0
void GJPBillCeckRecv(SDHP_BILLSEARCH_RESULT * lpMsg)
{
	int aIndex = lpMsg->Number ;
	char szId[11];

	szId[10] = 0;

	memcpy(szId, lpMsg->Id, sizeof(lpMsg->Id));

	if (gObjIsAccontConnect(aIndex, szId) == 0 )
	{
		return ;
	}

	if ( m_ObjBill[aIndex].SetBill( lpMsg->PayCode, lpMsg->EndTime, &lpMsg->EndDays[0] ) == TRUE )
	{
		gObjAddMsgSendDelay(&gObj[aIndex], 1000, aIndex, 100, 0);
	}
}
Пример #8
0
void GJPBillCeckRecv(SDHP_BILLSEARCH_RESULT * lpMsg)
{
    int aIndex = lpMsg->Number ;
    char szId[11];
    char EndsDays[13];

    szId[10] = 0;

    memcpy(szId, lpMsg->Id, sizeof(lpMsg->Id));

    if (gObjIsAccontConnect(aIndex, szId) == 0 )
    {
        return ;
    }

    memset(EndsDays, 0, sizeof(EndsDays));
    memcpy(EndsDays, lpMsg->EndsDays, sizeof(lpMsg->EndsDays));

}
Пример #9
0
BOOL CCashShop::CGCashPoint(LPOBJ lpObj)
{
	DWORD dwUserGuid = 0;
	
	if ( g_bConnectShopServer == TRUE && g_bShopServerConnectState == FALSE )
	{
		return FALSE;
	}

	if ( !gObjIsAccontConnect(lpObj->m_Index, lpObj->AccountID))
	{
		LogAddC(2, lMsg.Get(MSGGET(1, 175)), lpObj->AccountID, lpObj->m_Index);
		return FALSE;
	}

	if ( lpObj->Connected !=PLAYER_PLAYING && lpObj->Type != OBJ_USER )
		return FALSE;

	dwUserGuid = lpObj->DBNumber;
	this->GSReqCashPoint(dwUserGuid);

	return TRUE;
}
Пример #10
0
void ConnectEx::SendGame(int UserIndex)
{
	
	// ----
	gObj[UserIndex].m_ConnectEx = false;
	DataServerGetCharListRequest(UserIndex);
	// ----
	if ( !PacketCheckTime2(&gObj[UserIndex]))
	{
		return;
	}
	// ----
	if ( !gObjIsAccontConnect(UserIndex, gObj[UserIndex].AccountID))
	{
		return;
	}
	// ----
	if ( gObj[UserIndex].Connected == PLAYER_PLAYING )
	{
		return;
	}
	// ----
	gObj[UserIndex].bEnableDelCharacter = FALSE;
	// ----
	char _name[MAX_ACCOUNT_LEN+1];
	SDHP_DBCHARINFOREQUEST pCRequest;
	// ----
	PHeadSetB((LPBYTE)&pCRequest, 0x06, sizeof(pCRequest));
	memset(_name, 0, MAX_ACCOUNT_LEN);
	memcpy(_name, gObj[UserIndex].Name, MAX_ACCOUNT_LEN);
	BuxConvert(_name, MAX_ACCOUNT_LEN);
	memcpy(pCRequest.Name, _name, MAX_ACCOUNT_LEN);
	strcpy(pCRequest.AccountID, gObj[UserIndex].AccountID);
	pCRequest.Number = UserIndex;
	// ----
	cDBSMng.Send((char*)&pCRequest, pCRequest.h.size);
}
Пример #11
0
void GetTitanReward(SDHP_GETREWARD_INFOSAVE * lpMsg)
{	
	char szId[11]={0};
	int aIndex = 0;

	szId[MAX_ACCOUNT_LEN]=0;
	memcpy(szId, lpMsg->AccountID, sizeof(lpMsg->AccountID));
	aIndex = lpMsg->aIndex;

	if ( !gObjIsAccontConnect(aIndex, szId))
	{
		LogAddC(2, lMsg.Get(MSGGET(1, 175)), szId, aIndex);
		return;
	}
	
	LPOBJ lpObj = &gObj[aIndex];

	if (( lpObj->m_Index == aIndex) && (!strcmp(lpMsg->Name,lpObj->Name)))
	{
		char exVipMoney[512]={0};
		char exZen[512]={0};
		wsprintf(exVipMoney,"VipMoney increased in %d",lpMsg->rew.VipMoney);
		wsprintf(exZen,"Zen increased in %d",lpMsg->rew.Zen);

		if(lpMsg->ID_Num >= 0)
		{
			if(lpMsg->rew.num != (WORD) -1)
			{
				if(lpMsg->rew.Days == 0)
				{
					PMSG_BUYSHOPRESULT pResult;	
					PHeadSetB((LPBYTE)&pResult, 0x32, sizeof(pResult));
					CItem item;
					item.m_Level = lpMsg->rew.Level;
					item.m_SkillOption = lpMsg->rew.Skill;
					item.m_LuckOption = lpMsg->rew.Luck;
					item.m_Z28Option = lpMsg->rew.Opt;
					item.m_Durability = lpMsg->rew.Dur;
					item.m_ItemOptionEx = lpMsg->rew.Exc;
					item.m_JewelOfHarmonyOption = 0;
					if(lpMsg->rew.JOH > 0)
					{
						int btOptionLevel = item.m_Level;
						if(btOptionLevel > ReadConfig.JOHLevelMax)
							btOptionLevel = ReadConfig.JOHLevelMax;
						item.m_JewelOfHarmonyOption |= lpMsg->rew.JOH << 4;
						item.m_JewelOfHarmonyOption |= btOptionLevel & 0x0F;
					}
						
					item.Convert(lpMsg->rew.num, lpMsg->rew.Skill, lpMsg->rew.Luck, lpMsg->rew.Opt, lpMsg->rew.Exc, 0, 0, CURRENT_DB_VERSION);
					item.m_Durability = item.m_BaseDurability;
					item.m_ItemSlot1 = lpMsg->rew.Sock1;
					item.m_ItemSlot2 = lpMsg->rew.Sock2;
					item.m_ItemSlot3 = lpMsg->rew.Sock3;
					item.m_ItemSlot4 = lpMsg->rew.Sock4;
					item.m_ItemSlot5 = lpMsg->rew.Sock5;

					item.Value();
					pResult.Result = gObjShopBuyInventoryInsertItem(lpObj->m_Index,item);
						
					if ( pResult.Result != 0xFF )
					{
						DelTitanReward(aIndex,lpMsg->ID_Num);

						if(lpMsg->rew.IsForeverFFFE == 1)
							lpObj->pInventory[pResult.Result].m_Number = 0xFFFFFFFE;

						ItemByteConvert((LPBYTE)&pResult.ItemInfo, item);
						DataSend(aIndex, (LPBYTE)&pResult, pResult.h.size);

						if(lpMsg->rew.VipMoney > 0)
						{						
							lpObj->AccountExtraInfoModified = 1;
							lpObj->VipMoney += lpMsg->rew.VipMoney;
							GCServerMsgStringSend(exVipMoney, lpObj->m_Index, 0x01);
						}
						if(lpMsg->rew.Zen > 0)
						{
							if((__int64)(lpMsg->rew.Zen + gObj[aIndex].Money) > (__int64)MAX_ZEN)
								gObj[aIndex].Money = MAX_ZEN;
							else
								gObj[aIndex].Money += lpMsg->rew.Zen;

							::GCMoneySend(aIndex, gObj[aIndex].Money);
							GCServerMsgStringSend(exZen, lpObj->m_Index, 0x01);
						}
							
						GCServerMsgStringSend("Get Reward Success!", aIndex, 0x01);
						
						char sbuf[512]={0};
						wsprintf(sbuf,"[BotReward](%s)(%s) Buy Item:%d(%d %d) ID_DB:%d [LVL:%d O:%d L:%d S:%d E:%d]",
							gObj[aIndex].AccountID,gObj[aIndex].Name,
							lpMsg->rew.num, lpMsg->rew.num/512, lpMsg->rew.num-((int)(lpMsg->rew.num/512)*512), lpMsg->ID_Num,
							lpMsg->rew.Level,lpMsg->rew.Opt,lpMsg->rew.Luck,lpMsg->rew.Skill,lpMsg->rew.Exc);
						LogAddTD(sbuf);

						BOTREWARD_LOG.Output(sbuf);
					}
				}else
				{
					time_t t = time(NULL);
					localtime(&t);
					DWORD iTime = (DWORD)t + lpMsg->rew.Days * 86400;
					BYTE iItemPos = gObjInventoryInsertItem(&gObj[aIndex], ITEM_GET_TYPE(lpMsg->rew.num), ITEM_GET_INDEX(lpMsg->rew.num), lpMsg->rew.Level, iTime, 0xff,0,0,0,0,0);
					
					if ( iItemPos != (BYTE)-1 )
					{
						DelTitanReward(aIndex,lpMsg->ID_Num);
						gObj[aIndex].pInventory[iItemPos].m_JewelOfHarmonyOption = 0;
						if(lpMsg->rew.JOH > 0)
						{
							int btOptionLevel = gObj[aIndex].pInventory[iItemPos].m_Level;
							if(btOptionLevel > ReadConfig.JOHLevelMax)
								btOptionLevel = ReadConfig.JOHLevelMax;
							gObj[aIndex].pInventory[iItemPos].m_JewelOfHarmonyOption |= lpMsg->rew.JOH << 4;
							gObj[aIndex].pInventory[iItemPos].m_JewelOfHarmonyOption |= btOptionLevel & 0x0F;
						}
						gObj[aIndex].pInventory[iItemPos].Convert(lpMsg->rew.num, lpMsg->rew.Skill, lpMsg->rew.Luck, lpMsg->rew.Opt, lpMsg->rew.Exc, 0, 0, CURRENT_DB_VERSION);
						BYTE btItemType=0;
						btItemType |= (lpMsg->rew.num & 0x1E00 ) >> 5;
						gObj[aIndex].pInventory[iItemPos].m_ItemOptionEx = btItemType+2;
						gObj[aIndex].pInventory[iItemPos].m_ItemSlot1 = lpMsg->rew.Sock1;
						gObj[aIndex].pInventory[iItemPos].m_ItemSlot2 = lpMsg->rew.Sock2;
						gObj[aIndex].pInventory[iItemPos].m_ItemSlot3 = lpMsg->rew.Sock3;
						gObj[aIndex].pInventory[iItemPos].m_ItemSlot4 = lpMsg->rew.Sock4;
						gObj[aIndex].pInventory[iItemPos].m_ItemSlot5 = lpMsg->rew.Sock5;
						::GCInventoryItemOneSend(aIndex, iItemPos);
						MuItemShop.ItemSendTime(aIndex,iItemPos);					

						if(lpMsg->rew.VipMoney > 0)
						{						
							lpObj->AccountExtraInfoModified = 1;
							lpObj->VipMoney += lpMsg->rew.VipMoney;
							GCServerMsgStringSend(exVipMoney, lpObj->m_Index, 0x01);
						}
						if(lpMsg->rew.Zen > 0)
						{
							if((__int64)(lpMsg->rew.Zen + gObj[aIndex].Money) > (__int64)MAX_ZEN)
								gObj[aIndex].Money = MAX_ZEN;
							else
								gObj[aIndex].Money += lpMsg->rew.Zen;

							::GCMoneySend(aIndex, gObj[aIndex].Money);
							GCServerMsgStringSend(exZen, lpObj->m_Index, 0x01);
						}

						char sbuf[512]={0};
						GCServerMsgStringSend("Get Reward Success!", lpObj->m_Index, 0x01);
						wsprintf(sbuf,"[BotReward](%s)(%s) Buy Item:%d(%d %d) ID_DB:%d [LVL:%d O:%d L:%d S:%d E:%d]",
							gObj[aIndex].AccountID,gObj[aIndex].Name,
							lpMsg->rew.num, lpMsg->rew.num/512, lpMsg->rew.num-((int)(lpMsg->rew.num/512)*512), lpMsg->ID_Num,
							lpMsg->rew.Level,lpMsg->rew.Opt,lpMsg->rew.Luck,lpMsg->rew.Skill,lpMsg->rew.Exc);
						LogAddTD(sbuf);
						BOTREWARD_LOG.Output(sbuf);
					}
				}
			}else
			{
				if(lpMsg->rew.VipMoney > 0)
Пример #12
0
void CCashShop::CGCashItemBuy(LPOBJ lpObj, PMSG_REQ_CASHITEM_BUY *lpMsg)
{
	int iCategoryIndex = 0;
	BYTE btResult = 0;
	BYTE btPosition = 0;
	BOOL bItemEmptySpace = FALSE;
	int iItemCode = 0;
	CASHSHOP_ITEMLIST* lpCashItemInfo = NULL;

	if ( this->bCashItemListReload == TRUE )
	{
		btResult = 7;
		goto GOTO_EndFunc;
	}

	if ( g_bConnectShopServer == TRUE && g_bShopServerConnectState == FALSE )
	{
		btResult = 6;
		goto GOTO_EndFunc;
	}

	if ( !gObjIsAccontConnect(lpObj->m_Index, lpObj->AccountID))
	{
		LogAddC(2, lMsg.Get(MSGGET(1, 175)), lpObj->AccountID, lpObj->m_Index);
		btResult = 9;
		goto GOTO_EndFunc;
	}

	if ( lpObj->Connected !=PLAYER_PLAYING && lpObj->Type != OBJ_USER )
	{
		btResult = 9;
		goto GOTO_EndFunc;
	}

	iCategoryIndex = lpMsg->btCategoryIndex;

	if ( iCategoryIndex < 0 || iCategoryIndex > MAX_CASH_SHOP_CATEGORY )
	{
		btResult = 3;
		goto GOTO_EndFunc;
	}

	lpCashItemInfo = this->SearchItemList(lpMsg->dwItemPriceGuid);

	if ( lpCashItemInfo == NULL )
	{
		btResult = 3;
		LogAddTD("[CashShop][Buy Request] User(ID:%s, Name:%s) Item(Guid:%d,Category:%d) Result:RESULT_FAIL_NOT_FOUND_ITEM", lpObj->AccountID, lpObj->Name, lpMsg->dwItemPriceGuid, iCategoryIndex);
		goto GOTO_EndFunc;
	}

	iItemCode = ITEMGET(lpCashItemInfo->btItemType, lpCashItemInfo->wItemIndex);

	if(iItemCode == ITEMGET(14,91)) //Anti-hack Summoner Card
	{
		if(lpObj->Summoner != false)
		{
			btResult = 3;
			goto GOTO_EndFunc;
		}
	}

	if ( this->CheckPeriodItem(iItemCode) == TRUE )
	{
		g_CashItemPeriodSystem.SearchAndDeleteItemPeriodEffect(lpObj,iItemCode);
	}
	else if ( this->CheckInventoryEmptySpace(lpObj, lpCashItemInfo) == FALSE )
	{
		btResult = 2;
	}

GOTO_EndFunc:
	if ( btResult == 0 )
	{
		LogAddTD("[CashShop][Buy Request] User(ID:%s, Name:%s) Item(Name:%s,Guid:%d,Category:%d,Price:%d,SaleRate:%d) Result:%d", lpObj->AccountID, lpObj->Name, ItemAttribute[iItemCode].Name, lpMsg->dwItemPriceGuid, iCategoryIndex, lpCashItemInfo->wItemPrice, lpCashItemInfo->btItemSaleRatio, btResult);
		this->GSReqBuyCashItem(gGameServerCode, lpObj->DBNumber, lpObj->m_Index, lpObj->Name, 1, lpMsg->dwItemPriceGuid);
	}
	else
	{
		LogAddTD("[CashShop][Buy Request] User(ID:%s, Name:%s) Item(Guid:%d,Category:%d) Result:%d", lpObj->AccountID, lpObj->Name, lpMsg->dwItemPriceGuid, iCategoryIndex, btResult);
		this->GCCashItemBuyResult(lpObj, btResult);
	}
}