Thread: Zone.exe Crash
View Single Post
  #11  
Old 09-11-2016, 09:08 PM
whiteknight33
Sarnak
 
Join Date: Aug 2016
Location: Ohio
Posts: 69
Default

Quote:
Originally Posted by Uleat View Post
I did find the ref at: https://github.com/EQEmu/Server/blob..._base.cpp#L869

..and it does appear to be correct.


You don't appear to have any views in place..much less the proper ones.

And since those are missing, you're probably missing the functions as well.


I hate giving manual instructions because of the many nuances involved..and they're not things easily scripted...

But, assuming that everything else is up-to-date..you can try running this: http://wiki.eqemulator.org/i?Module=...Paste=V9CISaf7
I tried the copy and paste method and this is what it gave me:

Code:
MariaDB [peq]> DROP VIEW IF EXISTS `vwbotcharactermobs`;
Query OK, 0 rows affected, 1 warning (0.00 sec)

MariaDB [peq]> DROP VIEW IF EXISTS `vwbotgroups`;
Query OK, 0 rows affected, 1 warning (0.00 sec)

MariaDB [peq]> DROP VIEW IF EXISTS `vwgroups`;
Query OK, 0 rows affected, 1 warning (0.00 sec)

MariaDB [peq]> DROP VIEW IF EXISTS `vwguildmembers`;
Query OK, 0 rows affected, 1 warning (0.00 sec)

MariaDB [peq]>
MariaDB [peq]> DROP VIEW IF EXISTS `vwBotCharacterMobs`;
Query OK, 0 rows affected, 1 warning (0.00 sec)

MariaDB [peq]> DROP VIEW IF EXISTS `vwBotGroups`;
Query OK, 0 rows affected, 1 warning (0.00 sec)

MariaDB [peq]> DROP VIEW IF EXISTS `vwGroups`;
Query OK, 0 rows affected, 1 warning (0.00 sec)

MariaDB [peq]> DROP VIEW IF EXISTS `vwGuildMembers`;
Query OK, 0 rows affected, 1 warning (0.00 sec)

MariaDB [peq]>
MariaDB [peq]> DROP VIEW IF EXISTS `vw_bot_character_mobs`;
Query OK, 0 rows affected, 1 warning (0.00 sec)

MariaDB [peq]> DROP VIEW IF EXISTS `vw_bot_groups`;
Query OK, 0 rows affected, 1 warning (0.00 sec)

MariaDB [peq]> DROP VIEW IF EXISTS `vw_groups`;
Query OK, 0 rows affected, 1 warning (0.00 sec)

MariaDB [peq]> DROP VIEW IF EXISTS `vw_guild_members`;
Query OK, 0 rows affected, 1 warning (0.00 sec)

MariaDB [peq]>
MariaDB [peq]> DROP FUNCTION IF EXISTS `GetMobType`;
Query OK, 0 rows affected, 1 warning (0.00 sec)

MariaDB [peq]> DROP FUNCTION IF EXISTS `GetMobTypeByName`;
Query OK, 0 rows affected, 1 warning (0.00 sec)

MariaDB [peq]> DROP FUNCTION IF EXISTS `GetMobTypeByID`;
Query OK, 0 rows affected, 1 warning (0.00 sec)

MariaDB [peq]>
MariaDB [peq]>
MariaDB [peq]> DELIMITER $$
MariaDB [peq]>
MariaDB [peq]> CREATE FUNCTION `GetMobType` (mob_name VARCHAR(64)) RETURNS CHAR(1)
    -> BEGIN
    -> DECLARE Result CHAR(1);
    ->
    -> SET Result = NULL;
    ->
    -> IF ((SELECT COUNT(*) FROM `character_data` WHERE `name` = mob_name) > 0) THEN
    -> SET Result = 'C';
    -> ELSEIF ((SELECT COUNT(*) FROM `bot_data` WHERE `name` = mob_name) > 0) THEN
    -> SET Result = 'B';
    -> END IF;
    ->
    -> RETURN Result;
    -> END$$
Query OK, 0 rows affected (0.00 sec)

MariaDB [peq]>
MariaDB [peq]> CREATE FUNCTION `GetMobTypeById` (mob_id INTEGER UNSIGNED) RETURNS CHAR(1)
    -> BEGIN
    -> DECLARE Result CHAR(1);
    ->
    -> SET Result = NULL;
    ->
    -> IF ((select `id` from `character_data` where `id` = mob_id) > 0) THEN
    -> SET Result = 'C';
    -> ELSEIF ((select `bot_id` from `bot_data` where `bot_id` = mob_id) > 0) THEN
    -> SET Result = 'B';
    -> END IF;
    ->
    -> RETURN Result;
    -> END$$
Query OK, 0 rows affected (0.00 sec)

MariaDB [peq]>
MariaDB [peq]> DELIMITER ;
MariaDB [peq]>
MariaDB [peq]>
MariaDB [peq]> CREATE VIEW `vw_bot_character_mobs` AS
    -> SELECT
    -> _utf8'C' AS mob_type,
    -> c.`id`,
    -> c.`name`,
    -> c.`class`,
    -> c.`level`,
    -> c.`last_login`,
    -> c.`zone_id`
    -> FROM `character_data` AS c
    -> UNION ALL
    -> SELECT _utf8'B' AS mob_type,
    -> b.`bot_id` AS id,
    -> b.`name`,
    -> b.`class`,
    -> b.`level`,
    -> b.`last_spawn` AS last_login,
    -> b.`zone_id`
    -> FROM `bot_data` AS b;
Query OK, 0 rows affected (0.02 sec)

MariaDB [peq]>
MariaDB [peq]> CREATE VIEW `vw_bot_groups` AS
    -> SELECT
    -> g.`groups_index`,
    -> g.`group_name`,
    -> g.`group_leader_id`,
    -> b.`name` AS group_leader_name,
    -> b.`owner_id`,
    -> c.`name` AS owner_name
    -> FROM `bot_groups` AS g
    -> JOIN `bot_data` AS b ON g.`group_leader_id` = b.`bot_id`
    -> JOIN `character_data` AS c ON b.`owner_id` = c.`id`
    -> ORDER BY b.`owner_id`, g.`group_name`;
ERROR 1146 (42S02): Table 'peq.bot_groups' doesn't exist
MariaDB [peq]>
MariaDB [peq]> CREATE VIEW `vw_groups` AS
    -> SELECT
    -> g.`groupid` AS group_id,
    -> GetMobType(g.`name`) AS mob_type,
    -> g.`name` AS name,
    -> g.`charid` AS mob_id,
    -> IFNULL(c.`level`, b.`level`) AS level
    -> FROM `group_id` AS g
    -> LEFT JOIN `character_data` AS c ON g.`name` = c.`name`
    -> LEFT JOIN `bot_data` AS b ON g.`name` = b.`name`;
Query OK, 0 rows affected (0.01 sec)

MariaDB [peq]>
MariaDB [peq]> CREATE VIEW `vw_guild_members` AS
    -> SELECT
    -> 'C' AS mob_type,
    -> cm.`char_id`,
    -> cm.`guild_id`,
    -> cm.`rank`,
    -> cm.`tribute_enable`,
    -> cm.`total_tribute`,
    -> cm.`last_tribute`,
    -> cm.`banker`,
    -> cm.`public_note`,
    -> cm.`alt`
    -> FROM `guild_members` AS cm
    -> UNION ALL
    -> SELECT
    -> 'B' AS mob_type,
    -> bm.`bot_id` AS char_id,
    -> bm.`guild_id`,
    -> bm.`rank`,
    -> bm.`tribute_enable`,
    -> bm.`total_tribute`,
    -> bm.`last_tribute`,
    -> bm.`banker`,
    -> bm.`public_note`,
    -> bm.`alt`
    -> FROM `bot_guild_members` AS bm;
ERROR 1146 (42S02): Table 'peq.bot_guild_members' doesn't exist
Reply With Quote