Thread: Arrow buying
View Single Post
  #19  
Old 02-05-2011, 01:09 AM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
Quote:
Originally Posted by WhiteDragon View Post
Unfortunately this results in code duplication, which makes going back and editing things annoying (twice the work, and you better not forget one of the checks). I usually only add in the extra clientside check if it's something that's going to be triggering extremely frequently. Of course this is a matter of preference but this is what I've found to be a nice balance.

The code duplication issue is sadly a hard problem to solve, even outside of Graal, and I haven't really seen a solution I've liked anywhere to port it, so I guess we'll just have deal with it for now in the critical areas.
I usually use a this.attr[#] serverside to store the price which can be read clientside. Then if price is edited serverside, it applies clientside as well. Basically no code duplication involved?
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote