PlaneShift

  • Status Closed
  • Percent Complete
    100%
  • Task Type Bug Report
  • Category Engine → Inventory/Items
  • Assigned To
    Aresilek Besolez
  • Operating System
  • Severity High
  • Priority
  • Reported Version
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: PlaneShift
Opened by A. Kiefner - 20.09.2008
Last edited by Davide Vescovini - 01.04.2016

FS#2249 - transient flag doesn't work

All items have the “transient” flag which, according to my understanding of the code, is supposed to make things automatically vanish after 3000+ seconds.

This does normally not work, however under certain circumstances Aiken and I were not able to reproduce, it DOES work - which might be the cause for various items vanish from guildhouses.

This flag is supposed to work, BUT it has to be fixed AFTER working out the connected problems:

- /modify can’t disable the transient flag (which should be fixed before anything else to prevent dev stuff to vanish) - transient not in guildhouses
- transient is enabled by default, whether disabled in the /item console or not
- items should not vanish while guarded

It appears that this misbehaviour was caused on purpose (commented out the relevant lines) but not documented:
src/server/entitymanager.cpp line 902

One of the few times it it worked was in the following situation: Aiken added a few extra debug messages, reduced the time to 10 seconds, then bought an empty book and dropped it.
He also had picked up already existing items and some spawned via /item and dropped those.
The bought item disappeared, nothing else did. However, that was the only time, we couldn’t reproduce it.But the debug messages were triggered so the code was used to make the item disappear.

The task depends upon
ID Project Summary Priority Severity Assigned To Progress
1467 PlaneShift  FS#1467 - Autodrestroy dropped items  Medium
100%
2250 PlaneShift  FS#2250 - no transient in guildhouses!  Low peeg
100%
2251 PlaneShift  FS#2251 - /modify can’t disable the transient flag  Medium
100%
2252 PlaneShift  FS#2252 - transient can't be disabled in /item  Low
100%
2253 PlaneShift  FS#2253 - items should not be removed by transient while guarded  Medium Aresilek Besolez
100%
2341 PlaneShift  FS#2341 - TRANSIENT isn't reset if you pick up an item - server crash  High Thom, peeg, Mario Rohkrämer, Loyni, Mrokii, aurelynt
100%
2397 PlaneShift  FS#2397 - TRANSIENT - crafting transformations shouldn't schedule removal   High
100%
Closed by  Davide Vescovini
01.04.2016 14:25
Reason for closing:  
Additional comments about closing:  

Transient items have been fixed and are working in production server. Closing.

peeg commented on 03.10.2008 13:58

Another EID vs. UID bug - luckily those are easy to fix :)

NOTE: Do not commit this patch before ALL related problems are solved!

Index: src/server/bulkobjects/psitem.cpp
===================================================================
--- src/server/bulkobjects/psitem.cpp	(revision 2638)
+++ src/server/bulkobjects/psitem.cpp	(working copy)
@@ -74,10 +74,10 @@
 class psItemRemovalEvent : public psGameEvent
 {
 protected:
-    EID item_to_remove;
+    uint32 item_to_remove;
 
 public:
-    psItemRemovalEvent(int delayticks, EID gemID)    
+    psItemRemovalEvent(int delayticks, uint32 gemID)    
         : psGameEvent(0,delayticks*1000,"psItemRemovalEvent")
     {
         item_to_remove = gemID;
@@ -86,9 +86,9 @@
 
     virtual void Trigger()
     {
-        Debug2(LOG_USER, 0, "Removing object %s now.\n", ShowID(item_to_remove));
+        Debug2(LOG_USER, 0, "Removing object %d now.\n", item_to_remove);
         // cannot store pointer because object may have already been removed and ptr not valid
-        gemObject *obj = GEMSupervisor::GetSingleton().FindObject(item_to_remove);
+        gemObject *obj = GEMSupervisor::GetSingleton().FindItemEntity(item_to_remove);
         if (obj)
         {
             psItem *item = obj->GetItem();

Edit 07.12.2008: Updated patch to work with current trunk.

Project Manager
Lanarel commented on 03.10.2008 22:30

Peeg, why should this patch not be committed? It does not seem to be related to the other parts. If this report is to be used as a collection of transient bugs, maybe the patch should have its own report? I know Kayden just fixed two similar bugs (for items in crates).

Caarrie commented on 03.10.2008 23:24

it is more if this is commited not to merge to stable till the others are included so that we dont have players complaining of issues with missing items or odd things happening

peeg commented on 04.10.2008 02:59

What Caarrie said… My patch solves exactly the main problem: "TRANSIENT flag doesn't work", but there are a lot of related problems.
If this patch makes it into the next release before at least  FS#2250  is fixed we'll have a lot of players go berserk because all their items will start to disappear from their (previously safe) guildhouses.

Project Manager
Lanarel commented on 04.10.2008 09:52

OK I understand. It is just that that same change in the 'opening crate crashes server' thing, caused a crash, because FindItemEntity was used instead of FindObject. Even if the patch seems to do the opposite here, since the two do not seem to be interchangeable, I assume not applying this patch will mean the server crashes on this at this moment. So I wondered why not prevent a crash from happening.

Combining that with what you two say, therefor translates to: we will let the server crash when it tries to remove a transient object to prevent people missing objects due to other things not being implemented yet. Until someone tells me the server does not crash on this at this moment, I will increase severity from low to flash :)
This may mean it should quickly be solved by disabling transient objects another way (and lower priority again), if fixing all other things takes too long.

Caarrie commented on 04.10.2008 11:18

Lanarel we never said there was a crash related to this, just the flag did not work correctly, please change the severity/priority back ;)

Project Manager
Lanarel commented on 04.10.2008 11:36

I know you did not say it, but judging from what I know about the difference between findObject and findItemEntity, there may very well be a crash caused by this that no-one noticed. SOmeone convince me that current code does not cause a crash and severity can go down. THen someone has to convince us that Peegs patch will not introduce a crash before it gets implemented. As far as I know these two commands are not interchangeable, and one of the two will cause crashes :)

peeg commented on 04.10.2008 11:53

No possible crash here. Neither with the current code, nor with my patch. :)
GEMSupervisor.FindObject() and GEMSupervisor.FindItemEntity() are both returning NULL if no matching object is found and since the variable "obj" is checked for NULL cleanly there's no crash.

Project Manager
Lanarel commented on 04.10.2008 12:06

Peeg, please have a look at  bug 2272 . The problem there was that at least one of those functions did not return NULL but an invalid address, causing a crash. THe input argument of the functions (as you know) does not have the same meaning, but for some reason you can pass them to both functions (as they are really just integers). And even when it not crashes, it will sometimes not return null but another object. This may mean currently if you place an apple for an hour, after an hour a furnace vanishes :). Or I am completely wrong, in which case I just need better convincing than "you are wrong":)

Project Manager
Lanarel commented on 04.10.2008 15:21

Peeg convinced me that it will not crash, but I think I am still right in assuming that means that random other items will be disappearing. If the other issues related to this transient stuff can not be fixed soon, I suggest the feature to be disabled completely on laanx asap (hence leaving priority), to prevent furniture disappearing from guildhouses and other bugs.

Project Manager
Lanarel commented on 27.04.2009 18:31

Decreasing severity, as this will not effect the game as long as it is not enabled, and the functionality itself is not critical.

Anonymous Submitter commented on 16.07.2009 00:49

Again, passing this to Ares. He can decide how to handle it in his hierarchy of things to do for gms.

Project Manager
Lanarel commented on 19.07.2009 14:04

Please consult with Peeg, who looked into these transient things before.

Aresilek Besolez commented on 22.07.2009 03:58

Note when testing, you must now move far away from the dropped item as it wont disappear while your guarding it (PS#2253).

Thom commented on 17.08.2009 23:31

Is transient working at all right now? Because for testing purposes I have some transient items lying here in my NPCroom and they just won't disappear.

Aresilek Besolez commented on 11.09.2009 21:01

Peeg's patch to enable transient item still hasn't been committed, if you want to test transients apply his patch (1st comment). We're not confident that all issues related to transients have been resolved so this may not be enabled for a while.

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing