Skip to content

Commit

Permalink
[Enhancement] Rework on items to extinquish OTB file and use client 1…
Browse files Browse the repository at this point in the history
…2 protobuf instead (#204)

Description
We are using the OTB system for a really long time on OT community, but since Canary is heading to another path like using one single id (ClientID) for map/server/client, i'm propousing to follow Tibia updates more closely.

Just like cip did on the client (Same is happening on OTC), i think we can forget about using the jurassic Tibia.dat, Tibia.spr and items.otb and use Google Protobuf: https://github.com/protocolbuffers/protobuf. To deal with items updates without the need of any third partner tools like item editor and client converter.

Using Tibia protobuf files instead of our old .otb file looks like to me the best approach to keep the repository most updated as possible since, with this changes, we can just simple copy the 'appearances-XXXXXXXXX.dat' file from the client's /assets/ folder, rename it to 'appearances.dat' and paste on "/data/items/" on the server and then boom, it's already up-to-date.

Also, this commit include some changes on source to clean the unnused/useless tags and functions that was used on the old serverID/clientID system but are now deprecated.

This commit changes does not include client protocol messages updates, only items and a few more data.

Benefits:
- Fast and easy updates.
- Auto-insert items without the need to register on XML file and with some basic data like: "name", "description", "slot position", "loot type", "item tier upgrade", "podium" and all data from old "OTB" file.
- Opens the possibilities to (finally) insert new features like party hunt analyzer, adquire global position for NPCs on the global map with all item prices included, etc.
- Prevent errors and crashes related to wrong "lookType", "const_me" and "const_ani" effects.

Tests
Tested and working with no problem so far. But keep in mind that the OTBR Datapack is not ready for this PR yet. If the idea is approved (the idea, not the PR), i will open a similar PR on OTBR datapack to make it compatible with the changes here.

Map changes
 The map changes was necessary due to some invalid (garbage) items on the map. Does not affect anything at all since they were invisibly, untouchable and unnecessary.

Protofile
Protofile was added on "/src/protobuf/" directory.

Compiling windows (vcpkg)
[x86] ./vcpkg install protobuf:x86-windows protobuf[zlib]:x86-windows --recurse
[x64] ./vcpkg install protobuf:x64-windows protobuf[zlib]:x64-windows --recurse

Compiling windows Ubuntu/Debian (apt)
apt-get install libprotobuf-dev protobuf-compiler

Issues and chat
Any problem that you have on compiling or have anything you want to change on it you can use the discord: https://github.com/opentibiabr/canary/blob/4580324c18a69289db7ba346f04eec2d30188136/README.md?plain=1#L3
  • Loading branch information
marcosvf132 authored Apr 27, 2022
1 parent 4580324 commit 68d0475
Show file tree
Hide file tree
Showing 60 changed files with 21,648 additions and 5,566 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ endif()
set(VCPKG_FEATURE_FLAGS "versions")
set(VCPKG_BUILD_TYPE "release")


# *****************************************************************************
# Project canary
# *****************************************************************************
Expand Down Expand Up @@ -83,4 +82,5 @@ endif()
# *****************************************************************************
# Add project
# *****************************************************************************
add_subdirectory(src/protobuf)
add_subdirectory(src)
10 changes: 5 additions & 5 deletions config.lua.dist
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ loginProtocolPort = 7171
gameProtocolPort = 7172
statusProtocolPort = 7171
maxPlayers = 0
motd = "Bem vindo ao Canary!"
motd = "Welcome to the Canary!"
onePlayerOnlinePerAccount = true
allowClones = false
serverName = "Canary"
Expand Down Expand Up @@ -156,7 +156,7 @@ pushWhenAttacking = false
-- NOTE: set mapName WITHOUT .otbm at the end
-- NOTE: unzip the map world.rar
mapName = "canary"
mapAuthor = "Eduardo Dantas"
mapAuthor = "OpenTibiaBR"

-- Party List limitations
-- max distance in which players in party list are visible
Expand Down Expand Up @@ -197,7 +197,7 @@ coinImagesURL = "http://127.0.0.1/images/store/"
classicAttackSpeed = false
showScriptsLogInConsole = false

-- Server Save
-- Global server Save
-- NOTE: globalServerSaveNotifyDuration in minutes
globalServerSaveNotifyMessage = true
globalServerSaveNotifyDuration = 5
Expand Down Expand Up @@ -260,8 +260,8 @@ startupDatabaseOptimization = true

-- Status server information
ownerName = "OpenTibiaBR"
ownerEmail = ""
url = "https://github.com/opentibiabr/canary"
ownerEmail = "[email protected]"
url = "http://docs.opentibiabr.org/"
location = "South America"

-- Sends Discord webhook notifications on startup, raids and shutdown.
Expand Down
3 changes: 3 additions & 0 deletions data/XML/mounts.xml
Original file line number Diff line number Diff line change
Expand Up @@ -194,4 +194,7 @@
<mount id="192" clientid="1454" name="Mystic Raven" speed="20" premium="no" type="store" />
<mount id="193" clientid="1455" name="Radiant Raven" speed="20" premium="no" type="store" />
<mount id="194" clientid="1459" name="Gloothomotive" speed="20" premium="yes" type="store" />
<mount id="195" clientid="1491" name="Topaz Shrine" speed="20" premium="no" type="store" />
<mount id="196" clientid="1492" name="Jade Shrine" speed="20" premium="no" type="store" />
<mount id="197" clientid="1493" name="Obsidian Shrine" speed="20" premium="no" type="store" />
</mounts>
2 changes: 2 additions & 0 deletions data/XML/outfits.xml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
<outfit type="0" looktype="1456" name="Royal Costume" premium="no" unlocked="no" enabled="yes" from="store" />
<outfit type="0" looktype="1461" name="Formal Dress" premium="yes" unlocked="no" enabled="yes" from="store" />
<outfit type="0" looktype="1490" name="Ghost Blade" premium="yes" unlocked="no" enabled="yes" from="store" />
<outfit type="0" looktype="1501" name="Nordic Chieftain" premium="yes" unlocked="no" enabled="yes" from="store" />

<!-- Male outfits -->
<outfit type="1" looktype="128" name="Citizen" premium="no" unlocked="yes" enabled="yes" />
Expand Down Expand Up @@ -213,4 +214,5 @@
<outfit type="1" looktype="1457" name="Royal Costume" premium="no" unlocked="no" enabled="yes" from="store" />
<outfit type="1" looktype="1460" name="Formal Dress" premium="yes" unlocked="no" enabled="yes" from="store" />
<outfit type="1" looktype="1489" name="Ghost Blade" premium="yes" unlocked="no" enabled="yes" from="store" />
<outfit type="1" looktype="1500" name="Nordic Chieftain" premium="yes" unlocked="no" enabled="yes" from="store" />
</outfits>
Binary file added data/items/appearances.dat
Binary file not shown.
Binary file removed data/items/items.otb
Binary file not shown.
Loading

0 comments on commit 68d0475

Please sign in to comment.