From 91ddc8b635b7bd6a831318f750e99a9a21bd2f85 Mon Sep 17 00:00:00 2001 From: etienne Date: Mon, 6 Jan 2025 12:43:53 +0000 Subject: [PATCH 1/3] feat: use chunks batch processing --- src/core/modules/game_terrain.js | 78 ++++++------------- src/core/utils/terrain/engine_setup.js | 15 ++-- src/core/utils/terrain/setup.js | 4 +- .../utils/terrain/world_compute_worker.js | 8 +- src/core/utils/terrain/world_setup.js | 2 +- 5 files changed, 34 insertions(+), 73 deletions(-) diff --git a/src/core/modules/game_terrain.js b/src/core/modules/game_terrain.js index a1bda31a..bc441664 100644 --- a/src/core/modules/game_terrain.js +++ b/src/core/modules/game_terrain.js @@ -3,10 +3,11 @@ import { setInterval } from 'timers/promises' import { aiter } from 'iterator-helper' import { Vector3 } from 'three' import { - WorldComputeProxy, WorldUtils, WorldEnv, - ChunksIndexer, + ProcessingTask, + LowerChunksBatch, + UpperChunksBatch, } from '@aresrpg/aresrpg-world' import { current_three_character } from '../game/game.js' @@ -20,13 +21,13 @@ import { voxel_engine_setup } from '../utils/terrain/engine_setup.js' export default function () { // world setup (main thread environement) world_shared_setup() - // make sure worker pool is ready - WorldComputeProxy.current.isReady() + ProcessingTask.initWorkerPool() // engine setup const { terrain_viewer, voxelmap_viewer } = voxel_engine_setup() - // patch containers - const chunks_indexer = new ChunksIndexer() + // chunks batch processing + const lower_chunks_batch = new LowerChunksBatch() + const upper_chunks_batch = new UpperChunksBatch() return { tick() { @@ -47,6 +48,14 @@ export default function () { ) } + const on_chunks_processed = chunks => + chunks?.forEach(chunk => { + render_world_chunk(chunk) + }) + + lower_chunks_batch.onTaskCompleted = on_chunks_processed + upper_chunks_batch.onTaskCompleted = on_chunks_processed + window.dispatchEvent(new Event('assets_loading')) // this notify the player_movement module that the terrain is ready @@ -77,59 +86,16 @@ export default function () { const state = get_state() const player_position = current_three_character(state)?.position?.clone() - // check at least one world compute unit is available - if (player_position && WorldComputeProxy.workerPool) { + if (player_position) { const current_pos = player_position.clone().floor() - // Query chunks around player position const view_center = WorldUtils.convert.asVect2(current_pos).floor() - const view_radius = state.settings.view_distance - const new_patch_keys = chunks_indexer.getIndexingChanges( - view_center, - view_radius, - ) - const index_has_changed = new_patch_keys.length > 0 - if (index_has_changed) { - // instanciate chunkset for each new patches - chunks_indexer.indexElements(new_patch_keys) - voxelmap_viewer.setVisibility(chunks_indexer.chunkIds()) - // first process undeground chunks near player - // then process far chunks at ground surface - const batch = chunks_indexer.indexedElements - const priority_batch = batch.filter( - chunkset => - chunkset.distanceTo(view_center) <= - WorldEnv.current.nearViewDist, - ) - const pending_batch = priority_batch.map( - async chunkset => - // only process undeground for chunks within near dist - await chunkset.processChunksBelowGroundSurface().then(chunks => - chunks.forEach(chunk => { - render_world_chunk(chunk) - }), - ), - ) - // wait for first batch to complete before starting second batch - await Promise.all(pending_batch) - for (const chunkset of batch) { - // for chunks further away: process only surface part - chunkset.processChunksAboveGroundSurface().then(chunks => - chunks.forEach(chunk => { - render_world_chunk(chunk) - }), - ) - } - // prioritize patches around player - // const indexedElements = chunks_indexer.indexedElements - // const prioritizedElements = prioritize_items_around_pos( - // indexedElements, - // view_center, - // ) - // for (const chunks_processor of prioritizedElements) { - - // } - terrain_viewer.setLod(camera.position, 50, camera.far) + const view_far = state.settings.view_distance + const view_near = WorldEnv.current.nearViewDist + if (upper_chunks_batch.isSyncNeeded(view_center, view_far)) { + lower_chunks_batch.syncView(view_center, view_near) + upper_chunks_batch.syncView(view_center, view_far) + voxelmap_viewer.setVisibility(upper_chunks_batch.chunkIds) } // Board } diff --git a/src/core/utils/terrain/engine_setup.js b/src/core/utils/terrain/engine_setup.js index d1a5e4f5..916a394c 100644 --- a/src/core/utils/terrain/engine_setup.js +++ b/src/core/utils/terrain/engine_setup.js @@ -7,9 +7,9 @@ import { import { BlocksBatch, WorldEnv } from '@aresrpg/aresrpg-world' import { Color, Vector2 } from 'three' -import { BLOCKS_COLOR_MAPPING } from './world_settings.js' // DEV ONLY: LEAVE THIS LINE COMMENTED // import { BLOCKS_COLOR_MAPPING } from './world_setup.js' +import { BLOCKS_COLOR_MAPPING } from './world_settings.js' import { altitude, FLAGS, LOD_MODE, patch_size } from './setup.js' const voxel_materials_list = Object.values(BLOCKS_COLOR_MAPPING).map(col => ({ @@ -27,15 +27,10 @@ export const voxel_engine_setup = () => { FLAGS.LOD_MODE === LOD_MODE.DYNAMIC && console.log(`block batch compute size: ${coords.length}`) const pos_batch = coords.map(({ x, z }) => new Vector2(x, z)) - const blocks_batch = await BlocksBatch.proxyGen(pos_batch) - // const res = await WorldComputeProxy.current.computeBlocksBatch( - // pos_batch, - // { - // includeEntitiesBlocks: true, - // }, - // ) - const data = blocks_batch.map(block => ({ - altitude: block.pos.y + 0.25, + const blocks_batch = new BlocksBatch(pos_batch) + await blocks_batch.process() + const data = blocks_batch.output.map(block => ({ + altitude: block.data.level, // block.pos.y + 0.25, // @ts-ignore color: new Color(BLOCKS_COLOR_MAPPING[block.data.type]), })) diff --git a/src/core/utils/terrain/setup.js b/src/core/utils/terrain/setup.js index 5fbd5507..9004e308 100644 --- a/src/core/utils/terrain/setup.js +++ b/src/core/utils/terrain/setup.js @@ -4,13 +4,13 @@ import { chunk_data_encoder } from './world_utils.js' // NB: LOD should be set to STATIC to limit over-computations and fix graphical issues export const LOD_MODE = { - DISABLED: 0, + NONE: 0, STATIC: 1, DYNAMIC: 2, } export const FLAGS = { - LOD_MODE: LOD_MODE.DISABLED, + LOD_MODE: LOD_MODE.NONE, } export const patch_size = { xz: 64, y: 64 } diff --git a/src/core/utils/terrain/world_compute_worker.js b/src/core/utils/terrain/world_compute_worker.js index c175627a..bf87556b 100644 --- a/src/core/utils/terrain/world_compute_worker.js +++ b/src/core/utils/terrain/world_compute_worker.js @@ -1,4 +1,4 @@ -import { WorldEnv, WorldWorkerInit, Heightmap } from '@aresrpg/aresrpg-world' +import { WorldEnv, Heightmap, ProcessingTask } from '@aresrpg/aresrpg-world' import workerpool from 'workerpool' import { world_shared_setup } from './world_setup.js' @@ -8,6 +8,6 @@ Heightmap.instance.heightmap.sampling.harmonicsCount = 6 Heightmap.instance.amplitude.sampling.seed = 'amplitude_mod' // setup worker's own environment world_shared_setup(WorldEnv.current) -// unset URL to prevent other worker instances from spawning inside the worker. -WorldEnv.current.workerPool.url = '' -WorldWorkerInit(workerpool) +// setup objects replication in worker +const { replicate } = ProcessingTask +workerpool.worker({ replicate }) diff --git a/src/core/utils/terrain/world_setup.js b/src/core/utils/terrain/world_setup.js index 91541887..743ef613 100644 --- a/src/core/utils/terrain/world_setup.js +++ b/src/core/utils/terrain/world_setup.js @@ -23,7 +23,7 @@ const SEA_LEVEL = 76 export const world_shared_setup = (world_env = WorldEnv.current) => { world_env.seaLevel = SEA_LEVEL // TODO: remove hardcoded sea world_env.chunks.dataEncoder = chunk_data_encoder - world_env.patchViewDist.near = 4 // chunks view distance below ground surface + world_env.patchViewCount.near = 2 // chunks view below ground surface // EXTERNAL CONFIGS/RESOURCES world_env.biomes.rawConf = LANDSCAPE From 7057da29f47ff6b1b68cddc9475489dcf4dfb63b Mon Sep 17 00:00:00 2001 From: Sceat Date: Sat, 11 Jan 2025 14:34:14 +0800 Subject: [PATCH 2/3] chore: bump deps --- package-lock.json | 144 +++++++++++++++++++++++++++------------------- package.json | 16 +++--- 2 files changed, 94 insertions(+), 66 deletions(-) diff --git a/package-lock.json b/package-lock.json index a562e607..39d39857 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,19 +11,19 @@ "@aresrpg/aresrpg-engine": "2.6.8", "@aresrpg/aresrpg-protocol": "5.1.7", "@aresrpg/aresrpg-sdk": "5.0.23", - "@aresrpg/aresrpg-world": "^1.7.2", + "@aresrpg/aresrpg-world": "^1.7.3", "@bufbuild/buf": "1.49.0", "@bufbuild/protobuf": "2.2.3", "@bufbuild/protoc-gen-es": "2.2.3", "@imengyu/vue3-context-menu": "1.4.4", "@intlify/unplugin-vue-i18n": "6.0.3", - "@mysten/enoki": "0.4.19", - "@mysten/kiosk": "0.9.34", - "@mysten/sui": "1.18.0", - "@mysten/wallet-standard": "0.13.20", - "@mysten/zksend": "0.12.10", + "@mysten/enoki": "0.4.21", + "@mysten/kiosk": "0.10.2", + "@mysten/sui": "1.19.0", + "@mysten/wallet-standard": "0.13.22", + "@mysten/zksend": "0.12.12", "@vercel/analytics": "1.4.1", - "@vueuse/core": "12.3.0", + "@vueuse/core": "12.4.0", "bignumber.js": "9.1.2", "camera-controls": "2.9.0", "dat.gui": "0.7.9", @@ -58,7 +58,7 @@ "@iconify-json/fluent-emoji-high-contrast": "^1.2.2", "@iconify-json/fxemoji": "^1.2.1", "@iconify-json/game-icons": "^1.2.1", - "@iconify-json/line-md": "^1.2.4", + "@iconify-json/line-md": "^1.2.5", "@iconify-json/mage": "^1.2.2", "@iconify-json/map": "^1.2.2", "@iconify-json/material-symbols-light": "^1.2.12", @@ -222,9 +222,9 @@ } }, "node_modules/@aresrpg/aresrpg-world": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/@aresrpg/aresrpg-world/-/aresrpg-world-1.7.2.tgz", - "integrity": "sha512-CD5dBeSttFuSJEoFLkQQWedgNYiFhR2SLmGyRs3zCkYd3/vr5vetwq3DSdX799X1G+lnaLRGHQAShNN0LTflSg==", + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/@aresrpg/aresrpg-world/-/aresrpg-world-1.7.3.tgz", + "integrity": "sha512-3voAnSwzIwaFfChMzygnhSTI9BwInn0P9zOvBVVaKATxFewCSFYX7+3VKcInjVZDaneVzOiv0Y9DTtfo/EbJpA==", "dependencies": { "@types/pako": "^2.0.3", "alea": "^1.0.1", @@ -2720,9 +2720,9 @@ } }, "node_modules/@iconify-json/line-md": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@iconify-json/line-md/-/line-md-1.2.4.tgz", - "integrity": "sha512-zapvr+PM17evfekZwarZaNp4szd/2ELuFhNKqLw3hGqY4by8DWIE4c97yue9ooUJN54CQXPfVGFnxNEXeeZctQ==", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/@iconify-json/line-md/-/line-md-1.2.5.tgz", + "integrity": "sha512-6zFKhs6g++kFJLLi+ye5nPoHgjYh44yVLjua0tmbxH1HdImMQZ6rkRsPnBgxADY4bQWiapXBzfoiz7+UBXgtWg==", "dev": true, "license": "MIT", "dependencies": { @@ -3345,21 +3345,21 @@ } }, "node_modules/@mysten/bcs": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@mysten/bcs/-/bcs-1.2.0.tgz", - "integrity": "sha512-LuKonrGdGW7dq/EM6U2L9/as7dFwnhZnsnINzB/vu08Xfrj0qzWwpLOiXagAa5yZOPLK7anRZydMonczFkUPzA==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@mysten/bcs/-/bcs-1.2.1.tgz", + "integrity": "sha512-RMSaUsNb8oR0rTRVIOOcyoEVJqQi6DLvMXN+7mvDcki12FJFQ0lF89zQa7AV7cIurWlDQfJ8VIbCuRDyK+955A==", "license": "Apache-2.0", "dependencies": { "bs58": "^6.0.0" } }, "node_modules/@mysten/enoki": { - "version": "0.4.19", - "resolved": "https://registry.npmjs.org/@mysten/enoki/-/enoki-0.4.19.tgz", - "integrity": "sha512-muH2+jZDC7u9mQCa9i4zQo6gO5sNFvqoxtfHJYRP8U0dr5ehypgOZh8bnxHTJwIeH3NGCLiizlmFRLiwNxygiw==", + "version": "0.4.21", + "resolved": "https://registry.npmjs.org/@mysten/enoki/-/enoki-0.4.21.tgz", + "integrity": "sha512-iuflYB5xxQHRQUkhASyPwsJv8vqneQRn/MNHfO1bjxlH2mbxcNEZ2R/StR5lEr4z37Y2AwIIEcqfzG2rPzcK+Q==", "license": "Apache-2.0", "dependencies": { - "@mysten/sui": "1.18.0", + "@mysten/sui": "1.19.0", "@nanostores/react": "^0.7.2", "jose": "^5.6.3", "nanostores": "^0.10.3" @@ -3378,25 +3378,25 @@ } }, "node_modules/@mysten/kiosk": { - "version": "0.9.34", - "resolved": "https://registry.npmjs.org/@mysten/kiosk/-/kiosk-0.9.34.tgz", - "integrity": "sha512-0HlXygbGeW5FEXkptB36JQIfpHvuYCyw4B8uhtnTlVL52zMFrMazrgyqisnm+BJFxFfClz2WMuv98hVXcPtstQ==", + "version": "0.10.2", + "resolved": "https://registry.npmjs.org/@mysten/kiosk/-/kiosk-0.10.2.tgz", + "integrity": "sha512-23XD4NFqBGEFDu8Zae8+CW3TQPM5c494le35TIIod+F41A5AyQKK9ZiCkTPs6MfFJHOQNRbdEIPtUQW8K7DIhw==", "license": "Apache-2.0", "dependencies": { - "@mysten/sui": "1.18.0" + "@mysten/sui": "1.19.0" }, "engines": { "node": ">=18" } }, "node_modules/@mysten/sui": { - "version": "1.18.0", - "resolved": "https://registry.npmjs.org/@mysten/sui/-/sui-1.18.0.tgz", - "integrity": "sha512-cFh5LxXZrXb/ZAD1dkKeQxzhgRYFXreyFGmI7w/JQWwdl+/0FrHJBwaWyTmGxJ/6ZC9SlaOPOk63flN7DbUurg==", + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/@mysten/sui/-/sui-1.19.0.tgz", + "integrity": "sha512-hjNCArz7upZaGZNNmMeQRKSlQK73eN+p8MlKJvlZpx/6gorK0WWFWWjEcIyJndkIDbLb06nbQbWIWZ8KoI036Q==", "license": "Apache-2.0", "dependencies": { "@graphql-typed-document-node/core": "^3.2.0", - "@mysten/bcs": "1.2.0", + "@mysten/bcs": "1.2.1", "@noble/curves": "^1.4.2", "@noble/hashes": "^1.4.0", "@scure/bip32": "^1.4.0", @@ -3415,23 +3415,23 @@ } }, "node_modules/@mysten/wallet-standard": { - "version": "0.13.20", - "resolved": "https://registry.npmjs.org/@mysten/wallet-standard/-/wallet-standard-0.13.20.tgz", - "integrity": "sha512-k9nDnZ/ZkCr4wFRxiP984k/T2ZUfwd/+RfYnwbMHv6MW91no2VKb53fVxbkhqc39qGKAvrXeMonNrm37Iz0JFw==", + "version": "0.13.22", + "resolved": "https://registry.npmjs.org/@mysten/wallet-standard/-/wallet-standard-0.13.22.tgz", + "integrity": "sha512-pMGY5BkZzEGcSH0qDxjbk/KKg8jIr7MLvSBg/YHLrfUC3WPOUwrSVjmjuGaSPEa/QI3Kj3mzwx9OH9C7OYW94A==", "license": "Apache-2.0", "dependencies": { - "@mysten/sui": "1.18.0", - "@wallet-standard/core": "1.0.3" + "@mysten/sui": "1.19.0", + "@wallet-standard/core": "1.1.0" } }, "node_modules/@mysten/zksend": { - "version": "0.12.10", - "resolved": "https://registry.npmjs.org/@mysten/zksend/-/zksend-0.12.10.tgz", - "integrity": "sha512-qMbmRKnKV+AnLaKveJN8itAOMHa2pqfw3IkO3sLTlt42T5qQE0BXj9cKHMLv+F7w+k5+CBDL/0R7Xdb17hSRzw==", + "version": "0.12.12", + "resolved": "https://registry.npmjs.org/@mysten/zksend/-/zksend-0.12.12.tgz", + "integrity": "sha512-h7B4fCxpN1iK6pUNuz0x9rGzU6k4uQbfb/+6uJsV0kGRLN2cbS4wdFTPD+6g4xPrf94N0fHt2C+mlYOBfvGJ6g==", "license": "Apache-2.0", "dependencies": { - "@mysten/sui": "1.18.0", - "@mysten/wallet-standard": "0.13.20", + "@mysten/sui": "1.19.0", + "@mysten/wallet-standard": "0.13.22", "mitt": "^3.0.1", "nanostores": "^0.10.3", "valibot": "^0.36.0" @@ -4611,14 +4611,14 @@ } }, "node_modules/@vueuse/core": { - "version": "12.3.0", - "resolved": "https://registry.npmjs.org/@vueuse/core/-/core-12.3.0.tgz", - "integrity": "sha512-cnV8QDKZrsyKC7tWjPbeEUz2cD9sa9faxF2YkR8QqNwfofgbOhmfIgvSYmkp+ttSvfOw4E6hLcQx15mRPr0yBA==", + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/@vueuse/core/-/core-12.4.0.tgz", + "integrity": "sha512-XnjQYcJwCsyXyIafyA6SvyN/OBtfPnjvJmbxNxQjCcyWD198urwm5TYvIUUyAxEAN0K7HJggOgT15cOlWFyLeA==", "license": "MIT", "dependencies": { "@types/web-bluetooth": "^0.0.20", - "@vueuse/metadata": "12.3.0", - "@vueuse/shared": "12.3.0", + "@vueuse/metadata": "12.4.0", + "@vueuse/shared": "12.4.0", "vue": "^3.5.13" }, "funding": { @@ -4626,18 +4626,18 @@ } }, "node_modules/@vueuse/metadata": { - "version": "12.3.0", - "resolved": "https://registry.npmjs.org/@vueuse/metadata/-/metadata-12.3.0.tgz", - "integrity": "sha512-M/iQHHjMffOv2npsw2ihlUx1CTiBwPEgb7DzByLq7zpg1+Ke8r7s9p5ybUWc5OIeGewtpY4Xy0R2cKqFqM8hFg==", + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/@vueuse/metadata/-/metadata-12.4.0.tgz", + "integrity": "sha512-AhPuHs/qtYrKHUlEoNO6zCXufu8OgbR8S/n2oMw1OQuBQJ3+HOLQ+EpvXs+feOlZMa0p8QVvDWNlmcJJY8rW2g==", "license": "MIT", "funding": { "url": "https://github.com/sponsors/antfu" } }, "node_modules/@vueuse/shared": { - "version": "12.3.0", - "resolved": "https://registry.npmjs.org/@vueuse/shared/-/shared-12.3.0.tgz", - "integrity": "sha512-X3YD35GUeW0d5Gajcwv9jdLAJTV2Jdb/Ll6Ii2JIYcKLYZqv5wxyLeKtiQkqWmHg3v0J0ZWjDUMVOw2E7RCXfA==", + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/@vueuse/shared/-/shared-12.4.0.tgz", + "integrity": "sha512-9yLgbHVIF12OSCojnjTIoZL1+UA10+O4E1aD6Hpfo/DKVm5o3SZIwz6CupqGy3+IcKI8d6Jnl26EQj/YucnW0Q==", "license": "MIT", "dependencies": { "vue": "^3.5.13" @@ -4668,20 +4668,49 @@ } }, "node_modules/@wallet-standard/core": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@wallet-standard/core/-/core-1.0.3.tgz", - "integrity": "sha512-Jb33IIjC1wM1HoKkYD7xQ6d6PZ8EmMZvyc8R7dFgX66n/xkvksVTW04g9yLvQXrLFbcIjHrCxW6TXMhvpsAAzg==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@wallet-standard/core/-/core-1.1.0.tgz", + "integrity": "sha512-v2W5q/NlX1qkn2q/JOXQT//pOAdrhz7+nOcO2uiH9+a0uvreL+sdWWqkhFmMcX+HEBjaibdOQMUoIfDhOGX4XA==", + "license": "Apache-2.0", + "dependencies": { + "@wallet-standard/app": "^1.1.0", + "@wallet-standard/base": "^1.1.0", + "@wallet-standard/errors": "^0.1.0", + "@wallet-standard/features": "^1.1.0", + "@wallet-standard/wallet": "^1.1.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/@wallet-standard/errors": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@wallet-standard/errors/-/errors-0.1.0.tgz", + "integrity": "sha512-ag0eq5ixy7rz8M5YUWGi/EoIJ69KJ+KILFNunoufgmXVkiISC7+NIZXJYTJrapni4f9twE1hfT+8+IV2CYCvmg==", "license": "Apache-2.0", "dependencies": { - "@wallet-standard/app": "^1.0.1", - "@wallet-standard/base": "^1.0.1", - "@wallet-standard/features": "^1.0.3", - "@wallet-standard/wallet": "^1.0.1" + "chalk": "^5.3.0", + "commander": "^12.1.0" + }, + "bin": { + "errors": "bin/cli.mjs" }, "engines": { "node": ">=16" } }, + "node_modules/@wallet-standard/errors/node_modules/chalk": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.4.1.tgz", + "integrity": "sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w==", + "license": "MIT", + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, "node_modules/@wallet-standard/features": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@wallet-standard/features/-/features-1.1.0.tgz", @@ -5642,7 +5671,6 @@ "version": "12.1.0", "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==", - "dev": true, "license": "MIT", "engines": { "node": ">=18" diff --git a/package.json b/package.json index 90ab3f8f..785fa455 100644 --- a/package.json +++ b/package.json @@ -17,19 +17,19 @@ "@aresrpg/aresrpg-engine": "2.6.8", "@aresrpg/aresrpg-protocol": "5.1.7", "@aresrpg/aresrpg-sdk": "5.0.23", - "@aresrpg/aresrpg-world": "^1.7.2", + "@aresrpg/aresrpg-world": "^1.7.3", "@bufbuild/buf": "1.49.0", "@bufbuild/protobuf": "2.2.3", "@bufbuild/protoc-gen-es": "2.2.3", "@imengyu/vue3-context-menu": "1.4.4", "@intlify/unplugin-vue-i18n": "6.0.3", - "@mysten/enoki": "0.4.19", - "@mysten/kiosk": "0.9.34", - "@mysten/sui": "1.18.0", - "@mysten/wallet-standard": "0.13.20", - "@mysten/zksend": "0.12.10", + "@mysten/enoki": "0.4.21", + "@mysten/kiosk": "0.10.2", + "@mysten/sui": "1.19.0", + "@mysten/wallet-standard": "0.13.22", + "@mysten/zksend": "0.12.12", "@vercel/analytics": "1.4.1", - "@vueuse/core": "12.3.0", + "@vueuse/core": "12.4.0", "bignumber.js": "9.1.2", "camera-controls": "2.9.0", "dat.gui": "0.7.9", @@ -64,7 +64,7 @@ "@iconify-json/fluent-emoji-high-contrast": "^1.2.2", "@iconify-json/fxemoji": "^1.2.1", "@iconify-json/game-icons": "^1.2.1", - "@iconify-json/line-md": "^1.2.4", + "@iconify-json/line-md": "^1.2.5", "@iconify-json/mage": "^1.2.2", "@iconify-json/map": "^1.2.2", "@iconify-json/material-symbols-light": "^1.2.12", From edd0513aa7401f46a4ed40505aa4ad6787eaf60f Mon Sep 17 00:00:00 2001 From: Sceat Date: Sat, 11 Jan 2025 14:57:48 +0800 Subject: [PATCH 3/3] chore: bump dep & fix lint issues --- package-lock.json | 12 ++++++------ package.json | 2 +- src/components/game-canvas.vue | 1 + src/core/sui/client.js | 1 + 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index 39d39857..3c702aba 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "dependencies": { "@aresrpg/aresrpg-engine": "2.6.8", "@aresrpg/aresrpg-protocol": "5.1.7", - "@aresrpg/aresrpg-sdk": "5.0.23", + "@aresrpg/aresrpg-sdk": "5.0.24", "@aresrpg/aresrpg-world": "^1.7.3", "@bufbuild/buf": "1.49.0", "@bufbuild/protobuf": "2.2.3", @@ -200,9 +200,9 @@ } }, "node_modules/@aresrpg/aresrpg-sdk": { - "version": "5.0.23", - "resolved": "https://registry.npmjs.org/@aresrpg/aresrpg-sdk/-/aresrpg-sdk-5.0.23.tgz", - "integrity": "sha512-Cdbxa8qv4ZPtCrKld59+tER+TJl+3cKAMt1iNBOQLUXIXUZLxVtDCy4UtnyrX4T18UAt99w/M0U322Shv8mBNQ==", + "version": "5.0.24", + "resolved": "https://registry.npmjs.org/@aresrpg/aresrpg-sdk/-/aresrpg-sdk-5.0.24.tgz", + "integrity": "sha512-t7pZF72E9a5VJG/2I60klwJ3YBTyyyKBdHevmEvVRvVIQYzgnIddO5UuueV1uOUJIVtZIkQFj6nUpcWe35BZIA==", "license": "MIT", "dependencies": { "@hydre/pino-human": "1.3.0", @@ -210,14 +210,14 @@ "bignumber.js": "^9.1.2", "iterator-helper": "^1.3.4", "lru-cache": "^11.0.2", - "pino": "^9.5.0", + "pino": "^9.6.0", "spiralloop": "^1.0.2" }, "engines": { "node": ">=21.0.0" }, "peerDependencies": { - "@mysten/kiosk": "^0.9.33", + "@mysten/kiosk": "^0.10.2", "@mysten/sui": "^1.17.0" } }, diff --git a/package.json b/package.json index 785fa455..640b0ac5 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "dependencies": { "@aresrpg/aresrpg-engine": "2.6.8", "@aresrpg/aresrpg-protocol": "5.1.7", - "@aresrpg/aresrpg-sdk": "5.0.23", + "@aresrpg/aresrpg-sdk": "5.0.24", "@aresrpg/aresrpg-world": "^1.7.3", "@bufbuild/buf": "1.49.0", "@bufbuild/protobuf": "2.2.3", diff --git a/src/components/game-canvas.vue b/src/components/game-canvas.vue index 6c2b0df2..35296bd8 100644 --- a/src/components/game-canvas.vue +++ b/src/components/game-canvas.vue @@ -29,6 +29,7 @@ const show_topbar = inject('show_topbar'); const webgl_available = ref(true); onMounted(() => { + // @ts-ignore if (!WebGL.isWebGL2Available()) webgl_available.value = false; else { set_canvas(renderer_container.value); diff --git a/src/core/sui/client.js b/src/core/sui/client.js index af1085c9..9b161467 100644 --- a/src/core/sui/client.js +++ b/src/core/sui/client.js @@ -589,6 +589,7 @@ export async function sui_buy_item(item) { if (rule_definition.hasLockingRule) should_be_locked = true await rule_definition.resolveRuleFunction({ + kioskClient: sdk.kiosk_client, packageId: rule_definition.packageId, transaction: tx, itemType: item._type,