1
0
mirror of https://github.com/p2r3/bareiron.git synced 2025-10-01 23:25:09 +02:00

hash seeds before use

This commit is contained in:
p2r3
2025-08-20 23:39:51 +03:00
parent e60b5a44f9
commit 6e5791a2d0
2 changed files with 11 additions and 1 deletions

View File

@@ -26,7 +26,7 @@
ssize_t recv_count;
uint8_t recv_buffer[256] = {0};
uint32_t world_seed = 0xA103DE6C;
uint32_t world_seed = 0xA103DE6B;
uint32_t rng_seed = 0xE2B9419;
uint16_t client_count;

View File

@@ -337,6 +337,16 @@ void disconnectClient (int *client_fd, int cause) {
int main () {
// Hash the seeds to ensure they're random enough
world_seed = splitmix64(world_seed);
printf("World seed: ");
for (int i = 0; i < 4; i ++) printf("%X", (world_seed >> (8 * i)) & 255);
rng_seed = splitmix64(rng_seed);
printf("\nRNG seed: ");
for (int i = 0; i < 4; i ++) printf("%X", (rng_seed >> (8 * i)) & 255);
printf("\n\n");
for (int i = 0; i < sizeof(block_changes) / sizeof(BlockChange); i ++) {
block_changes[i].block = 0xFF;
}