-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi,
I applied the following patch to jpoker (accidentaly with the
TourneyStart packet handling that will show as non covered lines in
the test). I believe it fixes the issue johan had when trying the
client with the long poll implementation.
Cheers
diff -r 435dae76e10a jpoker/js/jquery.jpoker.js
- --- a/jpoker/js/jquery.jpoker.js Thu Sep 10 17:39:33 2009 +0200
+++ b/jpoker/js/jquery.jpoker.js Thu Sep 10 19:28:54 2009 +0200
@@ -835,7 +835,9 @@
if($this.getConnectionState() != 'connected') {
$this.setConnectionState('connected');
}
- - $this.receivePacket(data);
+ if(packet_type != 'PacketPokerLongPollReturn') {
+ $this.receivePacket(data);
+ }
},
error: function(xhr, status, error) {
if(status == 'timeout') {
@@ -1102,6 +1104,10 @@
switch(packet.type) {
+ case 'PacketPokerTourneyStart':
+ server.tableJoin(packet.table_serial);
+ break;
+
case 'PacketPokerTable':
if(packet.id in server.tables) {
server.tables[packet.id].reinit(packet);
diff -r 435dae76e10a jpoker/js/test-jpoker.js
- --- a/jpoker/js/test-jpoker.js Thu Sep 10 17:39:33 2009 +0200
+++ b/jpoker/js/test-jpoker.js Thu Sep 10 19:28:54 2009 +0200
@@ -2200,6 +2200,28 @@
self.reset();
});
+test("jpoker.connection:longPoll PacketPokerLongPollReturn not
received ", function(){ expect(1);
+
stop();
+ var PokerServer = function() {};
+
+ PokerServer.prototype = {
+ outgoing: '[]',
+
+ handle: function(packet) { }
+ };
+
+ ActiveXObject.prototype.server = new PokerServer();
+
+ var self = new jpoker.connection();
+ self.receivePacket = function(data) { ok(false, 'receive not
called'); };
+ self.sendPacket({ type: 'PacketPokerLongPollReturn'});
+ self.receivePacket = function(data) {
+ ok(true, 'receive called');
+ start_and_cleanup();
+ };
+ self.sendPacket({ type: 'Packet'});
+ });
+
test("jpoker.connection:longPoll frequency", function(){
expect(8);
now = jpoker.now
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkqpN/QACgkQ8dLMyEl6F23CVwCeJwCCRLhyfbIkeJI40D5JGSLE
vwgAni6BMVZVxcIZt5N3mY/e9lB/QQXl
=tuC6
-----END PGP SIGNATURE-----
<<attachment: loic.vcf>>
_______________________________________________ Pokersource-users mailing list [email protected] https://mail.gna.org/listinfo/pokersource-users
