Files
mod-playerbots/data/sql
Keleborn 9917863ca1 Feat. Add Fishing action and fish with master. (#1433)
### Update :Thank you to @notOrrytrout from prompting me to work on
this. Its been a huge learning experience.

With @notOrrytrout I started working on enabling bot fishing with
master, but also on their own.
The first commit didnt crash, showing that it was possible to have a bot
cast when master does. Currently it compiles but crashes when you try to
fish with a bot in the group, whether the bot has fishing or not. It
makes me think that the check in FishingValues is broken somehow, but I
cant figure out how.

---------

Co-authored-by: bash <31279994+hermensbas@users.noreply.github.com>
2025-12-27 19:50:18 +01:00
..
2025-09-19 22:43:50 +02:00

NEW MODULE - SQL BEST PRACTICES

Create a new table

Example:

CREATE TABLE IF NOT EXISTS `table`(
  `id` int(11) unsigned NOT NULL,
  `column` smallint(6) unsigned,
  `active` BOOLEAN DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

Boolean datatype in mysql: Use TinyInt(1) or Boolean (this is the same thing)

bit(1) can also work, but it may require a syntax like b'(0) and b'(1) when inserting (not sure).

If there are multiple booleans in the same table, bit(1) is better, otherwise it's the same result.

Rules

  • Use InnoDB as engine for dynamic tables (most likely in the auth and characters databases).
  • Use MyISAM for read-only tables (in world database), but if you're not sure, just use innoDB.
  • Use utf8 as charset.

Resources

https://www.w3schools.com/sql/sql_datatypes.asp