Jl777 (#1333)
* Slow down clock * Faster and slower * A0/50 * Fix dilithium inputs scan to compare for the voutpubtxids[vout] * Prevent use of uninitialized ignoredAddresses * Filter out amount=0 UTXOs from getsnapshot results * rogue msvc build (#1327) * + msvc 2015 deps headers * + msvc deps build script this script builds only deps, to build rogue binary, open *.sln file in MSVC 2015 and build x64 Release version. * + msvc solution (*.sln) update * + msvc build fix * fix libcurl deps install (msvc) * Fix wrong dilithium compare * Port getchaintxstats from BTC master (#1328) This will allow explorers to present interesting analytics about transaction volume in various time frames. * customcc * Make custom * Syntax * update * Patch rogue msvc (#1330) * + msvc 2015 deps headers * + msvc deps build script this script builds only deps, to build rogue binary, open *.sln file in MSVC 2015 and build x64 Release version. * + msvc solution (*.sln) update * + msvc build fix * fix libcurl deps install (msvc) * [msvc] fix seed str -> uint64 conversion * [msvc] fix config file name issue + debug print for send raw tx * + comment debug printouts * [ msvc ] display compiler version and build date on startup * +pritns * +prints * I, * Print hex * Allow gold mismatch for validate * Stricter player data validation * Change data source * Allow claiming less than cashout value * 50902 exemption * Taxied * Print * Debug file * Log seed * Potion file * ; * Log seed * Commands log * Fp * Test * Prints * static FILE *fp; * Fp2 * Daemons or fuses * Fuse prints * All funcs * Logfp * turn_see is a daemon! * 'void (*)(struct rogue_state *, int) * -prints * -file fp * -potions file * Test * -log * -print replay2 gold * Test * D'oh!
This commit is contained in:
@@ -38,6 +38,31 @@ union _bits256 { uint8_t bytes[32]; uint16_t ushorts[16]; uint32_t uints[8]; uin
|
||||
typedef union _bits256 bits256;
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#ifdef _MSC_VER
|
||||
int gettimeofday(struct timeval * tp, struct timezone * tzp)
|
||||
{
|
||||
// Note: some broken versions only have 8 trailing zero's, the correct epoch has 9 trailing zero's
|
||||
static const uint64_t EPOCH = ((uint64_t)116444736000000000ULL);
|
||||
|
||||
SYSTEMTIME system_time;
|
||||
FILETIME file_time;
|
||||
uint64_t time;
|
||||
|
||||
GetSystemTime(&system_time);
|
||||
SystemTimeToFileTime(&system_time, &file_time);
|
||||
time = ((uint64_t)file_time.dwLowDateTime);
|
||||
time += ((uint64_t)file_time.dwHighDateTime) << 32;
|
||||
|
||||
tp->tv_sec = (long)((time - EPOCH) / 10000000L);
|
||||
tp->tv_usec = (long)(system_time.wMilliseconds * 1000);
|
||||
return 0;
|
||||
}
|
||||
#endif // _MSC_VER
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
double OS_milliseconds()
|
||||
{
|
||||
struct timeval tv; double millis;
|
||||
@@ -392,6 +417,12 @@ char *post_process_bitcoind_RPC(char *debugstr,char *command,char *rpcstr,char *
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#ifdef _MSC_VER
|
||||
#define sleep(x) Sleep(1000*(x))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/************************************************************************
|
||||
*
|
||||
* perform the query
|
||||
@@ -736,6 +767,17 @@ int32_t rogue_sendrawtransaction(char *rawtx)
|
||||
}
|
||||
free_json(retjson);
|
||||
}
|
||||
|
||||
/* log sendrawtx result in file */
|
||||
|
||||
/*
|
||||
FILE *debug_file;
|
||||
debug_file = fopen("tx_debug.log", "a");
|
||||
fprintf(debug_file, "%s\n", retstr);
|
||||
fflush(debug_file);
|
||||
fclose(debug_file);
|
||||
*/
|
||||
|
||||
free(retstr);
|
||||
}
|
||||
free(params);
|
||||
@@ -899,9 +941,46 @@ int32_t rogue_setplayerdata(struct rogue_state *rs,char *gametxidstr)
|
||||
return(retval);
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
#ifdef _MSC_VER
|
||||
__inline int msver(void) {
|
||||
switch (_MSC_VER) {
|
||||
case 1500: return 2008;
|
||||
case 1600: return 2010;
|
||||
case 1700: return 2012;
|
||||
case 1800: return 2013;
|
||||
case 1900: return 2015;
|
||||
//case 1910: return 2017;
|
||||
default: return (_MSC_VER / 100);
|
||||
}
|
||||
}
|
||||
|
||||
static inline bool is_x64(void) {
|
||||
#if defined(__x86_64__) || defined(_WIN64) || defined(__aarch64__)
|
||||
return 1;
|
||||
#elif defined(__amd64__) || defined(__amd64) || defined(_M_X64) || defined(_M_IA64)
|
||||
return 1;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
#define BUILD_DATE __DATE__ " " __TIME__
|
||||
#endif // _WIN32
|
||||
#endif // _MSC_VER
|
||||
|
||||
int main(int argc, char **argv, char **envp)
|
||||
{
|
||||
uint64_t seed; FILE *fp = 0; int32_t i,j,c; char userpass[8192];
|
||||
|
||||
#ifdef _WIN32
|
||||
#ifdef _MSC_VER
|
||||
printf("*** rogue for Windows [ Build %s ] ***\n", BUILD_DATE);
|
||||
const char* arch = is_x64() ? "64-bits" : "32-bits";
|
||||
printf(" Built with VC++ %d (%ld) %s\n\n", msver(), _MSC_FULL_VER, arch);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
for (i=j=0; argv[0][i]!=0&&j<sizeof(ASSETCHAINS_SYMBOL); i++)
|
||||
{
|
||||
c = argv[0][i];
|
||||
@@ -913,13 +992,34 @@ int main(int argc, char **argv, char **envp)
|
||||
ASSETCHAINS_SYMBOL[j++] = toupper(c);
|
||||
}
|
||||
ASSETCHAINS_SYMBOL[j++] = 0;
|
||||
|
||||
#ifdef _WIN32
|
||||
#ifdef _MSC_VER
|
||||
if (strncmp(ASSETCHAINS_SYMBOL, "ROGUE.EXE", sizeof(ASSETCHAINS_SYMBOL)) == 0 || strncmp(ASSETCHAINS_SYMBOL, "ROGUE54.EXE", sizeof(ASSETCHAINS_SYMBOL)) == 0) {
|
||||
strcpy(ASSETCHAINS_SYMBOL, "ROGUE"); // accept ROGUE.conf, instead of ROGUE.EXE.conf or ROGUE54.EXE.conf if build with MSVC
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
ROGUE_PORT = komodo_userpass(userpass,ASSETCHAINS_SYMBOL);
|
||||
if ( IPADDRESS[0] == 0 )
|
||||
strcpy(IPADDRESS,"127.0.0.1");
|
||||
printf("ASSETCHAINS_SYMBOL.(%s) port.%u (%s) IPADDRESS.%s \n",ASSETCHAINS_SYMBOL,ROGUE_PORT,USERPASS,IPADDRESS); sleep(1);
|
||||
if ( argc == 2 && (fp=fopen(argv[1],"rb")) == 0 )
|
||||
{
|
||||
seed = atol(argv[1]);
|
||||
|
||||
#ifdef _WIN32
|
||||
#ifdef _MSC_VER
|
||||
seed = _strtoui64(argv[1], NULL, 10);
|
||||
fprintf(stderr, "replay seed.str(%s) seed.uint64_t(%I64u)", argv[1], seed);
|
||||
#else
|
||||
fprintf(stderr, "replay seed.str(%s) seed.uint64_t(%llu)", argv[1], (long long)seed);
|
||||
seed = atol(argv[1]); // windows, but not MSVC
|
||||
#endif // _MSC_VER
|
||||
#else
|
||||
seed = atol(argv[1]); // non-windows
|
||||
#endif // _WIN32
|
||||
|
||||
//fprintf(stderr,"replay %llu\n",(long long)seed);
|
||||
return(rogue_replay(seed,10));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user