• 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!

[7.4, 7.8, 7.92, 8.0] Sabrehaven.com based on Nostalrius 7.7 fork

I want to study using the server, but I'm trying to get something on my database. I am using Znote and whenever I try to create a new account, or a new character, he tries to create with "ID 0", and I see the error below:

Register Account​

string(178) "INSERT INTO accounts (name, password, email, premdays, creation) VALUES ('333333', '81d1ca2164b6b2681dc08cbe7ddfbbf53813cca2', '[email protected]', '30', '1681077737')"
(query - SQL error)
Type: voidQuery (voidQuery is used for update, insert or delete from database)

Duplicate entry '0' for key 'PRIMARY'

Does anyone know how to solve this problem? I believe there are also problems with Znote_accounts, Znote_Players, and always a problem involving the ID.
I'm sending my database if you help with something.
 

Attachments

Last edited:
Hello friends, I'm trying to use the SABREHAVEN 8.0 base to start some tests, I already have a client and a website compatible with it and when I put the distro online, it runs smoothly without any error, but when I log off a char, the char doesn't save anything, it always comes back to start, and the following error appears in the distro:

ADMIN has logged out.
[Error - mysql_real_query] Query: UPDATE players SET level = 8,group_id = 3,vocation = 1,health = 185,healthmax = 185,experience = 4200,lookbody = 106,lookfeet = 95,lookhead = 78,looklegs = 58,looktype = 128,lookaddons = 0,maglevel = 100,mana = 40,manamax =
Message: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '☺,lastlogin = 1681044343,lastip = 16777343,conditions = '',skulltime ...' at line 1
[Error - mysql_real_query] Query: UPDATE players SET level = 8,group_id = 3,vocation = 1,health = 185,healthmax = 185,experience = 4200,lookbody = 106,lookfeet = 95,lookhead = 78,looklegs = 58,looktype = 128,lookaddons = 0,maglevel = 100,mana = 40,manamax =
Message: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '☺,lastlogin = 1681044343,lastip = 16777343,conditions = '',skulltime ...' at line 1
[Error - mysql_real_query] Query: UPDATE players SET level = 8,group_id = 3,vocation = 1,health = 185,healthmax = 185,experience = 4200,lookbody = 106,lookfeet = 95,lookhead = 78,looklegs = 58,looktype = 128,lookaddons = 0,maglevel = 100,mana = 40,manamax =
Message: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '☺,lastlogin = 1681044343,lastip = 16777343,conditions = '',skulltime ...' at line 1
Error while saving player: ADMIN


After looking for possible solutions, what most told me was that the only way to solve this would be to go to the:


iologindata.cpp

find this line: query << " sex= " << player->sex << ',';

and change it to this line: query << " sex= " << static_cast<uint16_t>(player->sex) << ',';


They said that this would solve the problem, but for this to work I need to compile the server, but I'm a layman and I'm having a lot of difficulty with this, I've tried in different ways, I've seen several videos and tutorials but I still haven't been successful in solving this error, does anyone can you help me please??
 
Hello friends, I'm trying to use the SABREHAVEN 8.0 base to start some tests, I already have a client and a website compatible with it and when I put the distro online, it runs smoothly without any error, but when I log off a char, the char doesn't save anything, it always comes back to start, and the following error appears in the distro:

ADMIN has logged out.
[Error - mysql_real_query] Query: UPDATE players SET level = 8,group_id = 3,vocation = 1,health = 185,healthmax = 185,experience = 4200,lookbody = 106,lookfeet = 95,lookhead = 78,looklegs = 58,looktype = 128,lookaddons = 0,maglevel = 100,mana = 40,manamax =
Message: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '☺,lastlogin = 1681044343,lastip = 16777343,conditions = '',skulltime ...' at line 1
[Error - mysql_real_query] Query: UPDATE players SET level = 8,group_id = 3,vocation = 1,health = 185,healthmax = 185,experience = 4200,lookbody = 106,lookfeet = 95,lookhead = 78,looklegs = 58,looktype = 128,lookaddons = 0,maglevel = 100,mana = 40,manamax =
Message: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '☺,lastlogin = 1681044343,lastip = 16777343,conditions = '',skulltime ...' at line 1
[Error - mysql_real_query] Query: UPDATE players SET level = 8,group_id = 3,vocation = 1,health = 185,healthmax = 185,experience = 4200,lookbody = 106,lookfeet = 95,lookhead = 78,looklegs = 58,looktype = 128,lookaddons = 0,maglevel = 100,mana = 40,manamax =
Message: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '☺,lastlogin = 1681044343,lastip = 16777343,conditions = '',skulltime ...' at line 1
Error while saving player: ADMIN


After looking for possible solutions, what most told me was that the only way to solve this would be to go to the:


iologindata.cpp

find this line: query << " sex= " << player->sex << ',';

and change it to this line: query << " sex= " << static_cast<uint16_t>(player->sex) << ',';


They said that this would solve the problem, but for this to work I need to compile the server, but I'm a layman and I'm having a lot of difficulty with this, I've tried in different ways, I've seen several videos and tutorials but I still haven't been successful in solving this error, does anyone can you help me please??

I've attached the compiled .exe and .dlls with the fix for that issue for the 8.0 version.
 

Attachments

  • forgottenserver.rar
    1.2 MB · Views: 85 · VirusTotal
Carrying out some tests with the otclient version 8.0 that is next to the files, the character has no life bar and when he dies he is disconnected.

1681259732769.png1681259747329.png1681259826556.png
 
All you have to do is import the market_history/offer tables to your database.

Lua:
CREATE TABLE IF NOT EXISTS `market_history` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `player_id` int NOT NULL,
  `sale` tinyint NOT NULL DEFAULT '0',
  `itemtype` smallint unsigned NOT NULL,
  `amount` smallint unsigned NOT NULL,
  `price` bigint unsigned NOT NULL DEFAULT '0',
  `expires_at` bigint unsigned NOT NULL,
  `inserted` bigint unsigned NOT NULL,
  `state` tinyint unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `player_id` (`player_id`, `sale`),
  FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8;

CREATE TABLE IF NOT EXISTS `market_offers` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `player_id` int NOT NULL,
  `sale` tinyint NOT NULL DEFAULT '0',
  `itemtype` smallint unsigned NOT NULL,
  `amount` smallint unsigned NOT NULL,
  `created` bigint unsigned NOT NULL,
  `anonymous` tinyint NOT NULL DEFAULT '0',
  `price` bigint unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `sale` (`sale`,`itemtype`),
  KEY `created` (`created`),
  FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8;

Got problem with proper schema :(
Can someone share proper one for 8.0?
CREATE TABLE IF NOT EXISTS market_history (
id int unsigned NOT NULL AUTO_INCREMENT,
player_id int NOT NULL,
sale tinyint NOT NULL DEFAULT '0',
itemtype smallint unsigned NOT NULL,
amount smallint unsigned NOT NULL,

#1822 - Failed to add the foreign key constraint. Missing index for constraint 'market_history_ibfk_1' in the referenced table 'players'
 
Last edited:
Someone could provide a valid .sql file that contains at least 1 player working and all the database tables stable? Did a lot ot things but no sucess..
 
I want to study using the server, but I'm trying to get something on my database. I am using Znote and whenever I try to create a new account, or a new character, he tries to create with "ID 0", and I see the error below:



Does anyone know how to solve this problem? I believe there are also problems with Znote_accounts, Znote_Players, and always a problem involving the ID.
I'm sending my database if you help with something.
did you find a solution? be able to inform me I would be happy !
 
how do i edit the items for "example" to add new items to the server, like wands, rods, swords, shields etc etc...
is in srv , I've never worked with this type of files, I'm learning to work with older servers I'm sorry for my English, I'm brazilian
 
Hi guys, very good job, congrats. Btw my market not reading depot itens so it missing the itens, i cant make any sell offers, only buy offers. When i click on Show Depot Only it shows nothing then the problem is it. But the question is: how to solve? hehe i serach everywhere and theres nothing bout, looked the scripts and till i know its everything ok, so idk what to do, if smn could help me i will be grateful
 
any tutorial to compile this on 8.0? i've breen trying several tutorials but i keep failing.
 
hello friends, I would like to know how I can transform NPC files of type EX: Rashid.xml to Rashid.npc, my server only recognizes .npc , I added some new npcs in .xml by RME but they do not appear on the server :/
 
hello friends, I would like to know how I can transform NPC files of type EX: Rashid.xml to Rashid.npc, my server only recognizes .npc , I added some new npcs in .xml by RME but they do not appear on the server :/
dude, you can't add npcs with .npc format on rme, that's the thing.. you have to add them one by one at .npc file
 
Which site would you recommend using? How do you put points inside the game, I'm not getting it
 
I see many working and because of studying I would also like to work on a server that is being talked about.
What fork are you working on, 8.0 dowloaded from github?
 
Back
Top