• 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 Help to compile 0.4

devilfire

New Member
Joined
Nov 26, 2016
Messages
14
Reaction score
0
I was looking a lot to 0.4 sources with no yellow skull bug, no monster walk bug, cast system and another features...
So i found it in a brazilian forum:
https://github.com/Fir3element/tfs04full

But i having some problems to compile it and i don't found nothing like that here on this forum...
Anybody could help me?

Error is when i tried to:
./autogen.sh

Show me:
Code:
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force
autoreconf: configure.ac: tracing
autoreconf: configure.ac: not using Libtool
autoreconf: running: /usr/bin/autoconf --force
autoreconf: running: /usr/bin/autoheader --force
autoreconf: running: automake --add-missing --copy --force-missing
/usr/share/automake-1.15/am/depend2.am: error: am__fastdepCC does not appear in AM_CONDITIONAL
/usr/share/automake-1.15/am/depend2.am:   The usual way to define 'am__fastdepCC' is to add 'AC_PROG_CC'
/usr/share/automake-1.15/am/depend2.am:   to 'configure.ac' and run 'aclocal' and 'autoconf' again
Makefile.am: error: C source seen but 'CC' is undefined
Makefile.am:   The usual way to define 'CC' is to add 'AC_PROG_CC'
Makefile.am:   to 'configure.ac' and run 'autoconf' again.
Makefile.am:23: warning: variable 'theforgottenserver_SOURCES' is defined but no program or
Makefile.am:23: library has 'theforgottenserver' as canonical name (possible typo)
Makefile.am:8: warning: variable 'theforgottenserver_LDADD' is defined but no program or
Makefile.am:8: library has 'theforgottenserver' as canonical name (possible typo)
autoreconf: automake failed with exit status: 1
 
Last edited:
When I get home, I will test a few things because it seems to be about the wording of "theforgottenserver" on lines 8 and 23

@zabuzo + @devilfire - I did what the errors told me to do and it eventually compiled - try this sourcepack now, it should work for you. If not, post the errors.

https://mega.nz/#!XI1CjCjK!MCYliWfToADXo3QNajmgd-zaMJpMIpx7XCzywyq5QP4

Thank you so much!
But could you post only the files you have changed on http://pastebin.com/index.php or http://hastebin.com/ ?
I made my changes on source and i wanna know what was, ty

---

A user have fixed the last problem in cast system on original post (in a br forum), just use it chat.cpp and will be fixed
http://hastebin.com/micusanilu.php
 
The main issue was in configure.ac and makefile; i needed to add "ac_prog_cc" and modify the name tfs to theforgottenserver. Pretty sure there was something else but I was messing around for about an hour so I cant fully remember.

There was also like 8 files that needed small changes, I just followed the compiler errors. Changing some "return false to "return null", the async function that they added had errors so i commented that out of the sources, and there was just a few random fixes.

Ill check the cast system fix; i personally edited protocollogin.cpp, so instead of it showing "0 viewers" on cast list it will show "L.58 1/50". So it shows caster level and amount of viewers insteasd of just viewers.

Just a note, if you fork the source from github then commit the files I posted; it will show you all the changes line for line.

Edit: what does the chat file fix? @zabuzo
 
Last edited:
When I get home, I will test a few things because it seems to be about the wording of "theforgottenserver" on lines 8 and 23

@zabuzo + @devilfire - I did what the errors told me to do and it eventually compiled - try this sourcepack now, it should work for you. If not, post the errors.

https://mega.nz/#!XI1CjCjK!MCYliWfToADXo3QNajmgd-zaMJpMIpx7XCzywyq5QP4

Why show me this error when compile trying to add ping functions?

My changes:
ctrl+f: // getOtsysTime() + getPlayerPing(cid) + doPlayerSendPing(cid) [CREDITS: Shyzoul and Nothxbye]

luascript.h
1 time
http://hastebin.com/xakoculihu.cpp

luascript.cpp
2 times
http://hastebin.com/exujasukeh.go

Code:
luascript.cpp: In static member function ‘static int32_t LuaInterface::luaGetTownTemplePosition(lua_State*)’:
luascript.cpp:9598:7: warning: variable ‘displayError’ set but not used [-Wunused-but-set-variable]
  bool displayError = true;
       ^
In file included from player.h:33:0,
                 from luascript.cpp:26:
protocolgame.h: In static member function ‘static int32_t LuaInterface::luaPlayerSendPing(lua_State*)’:
protocolgame.h:205:8: error: ‘void ProtocolGame::sendPing()’ is private
   void sendPing();
        ^
luascript.cpp:10179:20: error: within this context
   client->sendPing();
                    ^
Makefile:551: recipe for target 'luascript.o' failed
 
It says sendping is under private, so move it to the public class. Im on my phone so I dont have functionality to check.
 
It says sendping is under private, so move it to the public class. Im on my phone so I dont have functionality to check.

You mean in luascript.h
Change from
protected:

To
public:

List? Because i did it and take new errors, trought was doing some wrong...
 
Oh i forgotten to post it:

I got this error:
Code:
luascript.cpp: In static member function ‘static int32_t LuaInterface::luaGetTownTemplePosition(lua_State*)’:
luascript.cpp:9598:7: warning: variable ‘displayError’ set but not used [-Wunused-but-set-variable]
  bool displayError = true;
       ^
In file included from player.h:33:0,
                 from luascript.cpp:26:
protocolgame.h: In static member function ‘static int32_t LuaInterface::luaPlayerSendPing(lua_State*)’:
protocolgame.h:205:8: error: ‘void ProtocolGame::sendPing()’ is private
   void sendPing();
        ^
luascript.cpp:10179:20: error: within this context
   client->sendPing();
                    ^

Changing luascript.h to:
http://hastebin.com/uyayenirog.cpp
 
Go to line 9598 and add // infront of bool displayError, then try to compile. It should say an error again that says displayError used but not defined and gives another line and just // the beginning of that line as well.

Not the greatest with c++ so i just commented it out
 
Go to line 9598 and add // infront of bool displayError, then try to compile. It should say an error again that says displayError used but not defined and gives another line and just // the beginning of that line as well.

Not the greatest with c++ so i just commented it out

What? I'm sorry
Is this?
http://hastebin.com/oyunumajak.go

Still same error:
Code:
luascript.cpp: In static member function ‘static int32_t LuaInterface::luaGetTownTemplePosition(lua_State*)’:
luascript.cpp:9600:3: error: ‘displayError’ was not declared in this scope
   displayError = popNumber(L);
   ^
In file included from player.h:33:0,
                 from luascript.cpp:26:
protocolgame.h: In static member function ‘static int32_t LuaInterface::luaPlayerSendPing(lua_State*)’:
protocolgame.h:205:8: error: ‘void ProtocolGame::sendPing()’ is private
   void sendPing();
        ^
luascript.cpp:10179:20: error: within this context
   client->sendPing();
                    ^
Makefile:551: recipe for target 'luascript.o' failed
make[1]: *** [luascript.o] Error 1
make[1]: *** Waiting for unfinished jobs....
mv -f .deps/manager.Tpo .deps/manager.Po
 
Can you read the error console, it tells you what line to edit -.- just read..

luascript.cpp:9600
Code:
int32_t LuaInterface::luaGetTownTemplePosition(lua_State* L) {     
//getTownTemplePosition(townId)     
//bool displayError = true;    
 if(lua_gettop(L) >= 2)        
 //displayError = popNumber(L);    
 uint32_t townId = popNumber(L);    
 if(Town* town = Towns::getInstance()->getTown(townId))        
pushPosition(L, town->getPosition(), 255);     
else         
lua_pushboolean(L, false);    
return 1; 
}
 
I did, i saw this error, but its make no sense, its showing only when i add that parts about checkping...
Anyways, the way i got to fix it was:
Code:
// getOtsysTime() + getPlayerPing(cid) + doPlayerSendPing(cid) [CREDITS: Shyzoul and Nothxbye]
int32_t LuaInterface::luaGetTownTemplePosition(lua_State* L)
{
   //getTownTemplePosition(townId)
   uint32_t townId = popNumber(L);
   if(Town* town = Towns::getInstance()->getTown(townId))
       pushPosition(L, town->getPosition(), 255);
   else
       lua_pushboolean(L, false);

   return 1;
}
// end

I don't know why, i just take from the old 0.4 sources...

Now i got this 2 files
luascript.cpp
http://hastebin.com/umodedehuy.go

luascript.h
http://hastebin.com/xonixeluqe.cpp

And this error:
Code:
In file included from player.h:33:0,
                 from luascript.cpp:26:
protocolgame.h: In static member function ‘static int32_t LuaInterface::luaPlayerSendPing(lua_State*)’:
protocolgame.h:205:8: error: ‘void ProtocolGame::sendPing()’ is private
   void sendPing();
        ^
luascript.cpp:10175:20: error: within this context
   client->sendPing();
                    ^

Idk why this error too
The
Code:
static int32_t luaPlayerSendPing(lua_State* L);


Is in:
Code:
class LuaInterface
{
   public:
 
Try moving it to private and see what happens?

Code:
In file included from player.h:33:0,
                 from luascript.cpp:26:
protocolgame.h: In static member function ‘static int32_t LuaInterface::luaPlayerSendPing(lua_State*)’:
protocolgame.h:205:8: error: ‘void ProtocolGame::sendPing()’ is private
   void sendPing();
        ^
luascript.cpp:10177:20: error: within this context
   client->sendPing();
                    ^
 
To fix www/cast.php not showing cast list, follow below.

In the file iologindata.cpp ctrl+f or goto line 812
Code:
query << "`stamina` = " << player->getStamina() << ", ";

After this/on line 813 add the following:
Code:
    query << "`cast` = " << (player->getCastingState() ? 1 : 0) << ", "; //CA
    query << "`castViewers` = " << player->getCastViewerCount() << ", ";
    query << "`castDescription` = " << db->escapeString(player->getCastDescription()) << ", ";

This will fix this issue with "doPlayerSave(cid)" not updating cast results in database. :)
 
Last edited:
Back
Top