Register for your free account! | Forgot your password?

You last visited: Today at 12:00

  • Please register to post and access all features, it's quick, easy and FREE!

 

WEBSHOP 1.1 SEDRIKA

Reply
 
Old   #1
 
elite*gold: 0
Join Date: May 2013
Posts: 7
Received Thanks: 0
WEBSHOP 1.1 SEDRIKA

web shop works when player is offline when i use shop in site
but when i use web shop in game my dpoins lost but item doesn't send
and in php log this error

[27-Dec-2015 12:16:16 Europe/Paris] PHP Strict standards: Non-static method CDPSrvr::SendAPICmd() should not be called statically in C:\wamp\www\shop\include\class\class.dpsrvr.php on line 29

[27-Dec-2015 12:16:16 Europe/Paris] PHP Stack trace:

[27-Dec-2015 12:16:16 Europe/Paris] PHP 1. {main}() C:\wamp\www\shop\ChargeFlyffItem.php:0

[27-Dec-2015 12:16:16 Europe/Paris] PHP 2. CDPSrvr::CreateItem() C:\wamp\www\shop\ChargeFlyffItem.php:39



help mee please!!!



alexpro10 is offline  
Old   #2
 
elite*gold: 0
Join Date: Jan 2014
Posts: 677
Received Thanks: 313
use the thread


Drabur is offline  
Old   #3
 
elite*gold: 0
Join Date: Oct 2012
Posts: 939
Received Thanks: 148
Here use 1.1.1 to see if your problem is solved.

Also use google for the error

Quote:
Originally Posted by raventh1984 View Post
After making some changes to the files Source and Php i have it all working now.

I asked Sedrika if i could release the fixed website and Source snippets and it was Ok.

So Here it is Web Version 1.1.1 All Credits to their respectfull owners.



Images
You must register and activate your account in order to view images.
You must register and activate your account in order to view images.

Source Snippets

DPSrvr.cpp
Code:
void CDPSrvr::OnBuyingInfo( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize )
{
	BUYING_INFO2 bi2;
	ar.Read( (void*)&bi2, sizeof(BUYING_INFO2) );

	CWorld* pWorld;
	CUser* pUser	= g_UserMng.GetUser( dpidCache, dpidUser );

	/*
		100 - Save Player
		101 - Create Item
	*/
    
    if( IsValidObj( pUser )  && ( pWorld = pUser->GetWorld() ) )
    {
		if( bi2.dwParam4 != 0000000 || bi2.dwParam5 != 0000000 )
				return;
		if( bi2.dwCommand == 100 ) // Save Player
		{
			g_dpDBClient.SavePlayer( pUser, pWorld->GetID(), pUser->GetPos(), pUser->GetLayer() );
		}
		else if( bi2.dwCommand == 101 ) // Create Item
		{
			SERIALNUMBER iSerialNumber	= 0;
			CItemElem itemElem;
			itemElem.m_dwItemId			= bi2.dwItemId;
			itemElem.m_nItemNum			= (short)bi2.dwItemNum;
			itemElem.m_bCharged        = TRUE;
			BYTE nId;
			bi2.dwParam3    = pUser->CreateItem( &itemElem, &nId );
			if( bi2.dwParam3 )
			{
				CItemElem* pItemElem    = pUser->m_Inventory.GetAtId( nId );
				if( pItemElem )
				{
					iSerialNumber    = pItemElem->GetSerialNumber();
					pItemElem->m_bCharged    = TRUE;
					if( bi2.dwTargetId > 0 )
						pUser->AddDefinedText( TID_EVE_GIFT, "\"%s\" \"%s\"", itemElem.GetName(), pUser->GetName() );
				}
			}
			else
			{
				LogItemInfo aLogItem;
				aLogItem.Action = "S";
				aLogItem.SendName = pUser->GetName();
				aLogItem.WorldId = pUser->GetWorld()->GetID();
				aLogItem.Gold = aLogItem.Gold2 = pUser->GetGold();

				g_dpDBClient.SendQueryPostMail( pUser->m_idPlayer, 0, itemElem, 0, "WebShop", "" );
				aLogItem.RecvName = "HOMEPAGE_SHOP";
				g_DPSrvr.OnLogItem( aLogItem, &itemElem, itemElem.m_nItemNum );
			}
			g_dpDBClient.SendBuyingInfo( &bi2, iSerialNumber );
			g_dpDBClient.SavePlayer( pUser, pWorld->GetID(), pUser->GetPos(), pUser->GetLayer() );
		}
	}
}
Buyinginfo.h

Code:
#ifndef __CHARGEDITEM_H__
#define	__CHARGEDITEM_H__

typedef struct _BUYING_INFO
{
	DWORD	dwServerIndex;
	DWORD	dwPlayerId;
	DWORD	dwTargetId;
	DWORD	dwItemId;
	DWORD	dwItemNum;
	DWORD	dwCommand;
	DWORD	dwParam3;
	DWORD	dwParam4;
	DWORD	dwParam5;

	_BUYING_INFO()
	{
		dwServerIndex	= 0;
		dwPlayerId		= 0;
		dwTargetId		= 0;
		dwItemId		= 0;
		dwItemNum		= 0;
		dwCommand		= 0;
		dwParam3		= 0;
		dwParam4		= 0;
		dwParam5		= 0;
	}
}
BUYING_INFO, *PBUYING_INFO;

typedef struct _BUYING_INFO2: public _BUYING_INFO
{
	DWORD	dpid;
	DWORD	dwKey;
	_BUYING_INFO2() : _BUYING_INFO()
		{
			dpid	= 0xFFFFFFFF;
			dwKey	= 0;
		}
}
BUYING_INFO2, *PBUYING_INFO2;

typedef struct _BUYING_INFO3: public _BUYING_INFO2
{
	DWORD	dwTickCount;
	_BUYING_INFO3() : _BUYING_INFO2()
		{
//			dwTickCount		= GetTickCount();
		}
}
BUYING_INFO3, *PBUYING_INFO3;

#endif	// __CHARGEDITEM_H__
dpadbill.h

Code:
void	Process( void )
{
	DWORD dwTickCount	= GetTickCount();
//	static DWORD adwKey[1024];
	vector<DWORD>	adwKey;
			
	int nSize	= 0;
			
	m_AddRemoveLock.Enter();
	for( map<DWORD, PBUYING_INFO3>::iterator i = m_mapPbi3.begin(); i != m_mapPbi3.end(); ++i )
	{
		PBUYING_INFO3 pbi3	= i->second;
		if( dwTickCount - pbi3->dwTickCount > SEC( 3 ) )
		{
			CDPAdbill::GetInstance()->Send( pbi3, sizeof(BUYING_INFO), pbi3->dpid );
//			adwKey[nSize++]	= pbi3->dwKey;
			adwKey.push_back( pbi3->dwKey );
		}
	}
			
//	Remove
//	for( int j = 0; j < nSize; j++ )
	for( DWORD j = 0; j < adwKey.size(); j++ )
	{
//		PBUYING_INFO3 ptr	= CBuyingInfoMng::GetInstance()->Get( adwKey[j] );
		PBUYING_INFO3 ptr	= CBuyingInfoMng::GetInstance()->Get( adwKey[j] );
		if( ptr )
		{
			BUYING_INFO2	bi2;
			DWORD sn = 0;

			bi2.dwServerIndex	= ptr->dwServerIndex;
			bi2.dwPlayerId		= ptr->dwPlayerId;
			bi2.dwTargetId		= ptr->dwTargetId;
			bi2.dwItemId		= ptr->dwItemId;
			bi2.dwItemNum		= ptr->dwItemNum;
			bi2.dwCommand		= ptr->dwCommand;
			bi2.dwParam3		= ptr->dwParam3;
			bi2.dwParam4		= ptr->dwParam4;
			bi2.dwParam5		= ptr->dwParam5;

			CAr ar;
			ar.Write( (void*)&bi2, sizeof(BUYING_INFO2) );
			ar << sn;

			int nBufSize;
			LPBYTE lpData	= ar.GetBuffer( &nBufSize );
			LPDB_OVERLAPPED_PLUS lpDbOverlappedPlus		= g_DbManager.m_pDbIOData->Alloc();
			memcpy( lpDbOverlappedPlus->lpBuf, lpData, nBufSize );
			lpDbOverlappedPlus->uBufSize	= nBufSize;
			lpDbOverlappedPlus->nQueryMode	= LOG_SM_ITEM;
			PostQueuedCompletionStatus( g_DbManager.m_hDbCompletionPort, 1, NULL, &lpDbOverlappedPlus->Overlapped );
		}
		Remove( adwKey[j] );
		SAFE_DELETE( ptr );
	}

	m_AddRemoveLock.Leave();

	adwKey.clear();
}

If you encounter any problems feel free to ask.

Enjoy it.

Little Update

Atm only the first Character on your account is aible to get the items.
If you whant it for the char that you log in to then you need to change this

Login.php
Code:
$Query = "SELECT [m_idPlayer] FROM [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] WHERE [account] = %s AND [isblock] = 'F'";
				$_SESSION['m_idPlayer'] = $SQL->Exec( $Query, $_SESSION['user_id'] ) ? (int)$SQL->fetch[0]['m_idPlayer'] : false;
To this
Code:
$Query = "SELECT [m_idPlayer] FROM [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] WHERE [m_szName] = %s AND [isblock] = 'F'";
				$_SESSION['m_idPlayer'] = $SQL->Exec( $Query, $_SESSION['m_idPlayer'] ) ? $SQL->fetch[0]['m_idPlayer'] : false;
Also make sure that Character field cant be empty
Thus change this

login.php
Code:
if( !empty( $_SESSION['user_id'] ) )
To
Code:
if( !empty( $_SESSION['user_id'] ) || !empty( $_SESSION['m_idPlayer'] ) )
raventh1984 is offline  
Old   #4
 
elite*gold: 0
Join Date: May 2013
Posts: 7
Received Thanks: 0
But i need to use rus character name because i create multilang site
But then i use russ this shop doesn't work
But shop by sedrika works in web site

I have an error in source

Source\WORLDSERVER\DPSrvr.cpp(6503): error C2065: 'TID_EVE_GIFT' : undeclared identifier
alexpro10 is offline  
Reply

Tags
flyff, sedrika, webshop



« Previous Thread | Next Thread »

Similar Threads
[Help] Sedrika webshop
How to fix log in,I cant log in here : and how to fix this ERROR: TEST INGAME:http://i.epvpimg.com/jJj8g.jpg http://i.epvpimg.com/HKJTb.png...
1 Replies - Flyff PServer - Discussions / Questions



All times are GMT +2. The time now is 12:00.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Abuse
Copyright ©2017 elitepvpers All Rights Reserved.