Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
Bug in will_fall( )
Oct 23, 2017, 1:35 am
By GatewaySysop
Bug in do_zap( ), do_brandish( )
Oct 18, 2017, 1:52 pm
By GatewaySysop
Bug in get_exp_worth( )
Oct 10, 2017, 1:26 am
By GatewaySysop
Bug in do_drag( )
Oct 8, 2017, 12:40 am
By GatewaySysop
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Memwatch
Author: Johan Lindh
Submitted by: Vladaar
Beastmaster 6D sound files
Author: Vladaar
Submitted by: Vladaar
Users Online
CommonCrawl, DotBot, Sogou

Members: 0
Guests: 7
Stats
Files
Topics
Posts
Members
Newest Member
476
3,704
19,231
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » SWR FUSS » Player Home Dupe Bug
Forum Rules | Mark all | Recent Posts

Player Home Dupe Bug
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Jul 10, 2009, 1:32 pm
Go to the top of the page
Go to the bottom of the page

Banner
Magician
GroupMembers
Posts169
JoinedNov 29, 2005

Not entirely sure if this has been addressed or not because I know I seen it somewhere at some point and thought I had it fixed but someone else found I hadn't. If so point me there so I can verify which fix is better, but anyway!

Player homes have a pretty serious bug that, if you let someone into your house (only possible if you have some type of invite/buz code, which is not stock), player2 can enter player1's home. Player2 can then pick up an item or credits, and player1 can logout, and then log back in and the item is reloaded, thus duping it. Now, I fixed it by making it so a player cannot logout in a house if another player is in there, but that also requires that a player's house does not save when he goes linkdead, which I think Keberu's bugfix addresses. I used my own so you're on your own.

do_quit, declare CHAR_DATA *rch; and bool is_rch = FALSE;
   if( IS_SET(ch->in_room->room_flags, ROOM_PLR_HOME ))
   {
      for( rch = ch->in_room->first_person; rch; rch = rch->next )
      {
         if( !IS_NPC(rch) && rch != ch)
         {
            is_rch = TRUE;
            break;
         }
      }
   }
   if( is_rch == TRUE )
   {
      ch_printf( ch, "&RYou can only quit here when the room is devoid of other players.\n\r" );
      return;
   }
       
Post is unread #2 Jul 10, 2009, 4:44 pm
Go to the top of the page
Go to the bottom of the page

Andril
Magician
GroupMembers
Posts147
JoinedJun 9, 2009

Just out of curiosity but, why not just make it so players can't pick up stuff in homes that don't belong to them? Or just have the homes contents saved whenever the owner logs out or goes link-dead? Either way would fix your item duplication issue, though I, personally, would go the second route. That should teach people not to let someone they don't really really trust into their home!
       
Post is unread #3 Jul 10, 2009, 7:31 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

Couldn't you just have the rooms where people store stuff flagged to save their contents instead of attaching it to someone's pfile? Like the way Smaug handles clan storerooms? Can't dupe if it's not pfile dependent :)
       
Post is unread #4 Jul 11, 2009, 12:14 am
Go to the top of the page
Go to the bottom of the page

Banner
Magician
GroupMembers
Posts169
JoinedNov 29, 2005


Andril said:

Just out of curiosity but, why not just make it so players can't pick up stuff in homes that don't belong to them? Or just have the homes contents saved whenever the owner logs out or goes link-dead? Either way would fix your item duplication issue, though I, personally, would go the second route. That should teach people not to let someone they don't really really trust into their home!

Players can pick up stuff in other's homes because its a gameplay feature. People sometimes drop items intended for other players in their home and then invite them inside to pick it up or whatever. I don't know what all they do, but I'm sure that 'fix' would be more of a hassle.

Secondly, I don't remember offhand how/when/where it saves player homes but I don't believe it would be possible to insitute that fix without extra work.
Samson said:

Couldn't you just have the rooms where people store stuff flagged to save their contents instead of attaching it to someone's pfile? Like the way Smaug handles clan storerooms? Can't dupe if it's not pfile dependent :)

I was unaware the clan storeoms code worked in Smaug. -_- I'll need to look at that, and possibly even convert it to SWR's store rooms work.
       
Post is unread #5 Jul 11, 2009, 12:48 am   Last edited Jul 11, 2009, 12:49 am by Andril
Go to the top of the page
Go to the bottom of the page

Andril
Magician
GroupMembers
Posts147
JoinedJun 9, 2009

Check save_clan_storeroom in act_obj.c. I'd imagine you have it anyways as it's part of SWR 1.0. It's called in do_drop, get_obj and do_put, all in act_obj.c as well. You should be able to just copy and modify it to handle the player home room flag easily enough I'd imagine.
       
Post is unread #6 Jul 11, 2009, 12:50 am
Go to the top of the page
Go to the bottom of the page

Banner
Magician
GroupMembers
Posts169
JoinedNov 29, 2005

Clan store room saving doesn't work in SWR. Perhaps it was fixed at some point, but not in the version I use.
       
Post is unread #7 Jul 11, 2009, 1:53 am   Last edited Jul 11, 2009, 1:53 am by Andril
Go to the top of the page
Go to the bottom of the page

Andril
Magician
GroupMembers
Posts147
JoinedJun 9, 2009

Huh, it does on mine, and I'm not using the FUSS verson of SWR... Maybe the people that worked on it before me fixed it at some point.
       
Post is unread #8 Jul 11, 2009, 11:16 am
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

Well if it doesn't work in FUSS then that's a bug in need of fixing especially since it has such an obvious use.
       
Post is unread #9 Jul 13, 2009, 3:21 am
Go to the top of the page
Go to the bottom of the page

Andril
Magician
GroupMembers
Posts147
JoinedJun 9, 2009

Clan storeroom saving works in SWR FUSS.
       
Post is unread #10 Jul 15, 2009, 2:30 am   Last edited Jul 15, 2009, 2:49 am by Banner
Go to the top of the page
Go to the bottom of the page

Banner
Magician
GroupMembers
Posts169
JoinedNov 29, 2005

Andril said:

Clan storeroom saving works in SWR FUSS.
As I said, I'm not using the latest FUSS. SWGI is older than a few months. ;)

EDIT: And I just tested it, it does not work. It appears to create a storeroom and load the contents but does not drop anything new into it. You must have been witnessing hotboot room saving instead.
       
Post is unread #11 Jul 15, 2009, 11:28 am
Go to the top of the page
Go to the bottom of the page

Andril
Magician
GroupMembers
Posts147
JoinedJun 9, 2009

Well, I just shut the mud down completely with the shutdown command in-game, and started it back up. I'd dropped 4 items into the room set as my test clans storeroom and they loaded in just fine. Our load_clan_file function is exactly the same as FUSS', which is exactly the same as the original SWR 1.0's, which I presume is the same as the original Smaug SWR is derived from.

Banner said:

Andril said:

Clan storeroom saving works in SWR FUSS.
As I said, I'm not using the latest FUSS. SWGI is older than a few months. ;)

EDIT: And I just tested it, it does not work. It appears to create a storeroom and load the contents but does not drop anything new into it. You must have been witnessing hotboot room saving instead.


Well, my comment was mostly to reassure Samson that it is working in FUSS :). But also, you could try comparing your load_clan_file function to FUSS', if you haven't done so already, to try and figure out what's going on differently in yours.
       
Post is unread #12 Jul 29, 2009, 12:07 pm
Go to the top of the page
Go to the bottom of the page

Darrik
Fledgling
GroupMembers
Posts20
JoinedJan 29, 2008


Make sure you are testing the storerooms attached to clans vs the actual clan_storeroom flag... clan_storeroom room flags don't work in SWR 1.0, whereas the clan storerooms ( attached to clan_data and set it setclan ) do. You two may be looking at entirely different things :)

In order to fix the bug in this thread, I made it possible that an invited player in someone else's room can only pick up, get, or otherwise manipulate an object in the home if the owner is online... that prevents any duplication, as well as avoiding erasing anything dropped, since the room is cleared and reloaded when the room is loaded.
       
Post is unread #13 Jul 29, 2009, 5:45 pm
Go to the top of the page
Go to the bottom of the page

Andril
Magician
GroupMembers
Posts147
JoinedJun 9, 2009

When I tested it, I set a room with the clanstoreroom flag, then set a clans storeroom value to the vnum of the room I set the flag on. It worked just fine. That function is only called, in SWR 1.0, if a) the room has the clanstoreroom flag and b) if there is a clan that has that rooms vnum set as its storeroom. I'm using a modified version of 1.0 myself, and the save_clan_storeroom function in the one I work on and the copy of 1.0 that I just have sitting around on my computer are exactly the same. Also, according to my computer, the last time that any files in the copy of 1.0 I have on my home system were modified was on May 7, 1999.

I suspect that the reason most people don't think it works is because they aren't aware that both have to be set, due to poor documentation most likely, and they usually only set one or the other.

Hmm, now I want to go and make it so clans can have multiple storage rooms, and have the capture command set them automatically. Like I don't have enough random ideas floating around that I keep forgetting then remembering.
       
Post is unread #14 Jul 30, 2009, 7:44 am
Go to the top of the page
Go to the bottom of the page

Darrik
Fledgling
GroupMembers
Posts20
JoinedJan 29, 2008


Yeah, sorry, I was referring to Banner's testing, rather than you, Andril. But I apparently forgot that you have to have both set, I thought the room flag was useless in SWR 1. I changed it long ago so that the storeroom flag does it on it's own, with no requirement to set it in setclan.
       
Post is unread #15 Jul 30, 2009, 2:26 pm
Go to the top of the page
Go to the bottom of the page

Andril
Magician
GroupMembers
Posts147
JoinedJun 9, 2009

Ahh. Like I said, poor documentation. :)

I knew because I checked the places it was called to see how it was handled. It probably would have been better to just require a clan to have its storage room set and then call it a day, at least to my mind. *shrug*

So how does your system decide which clan the storeroom belongs to if it just uses the flag? Planet ownership with specific planets set as non-capturable?
       
Post is unread #16 Aug 3, 2009, 8:42 am   Last edited Aug 3, 2009, 8:43 am by Darrik
Go to the top of the page
Go to the bottom of the page

Darrik
Fledgling
GroupMembers
Posts20
JoinedJan 29, 2008

Storerooms became available to anyone with the cash to buy them. A storeroom is the same, clan or player owned, except the area around where it resides is likely an area available to the clan, rather than a personal ship or home.

I actually had a couple people putting them in public areas to add persistence, for whatever reason.
       
Pages:<< prev 1 next >>