Author Topic: psItem UID detailed question  (Read 687 times)

davewb

  • Traveller
  • *
  • Posts: 34
    • View Profile
psItem UID detailed question
« on: June 10, 2006, 06:19:53 pm »
Hi

I have a detailed question about the generation of new UID's applied to psItem objects, especially after a SplitStack....

From what I have seen, a new UID is generated when psItem::Commit() is called, when psItem::Save() has set up a trigger to call it 500ms later.

My question is does anyone forsee problems if ::Save() actually generates the new UID instead of waiting till ::Commit()? There is a specific problem in purifying glyphs which calls glyph->Save() [in psSpellManager::StartPurifying()] then sets up an event to complete purification for the glyph [with UID=0 if its for a single glyph out of a stack of many which needs its own, new UID after SplitStack()], because Commit has not yet been called.

It seems to investigate all the potential pitfalls seems very timeconsuming if someone on this board can say "DONT DO THAT because..." (or preferably "Great idea Dave, do it!!!").

thanks
Dave

DaveG

  • Forum Addict
  • *
  • Posts: 2058
    • View Profile
Re: psItem UID detailed question
« Reply #1 on: June 10, 2006, 07:41:37 pm »
Ah, crud.  Yeah, that'd be a bug there.  Essentially we'd need to add a ForceSave() or something for that spot.  'Course that opens up the system for abuse again if you can opt to not gang the saves together automatically.  (maybe I could make it a special psGlyph method or something)  I'll think of something.

Thanks.  Good catch.  :)

I'll try to get something done with that in a bit.  Little busy right now with some other stuff.

::  PlaneShift Team Programmer  ::