示例#1
0
        public void Handle(NetworkManager nm, Bot core)
        {
            File.WriteAllBytes("map.gz", core.ClientWorld.BlockArray);

            core.ClientWorld.BlockArray = GZip.UnGZip(core.ClientWorld.BlockArray) ??
                                          new byte[(SizeX * SizeY * SizeZ) + 4];

            var blockArraySize = BitConverter.ToInt32(new[] { core.ClientWorld.BlockArray[3], core.ClientWorld.BlockArray[2], core.ClientWorld.BlockArray[1], core.ClientWorld.BlockArray[0] }, 0);
            core.ClientWorld.RemoveSize();

            core.ClientWorld.MapSize = new Vector3S {X = SizeX, Y = SizeZ, Z = SizeY};

            core.RaiseInfoMessage("Map complete.");

            if ((SizeX * SizeY * SizeZ) != blockArraySize)
                core.RaiseErrorMessage(
                    $"Protocol Error: Map data length != Finalize length ({blockArraySize} - {(SizeX*SizeY*SizeZ)})");

            core.RaiseLevelComplete(SizeX, SizeY, SizeZ);

            //core.ClientWorld.WorldCheck(core);
        }