My gut is telling me that you simply shouldn't allow the client to do anything that would alter the characteristics of object attributes on the server other than by calling well-defined actions such as "hit" or "run away." Granted, the server might need to send some values to the display, but it should not matter in the least if the client alters those values since it would result in an invalid display and the client would still be limited to interacting with the server by using only valid actions.

I think you would be much more concerned about securing access to the server so that clients could not alter the code itself that resides there. Along with such basic things as understanding how "taint" is your friend when dealing with input from sh...., uhhh, users.

Without having done any research right now, I would wager that there are several examples of game APIs on CPAN. I would look them up, especially those that deal with card games, and see how they address the issues you have brought up. Never forget the fundamental rule of programming: Don't reinvent the wheel, steal it! (Okay, I'm showing my age and Unix roots, but it applies more than ever today given how that is a primary goal of OO design.)


In reply to Re: Moose class design for game by boftx
in thread Moose class design for game by wanna_code_perl

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.