From c5bcb12119f6fc8d2a58a8fb04731578d47620f4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 22 Mar 2019 01:14:47 -1100 Subject: [PATCH] seeds --- src/cc/gamescc.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/cc/gamescc.cpp b/src/cc/gamescc.cpp index d083e2292..25088d7fc 100644 --- a/src/cc/gamescc.cpp +++ b/src/cc/gamescc.cpp @@ -59,6 +59,9 @@ UniValue games_rng(uint64_t txfee,struct CCcontract_info *cp,cJSON *params) invertflag = 1; playerid--; } + for (i=0; i<8; i++) + if ( ((1 << i) & playerid) != 0 ) + seed ^= hash.uints[i]; } else { @@ -71,6 +74,7 @@ UniValue games_rng(uint64_t txfee,struct CCcontract_info *cp,cJSON *params) if ( invertflag != 0 ) seed ^= -1; } + result.push_back(Pair("playerid",(int64_t)(playerid - 1 + invertflag))); result.push_back(Pair("seed",seed)); result.push_back(Pair("result","success")); }