Iris2.de
http://iris2.de/forum/

Name Bug
http://iris2.de/forum/viewtopic.php?f=18&t=1394
Page 1 of 1

Author:  Sehlor [ Thu May 07, 2009 3:39 pm ]
Post subject:  Name Bug

When I Drag Something On paperdoll and Drop to my Backpack my Name Appears: "Sehlor" then if i drag something from my backpack and drop to paperdoll my name appears "Sinister Sehlor, Legendary Wizard"

I Looked paperdoll.lua but couldn't find any function to update name where can i handle it ?

regards

Author:  ghoulsblade [ Thu May 07, 2009 4:52 pm ]
Post subject: 

it might be caused by the server sending the full name only when a single click event on your char is sent (during dragdrop maybe?)

paperdoll name text change happens here :

iris/lua/gui/gui.paperdoll.lua:381: dialog.controls["paperdollname"]:SetUOHtml("<BASEFONT COLOR=#000000>"..sname.."</BASEFONT>", true)

to find out what caused it i'd suggest adding a line below it that prints a stacktrace when it is updated :

print("paperdoll name update",GetStackTrace())

other places where the name is updated :
iris/lua/net/net.packethandlers.lua:19: paperdoll.name = input:PopFilledString(60)
iris/lua/gui/gui.paperdoll.lua:480: paperdoll.name = playermobile.name
iris/lua/gui/gui.paperdoll.lua:497: paperdoll.name = m and m.name or serial

so it comes from the mobile name or from the open-paperdoll-packet.
there might be several different places where the mobile name is updated as well.

one way to trace it would be to do some intricate lua magic to catch all changes to the name field of mobiles and paperdoll, to do that you'd install a metatable in the paperdoll and mobile object at creation, the metatable could then call a callback on the _newvalue (or so) event whenever the "name" field is accessed.

to have the callback called not only the first time but also subsequent times, the callback would have to store the real value of the "name" field in another field like shadow_name and then also also override the "_value" method of the metatable to use that shadow field for reading.

it's a bit tricky, you might not need that trick, i just thought i'd mention it.

Author:  Sehlor [ Thu May 07, 2009 5:30 pm ]
Post subject: 

i think i can made some server side changes or some tricks in client i don't know, for now we are making new map and particles.

thanks for reply
Regards
Sehlor

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/