"Michael Oschmann" <[EMAIL PROTECTED]> writes:

>    My problem is I'm not getting any extra packets after packetshowdown,

     Please include the traces + binary dump for these extra packets and
for packetshowdown. 

>    and I suspect the packets necessary for the beginning of a new poker
>    game are after packetpokershowdown. There's 440 bytes "apparently" in
>    showdown?

     The showdownpacket is rather large. There is a bug in the unpacking
function. If you're not interested in the json content, at least the unpack
function should discard the bytes as if it was a string. Here is the AS
class fixed:

public class PacketPokerShowdown extends Packet
{
        public var serial:int;
        public var game_id:int;
        public var showdown_stack:String;

        public override function unpack(bytes:ByteArray):ByteArray
        {
                bytes = super.unpack(bytes);
                this.serial = bytes.readUnsignedInt();
                this.game_id = bytes.readUnsignedInt();
                {
                        var size:int = bytes.readUnsignedShort();
                        this.showdown_stack = bytes.readUTFBytes(size);
                }
                return bytes;
        }

        public override function pack():ByteArray
        {
                var bytes:ByteArray = super.pack();
                bytes.writeUnsignedInt(this.serial);
                bytes.writeUnsignedInt(this.game_id);
                bytes.writeUnsignedShort(this.showdown_stack.length);
                bytes.writeUTFBytes(this.showdown_stack, 
this.showdown_stack.length)
                return bytes;
        }

        public override function calcsize():int
        {
                var size:int = super.calcsize();
                size += 4; // serial
                size += 4; // game_id
                size += 2 + this.showdown_stack.length;
                return size;
        }
}


-- 
+33 1 76 60 72 81  Loic Dachary mailto:[EMAIL PROTECTED]
http://dachary.org/loic/gpg.txt sip:[EMAIL PROTECTED]
Latitude: 48.86962325498033 Longitude: 2.3623046278953552

_______________________________________________
Pokersource-users mailing list
[email protected]
https://mail.gna.org/listinfo/pokersource-users

Reply via email to