opentibia / server Goto Github PK
View Code? Open in Web Editor NEWAn open source server for the MMORPG Tibia.
License: GNU General Public License v2.0
An open source server for the MMORPG Tibia.
License: GNU General Public License v2.0
All monsters drop a label upon being killed, some monsters of one and the same type are indestructible while some can be killed, and all monsters generate weird server messages:
00:34 Loot of a rabbit: a label
00:35 Loot of a cave rat: a label
00:39 You killed again!
00:39 You killed Rat.
00:39 You killed again!
00:39 You killed Rat.
Some monsters, after dying and respawning, starts dropping two labels:
00:40 Loot of a wolf: a label, a label
The test map was created with RME 2.2, set for Map version OTServ 0.6.1 and Client version 8.70. For some reason it's not possible to change a map in RME to use Map version OTServ 0.7.0 / Revscriptsys, so I couldn't try that solution.
We will soon release 0.6.4 stable version (branch legacy ) 8.60 version.
Default database schema is not working in otserv 0.6.3, both when loaded by gendb.sh and by manually executing schema.sqlite into the new database. Errors generated by gendb.sh probably are not relevant, but I include them nevertheless.
It may be that you only need to bump the schema version number, but it still should be done in the repository.
Steps to reproduce:
1 Run gendb.sh
gendb.sh
WARNING
This will reinitialize your db.s3db file from the current directory,
using schema.sqlite, and populate it with basic players and accounts.
This means you LOSE ALL DATA in SQLite database db.s3db.
If you are upgrading, you should try the database utility!
If you don't care about your data, type 'yes, ok' below.
Pressing enter cancels.
Reinitializing
Error: near line 22: players.guildnick may not be NULL
Error: near line 24: players.guildnick may not be NULL
Error: near line 26: players.guildnick may not be NULL
Error: near line 28: players.guildnick may not be NULL
Error: near line 30: players.guildnick may not be NULL
Error: near line 32: players.guildnick may not be NULL
Done!
2 Run otserv
:: OTServ Version 0.6.3_SVN
:: ============================================================================
::
:: Initializing the random numbers... [done]
:: Loading lua script config.lua... [done]
:: No datadir 'Data/', using a system-wide one
:: Using data directory /usr/local/share/otserv/Data/... [done]
:: Checking Database Connection... [done]
:: Checking Schema version...
Error: Your database is outdated. Run the dbupdate utility to update it to the latest schema version.
otserv: /usr/include/boost/thread/pthread/condition_variable_fwd.hpp:46: boost::condition_variable::~condition_variable(): Assertion `!pthread_mutex_destroy(&internal_mutex)' failed.
Aborted (core dumped)
An OnTimerEvent should be implemented that allows you to schedule timers, both repeating and non-repeating.
Proposed solution: Add a new queue to ScriptManager with <microtime, Listener_ptr>, check this at the same time as timer event and dispatch any that have run out. Register function should be registerTimerEvent(1000, handler [, repeating])
.
This happens when all the .o are compiled and you're about to link the main executable.
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/../../../../x86_64-pc-linux-gnu/bin/ld: CMakeFiles/otserv.dir/connection.cpp.o: undefined reference to symbol 'pthread_mutexattr_settype@@GLIBC_2.2.5' /lib64/libpthread.so.0: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status
function Actor.onLoadSpell(event)
--print("loading spell - " .. event.name)
local spell = nil
if event.configureSpell then
spell = Spell:new(event.name)
spell.aggressive = event.aggressive
spell.words = event.name
spell.damageType = event.damageType or COMBAT_FIREDAMAGE
damageType is always NIL so all damagetype will turn to the combat firedamage effect.
01:21:49 sarnold $ d33tah: wtf do lines 101, 102, 103 do??
01:24:31 sarnold $ d33tah: are you one of the maintainers of this codebase?
01:25:03 d33tah $ nope
01:25:06 sarnold $ damn
01:25:12 d33tah $ but i think i'll contact them
01:26:55 sarnold $ d33tah: please do, RSA::setKey() has multiple problems: (a) fails to close the file (b) delete on automatic arrays (htf does that even compile btw?) (c) no error checking on fgets()
$ (d) improper use of fgets() (see the bit about "fgets() reads in at most one less than size characters..." in the manpage)
The Market introduced in 9.x something is not supported in master. It should be ported from legacy.
Suggestion: set the default linking method to be dynamic instead. Static linking may be a wee bit faster during compile time, but it is not faster for execve() etc. during start-up of a statically linked executable when its size is over 120mb instead of 7mb when dynamically linked, which could also end up being the crucial difference that might allow people to host small worlds even on a very cheap VPS with only 256mb of RAM, as many of the involved libraries are already used by other applications.
Change to using lua 5.2 rather than 5.1.
Not a priority since as far as I know there are no tangible benefits at the moment.
legacy-dev should be branch of legacy not of master since we won't be merging master with legacy its completly diffrent.
"This branch is 12 commits ahead and 157 commits behind master."
When you kill a monster with summon for example lets say rat which has 5x experience. You set in exp_stages exp x100 so it means that for rat you should get 500exp that's correct without a summon.
But when you summon a monster and then kill rat you only get 400exp (200 summon 200 player).
When you for example kill cave rat which should give you 1000exp but when summon helps you you get for example 800+ 100 summon.
When summon helps you kill rat for example you get 100 exp and summon gets 100 exp simply varies (instead of total 500)
or when you kill cave rat with summon which should give you 1000 exp you get:
300 + 300 for summon .
So it's completly broken right now.
Keep in mind that I didn't used happy hours in this calculation.
Wiki:
Experience Gain
When killing a creature with a summon, you will only receive partial experience for the kill (minimum of 50%).
For example, if your summon causes all of the damage to kill a Rotworm, you will only receive 20 experience (half). If you personally deal some of the damage, you will receive more exp.
The formula for experience gain is:
player's exp gain + (summon's exp gain /2)
The player's experience gain is based on the player's damage.
Hi all!
I compiled OTServ and all right but when I run it and try to login with default sampleworlds.sql accounts (1,1) using the client (I have tested it with 8.70 client) I got a -1 Error(from Client). It actually displays the players name, but when I go with some of them, it does not connect. The Otserv outputs the next which is an error coming from the database schema used(I'm using Mysql):
...
:: Starting Server OTServ... [done]
:: OpenTibia Server Running...
mysql_real_query(): SELECT COUNT(*) AS count
FROM bans
WHERE type
= 1 AND ((16777343 & 4294967295 & param
) = (value
& param
& 4294967295)) AND active
= 1 AND (expires
>= 1386596187 OR expires
<= 0): MYSQL ERROR: Unknown column 'type' in 'where clause'
mysql_store_result(): SELECT COUNT(*) AS count
FROM bans
WHERE type
= 1 AND ((16777343 & 4294967295 & param
) = (value
& param
& 4294967295)) AND active
= 1 AND (expires
>= 1386596187 OR expires
<= 0): MYSQL ERROR: Unknown column 'type' in 'where clause'
I do not think the login problem is actually due to the errors display on the output above. I did also try to add the column type, param and value to the 'bans' table but login error still persists.
Thanks!
Regardless of what you set the IP parameter in config.lua to, and regardless of what you set it to in the worlds sql table, OTServ changes the value in the sql table to 16777343 (0x100007F) when starting up, and then ignores the IPs supplied and instead chooses to do a reverse lookup on... something... and then tries binding to whatever the DNS responds with.
I'm curious, which IP setting does it even try to use? The one in the config or the one in the worlds table?
(ps. despite the project being CMake'd there are a few things that I had to fix in order for it to configure and build properly under FreeBSD 8.3 / GCC 4.2.2 - I'll get back with the details in another issue ticket when I have time, in hopes that you will adapt so that people can host on more platforms.)
I get a bunch of errors when I try to compile this.
I've followed this tutorial https://otland.net/threads/compiling-simple-otserv-msvc-2010-linux-compiling-the-source.218342/
These are the errors:
1>c:\users\watchdog\documents\github\server\src\otsystem.h(51): fatal error C1083: Cannot open include file: 'sys/socket.h': No such file or directory
1> http_request.cpp
1> Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately. For example:
1> - add -D_WIN32_WINNT=0x0501 to the compiler command line; or
1> - add _WIN32_WINNT=0x0501 to your project's Preprocessor Definitions.
1> Assuming _WIN32_WINNT=0x0501 (i.e. Windows XP target).
1>c:\users\watchdog\documents\github\server\src\otsystem.h(51): fatal error C1083: Cannot open include file: 'sys/socket.h': No such file or directory
1> tasks.cpp
While moving with keyboard, you keep right clicking on map to move in the same direction (never stop pressing key arrows), your character like speed hack while doing it. It's like a map click speed hack where people use the ground when they walk.
Better described here http://otland.net/threads/speed-hacking.7418/
And here:
Ezzz-dev/OTHire#21
when we use this fix:
in Game::PlayerUseItem(...)
Under:
Thing* thing = internalGetThing(player, pos, stackPos, spriteId, STACKPOS_USEITEM);
add:
player->lastStepCost = 3;
It stops you when you right click using classic control and also there is a delay when you try to open backpack or body from far away.
Also you can't shoot runes while moving you have to stop for a sec to shoot sd for example.
I'm new here and I'd like to open the opentibia server code on XCode but I don't know where is the xcode file described in the project.
New master version (I think later than December 2012) is unable to compile on Debian 8
Scanning dependencies of target otserv
[ 1%] Building CXX object src/CMakeFiles/otserv.dir/thing.cpp.o
/home/fervi/Intinte/MMORPG/server-master/src/thing.cpp:20:19: fatal error: otpch.h: Nie ma takiego pliku ani katalogu
#include "otpch.h"
No such file - otpch.h
Hello I have released my gesior for OTServ here is it (fully functional including installation)
https://github.com/Pietia10/Gesior-for-OTServ
would be nice if it would be in official open tibia repository.
I compiled this source, all works ok, but when i try login: You need Tibia 8.7
bug? or no support 8.6 and 8.61
When I use option to create precompiled header there is error:
http://wklej.org/id/1417146/
Im not exactly sure how to fix it.
Well I think we should make player_depotitems binary just like map_store, because currently this is taking alot of HDD resources/CPU during save.
Is it dropped? I can still see Iryont committing in the code from otrevscriptsys, like what?
When you cast desintegrate and there is alot items in stack for example 200 the client gets disconnected cause of packet per second limit .
If you want a npc to sell a "vial of oil",
you can only see "vial" in the trade window.
It should state: "vial of oil".
It should be like this:
if item->subtype > 0 {
vial of oil
}
else{
vial
}
This piece of code in protocollogin.cpp (line 158) does not quite work as desired:
if (clientip == getIP() && character.world_id ==
(uint16_t)g_config.getNumber(ConfigManager::WORLD_ID))
clientip is set to getConnection()->getIP()
and the function getIP()
does the exact same thing. So if the world ID of the character matches the world ID of the (current) login server, this if statement is always true.
In this 'if':
https://github.com/opentibia/server/blob/master/src/database_driver.cpp#L144
You must add:
m_rows++;
or it will remove item/house items on save [there is a little change to remove 1 item - last 'row' of 'insert' query], because:
if(!execute())
2 lines above resets 'm_rows' and used everywhere is sources (ioplayer, iomapserialize):
if(!stmt.execute()){
does nothing, because 'm_rows' is 0.. but there is INSERT QUERY waiting to be send in 'm_buf'!
Implement bare-bone packet handlers for the additions from 8.7 .. 9.6. There is no need to actually implement the new functionality, this issue is just about being able to login without debugging.
Someone can tell me if revscriptsys have much bug ? How much stable is it compared on legacy code ?
01:20:54 mm_freak $ it might be a bug, because d isn't used at all
01:21:15 mm_freak $ the code uses optimized CRT operations using the d's residues modulo p - 1 and q - 1
01:21:38 mm_freak $ (the fact that it does it that way is not a bug)
01:22:54 mm_freak $ d33tah: 46730330223584118622160180015036832148732986808519344675210555262940258739805766860224610646919605860206328024326703361630109888417839241959507572247284807035235569619173792292786907845791904955103601652822519121908367187885509270025388641700821735345222087940578381210879116823013776808975766851829020659073
01:23:00 mm_freak $ this is the correct d
01:23:09 mm_freak $ this code is weird in many ways
01:23:11 mm_freak $ also it's insecure
01:23:32 mm_freak $ it has lots of side channels
Basically used a door house and this happened, at least any info about why is this happening would be okay.
(gdb) bt
#0 0x000000000046500c in Game::internalGetThing (this=this@entry=0x7bbf40, player=player@entry=0x7fff454f5c80, pos=..., index=index@entry=1, spriteId=spriteId@entry=1638, type=type@entry=STACKPOS_USEITEM) at game.cpp:555
#1 0x000000000046a1a4 in Game::playerUseItem (this=0x7bbf40, playerId=268460163, pos=..., stackPos=1 '\001', index=0 '\000', spriteId=1638) at game.cpp:2543
#2 0x00000000004a26d5 in operator() (this=0x1de11c8) at /usr/include/boost/function/function_template.hpp:760
#3 operator() (this=0x1de11c0) at tasks.h:44
#4 Dispatcher::dispatcherThread (p=0x7bbe80) at tasks.cpp:87
#5 0x00007ffff7e7c629 in boost::(anonymous namespace)::thread_proxy (param=) at libs/thread/src/pthread/thread.cpp:121
#6 0x00007ffff71e3b50 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#7 0x00007ffff642ee6d in clone () from /lib/x86_64-linux-gnu/libc.so.6
#8 0x0000000000000000 in ?? ()
Would be a nice addition to have this for OTServ as well, preferrably in a more configurable way than TFS - f.e. min/max lengths for account name and password set in config.lua instead of hard-coded values like TFS does. Hopefully also a less buggy manager than the one in TFS which craps out on a number of awkward scenarios.
how can i compile the source?
CMake seems to think that the default INCLUDE_DIR for Boost is /usr/local/include, while in FreeBSD the pkg'd headers are actually stored in /usr/local/include/boost.
The BSD flavors and the various Linuxes keep some of their common functions in different places. libdl does not exist in FreeBSD, so the dynamic linker functions such as dlopen(), dlclose() etc. are kept inside libc, and ftime() is kept inside libcompat - instead of adding "dl" to SERVER_LIBRARIES, make it add "c compat".
GCC 4.2 / FreeBSD does not have the -static-libstdc++ option (but it does have -static-libgcc).
I don't really know if this is a bug, but the damage calculation from the onDamage is not taking into the act if you last hit someone.
The damage value given in the event is not equal to the enemies last hp, its the actuall damage of the attack.
This are non existing number which i would assume be unbalacing certain ways.
Hey guys
Wiki is kind of outdated and it would be cool if someone took care of it. I did change compiling tutorials a bit but that's still not enough though.
I'm talking about revscriptsys2 0.7.0 (master), but if someone wants to write some tutorials for legacy and legacy-dev then he is free to do so.
fileloader.cpp:
reading = std::min(remain, m_cached_data[i].size - m_cache_offset);
reading = std::min< int32_t>(remain, m_cached_data[i].size - m_cache_offset); //works fine
msvc64 error:
1>....\src\fileloader.cpp(373): error C2784: '_Ty std::min(std::initializer_list<_Elem>,_Pr)' : could not deduce template argument for 'std::initializer_list<_Elem>' from 'unsigned long'
1> D:\Programas\Microsoft Visual Studio 12.0\VC\include\algorithm(4141) : see declaration of 'std::min'
1>....\src\fileloader.cpp(373): error C2780: 'const _Ty &std::min(const _Ty &,const _Ty &,_Pr)' : expects 3 arguments - 2 provided
1> D:\Programas\Microsoft Visual Studio 12.0\VC\include\algorithm(4134) : see declaration of 'std::min'
1>....\src\fileloader.cpp(373): error C2780: '_Ty std::min(std::initializer_list<_Elem>)' : expects 1 arguments - 2 provided
1> D:\Programas\Microsoft Visual Studio 12.0\VC\include\algorithm(4125) : see declaration of 'std::min'
1>....\src\fileloader.cpp(373): error C2782: 'const _Ty &std::min(const _Ty &,const _Ty &)' : template parameter '_Ty' is ambiguous
1> D:\Programas\Microsoft Visual Studio 12.0\VC\include\algorithm(4119) : see declaration of 'std::min'
Right now, every event spawns a new lua coroutine, which is then immediately destroyed if the handler does not call wait / listen or similar.
This is not ideal. A better solution would be to implement event-handler threads so that coroutines are reused. This would also make it possible to implement LuaJIT support.
Make use of the new database design for saving and loading.
I have already coded much of what is necessary, and will commit it once I'm able to.
Hello!
I have a little problem
To generate database we need to copy sql folder into tools. use gendb.sh and copy db.s3db to folder (copy to otserv binary file). But OTServ (binary) doesn't work with them.
Error: Database Connection Failed!
otserv: /usr/include/boost/thread/pthread/condition_variable_fwd.hpp:81: boost::condition_variable::~condition_variable(): Assertion `!ret' failed.
Something wrong with old database or what?
Thanks
Fervi
HI currently the monsters doesn't behave like in real Tibia , I remember that iryont have already fix for it mind to commit ?;>
1.Dancestep - the creatures attempts to step randomly (1 second interval between checks) to any open square (north, south, east, or west) that keeps the monster within range of the target. If the square is blocked or occupied then the monster stays still until the next check. If there is a player on screen, but no target is reachable then the monster will no longer be restricted by range and can step anywhere (n,s,e,w) on screen. Monsters will only dancestep if they are within their desired range of the target or if no target is reachable.
there is dancestep but its for sure not 1sec.
its way more.
2/Running Away/Escaping - if a creature is below it's runonhealth value it will no longer attack the target with melee, it will however still use any of it's other abilities
it is wrong in otserv.
it attacks with melee.
3.There is also walkback feature.(would be good if configurable by config.lua)
4.distance monsters should slow down when they are reached by player
luajit works well or is better to use lua?
~~
1>....\src\tools.cpp(211): error C2106: '=' : left operand must be l-value
1.These two is creating problems with instant ultimate healing rune curing paralyze in actions.cpp
player->setNextAction(OTSYS_TIME() + g_config.getNumber(ConfigManager::MIN_ACTIONEXTIME) + SCHEDULER_MINTICKS);
player->setNextAction(OTSYS_TIME() + g_config.getNumber(ConfigManager::MIN_ACTIONTIME) + SCHEDULER_MINTICKS);
You can set it under this to fix this
if(ret != RET_NOERROR){
player->sendCancelMessage(ret);
return false;
}
When you type /shutdown and gdb is on this happens:
Program terminated with signal SIGSEGV, Segmentation fault.
#0 malloc_consolidate (av=av@entry=0x7f9b64000020) at malloc.c:4151
4151 malloc.c: No such file or directory.
(gdb) bt
#0 malloc_consolidate (av=av@entry=0x7f9b64000020) at malloc.c:4151
#1 0x00007f9b6ed21691 in _int_free (av=0x7f9b64000020, p=,
have_lock=0) at malloc.c:4057
#2 0x00007f9b6ecdfbc9 in __run_exit_handlers (status=0,
listp=0x7f9b6f04b5a8 <__exit_funcs>,
run_list_atexit=run_list_atexit@entry=true) at exit.c:82
#3 0x00007f9b6ecdfc15 in __GI_exit (status=) at exit.c:104
#4 0x00007f9b6ecc9b4c in __libc_start_main (
main=0x416bc0 <main(int, char**)>, argc=4, argv=0x7fff109c3418,
init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>,
stack_end=0x7fff109c3408) at libc-start.c:321
#5 0x000000000041a900 in _start ()
How i can setup guild war ? Someone already have this system "working" ?
0.6.4 bugs here
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.