Skip to content

Inconcessus/html5-tibia-engine

Repository files navigation

Forby HTML5 Open Tibia Server

Example

Visit https://inconcessus.nl for an example server & client. The client software can be found here.

Installation

The server runs on NodeJS and is lightweight. It requires only two NPM modules that can be installed using npm install. The client directory needs to be hosted and accessible over HTTP e.g., cd client; python3 -m http.server. It does not have to be Python but can also be done using Node, NGINX or Apache, or even GitHub pages.

Running

The server can be started by running node engine.js. The login server can be started by running node login.js. The IPC client can be started using node ipcclient.js.

Server Engine

This is the main engine for the server. It runs over the WebSocket protocol and required a valid login token from the login server to upgrade HTTP connections to the WebSocket protocol.

Login Server

The login server is responsible for creating and managing player accounts. If the player succesfully logs in with a valid account number and password an SHA256-HMAC token is returned including a pointer to the data to load. This token is automatically passed to the gameserver by the game client and has its signature verified. The verification is done by a shared secret in the configuration file.

IPC Client

Windows named pipes and Unix domain sockets are used to communicate with the gameserver locally. For example for getting the number of players online, broadcasting a message, or shutting down the server. The IPC client is exposed through an HTTP API (node ipcclient.js). In config.json the HTTP API will be exposed on the configured host/port. The socket represents the name of the Unix Domain Socket or Named Pipe (windows) and is arbitrary.

"IPC": {
  "HOST": "0.0.0.0",
  "PORT": 2000,
  "SOCKET": "game.sock"
}

Example calls to the HTTP API:

http://127.0.0.1:2000/status # Returns the status of the server
http://127.0.0.1:2000/shutdown?seconds=10 # Shuts the server down gracefully after 10 seconds
http://127.0.0.1:2000/broadcast?message=hello # Broadcast a message to all players

Additional paths and methods should be implemented in src/ipchttpapi.js. The IPC packets constructed by the API should be handled by the gameserver too in src/ipcsocket.js.

Completed Features

  • Support for Tibia versions:

    • 740
    • 1098
  • Damage types (e.g., physical, fire, energy)

  • Necklaces

  • Guilds

  • Trade system

  • Skill advancing

  • Mailboxes for sending parcels and letters

  • Mailbox for receiving items either in inventory or depot

  • Keyring (container) that automatically opens doors with available keys

  • Player houses (preliminary)

  • Tibia walking speed handling

  • Books and writeables

  • Client auto-scaling screen window & support for fixed resolutions

  • Anti-aliasing feature

  • Doors of expertise

  • Doors against unwanted intruders

  • Depot

  • Programmable action events

  • Programmable unique events

  • World clock

  • Friendlist

  • Chats

    • Default chat
    • Global chats
    • Private chats
  • Changeable outfits

  • Lighting (e.g., dark in underground or arbitrary RGBA)

  • Support for different world zones (e.g., "Now entering Borne")

  • Weather effects (e.g., clouds)

  • Regeneration (Default or modified; e.g., Life Ring, Ring of Healing)

  • Experience and leveling

  • Spells and spellbook

    • Learn new spells
    • Spells with cooldowns
    • Spell hotbar with key shortcuts
  • Conditions (e.g., Poision, Burning, Electrified, Drunk, Healing)

  • Drunk Suppression (e.g., Dwarven Ring)

  • Invisibility

  • Distance weapons

  • Runes

  • Ground walking speed

  • Client auto-walk (Within visible chunks)

  • Protection Zones

  • Monsters

    • A* Pathfinding
    • Targeting
    • Loot
    • Spells
    • Attacks
    • Sounds
    • Behaviour
      • Open doors
      • Different behaviours (e.g., flee on attack, neutral, hostile, hostile on attack)
      • Kill weaker creatures
      • Push or destroy items
  • NPCs

    • Talk actions
    • Trades
    • Cutscenes
    • World time sensitive behaviour (e.g., move indoors at night)
  • Vocations

  • PvP

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published