HeroEngine Forums
Welcome, Guest. Please login or Register for HeroCloud Account.

Author Topic: Errors Deleting Class from DOM  (Read 2748 times)

Arthain-Baka

  • World Owners
  • ****
  • Posts: 4
    • View Profile
Errors Deleting Class from DOM
« on: Apr 27, 13, 09:43:00 AM »

I've been staring at this for a little while now and I think I need some more opinions...
I have been going through and removing all of the classes I created while I was getting used to HeroEngine, and primarily after I started getting some replication errors with the _PlayerAccount class which no matter what code point I reset my code to I couldn't seem to figure out so I decided to drop everything, and start over as I understand the system better now.
Anyway, I decided that I'd remove all of the classes and stuff and let the system go to sleep so that any old nodes would get cleaned up (not sure if it works that way but after the errors I had I read somewhere that some replication cleanup occurs when a server wakes up).
I've gotten down to one last class on the server: ABHORSON_PlayerCharacter.
I've removed all references that I created to this class however I'm still getting errors when I try to delete them so maybe someone else has some idea what's going on. I have two active accounts which I have reset their account prior to trying all of this which isn't making a difference.

And ABHORSON_PlayerCharacter
Code: [Select]
22:26:44: \scd ABHORSON_PlayerCharacter
22:26:44: SCD LISTBEGIN 9223372056489021562 : "Class Definition ID: 9223372056489021562 Name: "ABHORSON_PlayerCharacter" Archetype: data Package: game Description: "Glommed onto all _PlayerCharacter class nodes to provide ABHORSON game-specific methods" DestinationClass: 0 DestinationClassClient: 9223372056767021544"
SCD LISTELEMENT 9223372056489021562 : "Incompatible Class ID: 4611686018428838014 Name: "E_CommonCharacter" Description: """
SCD LISTELEMENT 9223372056489021562 : "Incompatible Class ID: 4611686018427707942 Name: "E_playerCharacter" Description: "Game specific class for characters""
SCD LISTEND 9223372056489021562 : "End of List."
===============================================
22:29:19: \dcd ABHORSON_PlayerCharacter
22:29:19: DCD ERROR 9223372056489021562 : GOM::removeClassDef (5301): error: with InternalException message 'Database error at 15376 message: ORA-02292: integrity constraint (X_004_00490_SERVER_GOM.NODE_BASE_CLASS_FK) violated - child record found
ORA-06512: at "X_004_00490_SERVER_GOM.JAVELIN_PKG", line 1270
ORA-06512: at line 1
The thing that gets me about this is the "Incompatible Class ID" comments relating to "E_CommonCharacter" and "E_playerCharacter" as they've never been used together and none of the existing prototypes have any cross references between these classes.
It's getting the same kind of deletion error as well.

Currently, I've removed everything else I created and changed all the Nodes in the Control Panel and no active nodes are using either of these classes as far as I can tell but I feel like the error means there is a reference somewhere...
I feel like it might be related to the Incompatible Class ID message but I have no idea what it actually means...
So if anyone has any idea's I'd be open to hearing them ^.^"
Even just some clarification on what the Incompatible Class ID means and some more information about the DCD error would be great. I'm just a little stumped and have been looking at the issue for too long.
Logged

Thazager

  • General Accounts
  • *
  • Posts: 1160
  • Never stop learning
    • View Profile
Re: Errors Deleting Class from DOM
« Reply #1 on: Apr 27, 13, 08:12:42 PM »

Reading through the error messages - "ABHORSON_PlayerCharacter" Archetype: data Package: game Description: "Glommed onto all _PlayerCharacter class nodes to provide ABHORSON game-specific methods"

It appears that you might have the class glommed onto another class somewhere. Perhaps checking the hotspot GUI (F5), and seeing if it might have been glommed onto the _playerCharacter there.
Check under 2nd tab - Tools, in section System Node Confiuration GUI.
Logged
Lead scripter for EO, Repop helper.
HSL Video tutorials:
https://community.heroengine.com/forums/index.php/topic,1719.msg36858.html#msg3685

Arthain-Baka

  • World Owners
  • ****
  • Posts: 4
    • View Profile
Re: Errors Deleting Class from DOM
« Reply #2 on: Apr 27, 13, 08:54:59 PM »

The description is a bit outdated, it was there from when I was using HJ as a reference before I realised a lot of it was outdated. It was used in the HE_CSSUseCharacterPrototype which I've since deleted as there were no account nodes left using it that I could see.

It hasn't been GLOMed onto anything inside the System Node Configuration GUI. And when I create new characters this class isn't used on any of the nodes.
Logged

HE-SCOTT

  • HeroEngine
  • *****
  • Posts: 158
    • View Profile
Re: Errors Deleting Class from DOM
« Reply #3 on: May 02, 13, 01:33:05 PM »

Issues like this can be a little hard to troubleshoot. The error message does give you some information about what could be preventing you from deleting your class definition but it isn't obvious. Whenever you attempt to delete a class anything that has a reference to that class needs to be deleted first or it will give an error like you are getting. In order to fully remove the class you were correct that you had clean up all the DOM references, however you also need to clean up all GOM references as well. That means that somewhere there are nodes that are still using that class. Removing the class would break those nodes which is why the error pops up.

Knowing that there are still nodes left around makes the issue easier to manage. Since they may not be associated to nodes you know about off hand, or are orphaned, you can use a CLI command to load them in your current area. This command is \LCN (the backslash makes sure you are loading them on the server) After they are loaded you may want to query their associations and if they have any root node children, this page has info on dealing with root nodes and their script interface: http://wiki.heroengine.com/wiki/Arbitrary_Root_Node. Once you have cleared up any associations or root node dependencies and determined that the nodes are safe to delete you can call destroynode(node) from script or use the CLI to delete them. Keep in mind when deleting the nodes this is permanent and can not be undone so care must be used to not mangle accounts or characters that should be kept around. 
Logged

Arthain-Baka

  • World Owners
  • ****
  • Posts: 4
    • View Profile
Re: Errors Deleting Class from DOM
« Reply #4 on: May 03, 13, 08:43:08 AM »

That post was really useful and now I know exactly where the issues are being generated from.
There's two nodes that are using that class in the database and I've been able to load them using the \LCN command.
After loading them I'm able to get the following information:
Code: [Select]
21:21:16: \QN ABHORSON_PlayerCharacter
21:21:16: QN LISTBEGIN 0 : "Node ID: "
QN LISTELEMENT 0 : "9223372056689021589 Base Class: ABHORSON_PlayerCharacter"
QN LISTELEMENT 0 : "9223372056710021556 Base Class: ABHORSON_PlayerCharacter"
QN LISTEND 0 : "End of Nodes"
===============================================
21:21:25: \sn 9223372056689021589
21:21:25: SN LISTBEGIN 9223372056689021589 : "Node ID: 9223372056689021589 Base Class ID: 9223372056489021562 Name: "ABHORSON_PlayerCharacter""
SN LISTEND 9223372056689021589 : "End of List."
===============================================
21:21:38: \sn 9223372056710021556
21:21:39: SN LISTBEGIN 9223372056710021556 : "Node ID: 9223372056710021556 Base Class ID: 9223372056489021562 Name: "ABHORSON_PlayerCharacter""
SN LISTEND 9223372056710021556 : "End of List."
===============================================
21:22:10: \QA 9223372056689021589 0 0
21:22:10: QA LISTBEGIN 0 : "Source, Association Type, Target"
QA LISTEND 0 : "End of Associations"
===============================================
21:22:19: \QA 9223372056710021556 0 0
21:22:19: QA LISTBEGIN 0 : "Source, Association Type, Target"
QA LISTEND 0 : "End of Associations"

Which unless I'm missing a command shows there's no associations with those two nodes. So I created the following code to remove them:
Code: [Select]
    // Standard Command Script Template Code

    to "destroyrootnode"
      if args.length < 3
        HE_CommandUsage( account, input )
      else
        nodeID as ID = args[3]
        node as NodeRef of Class ABHORSON_PlayerCharacter = nodeID
        DestroyRootNode(node)
      .
    .
    to "deletecharacter"
      if args.length < 3
        HE_CommandUsage( account, input )
      else
        nodeID as ID = args[3]
        node as NodeRef of Class ABHORSON_PlayerCharacter = nodeID
        DeleteCharacter( node, account )
      .
    .

Now, as they were from a Character I assume I need to use the "DeleteCharacter" function, however that gives me the following error:
Code: [Select]
[hsl_error] 9223372055609790087,1: [Fantasy Lowlands] SCRIPT ERROR: In function DeleteCharacter: Error destroying character root node: GOM::deleteCharacterEntryFromRoot (18864): Unable to delete the character from the DB.
05/03/2013 13:38:40 UTC
Call trace:
  Script cmdNodes line 35 me[9223372056913586118]
  Script commandHQ line 360 me[9223372056913586118]
  Script _CommandHandlerClassMethods line 147 me[9223372056913586118]
starting method/function _PROCESSCOMMAND
starting me[id=9223372056913586118 class=_CommandHandler]

And incase it wasn't a character node for some reason I've tried to delete it as just a RootNode:
Code: [Select]
[hsl_error] 9223372055609790087,1: [Fantasy Lowlands] SCRIPT ERROR: In function DestroyRootNode: Node to destroy is not a loaded root node.
05/03/2013 13:37:44 UTC
Call trace:
  Script cmdNodes line 26 me[9223372056913586118]
  Script commandHQ line 360 me[9223372056913586118]
  Script _CommandHandlerClassMethods line 147 me[9223372056913586118]
starting method/function _PROCESSCOMMAND
starting me[id=9223372056913586118 class=_CommandHandler]

Obviously the standard \DN does not work for this scenario so I'm not quite sure what I've gotten wrong, I've been staring at the CLI page on the Wiki looking for any commands that would help but I can't see any that I believe would directly help me.
So what exactly am I missing here?
« Last Edit: May 03, 13, 10:21:10 PM by Arthain-Baka »
Logged

HE-SCOTT

  • HeroEngine
  • *****
  • Posts: 158
    • View Profile
Re: Errors Deleting Class from DOM
« Reply #5 on: May 03, 13, 01:17:30 PM »

Before we go any deeper in to how to fully get rid of these nodes you need to consider why you are doing this, because you are heading down a very complicated path just to get rid of them. In your original post you complained about "Incompatible Class IDs" on your player character. When you look at E_commonCharacter and E_playerCharacter you can see that E_playerCharacter inherits from E_CommonCharacter which is where the incompatibility is coming from. They both define common methods and there is no way to know which is the correct one to choose in HSL.

Your class itself should be fine the way it is with out deleting it and remaking it as long as you don't try to inherit from classes that have the same parent classes or define methods that share the same name. I would recommend not using the E_playercharacter as a base for your custom game character and instead use the basic _PlayerCharacter which also has the base _CommonCharacter as a parent. This will give you more flexibility in the long term.
« Last Edit: May 03, 13, 02:53:16 PM by HE-SCOTT »
Logged

Arthain-Baka

  • World Owners
  • ****
  • Posts: 4
    • View Profile
Re: Errors Deleting Class from DOM
« Reply #6 on: May 03, 13, 10:23:39 PM »

I guess there were a few reasons for it, in one way I'd like to learn how to handle these situations now rather than when I have a huge code base. But primarily I think it was because I'm a little OCD and just wanted everything clean and that I was a little worried it might effect code if they weren't cleaned up. I think I'll leave them there for the moment until I'm more familiar with HeroEngine and then decide if it's actually worth deleting them which it sounds like it isn't.
Logged