|
You last visited: Today at 02:21
Advertisement
Tabbed Inventory DB
Discussion on Tabbed Inventory DB within the Flyff Private Server forum part of the Flyff category.
08/23/2016, 04:38
|
#1
|
elite*gold: 0
Join Date: Jul 2016
Posts: 36
Received Thanks: 17
|
Tabbed Inventory DB
Does any one have this and are they will to share the db changes for it? I know a few servers have it, i just need the db edits is all.
Thanks!
|
|
|
08/23/2016, 10:28
|
#2
|
elite*gold: 18
Join Date: Sep 2009
Posts: 20,177
Received Thanks: 14,471
|
Did you tried to do it by yourself so we may help you out ?
|
|
|
08/23/2016, 14:46
|
#3
|
elite*gold: 0
Join Date: Jan 2014
Posts: 773
Received Thanks: 373
|
Quote:
Originally Posted by Lodelight
Does any one have this and are they will to share the db changes for it? I know a few servers have it, i just need the db edits is all.
Thanks!
|
i can sell it
|
|
|
08/23/2016, 17:47
|
#4
|
elite*gold: 0
Join Date: Jul 2016
Posts: 36
Received Thanks: 17
|
Quote:
Originally Posted by Drabur
i can sell it
|
I'm not buying sql changes lol.
Quote:
Originally Posted by Avalion
From the system I have of tabbed inventory, it is a bit messy but it is something probably like so.
CDbManager::SendPlayerList
-> Sends S2 to character str
-> It is requesting m_Inventory, m_Inventory2, m_Inventory3, m_Inventory4
-> Requests 4 x the other inventory arrays.
Code:
IF @iGu = 'S2'
BEGIN
IF @iaccount = '' OR @im_szName = ''
BEGIN
SELECT m_chAuthority = '',fError = '1', fText = '????'
RETURN
END
SELECT A.dwWorldID,
A.m_szName,
A.playerslot,
A.End_Time,
A.BlockTime,
A.m_dwIndex,
A.m_idPlayer,
A.m_idparty,
A.m_dwSkinSet,
A.m_dwHairMesh,
A.m_dwHeadMesh,
A.m_dwHairColor,
A.m_dwSex,
A.m_nJob,
A.m_nLevel,
A.m_vPos_x,
A.m_vPos_y,
A.m_vPos_z,
A.m_nStr,
A.m_nSta,
A.m_nDex,
A.m_nInt,
A.m_aJobLv,
A.m_chAuthority,
A.m_idCompany,
A.m_nMessengerState,
B.m_Inventory,
--Inventory is being pulled right here, lets add what is needed
B.m_Inventory2,
B.m_Inventory3,
B.m_Inventory4,
B.m_apIndex,
B.m_adwEquipment,
B.m_dwObjIndex,
m_idGuild = CASE WHEN C.m_idGuild IS NULL THEN '0' ELSE C.m_idGuild END ,
m_idWar = CASE WHEN C.m_idWar IS NULL THEN '0' ELSE C.m_idWar END,
D.m_extInventory,
D.m_InventoryPiercing,
A.m_nHonor,
last_connect = [MENTION=5497993]last_[/MENTION]connect
FROM CHARACTER_TBL as A
inner join INVENTORY_TBL as B on A.m_idPlayer = B.m_idPlayer and A.serverindex = B.serverindex
inner join INVENTORY_EXT_TBL as D on B.serverindex = D.serverindex and B.m_idPlayer = D.m_idPlayer
left outer join GUILD_MEMBER_TBL as C on D.m_idPlayer = C.m_idPlayer and D.serverindex = C.serverindex
WHERE A.isblock = 'F'
AND A.account = @iaccount
AND A.serverindex = [MENTION=3453071]iServe[/MENTION]rindex
ORDER BY A.playerslot
insert into CHARACTER_TBL_penya_check (account, m_szName, m_dwGold, check_sec, serverindex)
select @iaccount, m_szName, m_dwGold, 9, [MENTION=3453071]iServe[/MENTION]rindex
from CHARACTER_TBL (nolock)
where account = @iaccount and serverindex = [MENTION=3453071]iServe[/MENTION]rindex and TotalPlayTime < 1 and m_dwGold >= 1
RETURN
END
Because it is requesting that data, we will need to add the values into the table "INVENTORY_TBL" and update the table to withhold the new varchar sizes.
CDbManager::Join
-> Moving on to further information, this function passes "S8" to the character str.
-> We Notice that this function also calls GetInventory which also expects having access to other table information that we have yet to come across. In S8, we will noticed it is "INVENTORY_EXT_TBL".
-> Because we are still pulling the new inventory, we need to add the values and then compensate the db for the new varchar lengths.
Code:
IF @iGu = 'S8'
BEGIN
SELECT @om_chLoginAuthority = m_chLoginAuthority FROM ACCOUNT_DBF.dbo.ACCOUNT_TBL_DETAIL WHERE account = @iaccount
SELECT m_chLoginAuthority = @om_chLoginAuthority,
A.account,
A.m_idPlayer,
A.playerslot,
A.serverindex,
A.dwWorldID,
A.m_szName,
A.m_dwIndex,
A.m_vScale_x,
A.m_dwMotion,
A.m_vPos_x,
A.m_vPos_y,
A.m_vPos_z,
A.m_fAngle,
A.m_szCharacterKey,
A.m_idPlayer,
A.m_nHitPoint,
A.m_nManaPoint,
A.m_nFatiguePoint,
A.m_nFuel,
A.m_dwSkinSet,
A.m_dwHairMesh,
A.m_dwHairColor,
A.m_dwHeadMesh,
A.m_dwSex,
A.m_dwRideItemIdx,
A.m_dwGold,
A.m_nJob,
A.m_pActMover,
A.m_nStr,
A.m_nSta,
A.m_nDex,
A.m_nInt,
A.m_nLevel,
A.m_nMaximumLevel,
A.m_nExp1,
A.m_nExp2,
A.m_aJobSkill,
A.m_aLicenseSkill,
A.m_aJobLv,
A.m_dwExpertLv,
A.m_idMarkingWorld,
A.m_vMarkingPos_x,
A.m_vMarkingPos_y,
A.m_vMarkingPos_z,
A.m_nRemainGP,
A.m_nRemainLP,
A.m_nFlightLv,
A.m_nFxp,
A.m_nTxp,
A.m_lpQuestCntArray,
m_aCompleteQuest = ISNULL(A.m_aCompleteQuest,'$'),
A.m_chAuthority,
A.m_dwMode,
A.m_idparty,
A.m_idCompany,
A.m_idMuerderer,
A.m_nFame,
A.m_nDeathExp,
A.m_nDeathLevel,
A.m_dwFlyTime,
A.m_nMessengerState,
A.End_Time,
A.BlockTime,
A.blockby,
A.isblock,
A.TotalPlayTime,
A.CreateTime,
A.m_dwSkillPoint,
B.m_aSlotApplet,
B.m_aSlotQueue,
B.m_SkillBar,
C.m_aSlotItem,
D.m_Inventory,
--teh inventory
D.m_Inventory2,
D.m_Inventory3,
D.m_Inventory4,
D.m_apIndex,
D.m_adwEquipment,
D.m_dwObjIndex,
m_idGuild = ISNULL(G.m_idGuild,'0'),
m_idWar = ISNULL(G.m_idWar,'0'),
A.m_tmAccFuel,
A.m_tGuildMember,
m_dwSMTime = ISNULL(H.m_dwSMTime,'NULL') ,
SkillInfluence = ISNULL(E.SkillInfluence,'$'),
F.m_extInventory,
F.m_InventoryPiercing,
A.m_dwReturnWorldID,
A.m_vReturnPos_x,
A.m_vReturnPos_y,
A.m_vReturnPos_z,
last_connect = [MENTION=5497993]last_[/MENTION]connect,
A.m_SkillPoint,
A.m_SkillLv,
A.m_SkillExp,
A.dwEventFlag,
A.dwEventTime,
A.dwEventElapsed
,A.PKValue as m_nPKValue
,A.PKPropensity as m_dwPKPropensity
,A.PKExp as m_dwPKExp
,A.AngelExp as m_nAngelExp
,A.AngelLevel as m_nAngelLevel
,F.szInventoryPet as szInventoryPet
,A.m_dwPetId
, A.m_nExpLog, A.m_nAngelExpLog
, m_nCoupon
, A.m_nLayer
, A.m_aCheckedQuest
, A.m_nCampusPoint
, A.idCampus
, isnull(R.m_nRestPoint, 0) m_nRestPoint
, isnull(R.m_LogOutTime, 0) m_LogOutTime
FROM CHARACTER_TBL A
inner join TASKBAR_TBL B on A.m_idPlayer = B.m_idPlayer and A.serverindex = B.serverindex
inner join TASKBAR_ITEM_TBL C on B.m_idPlayer = C.m_idPlayer and B.serverindex = C.serverindex
inner join INVENTORY_TBL D on C.m_idPlayer = D.m_idPlayer and C.serverindex = D.serverindex
inner join SKILLINFLUENCE_TBL E on D.m_idPlayer = E.m_idPlayer and D.serverindex = E.serverindex
inner join INVENTORY_EXT_TBL F on E.m_idPlayer = F.m_idPlayer and E.serverindex = F.serverindex
left outer join GUILD_MEMBER_TBL G on F.serverindex = G.serverindex and F.m_idPlayer = G.m_idPlayer
left outer join BILING_ITEM_TBL H on F.serverindex = H.serverindex and F.m_idPlayer = H.m_idPlayer
left outer join tblRestPoint R on F.serverindex = R.serverindex and F.m_idPlayer = R.m_idPlayer
WHERE A.m_idPlayer = @im_idPlayer
AND A.serverindex = [MENTION=3453071]iServe[/MENTION]rindex
AND A.account = lower(@iaccount)
insert into CHARACTER_TBL_validity_check (m_idPlayer, serverindex, account, m_szName, TotalPlayTime, m_dwGold, m_nLevel, m_nJob, sum_ability, CreateTime)
select m_idPlayer, serverindex, account, m_szName, TotalPlayTime, m_dwGold, m_nLevel, m_nJob, (m_nStr + m_nSta + m_nDex + m_nInt), CreateTime
from CHARACTER_TBL (nolock)
where m_idPlayer = @im_idPlayer and TotalPlayTime <= 1
and (m_dwGold >= 1 or m_nLevel >= 2 or m_nJob >= 1 or (m_nStr + m_nSta + m_nDex + m_nInt) > 60)
declare [MENTION=1899648]M_D[/MENTION]wGold_old bigint, [MENTION=1899648]M_D[/MENTION]wGold_now bigint
select [MENTION=1899648]M_D[/MENTION]wGold_old = m_dwGold from tblLogout_Penya (nolock) where m_idPlayer = @im_idPlayer
select [MENTION=1899648]M_D[/MENTION]wGold_now = m_dwGold from CHARACTER_TBL (nolock) where serverindex = [MENTION=3453071]iServe[/MENTION]rindex and m_idPlayer = @im_idPlayer
if [MENTION=1899648]M_D[/MENTION]wGold_old <> [MENTION=1899648]M_D[/MENTION]wGold_now)
begin
insert into tblLogout_Penya_Diff_Log (serverindex, m_idPlayer, m_dwGold_old, regdate_old, m_dwGold_now)
select serverindex, m_idPlayer, [MENTION=1899648]M_D[/MENTION]wGold_old, regdate, [MENTION=1899648]M_D[/MENTION]wGold_now
from tblLogout_Penya (nolock)
where m_idPlayer = @im_idPlayer and serverindex = [MENTION=3453071]iServe[/MENTION]rindex
end
SELECT a.m_idPlayer,
c.playerslot,
a.m_Bank,
a.m_apIndex_Bank,
a.m_dwObjIndex_Bank,
a.m_dwGoldBank,
a.m_BankPw,
b.m_extBank,
b.m_BankPiercing
,b.szBankPet
FROM dbo.BANK_TBL a,
dbo.BANK_EXT_TBL b,
dbo.CHARACTER_TBL c
WHERE a.m_idPlayer = b.m_idPlayer
AND a.serverindex = b.serverindex
AND b.m_idPlayer = c.m_idPlayer
AND b.serverindex = c.serverindex
AND c.account = @iaccount
AND c.isblock = 'F'
ORDER BY c.playerslot
SELECT a.nPocket,
a.szItem,
a.szIndex,
a.szObjIndex,
a.bExpired,
a.tExpirationDate,
b.szExt,
b.szPiercing,
b.szPet
FROM tblPocket as a inner join tblPocketExt as b
on a.serverindex = b.serverindex AND a.idPlayer = b.idPlayer AND a.nPocket = b.nPocket
WHERE a.serverindex = [MENTION=3453071]iServe[/MENTION]rindex AND a.idPlayer = @im_idPlayer
ORDER BY a.nPocket
RETURN
END
-> The values in the db could be more proper, but for this explanation I am multiplying the value by 4. Varchar in mssql cannot have a number if they are above 8000, thus varchar(max) had to be used.
If we load an inventory, we must save a players inventory, so
CDbManager::SavePlayer
-> Calls U1
-> Adds 3 params to the save, and binds parameter.
So firstly, of the binding of the paramter, either remove the buffer length or increase the buffer length to the proper / new size. Ie: Old size * 4 or 0
Code:
bOK[++j] = qry->BindParameter( ++i, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, 0, 0, icsInventory.szItem, 0, &cbLen );
bOK[++j] = qry->BindParameter( ++i, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, 0, 0, icsInventory.szItem2, 0, &cbLen );
And we need to make sure U1 is updated to receive the new parameters. Since we are calling the stored procedure with data rather reading the data, we need to have a variable in which will allow us to edit the table. We also need to increase the sizes of all the edited values
ALTER proc [dbo].[CHARACTER_STR]
Code:
-- INVENTORY_TBL
@im_Inventory VARCHAR(6940)= '',
@im_Inventory2 VARCHAR(6940)= '',
@im_Inventory3 VARCHAR(6940)= '',
@im_Inventory4 VARCHAR(6940)= '',
@im_apIndex VARCHAR(1380) = '',
@im_adwEquipment VARCHAR(540) = '',
@im_dwObjIndex VARCHAR(1380) = '',
Code:
@im_extInventory varchar(8000) = '',
@im_InventoryPiercing varchar(MAX) = '',
Code:
,@iszInventoryPet varchar(MAX) = '$'
Now, in U1, we can edit the inventory stuff
Code:
UPDATE INVENTORY_TBL
SET m_Inventory = @im_Inventory,
m_Inventory2 = @im_Inventory2,
m_Inventory3 = @im_Inventory3,
m_Inventory4 = @im_Inventory4,
m_apIndex = @im_apIndex,
m_adwEquipment = @im_adwEquipment,
m_dwObjIndex = @im_dwObjIndex
WHERE m_idPlayer = @im_idPlayer
AND serverindex = [MENTION=3453071]iServe[/MENTION]rindex
Now, the one that I have access too, looks like it stores the main column as 4 columns rather one and then multiplicates the rest by 4. Other than that, it also looks like it reads it all into one value after reading -- then having to separate on save.
|
Thanks will look into this
|
|
|
08/23/2016, 17:57
|
#5
|
elite*gold: 0
Join Date: Jan 2014
Posts: 773
Received Thanks: 373
|
Quote:
Originally Posted by Avalion
From the system I have of tabbed inventory, it is a bit messy but it is something probably like so.
CDbManager::SendPlayerList
-> Sends S2 to character str
-> It is requesting m_Inventory, m_Inventory2, m_Inventory3, m_Inventory4
-> Requests 4 x the other inventory arrays.
Code:
IF @iGu = 'S2'
BEGIN
IF @iaccount = '' OR @im_szName = ''
BEGIN
SELECT m_chAuthority = '',fError = '1', fText = '????'
RETURN
END
SELECT A.dwWorldID,
A.m_szName,
A.playerslot,
A.End_Time,
A.BlockTime,
A.m_dwIndex,
A.m_idPlayer,
A.m_idparty,
A.m_dwSkinSet,
A.m_dwHairMesh,
A.m_dwHeadMesh,
A.m_dwHairColor,
A.m_dwSex,
A.m_nJob,
A.m_nLevel,
A.m_vPos_x,
A.m_vPos_y,
A.m_vPos_z,
A.m_nStr,
A.m_nSta,
A.m_nDex,
A.m_nInt,
A.m_aJobLv,
A.m_chAuthority,
A.m_idCompany,
A.m_nMessengerState,
B.m_Inventory,
--Inventory is being pulled right here, lets add what is needed
B.m_Inventory2,
B.m_Inventory3,
B.m_Inventory4,
B.m_apIndex,
B.m_adwEquipment,
B.m_dwObjIndex,
m_idGuild = CASE WHEN C.m_idGuild IS NULL THEN '0' ELSE C.m_idGuild END ,
m_idWar = CASE WHEN C.m_idWar IS NULL THEN '0' ELSE C.m_idWar END,
D.m_extInventory,
D.m_InventoryPiercing,
A.m_nHonor,
last_connect = [MENTION=5497993]last_[/MENTION]connect
FROM CHARACTER_TBL as A
inner join INVENTORY_TBL as B on A.m_idPlayer = B.m_idPlayer and A.serverindex = B.serverindex
inner join INVENTORY_EXT_TBL as D on B.serverindex = D.serverindex and B.m_idPlayer = D.m_idPlayer
left outer join GUILD_MEMBER_TBL as C on D.m_idPlayer = C.m_idPlayer and D.serverindex = C.serverindex
WHERE A.isblock = 'F'
AND A.account = @iaccount
AND A.serverindex = [MENTION=3453071]iServe[/MENTION]rindex
ORDER BY A.playerslot
insert into CHARACTER_TBL_penya_check (account, m_szName, m_dwGold, check_sec, serverindex)
select @iaccount, m_szName, m_dwGold, 9, [MENTION=3453071]iServe[/MENTION]rindex
from CHARACTER_TBL (nolock)
where account = @iaccount and serverindex = [MENTION=3453071]iServe[/MENTION]rindex and TotalPlayTime < 1 and m_dwGold >= 1
RETURN
END
Because it is requesting that data, we will need to add the values into the table "INVENTORY_TBL" and update the table to withhold the new varchar sizes.
CDbManager::Join
-> Moving on to further information, this function passes "S8" to the character str.
-> We Notice that this function also calls GetInventory which also expects having access to other table information that we have yet to come across. In S8, we will noticed it is "INVENTORY_EXT_TBL".
-> Because we are still pulling the new inventory, we need to add the values and then compensate the db for the new varchar lengths.
Code:
IF @iGu = 'S8'
BEGIN
SELECT @om_chLoginAuthority = m_chLoginAuthority FROM ACCOUNT_DBF.dbo.ACCOUNT_TBL_DETAIL WHERE account = @iaccount
SELECT m_chLoginAuthority = @om_chLoginAuthority,
A.account,
A.m_idPlayer,
A.playerslot,
A.serverindex,
A.dwWorldID,
A.m_szName,
A.m_dwIndex,
A.m_vScale_x,
A.m_dwMotion,
A.m_vPos_x,
A.m_vPos_y,
A.m_vPos_z,
A.m_fAngle,
A.m_szCharacterKey,
A.m_idPlayer,
A.m_nHitPoint,
A.m_nManaPoint,
A.m_nFatiguePoint,
A.m_nFuel,
A.m_dwSkinSet,
A.m_dwHairMesh,
A.m_dwHairColor,
A.m_dwHeadMesh,
A.m_dwSex,
A.m_dwRideItemIdx,
A.m_dwGold,
A.m_nJob,
A.m_pActMover,
A.m_nStr,
A.m_nSta,
A.m_nDex,
A.m_nInt,
A.m_nLevel,
A.m_nMaximumLevel,
A.m_nExp1,
A.m_nExp2,
A.m_aJobSkill,
A.m_aLicenseSkill,
A.m_aJobLv,
A.m_dwExpertLv,
A.m_idMarkingWorld,
A.m_vMarkingPos_x,
A.m_vMarkingPos_y,
A.m_vMarkingPos_z,
A.m_nRemainGP,
A.m_nRemainLP,
A.m_nFlightLv,
A.m_nFxp,
A.m_nTxp,
A.m_lpQuestCntArray,
m_aCompleteQuest = ISNULL(A.m_aCompleteQuest,'$'),
A.m_chAuthority,
A.m_dwMode,
A.m_idparty,
A.m_idCompany,
A.m_idMuerderer,
A.m_nFame,
A.m_nDeathExp,
A.m_nDeathLevel,
A.m_dwFlyTime,
A.m_nMessengerState,
A.End_Time,
A.BlockTime,
A.blockby,
A.isblock,
A.TotalPlayTime,
A.CreateTime,
A.m_dwSkillPoint,
B.m_aSlotApplet,
B.m_aSlotQueue,
B.m_SkillBar,
C.m_aSlotItem,
D.m_Inventory,
--teh inventory
D.m_Inventory2,
D.m_Inventory3,
D.m_Inventory4,
D.m_apIndex,
D.m_adwEquipment,
D.m_dwObjIndex,
m_idGuild = ISNULL(G.m_idGuild,'0'),
m_idWar = ISNULL(G.m_idWar,'0'),
A.m_tmAccFuel,
A.m_tGuildMember,
m_dwSMTime = ISNULL(H.m_dwSMTime,'NULL') ,
SkillInfluence = ISNULL(E.SkillInfluence,'$'),
F.m_extInventory,
F.m_InventoryPiercing,
A.m_dwReturnWorldID,
A.m_vReturnPos_x,
A.m_vReturnPos_y,
A.m_vReturnPos_z,
last_connect = [MENTION=5497993]last_[/MENTION]connect,
A.m_SkillPoint,
A.m_SkillLv,
A.m_SkillExp,
A.dwEventFlag,
A.dwEventTime,
A.dwEventElapsed
,A.PKValue as m_nPKValue
,A.PKPropensity as m_dwPKPropensity
,A.PKExp as m_dwPKExp
,A.AngelExp as m_nAngelExp
,A.AngelLevel as m_nAngelLevel
,F.szInventoryPet as szInventoryPet
,A.m_dwPetId
, A.m_nExpLog, A.m_nAngelExpLog
, m_nCoupon
, A.m_nLayer
, A.m_aCheckedQuest
, A.m_nCampusPoint
, A.idCampus
, isnull(R.m_nRestPoint, 0) m_nRestPoint
, isnull(R.m_LogOutTime, 0) m_LogOutTime
FROM CHARACTER_TBL A
inner join TASKBAR_TBL B on A.m_idPlayer = B.m_idPlayer and A.serverindex = B.serverindex
inner join TASKBAR_ITEM_TBL C on B.m_idPlayer = C.m_idPlayer and B.serverindex = C.serverindex
inner join INVENTORY_TBL D on C.m_idPlayer = D.m_idPlayer and C.serverindex = D.serverindex
inner join SKILLINFLUENCE_TBL E on D.m_idPlayer = E.m_idPlayer and D.serverindex = E.serverindex
inner join INVENTORY_EXT_TBL F on E.m_idPlayer = F.m_idPlayer and E.serverindex = F.serverindex
left outer join GUILD_MEMBER_TBL G on F.serverindex = G.serverindex and F.m_idPlayer = G.m_idPlayer
left outer join BILING_ITEM_TBL H on F.serverindex = H.serverindex and F.m_idPlayer = H.m_idPlayer
left outer join tblRestPoint R on F.serverindex = R.serverindex and F.m_idPlayer = R.m_idPlayer
WHERE A.m_idPlayer = @im_idPlayer
AND A.serverindex = [MENTION=3453071]iServe[/MENTION]rindex
AND A.account = lower(@iaccount)
insert into CHARACTER_TBL_validity_check (m_idPlayer, serverindex, account, m_szName, TotalPlayTime, m_dwGold, m_nLevel, m_nJob, sum_ability, CreateTime)
select m_idPlayer, serverindex, account, m_szName, TotalPlayTime, m_dwGold, m_nLevel, m_nJob, (m_nStr + m_nSta + m_nDex + m_nInt), CreateTime
from CHARACTER_TBL (nolock)
where m_idPlayer = @im_idPlayer and TotalPlayTime <= 1
and (m_dwGold >= 1 or m_nLevel >= 2 or m_nJob >= 1 or (m_nStr + m_nSta + m_nDex + m_nInt) > 60)
declare [MENTION=1899648]M_D[/MENTION]wGold_old bigint, [MENTION=1899648]M_D[/MENTION]wGold_now bigint
select [MENTION=1899648]M_D[/MENTION]wGold_old = m_dwGold from tblLogout_Penya (nolock) where m_idPlayer = @im_idPlayer
select [MENTION=1899648]M_D[/MENTION]wGold_now = m_dwGold from CHARACTER_TBL (nolock) where serverindex = [MENTION=3453071]iServe[/MENTION]rindex and m_idPlayer = @im_idPlayer
if [MENTION=1899648]M_D[/MENTION]wGold_old <> [MENTION=1899648]M_D[/MENTION]wGold_now)
begin
insert into tblLogout_Penya_Diff_Log (serverindex, m_idPlayer, m_dwGold_old, regdate_old, m_dwGold_now)
select serverindex, m_idPlayer, [MENTION=1899648]M_D[/MENTION]wGold_old, regdate, [MENTION=1899648]M_D[/MENTION]wGold_now
from tblLogout_Penya (nolock)
where m_idPlayer = @im_idPlayer and serverindex = [MENTION=3453071]iServe[/MENTION]rindex
end
SELECT a.m_idPlayer,
c.playerslot,
a.m_Bank,
a.m_apIndex_Bank,
a.m_dwObjIndex_Bank,
a.m_dwGoldBank,
a.m_BankPw,
b.m_extBank,
b.m_BankPiercing
,b.szBankPet
FROM dbo.BANK_TBL a,
dbo.BANK_EXT_TBL b,
dbo.CHARACTER_TBL c
WHERE a.m_idPlayer = b.m_idPlayer
AND a.serverindex = b.serverindex
AND b.m_idPlayer = c.m_idPlayer
AND b.serverindex = c.serverindex
AND c.account = @iaccount
AND c.isblock = 'F'
ORDER BY c.playerslot
SELECT a.nPocket,
a.szItem,
a.szIndex,
a.szObjIndex,
a.bExpired,
a.tExpirationDate,
b.szExt,
b.szPiercing,
b.szPet
FROM tblPocket as a inner join tblPocketExt as b
on a.serverindex = b.serverindex AND a.idPlayer = b.idPlayer AND a.nPocket = b.nPocket
WHERE a.serverindex = [MENTION=3453071]iServe[/MENTION]rindex AND a.idPlayer = @im_idPlayer
ORDER BY a.nPocket
RETURN
END
-> The values in the db could be more proper, but for this explanation I am multiplying the value by 4. Varchar in mssql cannot have a number if they are above 8000, thus varchar(max) had to be used.
If we load an inventory, we must save a players inventory, so
CDbManager::SavePlayer
-> Calls U1
-> Adds 3 params to the save, and binds parameter.
So firstly, of the binding of the paramter, either remove the buffer length or increase the buffer length to the proper / new size. Ie: Old size * 4 or 0
Code:
bOK[++j] = qry->BindParameter( ++i, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, 0, 0, icsInventory.szItem, 0, &cbLen );
bOK[++j] = qry->BindParameter( ++i, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, 0, 0, icsInventory.szItem2, 0, &cbLen );
And we need to make sure U1 is updated to receive the new parameters. Since we are calling the stored procedure with data rather reading the data, we need to have a variable in which will allow us to edit the table. We also need to increase the sizes of all the edited values
ALTER proc [dbo].[CHARACTER_STR]
Code:
-- INVENTORY_TBL
@im_Inventory VARCHAR(6940)= '',
@im_Inventory2 VARCHAR(6940)= '',
@im_Inventory3 VARCHAR(6940)= '',
@im_Inventory4 VARCHAR(6940)= '',
@im_apIndex VARCHAR(1380) = '',
@im_adwEquipment VARCHAR(540) = '',
@im_dwObjIndex VARCHAR(1380) = '',
Code:
@im_extInventory varchar(8000) = '',
@im_InventoryPiercing varchar(MAX) = '',
Code:
,@iszInventoryPet varchar(MAX) = '$'
Now, in U1, we can edit the inventory stuff
Code:
UPDATE INVENTORY_TBL
SET m_Inventory = @im_Inventory,
m_Inventory2 = @im_Inventory2,
m_Inventory3 = @im_Inventory3,
m_Inventory4 = @im_Inventory4,
m_apIndex = @im_apIndex,
m_adwEquipment = @im_adwEquipment,
m_dwObjIndex = @im_dwObjIndex
WHERE m_idPlayer = @im_idPlayer
AND serverindex = [MENTION=3453071]iServe[/MENTION]rindex
Now, the one that I have access too, looks like it stores the main column as 4 columns rather one and then multiplicates the rest by 4. Other than that, it also looks like it reads it all into one value after reading -- then having to separate on save.
|
thats not all
|
|
|
|
Similar Threads
|
Tabbed Inventory
11/14/2012 - Flyff Private Server - 2 Replies
Wäre es besser 4 Spalten in der BD zu machen oder die Inventory DB zu vergrößern?
und besser aus m_Inventory nen array zu machen oder neue CWndItemCtrl pointer?, die alles aus m_Inventory kopieren?
|
[SHOW] Tabbed Inventory und Shopsystem
03/10/2012 - Flyff Private Server - 24 Replies
Hi Elitepvperzzzzzz...
ich bin fast mit der Programmierung des Tabbed Inventorys fertig und wollte euch einfach mal zeigen, dass auch eine Privatperson und ein sogenannter "theoretischer" Programmierer in der Lage ist ein solches System zu programmieren.
Flyff Tabbed Inventory - YouTube
...das System ist noch weit davon entfernt bugfrei zu sein:
-das Speichern funktioniert noch nicht ganz ( der SQLString wird abgeschnitten )
-kleiner Bug durch schlampige Programmierung in der...
|
Request v17 Tabbed Inventory
03/10/2012 - Flyff Private Server - 2 Replies
Does anyone has the v17 tabbed inventory that they may share to our community or to me? It would be great if so.
Just wondering if someone will, really appreciate it.
|
[VK] Tabbed Inventory (source)
02/18/2012 - Flyff Trading - 6 Replies
Da ich mit flyff aufhöre will ich hier mal das Tabbed inventory zum verkauf anbieten.
Hier mal paar daten
Info|Normal|Tabbed
Slots|42|42
Tabs|1|4
SRO|ja|nein*
GRO|ja|nein*
CI|ja|ja
RITEM|ja|ja
|
All times are GMT +1. The time now is 02:21.
|
|