Housing bugs

A place to submit .patch fixes for the DOL SVN

Moderator: Developer Team

Housing bugs

Postby Tolakram » Wed Nov 17, 2010 2:32 pm

This one has been driving me crazy for 2 days now and no fix. This is not a new bug. It exists on Storm running a 1.106 client and it exists on my private server running client version 1.88 and a very old version of the core.

To reproduce:

-Jump into a housing zone and stand in front of a house that you can edit.
-Create a mob, any mob, leave it as a jewel if you want.
-Shift right click on the house to bring up the edit menu

Now wait 30 or so seconds and the mob will vanish. /jump to the mob (that you can't see) and you'll notice the sky gets dark and shadows vanish. No kidding. The world has died and nothing can bring it back except going into the house and coming back out. The client, for some reason, has been told not to refresh any world objects. Furthermore it appears to be ignoring time and weather data as well. The NPC update thread is still broadcasting updates and I can even call a full refresh to send creates of all objects but they will not draw.

So what does enter and exit do?

On entering a house :
player.Out.SendEnterHouse(this);
player.Out.SendFurniture(this);
MoveTo up to a Z of aprox. 25000 (all house interiors exist above houses, offset by a few units).

It's interesting the move is done after the sends, but this seems to work.

On exiting a house:

player.MoveTo(OutdoorJumpPoint);
player.Out.SendExitHouse(this);

For testing purposes I have commented out code that sends messages and shows a house as occupied to make sure these have no effect, and they don't.

When a player pops open a housing menu this handler is called:

[PacketHandler(PacketHandlerType.TCP, 0x00, "Handles housing menu requests")]
public class HousingMenuRequestHandler : IPacketHandler
...

It sends various menu/windows depending on the packet values, for example:

Code: Select all
            case 0: // Exterior decoration (Garden)
               if (!house.CanChangeGarden(client.Player, DecorationPermissions.Add))
                  return;
               client.Player.Out.SendMerchantWindow(HouseTemplateMgr.OutdoorShopItems, eMerchantWindowType.HousingOutsideShop);
               log.Debug("Window: HousingOutsideShop");
               break;


At this point the client stops updating the world and only the house(s) and gardens continue to display.

Now I know entering and leaving a house works to fix the issue so I've tried blindly sending every house packet, but nothing works. The only way I can fix the redraw issue is to enter and leave a house, which must reset some magical flag on the client that says we can see world objects.

All I need to know is what that magical command is.

Does anyone have a live account with a house that is willing to log editing the garden?

Anyone see any other possible solution for this?

For now I'm going to display a warning to the player that they need to enter/exit a house to refresh the world when done editing.
- Mark
User avatar
Tolakram
Storm / Storm-D2 Admin
 
Posts: 9189
Joined: Tue Jun 13, 2006 1:49 am
Location: Kentucky, USA

Re: Housing bugs

Postby Graveen » Wed Nov 17, 2010 3:02 pm

Ouch. I presume pendragon does not allow via Gold & glory to buy a house ?

If yes i can log and track this bug. I have a worked on Monster Maker, and although it is not converted, i need to have a little pause related to it !
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France

Re: Housing bugs

Postby Tolakram » Wed Nov 17, 2010 7:18 pm

Thanks, that will be a big help. Hopefully I can see something we missed before, or maybe a better packet person can chime in.
- Mark
User avatar
Tolakram
Storm / Storm-D2 Admin
 
Posts: 9189
Joined: Tue Jun 13, 2006 1:49 am
Location: Kentucky, USA

Re: Housing bugs

Postby Graveen » Thu Nov 18, 2010 3:01 pm

I noticed and i'm able to reproduce the bug... Good beginning ! :p

-> it seems the npc diseappears because of no refresh ?
so, this is the part 1
-> i'm trying to reproduce the dark sky w/o having to /jump . You have a tip about this ?
so, this is the part 2, but of course i think this is because no-world-update aka 'npc vanishes'

So, basically, Shift-right clic on the house 'd trigger the bug ->> i'll log theses packets.

Notice i'm not able to display the window on Shift - right clic on the house ' Unknow is under neutral ownership', but it doesn't matter

I also tryed to change mobs with OID it confirms your point, no updates are effectives.
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France

Re: Housing bugs

Postby Tolakram » Thu Nov 18, 2010 3:16 pm

The dark sky bug happens when player (you) is removed from world and re-added. As far as I can tell that's the only way to reproduce it.
- Mark
User avatar
Tolakram
Storm / Storm-D2 Admin
 
Posts: 9189
Joined: Tue Jun 13, 2006 1:49 am
Location: Kentucky, USA

Re: Housing bugs

Postby Tolakram » Sat Nov 20, 2010 1:27 pm

Some more observations.

if I enter a house and then jump to the mob the world is frozen. So entering a house does not fix it, only exiting does. If I send house exit when the menu comes up it does not fix it. gah!
- Mark
User avatar
Tolakram
Storm / Storm-D2 Admin
 
Posts: 9189
Joined: Tue Jun 13, 2006 1:49 am
Location: Kentucky, USA

Re: Housing bugs

Postby Tolakram » Sat Nov 20, 2010 3:05 pm

I re-subbed, bought a house, and tested. :) Found at least one culprit.

00:02:31.368 S<=C 0xBA player short state v190c (sessionId:0x0132 heading:0x0328 flags:0x80 health:100% unk1:0xB0 innerCounter:0x04 bSlot:0x00 state:0 unk2:0x0000 (,Torch))
00:02:31.524 S=>C 0xBA player short state v190c (sessionId:0x0132 heading:0x0328 flags:0x80 health:100% unk1:0xB0 innerCounter:0x04 bSlot:0x00 state:0 mana:100% endurance:100% (,Torch))


The server to client response is not sent by DOL. As a matter of fact DOL never sends 0xBA back to the client and this is sent fairly regularly on live.
- Mark
User avatar
Tolakram
Storm / Storm-D2 Admin
 
Posts: 9189
Joined: Tue Jun 13, 2006 1:49 am
Location: Kentucky, USA

Re: Housing bugs

Postby Graveen » Sat Nov 20, 2010 3:24 pm

Ah Mark, time to share my tests :mrgreen:

Well, after 5 hours of work on this topic:

- i confirm, UDP packets are not sent actually. This is true for 0xBA (playershortupdate), but also for 0xA9 (player refresh)
On theses points, i fixed the UDP to match live, for both packets. In fact SendUDP from player.out is trying to prefer TCP, but it is not working; for sending UDP, i used the GameClient.PacketProcessor.SendUDP(GSUDPPacketOut, true) to force UDP.

Anyway, it does not fix the problems.

- i also agree with the MoveTo when you are in a house. Also, you can force a refresh of Enter() or Exit() - well, sending S to C packets - this is not unlokcing the world (right clic -> Enter/Exit via /code -> always crashed). So, my theory is related to the client forced display refresh is uncrashing the client, not any kind of packet

- last, i tryed to simulate a livelike 0x17 response (window merchant display). I tryed to know *if* the crash 'd be introduced by a badly formed packet (or no 0x17 answer). I doubt a bit of this, because when a shit right clic is performed on an house where you are not the owner, it crashes too.

- next, 'll be the last thing i see: after a 0x00 menu request, live got an npc update sent automagically. I have not yet simulated one in our code.

/headbang :mrgreen:
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France

Re: Housing bugs

Postby Tolakram » Sat Nov 20, 2010 3:25 pm

I saw the npc update ... I've got a version of it split out in my gameplayer and am sending a full refresh but nothing. Perhaps it's not exactly correct. :) Bloody hell! :)
- Mark
User avatar
Tolakram
Storm / Storm-D2 Admin
 
Posts: 9189
Joined: Tue Jun 13, 2006 1:49 am
Location: Kentucky, USA

Re: Housing bugs

Postby Tolakram » Sat Nov 20, 2010 3:33 pm

Oh wait.

In objectupdate ... (npc update)

Code: Select all
         if (m_gameClient.Player == null || obj.CurrentHouse != m_gameClient.Player.CurrentHouse ||
            obj.CurrentRegion != m_gameClient.Player.CurrentRegion)
         {
            return;
         }


Our current house is set when we open the menu ... ah, which will kill the update code since outside mobs are not in a current house. Hmmm.
- Mark
User avatar
Tolakram
Storm / Storm-D2 Admin
 
Posts: 9189
Joined: Tue Jun 13, 2006 1:49 am
Location: Kentucky, USA

Re: Housing bugs

Postby Tolakram » Sat Nov 20, 2010 3:40 pm

laugh out loud

Fixed! Damn CurrentHouse bug. So now to evaluate when this is set and checked to see if there are any others lurking.
- Mark
User avatar
Tolakram
Storm / Storm-D2 Admin
 
Posts: 9189
Joined: Tue Jun 13, 2006 1:49 am
Location: Kentucky, USA

Re: Housing bugs

Postby Tolakram » Sat Nov 20, 2010 4:24 pm

packetLib168.cs:

Code: Select all
      public virtual void SendObjectUpdate(GameObject obj)
      {
         Zone z = obj.CurrentZone;
         if (z == null)
            return;

         if (m_gameClient.Player == null || obj.CurrentHouse != m_gameClient.Player.CurrentHouse ||
            obj.CurrentRegion != m_gameClient.Player.CurrentRegion)
         {
            return;
         }


If it thinks the player is in a house then all updates are thrown out for objects not in a house. When a player edits the outside of the house CurrentHouse is set ... so no more updates. :)
- Mark
User avatar
Tolakram
Storm / Storm-D2 Admin
 
Posts: 9189
Joined: Tue Jun 13, 2006 1:49 am
Location: Kentucky, USA

Re: Housing bugs

Postby Graveen » Sat Nov 20, 2010 4:51 pm

/bow, excellent ! :)
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France


Return to “%s” DOL Code Contributions

Who is online

Users browsing this forum: No registered users and 1 guest