Znote / POTCP

(P)HP (O)pen (T)ibia (C)lient (P)rotocol
MIT License
9 stars 6 forks source link

Read Map packets (tiles, items) #6

Open Znote opened 5 years ago

Znote commented 5 years ago

https://github.com/otland/forgottenserver/tree/master/data/items

Parse map packet. So the server uses items.otb as some sort of dictionary to figure out what id to send to the client, and the client then, using that id figures out what to load from the dat file. Which is why we call it a dat editor when someone wants to peek into client tile graphics.

For now, we should be able to parse map packets, identify first map packet as a signal that we are connected and can do stuff in-game. (Right now we sleep for 100ms and hope the server is ready to accept our packets).

Perhaps we can reverse lookup the id from the server with items.otb to retrieve the itemid from items.xml?

items.otb, every 2 lines seems to contain an item object of sorts? image

If we could get this value back to an itemid it would be awesome, and we could already begin to play with a rudamentary UI for loading the screen using an image server such as this: http://items.znote.eu/

http://items.znote.eu/1003.gif image

Without having to deal with the way the client renders spr/dat files.

Znote commented 5 years ago

bool Items::loadFromOtb(const std::string& file)

Marks thoughts on otb: https://github.com/otland/forgottenserver/issues/1085#issuecomment-65853403

It connects server ids to client ids in an unobtrusive way.

Znote commented 5 years ago

SharpMapTracker read and parse Tibia packets to extract map information, and it saves the extracted map as a OpenTibia map (OTBM).

https://github.com/Znote/sharpmaptracker