-
-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: House lock downs and secure ownership bugs #940
base: main
Are you sure you want to change the base?
Changes from 4 commits
d5a0676
e78d629
0aad45e
ececce6
14e5933
65538cc
4d3b4e3
941ea8f
0d8c432
fb5a75d
fc15c30
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2070,7 +2070,7 @@ private void SetLockdown(Item i, bool locked, bool checkContains = false) | |
|
||
public bool LockDown(Mobile m, Item item, bool checkIsInside) | ||
{ | ||
if (!IsCoOwner(m) || !IsActive) | ||
if (!IsFriend(m) || !IsActive) | ||
{ | ||
return false; | ||
} | ||
|
@@ -2325,13 +2325,17 @@ public void EndConfirmTransfer(Mobile from, Mobile to) | |
|
||
public void Release(Mobile m, Item item) | ||
{ | ||
if (!IsCoOwner(m) || !IsActive) | ||
if (!IsFriend(m) || !IsActive) | ||
{ | ||
return; | ||
} | ||
|
||
if (HasLockedDownItem(item)) | ||
{ | ||
/* How do we ensure that friends can only release things locked down | ||
* by them and not things locked down by co-owners/owners? It's an\ | ||
* important step to prevent grief and separate security levels. */ | ||
|
||
item.PublicOverheadMessage(MessageType.Label, 0x3B2, 501657); // [no longer locked down] | ||
SetLockdown(item, false); | ||
// TidyItemList( m_LockDowns ); | ||
|
@@ -2340,7 +2344,18 @@ public void Release(Mobile m, Item item) | |
} | ||
else if (HasSecureItem(item)) | ||
{ | ||
ReleaseSecure(m, item); | ||
/* We don't want friends of the house releasing secured containers. This is a co-owner/owner | ||
* superpower. */ | ||
|
||
if (IsCoOwner(m)) | ||
{ | ||
ReleaseSecure(m, item); | ||
} | ||
else | ||
{ | ||
m.LocalOverheadMessage(MessageType.Regular, 0x3E9, 1010418); // You did not lock this down, and you are not able to release this. | ||
return; | ||
} | ||
} | ||
else | ||
{ | ||
|
@@ -2350,7 +2365,7 @@ public void Release(Mobile m, Item item) | |
|
||
public void AddSecure(Mobile m, Item item) | ||
{ | ||
if (Secures == null || !IsOwner(m) || !IsActive) | ||
if (Secures == null || !IsCoOwner(m) || !IsActive) | ||
{ | ||
return; | ||
} | ||
|
@@ -2408,7 +2423,17 @@ public void AddSecure(Mobile m, Item item) | |
} | ||
else | ||
{ | ||
info = new SecureInfo((Container)item, SecureLevel.Owner); | ||
/* There seems to be some confusion regarding security access on secured containers. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The owner of the house should have access to everything. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree. House owners should automatically have access to everything. Perhaps we can make a new securelevel.HouseOwner and Co-Owners can become securelevel.Owners? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we need to separate the security access levels and the house access levels. These are obviously not interchangeable. The security access levels only apply to each individual container in question and are applicable to the individual who secured said container, NOT the house owner (although they have access/control over it regardless). For things like doors and teleporters, the house owner is automatically the owner. |
||
* when a player secures a container (via "I wish to secure this"), they are considered | ||
* the "owner" of that item. Thus, if the option "Owner only" is selected, then the | ||
* player who secured the container AND the house owner both have access to it. I am not | ||
* sure how to address this without throwing the whole thing into chaos. | ||
* | ||
* As it stands, the gump automatically assigns the house owner as the owner | ||
* of the secured container. Thus, co-owners who secure a container and select | ||
* "Owner Only" from the security gump will be unable to access or release the container. */ | ||
|
||
info = new SecureInfo((Container)item, SecureLevel.Owner); | ||
|
||
item.IsLockedDown = false; | ||
item.IsSecure = true; | ||
|
@@ -2472,7 +2497,7 @@ public bool HasSecureAccess(Mobile m, SecureLevel level) | |
|
||
public void ReleaseSecure(Mobile m, Item item) | ||
{ | ||
if (Secures == null || !IsOwner(m) || item is StrongBox || !IsActive) | ||
if (Secures == null || !IsCoOwner(m) || item is StrongBox || !IsActive) | ||
{ | ||
return; | ||
} | ||
|
@@ -2500,6 +2525,10 @@ public void ReleaseSecure(Mobile m, Item item) | |
Secures.RemoveAt(i); | ||
return; | ||
} | ||
else // Added fallback incase the player is a co-owner who is trying to release a container secured by the owner. | ||
{ | ||
m.LocalOverheadMessage(MessageType.Regular, 0x3E9, 1010418); // You did not lock this down, and you are not able to release this. | ||
} | ||
} | ||
|
||
m.SendLocalizedMessage(501717); // This isn't secure... | ||
|
@@ -2595,7 +2624,7 @@ public void Kick(Mobile from, Mobile targ) | |
/* You have been ejected from this house. | ||
* If you persist in entering, you may be banned from the house. | ||
*/ | ||
targ.SendLocalizedMessage(501341); | ||
targ.SendLocalizedMessage(501341); | ||
kamronbatman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
} | ||
|
||
|
@@ -2622,7 +2651,7 @@ public void RemoveAccess(Mobile from, Mobile targ) | |
|
||
public void RemoveBan(Mobile from, Mobile targ) | ||
{ | ||
if (!IsCoOwner(from) || Bans == null) | ||
if (!IsFriend(from) || Bans == null) | ||
{ | ||
return; | ||
} | ||
|
@@ -3936,7 +3965,7 @@ protected override void OnTargetNotAccessible(Mobile from, object targeted) | |
|
||
protected override void OnTarget(Mobile from, object targeted) | ||
{ | ||
if (!from.Alive || m_House.Deleted || !m_House.IsCoOwner(from)) | ||
if (!from.Alive || m_House.Deleted || !m_House.IsFriend(from)) | ||
{ | ||
return; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure if this is right. Let's do some testing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Friends of the house have always been allowed to lock things down. This was tested via OSI and is at the link: https://uo.com/wiki/ultima-online-wiki/gameplay/houses-placing-a-house/house-ownership-4-managing-your-home/