Deprecated: The behavior of unparenthesized expressions containing both '.' and '+'/'-' will change in PHP 8: '+'/'-' will take a higher precedence in /home/iano/public_html/tpforums-vb5/forum/includes/class_core.php on line 5842

PHP Warning: Use of undefined constant MYSQL_NUM - assumed 'MYSQL_NUM' (this will throw an Error in a future version of PHP) in ..../includes/init.php on line 165

PHP Warning: Use of undefined constant MYSQL_ASSOC - assumed 'MYSQL_ASSOC' (this will throw an Error in a future version of PHP) in ..../includes/init.php on line 165

PHP Warning: Use of undefined constant MYSQL_BOTH - assumed 'MYSQL_BOTH' (this will throw an Error in a future version of PHP) in ..../includes/init.php on line 165

PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in ..../includes/functions_navigation.php on line 588

PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in ..../includes/functions_navigation.php on line 612

PHP Warning: Use of undefined constant archive_postsperpage - assumed 'archive_postsperpage' (this will throw an Error in a future version of PHP) in ..../archive/index.php on line 456
[Java] Tibia server [Archive] - Forums

PDA

View Full Version : [Java] Tibia server



haha669
11-13-2013, 11:49 AM
Hi,

I'm studying Java and now I'm trying to make a Tibia server (with java, of course) for 8.6 protocol. I created a socket at port 7171 to receive login connections and I receive a packet but now I don't know how to 'treat' that packet (I don't have any knowledge about packets).
Anyone can give me a clue?


P.S: sorry for bad english.

Farsa
11-13-2013, 12:14 PM
Take a look at TibiaAPI's main trunk source code or, even better, Open Tibia's source code if you don't mind the GPL license.

haha669
11-13-2013, 12:34 PM
I've downloaded TibiaAPI, SharpOT and jOts sources, I'll take a look at home.

Thanks.

Devil
11-15-2013, 01:56 AM
(Just my opinion)
If your project grow, please, don't fucking use XML for some configuration, neither .otb for items properties neither .otbm for map like TFS do...
My tips:
- Pure lua files for all configuration files and event scripts
- Items.xml/Items.otb in a single file (but as a big lua table <3)
- Maps instead of otbm, would use .lua extension, so minor changes could be edited in notepad or a simple editor instead of Remere's Map Editor... (And it would be easier to make custom map editors compatible)
- Shared lua state in default configuration: all lua variables could be read/write in any file... Actually you cannot change any variable in libs

DarkstaR
11-15-2013, 02:11 PM
(Just my opinion)
If your project grow, please, don't fucking use XML for some configuration, neither .otb for items properties neither .otbm for map like TFS do...
My tips:
- Pure lua files for all configuration files and event scripts
- Items.xml/Items.otb in a single file (but as a big lua table <3)
- Maps instead of otbm, would use .lua extension, so minor changes could be edited in notepad or a simple editor instead of Remere's Map Editor... (And it would be easier to make custom map editors compatible)
- Shared lua state in default configuration: all lua variables could be read/write in any file... Actually you cannot change any variable in libs


You are really really oblivious to space requirements, aren't you? Do you realize how much space a lua map would take up if it were saved in a way that was easily editable? Do you know how hard it would be to edit if it were saved efficiently? Do you have any clue why OT stopped using XML to store map files? You're insane.


Go look at the OTBM structure, it saves the map in blocks of 256x256 where the first bytes are the x,y,z location of the block and then it has a mandatory 65535 (255 * 255) tiles after it, their positions being relative to the block they are a part of. Doing this in Lua would mean have maps harder to edit by hand than they are by editor. Not doing this would make the map files huge. Either way, your purpose is defeated, especially since lua, in every implementation I've seen, is limited to a 1GB heap.

haha669
11-16-2013, 12:38 PM
I want to make a "multi map" system, so you can have many maps as you want and the server will load all files itself, and I won't use LUA.
I'll do a 'base' server (a .jar) with all the necessary things such as functions and packet things, then there will be another 'engine' to scripts and this scripts will be written in java because With java you will be able to do same or better scripts than lua.

I think I'll drop this project because I'm newbie in java and I can't manage the basic of server (login, for example).

Devil
11-18-2013, 03:16 AM
I though .OTBM were easier Darkstar. How do you discovered the map format ?
But I still think my other sugestions would be amazing for OTservers

jo3bingham
11-18-2013, 04:55 AM
But I still think my other sugestions would be amazing for OTservers
Good luck with that statement. I once suggested updating the items.xml file so that the IDs in that file matched the actual IDs in client. For example, gold coin ID is 3031, but in items.xml it's 2148. I wanted to change it so that the ID of gold coin in items.xml was also 3031. I even offered to make these changes myself in the items.xml file and the TFS source. Everyone on the TFS team I talked to supported the idea, but Talaturen(sp?) disagreed. He ripped me a new one about how I only wanted to do that to make updating ""my" map tracker easier" (which makes no sense), and that he would never let those changes happen to his code.

Nabb
11-18-2013, 10:06 AM
Talaturen loves his code too much to let anyone touch it. As you probably know he is developing his own verision of TFS (can't really recall the name, it was different version number at least). And he is very stubborn, while in actuality he is the most childish person I've ever met and writes like a 12 year old kid in private conversations.

Anyway I suppose the reason of having items.xml is to allow easy edit of the things that are usually needed to be edited. Even though I support shared Lua script, it's not good for all the newbies out there that will have all their variables conflicting each other. But that's good I guess, get rid of the leechers :p

Devil
11-18-2013, 01:28 PM
The new Talaturen's project is open source, closed or private ?

DarkstaR
11-18-2013, 02:35 PM
Talaturen is a retard. And it's not even his code, he ripped off OTServ and called it his.

haha669
11-20-2013, 08:45 AM
The new distro of Tala its TFS 1.0.
https://github.com/otland/forgottenserver