m1ndgames has asked for the wisdom of the Perl Monks concerning the following question:

hello!
im trying to write a script that connects to a gameserver over udp.
the communication is based on XDR encoded packets, you can see how the packet should be crafted on the servers sourcecode:
http://gitorious.org/fg/flightgear/blobs/next/src/MultiPlayer/multiplaymgr.cxx#line900

So im connected to my local server, but i cant figure out how to craft those packets (im seeing "bad client" in the servers logfile).
pack() is only for numeric values, right? the cpan XDR module is no help either :(

can you point me in the right direction?

Replies are listed 'Best First'.
Re: XDR encoded packet over udp socket
by Anonymous Monk on Aug 09, 2012 at 02:16 UTC
      i know, but i dont understand those functions :(

      sub xdrencode() { my ($args) = shift; my $xid = "FGMS"; my $vers = "1.1"; my $proc = "test"; my $prog = "test2"; my $xdr = XDR->call_packet($xid, $proc, $args, $vers, $prog); return ($xdr); } print &xdrencode("www");


      how do i create such a packet? can anyone give me an example please? :(