Jason McIntosh | 19 Aug 20:49
Picon

Re: Number handling in RPCs

On 8/18/05, Andrew Plotkin <erkyrath <at> eblong.com> wrote:
> 
> * Second case: We tweak the Javolin code to convert Javascript numbers to
> ints where possible. This is the same procedure as above, only in the
> client rather than the (Python) referee.
> 
> Games which use floats will still have to accept ints, as in case 1.

I am fine with this solution for now.

--

-- 
  Jason McIntosh             jmac <at> jmac.org
Somerville, MA, USA       http://www.jmac.org

-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
Doug Orleans | 19 Aug 22:44
X-Face

Re: Number handling in RPCs

Jason McIntosh writes:
 > On 8/18/05, Andrew Plotkin <erkyrath <at> eblong.com> wrote:
 > > 
 > > * Second case: We tweak the Javolin code to convert Javascript numbers to
 > > ints where possible. This is the same procedure as above, only in the
 > > client rather than the (Python) referee.
 > > 
 > > Games which use floats will still have to accept ints, as in case 1.
 > 
 > I am fine with this solution for now.

I agree.  I'm not entirely sure where to do it, though.  I was
thinking it could be done in
org.volity.jabber.packet.RPC.getValueXML(), but it should probably
happen further upstream, i.e., if someone gives 42.0 to the RPC code,
it should be sent as a <double>, not an <int>.  So I guess it should
happen before calling org.volity.client.Referee.invoke(), namely in
the "rpc" callback in GameUI, which is where we first get our hands on
the ECMAScript parameter values.  I'll try that out this weekend,
unless someone else gets to it first.

--dougo <at> place.org

-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf

Gmane