• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

C++ TFS 1.4 8.6 nekiro downgrade depot, locker save items

Nefre

Member
Joined
May 17, 2012
Messages
33
Reaction score
10
Hello,
I used tfs 1.4 8.6 nekiro downgrade. I have problem with saving items in depot and locker.
I used in event script this functions
Lua:
local bag = winner:addItem(config.rewardBag, 1)
    bag:addItem(reward.itemId, reward.count, INDEX_WHEREEVER, FLAG_NOLIMIT)
When event ends winner get bag with items inside when i relog it's ok but when i put the items to depot or locker and relog i get errors.
Code:
[Error - mysql_real_query] Query: INSERT INTO `player_depotlockeritems` (`player_id`, `pid`, `sid`, `itemtype`, `count`             , `attributes`) VALUES (7, 1, 101, 2496, 1, ''),(7, 1, 102, 1988, 1, ''),(7, 1, 103, 2407, 1, ''),(7, 102, 104, 2539, 1             , '')
Message: Duplicate entry '7-103' for key 'player_depotlockeritems.player_id_2'
[Error - mysql_real_query] Query: INSERT INTO `player_depotlockeritems` (`player_id`, `pid`, `sid`, `itemtype`, `count`             , `attributes`) VALUES (7, 1, 101, 2496, 1, ''),(7, 1, 102, 1988, 1, ''),(7, 1, 103, 2407, 1, ''),(7, 102, 104, 2539, 1             , '')
Message: Duplicate entry '7-103' for key 'player_depotlockeritems.player_id_2'
[Error - mysql_real_query] Query: INSERT INTO `player_depotlockeritems` (`player_id`, `pid`, `sid`, `itemtype`, `count`             , `attributes`) VALUES (7, 1, 101, 2496, 1, ''),(7, 1, 102, 1988, 1, ''),(7, 1, 103, 2407, 1, ''),(7, 102, 104, 2539, 1             , '')
Message: Duplicate entry '7-103' for key 'player_depotlockeritems.player_id_2'
Error while saving player: Nefre
@Nekiro
 
Last edited:

ralke

(҂ ͠❛ ෴ ͡❛)ᕤ
Joined
Dec 17, 2011
Messages
964
Solutions
23
Reaction score
494
Location
Santiago - Chile
Not sure what's happening but you can try the following. First drop player_depotlockeritems table
SQL:
DROP TABLE `player_depotlockeritems`;

Then create it again
SQL:
CREATE TABLE IF NOT EXISTS `player_depotlockeritems` (
  `player_id` int NOT NULL,
  `sid` int NOT NULL COMMENT 'any given range eg 0-100 will be reserved for depot lockers and all > 100 will be then normal items inside depots',
  `pid` int NOT NULL DEFAULT '0',
  `itemtype` smallint NOT NULL,
  `count` smallint NOT NULL DEFAULT '0',
  `attributes` blob NOT NULL,
  UNIQUE KEY `player_id_2` (`player_id`, `sid`),
  FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8;

Do some testings and see if this fix the error. Good luck, regards!
 
OP
OP
N

Nefre

Member
Joined
May 17, 2012
Messages
33
Reaction score
10
Not sure what's happening but you can try the following. First drop player_depotlockeritems table
SQL:
DROP TABLE `player_depotlockeritems`;

Then create it again
SQL:
CREATE TABLE IF NOT EXISTS `player_depotlockeritems` (
  `player_id` int NOT NULL,
  `sid` int NOT NULL COMMENT 'any given range eg 0-100 will be reserved for depot lockers and all > 100 will be then normal items inside depots',
  `pid` int NOT NULL DEFAULT '0',
  `itemtype` smallint NOT NULL,
  `count` smallint NOT NULL DEFAULT '0',
  `attributes` blob NOT NULL,
  UNIQUE KEY `player_id_2` (`player_id`, `sid`),
  FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8;

Do some testings and see if this fix the error. Good luck, regards!
Great job! It works! Thank you very much!
 

unknownuser

Member
Joined
Apr 2, 2015
Messages
40
Reaction score
10
It will happen again soon. On the beginning it worked.
Post automatically merged:

I know how to reproduce this.
1. Login to game
2. Put backpack in locker
3. Put 2 items to locker
4. Relog
5. change places of these 2 items
6. relog and error
 
Last edited:
OP
OP
N

Nefre

Member
Joined
May 17, 2012
Messages
33
Reaction score
10
It will happen again soon. On the beginning it worked.
Post automatically merged:

I know how to reproduce this.
1. Login to game
2. Put backpack in locker
3. Put 2 items to locker
4. Relog
5. change places of these 2 items
6. relog and error
@ralke Ahh unfortunately i made it and again the same erros :/
 
Top