forked from EXTERNAL/bareiron
hash seeds before use
This commit is contained in:
@@ -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;
|
||||
|
10
src/main.c
10
src/main.c
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user