Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
7b03e60c06
  1. 2
      iguana/cards777.c
  2. 16
      iguana/pangea_hand.c

2
iguana/cards777.c

@ -220,7 +220,7 @@ bits256 cards777_initdeck(bits256 *cards,bits256 *cardpubs,int32_t numcards,int3
}
if ( playerprivs != 0 )
printf("\n%llx %llx playerprivs\n",(long long)playerprivs[0].txid,(long long)playerprivs[1].txid);
if ( 0 && Debuglevel > 2 )
//if ( 0 && Debuglevel > 2 )
{
for (i=0; i<numcards; i++)
printf("%d ",cards[i*N].bytes[1]);

16
iguana/pangea_hand.c

@ -160,6 +160,15 @@ int32_t pangea_newdeck(struct supernet_info *myinfo,struct table_info *tp)
datalen = (tp->G.numcards + 1 + n) * sizeof(bits256);
pangea_sendcmd(myinfo,tp,"newhand",-1,hand->cardpubs[0].bytes,datalen,n,n);
printf("host sends NEWDECK checkprod.%llx numhands.%d\n",(long long)hand->checkprod.txid,tp->numhands);
{
bits256 checkprod; char str[65],str2[65];
checkprod = cards777_pubkeys(hand->cardpubs,tp->G.numcards,hand->cardpubs[tp->G.numcards]);
if ( bits256_cmp(checkprod,hand->checkprod) != 0 )
printf("checkprod err.(%s) != (%s)\n",bits256_str(str,checkprod),bits256_str(str2,hand->checkprod));
for (i=0; i<tp->G.numcards; i++)
printf("%d: %s\n",i,bits256_str(str,hand->cardpubs[i]));
printf("cardpubs.(%s)\n",bits256_str(str,hand->cardpubs[tp->G.numcards]));
}
return(0);
}
@ -178,14 +187,17 @@ void pangea_newhand(PANGEA_HANDARGS)
tp->myind = -1;
for (i=0; i<n; i++)
{
if ( (ind= pangea_Pind(tp,pubkeys[numcards + 1 + i])) < 0 )
/*if ( (ind= pangea_Pind(tp,pubkeys[numcards + 1 + i])) < 0 )
{
char str[65],str2[65]; int32_t j;
for (j=0; j<n; j++)
printf("(j%d %s vs %s)",j,bits256_str(str,tp->G.P[j].playerpub),bits256_str(str2,pubkeys[numcards + 1 + i]));
printf("illegal pubkey, cant find player[%d] (%s)\n",i,bits256_str(str,pubkeys[numcards + 1 + i]));
return;
}
}*/
ind = i;
tp->G.P[ind].playerpub = pubkeys[numcards + 1 + i];
tp->G.P[ind].nxt64bits = acct777_nxt64bits(pubkeys[numcards + 1 + i]);
tp->active[i] = &tp->G.P[ind];
if ( i == 0 )
hand->button = ind;

Loading…
Cancel
Save