This commit is contained in:
jl777
2019-03-22 01:14:47 -11:00
parent b6cdf0725e
commit c5bcb12119

View File

@@ -59,6 +59,9 @@ UniValue games_rng(uint64_t txfee,struct CCcontract_info *cp,cJSON *params)
invertflag = 1; invertflag = 1;
playerid--; playerid--;
} }
for (i=0; i<8; i++)
if ( ((1 << i) & playerid) != 0 )
seed ^= hash.uints[i];
} }
else else
{ {
@@ -71,6 +74,7 @@ UniValue games_rng(uint64_t txfee,struct CCcontract_info *cp,cJSON *params)
if ( invertflag != 0 ) if ( invertflag != 0 )
seed ^= -1; seed ^= -1;
} }
result.push_back(Pair("playerid",(int64_t)(playerid - 1 + invertflag)));
result.push_back(Pair("seed",seed)); result.push_back(Pair("seed",seed));
result.push_back(Pair("result","success")); result.push_back(Pair("result","success"));
} }