RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

cooperative effort to debug Static Housing.

Brazen

Wanderer
cooperative effort to debug Static Housing.

Static Housing Re-Release


I said:
It seems to me, after the regions are able to be established, and attached to a sign, virtually everything else is already there in basehouse... ... The stealing bug does not exist in regular houses, so there has to be the solution contained within the regular housing code.


I also said:
And if someone is going to rework this system, or if sirens song wants to go with a new system, great, but a gump that is more user friendly would be a nice touch. (and probably the only part I'm up to tackling myself, if needs be, but I have like 500 tasks on my plate every day already. LOL)

KillerBeeZ said:
normal houses work just fine... why? figure that out and you will have solved the bug.

So here we go... who is up to the task of a coopreative search and destroy mission to find this anomaly, and create the newly revised and secure static housing system?

Brazen
Admin of A' Ciotach As Dan (P.S. I'm a LADY folks! LOL)
 

Brazen

Wanderer
* rolls eyes at Phantom * If you read the thread I linked to, we were discussing working on it together, and thought it best to start a new thread here for that task... question was who wished to work together towards a solution.

FYI I have looked at the housing script and the static housing script, and though there are differences, I am not skilled enough to discern which differences are key to locating the solution.

I have offered to rework the gump however, as that I am able to do.

Brazen
Admin of A' Ciotach As Dan
(P.S. I'm a LADY folks! LOL)
 

sirens song

Wanderer
How user friendly does the gump really need to be? The only things that should be on the gump is...

Transfer Ownership

Public / Private

BanList
-add
-remove
-clear

FriendList
-add
-remove
-clear

Co-Owner
-add
-remove

(and possible a purchase option, if the house has no owner)


And for the GM-aspect, all is really needed is a few entries in the [props menu?
2 Locations to establish region.
The ban location.
Oh theres got to be an array that stores doors, so it might be good to do a GM gump from the house sign too. So that they can add doors. Unless you just want them to Unlock doors with keys. Thats how I like it but many people think the opposite.
 

jjarmis

Wanderer
I think the main downfall of the static housing system is that is does not store houses into the hashtable that BaseHouse uses. if it did this then not only would admins be able to control how many houses people have, but they would be easier for admins to find as well.
 

Brazen

Wanderer
jjarmis : Care to elaborate on that? I know diddly about hashtables. So this comment, clearly well intended, is like greek to me.

sirens song : I'd refered to the GM setting up of the houses, rather than having to play with the props after performing only SOME of the set-up via the static housing sign / gump, it would be much more user friendly to have all of the setup done via the gump.


However, the intention mainly is to seal up the stealing bug once and for all. As I've said, there are destinct differences between the static base house and base housing. However, I am not skilled enough to determine which differences are germain to the issue of the security, or lack thereof.

Brazen
Admin of A' Ciotach As Dan
(P.S. I'm a LADY folks! LOL)


Note: for those who do not know me, I am said by those closest to me, to know just enough about scripting to be dangerous... and yet I script what I can, and try my darndest to find solutions, to the best of my admittedly limited abilities.
 

Kamron

Knight
Doesn't matter anymore.. I think I fixed it.. I should have an upload soon. And my two cents... the static housing system was scripted very very poorly. This is only ONE of the exploits that needed fixing.
 

HellRazor

Knight
Thanks XxSp1DERxX, looking forward to this!

Care to elaborate on some of the problems you found with the way he did it? Helps others to avoid making the same types of mistakes in their own scripts.
 

jjarmis

Wanderer
the hashtable used in BaseHouse simply holds the House and the owner... the static house system doesn't add to that hashtable and therefor anyone can own as many static houses as they want regardless to if they already own a non-static or other static houses... simply adding a feature to add the static house data to the hashtable and checking it before allowing a player to buy the static house would work (I know, I've done this on my friends shard for him). Also, the find houses admin control would be able to find the static houses if that was done.
 

Brazen

Wanderer
Ok. XxSP1DERxX *who I eternally owe one to* has given me the fix... there are 3 parts...

in StaticHouseRegion.cs, add in the following code:

Code:
public override bool SendInaccessibleMessage( Item item, Mobile from ) 


{ 



if ( item is Container ) 




item.SendLocalizedMessageTo( from, 501647 ); // That is secure. 



else 




item.SendLocalizedMessageTo( from, 1061637 ); // You are not allowed to access this. 
  


return true;  

}
public override bool CheckAccessibility( Item item, Mobile from ) 
{ 
return m_House.CheckAccessibility( item, from );  
}

Then in StaticHouse.cs

Code:
		public static bool CheckAccessible( Mobile m, Item item )
		{
			if ( m.AccessLevel >= AccessLevel.GameMaster )
				return true; // Staff can access anything

			StaticHouseSign house = StaticHouseSign.StaticFindHouseAt( item );

			if ( house == null )
				return true;

			SecureStaticAccessResult res = house.CheckSecureAccess( m, item );

			switch ( res )
			{
				case SecureStaticAccessResult.Insecure: break;
				case SecureStaticAccessResult.Accessible: return true;
				case SecureStaticAccessResult.Inaccessible: return false;
			}

			if ( house.checkLockedDown( item ) )
				return house.IsCoOwner( m ) && (item is Container);

			return true;
		}

		public bool CheckAccessibility( Item item, Mobile from )
		{
			SecureStaticAccessResult res = CheckSecureAccess( from, item );

			switch ( res )
			{
				case SecureStaticAccessResult.Insecure: break;
				case SecureStaticAccessResult.Accessible: return true;
				case SecureStaticAccessResult.Inaccessible: return false;
			}

			if ( !checkLockedDown( item ) )
				return true;
			else if ( from.AccessLevel >= AccessLevel.GameMaster )
				return true;
			else if ( item is Runebook )
				return true;
			else if ( item is ISecurable )
				return HasSecureAccess( from, (SecureLevelStatic)((ISecurable)item).Level );
			else if ( item is Container )
				return IsCoOwner( from );
			else if ( item is BaseLight )
				return IsFriend( from );
			else if ( item is PotionKeg )
				return IsFriend( from );
			else if ( item is BaseBoard )
				return true;
			else if ( item is Dices )
				return true;
			else if ( item is RecallRune )
				return true;
			else if ( item is TreasureMap )
				return true;
			else if ( item is Clock )
				return true;
			else if ( item is BaseBook )
				return true;
			else if ( item is BaseInstrument )
				return true;
			else if ( item is Dyes || item is DyeTub )
				return true;

			return false;
		}

and lastly, Runebooks one was apparently able to open a locked down runebook and drop the runes out of it... so here's the fix for that as well:

runebook.cs

REPLACE this:

Code:
		public bool CheckAccess( Mobile m )
		{
			if ( !IsLockedDown || m.AccessLevel >= AccessLevel.GameMaster )
				return true;

			BaseHouse house = BaseHouse.FindHouseAt( this );

			if ( house != null && house.IsAosRules && (house.Public ? house.IsBanned( m ) : !house.HasAccess( m )) )
				return false;

			return ( house != null && house.HasSecureAccess( m, m_Level ) );
		}

with this:

Code:
		public bool CheckAccess( Mobile m )
		{
			if ( !IsLockedDown || m.AccessLevel >= AccessLevel.GameMaster )
				return true;

			BaseHouse house = BaseHouse.FindHouseAt( this );
			StaticHouseSign staticHouse = StaticHouseSign.StaticFindHouseAt( this );

			if ( house != null && house.IsAosRules && (house.Public ? house.IsBanned( m ) : !house.HasAccess( m )) )
				return false;
			else if ( staticHouse != null && (staticHouse.Public ? staticHouse.IsBanned( m ) : !staticHouse.HasAccess( m )) )
				return false;

			return ( house != null && house.HasSecureAccess( m, m_Level ) ) || ( staticHouse != null && staticHouse.HasSecureAccess( m, (SecureLevelStatic)m_Level ) );
		}

Ok, All who think XxSP1DERxX rox, say AYE!

AYE AYE AYE AYE





I am still also very interested in being able to limit and to see the static houses owned, so that is still on the table here... and I'm still wiling to do the pretty gump if someone wants to revamp it code-wise to make it more cohesive.
 

Kamron

Knight
Brazen, JJarmis was talking about how to limit how many static houses are owned. I will code the changes required for that, to get it to work. There are two approaches, and I will use the one which requires the least additions/edits to distro files.
 

Atheena

Wanderer
Spider... I need the oppisite. I would like to be able to alter the number of static homes a player can have as well but would prefer to be able to set that number myself. It could check to see if owner has a home and then put in a number of homes allowed for account.

So for shards who wanted to have just one per account no matter if it was a static or basehouse..... it would say... if home count =< 0, then allow house placement.....

and we could change that 0 to what ever we wanted for our server?

I have not been able to find a place in the files anywhere that limits the number of static homes allowed per account :(
 

Brazen

Wanderer
Spider, dear... I know he wants to limit the static houses as well as the real ones... what I meant is... that I do not understand hashtables........ period............. LOL And can we diferentiate between real houses, and static ones via this method.. so like... per account, they could have 1 real and 2 statics, ... rather than 3 of either type period?

Brazen
Admin of A' Ciotach As Dan
 

Joeblow

Wanderer
Spider your ROXXOR!!!!
I had one problem inserting your edits. On the Runebook.cs you need to add this line at the top with the others.

using Server.StaticHousing;

But Spider you still ROXXOR!!!!

Spider if you need help reproduceing the tele bug let me know. I am not a good scripter at all, I am more of a hack and paste kinda guy. but I am willing to try and help. if ya need me just ask... :cool:
 

Kamron

Knight
Sure, just try and make a step-by-step walkthrough of how to reproduce it, and I can get started today.

HashTable is basically a giant list which says
Table[Key] = Value
so in the case of houses
Table[Owner] = House
 

jjarmis

Wanderer
In other words, a hashtable is an array that instead of having an index of ints it uses other objects as the index. As to limiting # of houses compared to # of static houses that shouldn't be a problem, will just have to have the code check if the house found is a basehouse or a static house and then go from there.
 

HellRazor

Knight
Spider, you rock! :) Thanks for investing your time in this, a lot of people enjoy this system and having a de-bugged, streamlined version is wonderful.

On a side note, there are a few different versions of this package floating around, can someone incorporate the fixes and then upload the complete package so we can have the "official" version for this particular thread all in one place?
 

Joeblow

Wanderer
XxSP1DERxX said:
Sure, just try and make a step-by-step walkthrough of how to reproduce it, and I can get started today.
[Owner] = House

OK Here are the steps for the tele bug.

First this is a player owned static house, set to private with the door locked. The house includes the fenced in yard.
House Bug 1
Standing at the front of the gate, a player can cast teleport. Target the ground just infront of the door.
House Bug 2
This teleports the player inside the private house. Once inside the house, the player can not move about, and can recall to get out of the house.
House bug 3
I am not sure what other information you need for this bug. The houseing area is Trammel Brit. The house was created before your last fixes. The server and client are fully OSI patched. Let me know if you want to test this on my shard, I will PM you with my shard info.
 

koluch

Sorceror
Great work!

I also have a question - is there an exact area that the corrections should be placed within the 2( since the runebook is a replacement) scripts?
I have added and get no errors, though from past experience I know that doesnt always mean it is correct:/

On a side note, there are a few different versions of this package floating around, can someone incorporate the fixes and then upload the complete package so we can have the "official" version for this particular thread all in one place

I agree and know it would help myself and others immensely.

Again, great job on a very useful script - all those nice empty houses just sitting there with nothing to do hehe ;)

Shazzy
 

Kamron

Knight
Thanks JoeBlow, I know how this is done... *sighs* more stuff he forgot to add in. I will have an update within two days or so (I have alot of school right now).

Koluch, the runebook is a replacement because the function already exists.. so you would delete the function, and put the one that was posted in its place (or comment it instead of deleting it). If it compiles, it will work :)


Once I have less school, and more time.. I will be completely recoding the static house system. I will try my hardest to prevent wipes of the current version, but I cannot gaurantee anything. Although I can gaurantee that it will be alot better. Brazen is a witness to the swearing and ranting about the terrible coding of this system. Just doing the replacements to get it to work when I downloaded it made me cringe as I sifted through the code slightly to get things in order.
 

jjarmis

Wanderer
Agreed... This system was so poorly coded it took me an hour just to space everything correctly before I could start actually working on it. Yes I use notepad and I know there are programs that will space for me but they are a waste of time if you know what you are doing and if people would just space it correctly in the first place....
Anyway. I cant wait for your remaking of this Spider. :)
 
Top