Jump to content
TrinityCore

[CPP] Custom Boss in custom instance sometimes crashes the Server on pull


Lenzork
 Share

Recommended Posts

Hey everyone!

I've starting with scripting on a Trinitycore Server and now i'm facing a little bit of a Problem. I've created a custom boss and sometimes when you attack the boss, the whole server crashes and sometimes it doesn't - other than that he works completely fine. So it's just the Problem, that sometimes the Server crashes on pulling him. So i think it has something to do with the Initialize i believe?
The Boss is on a custom instance map.

This is my first Boss script so i'm sorry when it's a bit messy.

Open the Spoiler for more Informations and the Script of the Boss:

Pastebin - Lord Krazu Script *CLICK*

Other Informations to the Boss:

Lord Krazu: Entry = 80000 [SQL]

Azaloth (Add): Entry = 80002 [SQL]

Galvanoth (Add): Entry = 80003 [SQL]

I did the debug thingy where you get a backtrace log and now i don't know about the next Steps. I'll upload the backtrace log here.
It seems to have something to do with the Map i guess because of the bool IsInWorld() const { return m_inWorld; } error in the Object.h File?

Also all of the Files are owned by the Lenzork User on the Server and i'm logged in as the Lenzork user when running the Server.
I've heared that you should never run the Server as root.

I hope to find some help here.

backtrace_2021-06-27-17_09_08.log

Edited by Lenzork
Link to comment
Share on other sites

There are a lot of things that could have been written better or different, but without trying to compile this myself, there is something that really bothers me and i would say this could potentially result in your crash:

image.png.c7332e835c73705dfd419f7a46922de2.png

You spamforce the boss an attackorder here on every update diff.

The more i think about this, the more i wonder where he even gets "target" from in this case? That should not even compile.

 

In general, there is a pretty basic and simple pattern you can follow in UpdateAI:

 

 

    void UpdateAI(uint32 diffoverride
    {
        if (!UpdateVictim())
            return;
 
        events.Update(diff);
 
        if (me->HasUnitState(UNIT_STATE_CASTING))
            return;
 
        while (uint32 eventId = events.ExecuteEvent())
        {
            switch (eventId)
            {
                case EVENT_NAME:
                         stuff that should happen;
                         break;
                default:
                    break;
            }
 
            if (me->HasUnitState(UNIT_STATE_CASTING))
                return;
        }
 
        DoMeleeAttackIfReady();
    }

 

 

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By xgamerninjax
      Hello all, first time posting here and it's really got me scratching my head.
      I've compiled everything on my own computer, and then transferred everything to a host computer so the server can stay live. The server was running fine for a month or so and then suddenly it just crashes when it hits "Loading C++ scripts", exiting saying "caught signal 22"
      I tried setting up the host computer from scratch and transferred everything over fresh and it's still happening for some reason. (Note, I can run the server perfectly on my personal pc where I compiled it.)
      Any help would be greatly appreciated, thanks!
      3d7e3a40e2b3+_worldserver.exe_[1-4_15-19-45].dmp 3d7e3a40e2b3+_worldserver.exe_[1-4_15-19-45].txt
    • By Deer_Hunter
      Hello all,
      I just updated from the latest Git 
      Trinity Core REV. ac6baa547376 + 2020-02-21  3.3.5 Branch.
      I'm getting this error after crash.
      Problem signature:
        Problem Event Name:    APPCRASH
        Application Name:    worldserver.exe
        Application Version:    0.0.0.0
        Application Timestamp:    5e50a462
        Fault Module Name:    StackHash_f12f
        Fault Module Version:    6.3.9600.19629
        Fault Module Timestamp:    5e2fdc0d
        Exception Code:    c0000374
        Exception Offset:    PCH_9E_FROM_ntdll+0x0000000000090D0A
        OS Version:    6.3.9600.2.0.0.272.7
        Locale ID:    1033
        Additional Information 1:    f12f
        Additional Information 2:    f12f0934d3e965f73c68e60f20f2cd40
        Additional Information 3:    7595
        Additional Information 4:    7595e4d8d703db9dcd3d2f6ea540e357
      the exception code says its a Heap error,  I'm not sure how to troubleshoot this.
      Thanks
    • By Elvis
      when i excute worldserver.exe after config and import the database, the app crash and print the error log: ERROR 1054 (42S22) at line 21: Unknown column 'OptionID' in 'field list'.
      my configuration is like this:
      when i create the database, "my create_mysql.sql" is as follows:
       
      GRANT USAGE ON * . * TO 'root'@'localhost' IDENTIFIED BY '123456' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 ;
      CREATE DATABASE `world` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
      CREATE DATABASE `characters` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
      CREATE DATABASE `auth` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
      GRANT ALL PRIVILEGES ON `world` . * TO 'root'@'localhost' WITH GRANT OPTION;
      GRANT ALL PRIVILEGES ON `characters` . * TO 'root'@'localhost' WITH GRANT OPTION;
      GRANT ALL PRIVILEGES ON `auth` . * TO 'root'@'localhost' WITH GRANT OPTION;
       
      the authserver.conf is as follows:
      LoginDatabaseInfo = "127.0.0.1;3306;root;123456;auth"
       
      the worldserver.conf is as follows:
      LoginDatabaseInfo     = "127.0.0.1;3306;root;123456;auth"
      WorldDatabaseInfo     = "127.0.0.1;3306;root;123456;world"
      CharacterDatabaseInfo = "127.0.0.1;3306;root;123456;characters"
       
      in the code, the red word 'root' is 'trinity' originally, the red word '123456' is also 'trinity' originally.
      and  after i excute the worldserver.exe,  the app print error log ang crash.
      the results of worldserver.exe and authserver.exe is shown in the picture.
       


    • By labaouici
      Hello, when I try to start my realm I got this
      Loading Warden Action Overrides...
      Deleting expired bans...
      Calculate next daily quest reset time...
      Calculate next weekly quest reset time...
      Calculate next monthly quest reset time...
      Calculate random battleground reset time...
      Calculate guild limitation(s) reset time...
      World initialized in 0 minutes 15 seconds
      TC>TC>Couldn't bind to 127.0.0.1:7878
      /home/Lici/ElunaTrinityWotlk/src/server/shared/Networking/SocketMgr.h:35 in ~SocketMgr ASSERTION FAILED:
        !_threads && !_acceptor && !_threadCount StopNetwork must be called prior to SocketMgr destruction
      Segmentation fault
       
      But I don't know why, I just change a line in ObjectMgr.cpp : itemTemplate.ItemStat.ItemStatValue = int32(fields[29 + i*2].GetInt16());
      to itemTemplate.ItemStat.ItemStatValue = int32(fields[29 + i*2].GetInt32());
    • By blkht
      The worldserver crashes whenever I create a character. Seems like there is an issue with mysql, but I have no idea what the issue is. Anybody knows what`s happening here?
       

×
×
  • Create New...