7ea6c46b2c
This is something I was always missing - posibbility to operate on binary files or streams in pure lua. In most cases we do only need to read simple variables from files such as integers with different amount of bytes. This "class" will provide that ability. It's a simple implementation of following C module for lua: http://www.inf.puc-rio.br/~roberto/struct/ It has much less, though. Following elements have been implemented: ">" flag to set mode to big endian. "<" flag to set mode to little endian. "b" a signed char. "B" an unsigned char. "h" a signed short (2 bytes). "H" an unsigned short (2 bytes). "i" a signed int (4 bytes). "I" an unsigned int (4 bytes). "l" a signed long (8 bytes). "L" an unsigned long (8 bytes). "s" a zero-terminated string. An example how to use it: ```lua local packed = Struct.pack('<LIhBsb', 123456789123456789, 123456789, -3200, 255, 'Test message', -1) -- packed is now a lua string we can save to file as binary data local L, I, h, B, s, b = Struct.unpack('<LIhBsb', packed) print(L, I, h, B, s, b) ``` You can use g_resources.readFileContents as function to read binary files and parse them via this class. |
||
---|---|---|
data | ||
mods | ||
modules | ||
src | ||
tools | ||
vc12 | ||
.gitattributes | ||
.gitignore | ||
.travis.yml | ||
AUTHORS | ||
BUGS | ||
CMakeLists.txt | ||
LICENSE | ||
README.md | ||
init.lua | ||
otclientrc.lua |
README.md
What is otclient?
Otclient is an alternative Tibia client for usage with otserv. It aims to be complete and flexible, for that it uses LUA scripting for all game interface functionality and configurations files with a syntax similar to CSS for the client interface design. Otclient works with a modular system, this means that each functionality is a separated module, giving the possibility to users modify and customize anything easily. Users can also create new mods and extend game interface for their own purposes. Otclient is written in C++2011, the upcoming C++ standard and heavily scripted in lua.
Where do I download?
The latest commits compiled for Windows can be found here.
Here is the latest v0.6.5 release compiled for both i686(32 bit) and x86_64(64 bit) machines, with OpenGL renderer. This release is compatible with protocols ranges from 7.60 up to 10.31.
NOTE: You will need to download spr/dat files on your own and place them in data/things/VERSION/
(i.e: data/things/1041/Tibia.spr
)
Older releases can be downloaded from here
Features
Beyond of it's flexibility with scripts, otclient comes with tons of other features that make possible the creation of new client side stuff in otserv that was not possible before. These include, sound system, graphics effects with shaders, modules/addons system, animated textures, styleable user interface, transparency, multi language, in game lua terminal, an OpenGL 1.1/2.0 ES engine that make possible to port to mobile platforms. Otclient is also flexible enough to create tibia tools like map editors just using scripts, because it wasn't designed to be just a client, instead otclient was designed to be a combination of a framework and tibia APIs.
Compiling
A package with all required libraries for compiling OTClient on Windows can be found here:
In short, if you need to compile OTClient, follow these tutorials:
Need help?
Try to ask questions in otland, now we have a board for the project there, or talk with us at #otclient irc.freenode.net
Bugs
Have found a bug? Please create an issue in our bug tracker
Contributing
We encourage you to contribute to otclient! You can make pull requests of any improvement in our github page, alternatively, see Contributing Wiki Page.
Contact
Talk directly with us at #otclient irc.freenode.net or send an email directly to the project leader edub4rt@gmail.com
License
Otclient is made available under the MIT License, thus this means that you are free to do whatever you want, commercial, non-commercial, closed or open.