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

Compiling Change Vocations and skills after restart server

arti1194

New Member
Joined
Jun 6, 2009
Messages
96
Reaction score
3
Dear otland,
I using TFS rev 3777 https://otland.net/threads/8-60-the-forgotten-server-0-4.240240/
problem is when i restart server
most of accounts changed vocations and some charachters get like 58967 distance or 3294 sword , etc
so when these players login the server get crash and no one can login
but really i dont know where is the error and there is no error in the cansole
now i want to know how i can fix it
thank you

Can any one help me?
 
Last edited by a moderator:
Update to TFS 1.x, I do not offer support for older versions.
Sry mate, but its not easy to do it when you already have an ot full os custom things. I tryed to study the tfs 1.2 syntax, to upgrade my tfs 0.4 8.60 server. It was a mess, everything is new, I could not take anything from my old ot, only if i star ALL OVER AGAIN, rewritting ALL scripts.
 
Thanks for the answer. Today at 5 it happened again and blocked the server. This release is stable? [8.60] The Forgotten Server 1.2

I see database schema with 1.2 is other then 0.4 :( how to migrate it?

Today I have error in console:
Code:
[Warning - Vocations::getVocation] Vocation 4294967295 not found.
Maybe problem is here?

Code:
game.cpp: In constructor 'Game::Game()':
game.cpp:80:31: warning: iteration 2u invokes undefined behavior [-Waggressive-loop-optimizations]
   globalSaveMessage[i] = false;
                               ^
game.cpp:79:2: note: containing loop
  for(int32_t i = 0; i < 3; i++)
  ^
In file included from game.cpp:18:0:
game.h: In member function 'void Game::globalSave()':
game.h:616:85: warning: iteration 2u invokes undefined behavior [-Waggressive-loop-optimizations]
   void setGlobalSaveMessage(int16_t key, bool value) {globalSaveMessage[key] = value;}
                                                                                     ^
game.cpp:6331:2: note: containing loop
  for(int16_t i = 0; i < 3; i++)
  ^

or

Code:
mv -f .deps/npc.Tpo .deps/npc.Po
g++ -DHAVE_CONFIG_H -I.    -I/usr/include/libxml2  -I/usr/include/lua5.1  -O2 -fomit-frame-pointer -D__USE_MYSQL__   -D__ENABLE_SERVER_DIAGNOSTIC__ -D_THREAD_SAFE -D_REENTRANT -Wall -Wextra -Wno-strict-aliasing -Wno-unused-parameter -Wno-array-bounds -pthread -pipe -MT protocollogin.o -MD -MP -MF .deps/protocollogin.Tpo -c -o protocollogin.o protocollogin.cpp
protocolgame.cpp: In member function 'void ProtocolGame::AddCreatureSpeak(NetworkMessage_ptr, const Creature*, SpeakClasses, std::string, uint16_t, uint32_t, Position*, ProtocolGame*)':
protocolgame.cpp:2972:158: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   if(speaker && type != SPEAK_RVR_ANSWER && !speaker->isAccountManager() && !speaker->hasCustomFlag(PlayerCustomFlag_HideLevel) && (pg == NULL || pg != NULL && !pg->getIsCast()))
 
Last edited by a moderator:
Sry mate, but its not easy to do it when you already have an ot full os custom things. I tryed to study the tfs 1.2 syntax, to upgrade my tfs 0.4 8.60 server. It was a mess, everything is new, I could not take anything from my old ot, only if i star ALL OVER AGAIN, rewritting ALL scripts.
except 1.2 has backwards compatibility with 95% of the functions from 0.4
>>compat.lua<<

Today I have error in console:
Code:
[Warning - Vocations::getVocation] Vocation 4294967295 not found.
Maybe problem is here?

Code:
game.cpp: In constructor 'Game::Game()':
game.cpp:80:31: warning: iteration 2u invokes undefined behavior [-Waggressive-loop-optimizations]
   globalSaveMessage[i] = false;
                               ^
game.cpp:79:2: note: containing loop
  for(int32_t i = 0; i < 3; i++)
  ^
In file included from game.cpp:18:0:
game.h: In member function 'void Game::globalSave()':
game.h:616:85: warning: iteration 2u invokes undefined behavior [-Waggressive-loop-optimizations]
   void setGlobalSaveMessage(int16_t key, bool value) {globalSaveMessage[key] = value;}
                                                                                     ^
game.cpp:6331:2: note: containing loop
  for(int16_t i = 0; i < 3; i++)
  ^

or

Code:
mv -f .deps/npc.Tpo .deps/npc.Po
g++ -DHAVE_CONFIG_H -I.    -I/usr/include/libxml2  -I/usr/include/lua5.1  -O2 -fomit-frame-pointer -D__USE_MYSQL__   -D__ENABLE_SERVER_DIAGNOSTIC__ -D_THREAD_SAFE -D_REENTRANT -Wall -Wextra -Wno-strict-aliasing -Wno-unused-parameter -Wno-array-bounds -pthread -pipe -MT protocollogin.o -MD -MP -MF .deps/protocollogin.Tpo -c -o protocollogin.o protocollogin.cpp
protocolgame.cpp: In member function 'void ProtocolGame::AddCreatureSpeak(NetworkMessage_ptr, const Creature*, SpeakClasses, std::string, uint16_t, uint32_t, Position*, ProtocolGame*)':
protocolgame.cpp:2972:158: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   if(speaker && type != SPEAK_RVR_ANSWER && !speaker->isAccountManager() && !speaker->hasCustomFlag(PlayerCustomFlag_HideLevel) && (pg == NULL || pg != NULL && !pg->getIsCast()))
download another 0.4
 
Nobody knows what's the problem?

I found this:
FIX : If anyone has the following error :

[Warning - Vocations::getVocation] Vocation 4294967295 not found.

To fix this problem change back the promotion in PMA from "1" to "0" because there comes to a crash between the ids that already have promotion like
vocation id="5" name="Master Sorcerer". You can't give promotion to a vocation that already has one. Hope i helped anyone with this kind of problem.
I check this and yes this is it. When vocation id player is 5-8 and player buy a promotion and hit the monster then server crash.
I checked in database and vocation of every player is 1-4 so something (script, engine) must change this vocation to 5-8..
But I don't know why vocation random players has change.
So my question is: Why after restart server, or sometimes 3-6 houres after restart server, vocation has change in random players?
Which function can change vocation?
What I must search?

!~~UP~~!

;)
 
Last edited by a moderator:
Nobody knows what's the problem?

I found this:

I check this and yes this is it. When vocation id player is 5-8 and player buy a promotion and hit the monster then server crash.
I checked in database and vocation of every player is 1-4 so something (script, engine) must change this vocation to 5-8..
But I don't know why vocation random players has change.
So my question is: Why after restart server, or sometimes 3-6 houres after restart server, vocation has change in random players?
Which function can change vocation?
What I must search?

!~~UP~~!

;)

download another 0.4

If you have tested that tell us what TFS you tested.
 
They are all outdated, so it dosn't matter.
But if I was going to start a server using 0.4 I would want an unmodified one, just look at TFS vs OTX xD
If I would stay with the current engine, what would I have to check. Which feature is responsible for changing the vocation?
 
Last edited:
If I would stay with the current engine, what would I have to check. Which feature is responsible for changing the vocation?

No ide, if you wanna use that one, once again download a clean one.
If that works you use ex WinMerge and see what the the changes has been done to your source code.
 
No ide, if you wanna use that one, once again download a clean one.
If that works you use ex WinMerge and see what the the changes has been done to your source code.
Before this I decided to write a script that does not resolve the issue, but will not stop the server.

in login.lua
Code:
LoginVocation=getPlayerVocation(cid)
        if((LoginVocation == 0) or (LoginVocation > 4)) then
                --Message to the player--
                return FALSE --stop login
        end

I noticed that characters who have promotions ( vocation id = {1-4}, promotion = 1 ) can not log in, player without promotion ( vocation id = {1-4}, promotion = 0 ) login successful. I would like to ask if the character is logged out it is saved his vocation? Or when the Global Save is executing? Or when I execute /save with GOD command? Maybe is error in save script wichone save vocation id 5-8 when have to be 1-4..
 
Last edited:
Before this I decided to write a script that does not resolve the issue, but will not stop the server.

in login.lua
Code:
LoginVocation=getPlayerVocation(cid)
        if((LoginVocation == 0) or (LoginVocation > 4)) then
                --Message to the player--
                return FALSE --stop login
        end

I noticed that characters who have promotions ( vocation id = {1-4}, promotion = 1 ) can not log in, player without promotion ( vocation id = {1-4}, promotion = 0 ) login successful. I would like to ask if the character is logged out it is saved his vocation? Or when the Global Save is executing? Or when I execute /save with GOD command? Maybe is error in save script wichone save vocation id 5-8 when have to be 1-4..

You shouldn't use your server as a test server, start a server on your own computer insted, that way you don't lose players.
As I said I have no ide, might be a saving issue, it might be that you have a bug in your source code that overwrites before saving etc etc

Do as I said, try another source code and see if that fixes the problem.
 
You shouldn't use your server as a test server, start a server on your own computer insted, that way you don't lose players.
As I said I have no ide, might be a saving issue, it might be that you have a bug in your source code that overwrites before saving etc etc

Do as I said, try another source code and see if that fixes the problem.
The problem occurs when there are more than 25 players, so it is hard for me to check another source .. Every time it happens it is at least two players. I have bought the server, start the server and everyone has gone through this problem. That is why it is hard for me to check another source.
 
The problem occurs when there are more than 25 players, so it is hard for me to check another source .. Every time it happens it is at least two players. I have bought the server, start the server and everyone has gone through this problem. That is why it is hard for me to check another source.

Well in that case there is nothing I can do, if you have the source code you can atleast compare them and see what changes it has and if something could be related to it.
 
Back
Top