world: publish decorated region batches
This commit is contained in:
parent
d8b5d0f79b
commit
c4be38acdd
10 changed files with 471 additions and 25 deletions
|
|
@ -1,6 +1,7 @@
|
|||
package server
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
|
|
@ -128,3 +129,24 @@ func TestServerRejectsNegativeCacheLimit(t *testing.T) {
|
|||
t.Fatal("negative cache limit was accepted")
|
||||
}
|
||||
}
|
||||
|
||||
func TestNewUsesProductionBatchGenerator(t *testing.T) {
|
||||
cfg := DefaultConfig()
|
||||
cfg.WorldDir = ""
|
||||
cfg.WorldSeed = 12345
|
||||
cfg.MaxCachedChunks = 64
|
||||
srv, err := New(cfg)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := srv.Chunks().PreloadErrContext(context.Background(), 0, 0); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
for cx := int32(-1); cx <= 1; cx++ {
|
||||
for cz := int32(-1); cz <= 1; cz++ {
|
||||
if !srv.Chunks().IsChunkLoaded(cx, cz) {
|
||||
t.Fatalf("production batch did not publish neighbor (%d,%d)", cx, cz)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue