Giter VIP home page Giter VIP logo

blockexchange's Introduction

minetest blockexchange mod

Coverage Status License Download

Overview

The blockexchange mod allows you to share and use your builds across different worlds. It uses a central (configurable) server to exchange schemas (builds) of near infinite size.

The server part lives at https://github.com/blockexchange/blockexchange_server and can be self-hosted.

Schemas can be browsed and administered on the central server: https://blockexchange.minetest.ch

Basic usage

Download

  • Start your minetest app
  • Download the blockexchange mod in the "Content" tab from the ContentDB.
  • Add the blockexchange mod to the secure HTTP-Mods settings (search for "http" in the "settings" tab)
  • Create a new world and activate the mod
  • Grant yourself the needed privs with /grantme blockexchange
  • Search for an empty place and mark it with /bx_pos1
  • Browse online for a schema at https://blockexchange.minetest.ch
  • Load the schema with the /bx_load <username> <schemaname> command (WARNING: this may place the schema over existing builds!)
  • Have fun!

Upload

  • Start your minetest app
  • Download the blockexchange mod in the "Content" tab from the ContentDB.
  • Add the blockexchange mod to the secure HTTP-Mods settings (search for "http" in the "settings" tab)
  • Create a new world and activate the mod
  • Grant yourself the needed privs with /grantme blockexchange
  • Build a thing
  • Set positions on the opposite corners with /bx_pos1 and /bx_pos2
  • Login with an access token generated from https://blockexchange.minetest.ch: /bx_login [username] [access_token]
  • Save the schematic with /bx_save <name>

Chat commands

Offline

Local commands, they don't need the http-api and make no calls "home"

  • /bx_hud [on|off] enables or disables the blockexchange hud
  • /bx_pos1 [pos?] mark position 1 (uses WE positions if available)
  • /bx_pos2 [pos?] mark position 2 (uses WE positions if available)
  • /bx_cleanup cleans up stray metadata and invalid param2 values
  • /bx_area_remove [area_id?] removes the area information (not the build)
  • /bx_area_mark [area_id?] marks the area
  • /bx_emerge emerge the selected area
  • /bx_save_local [schematic-name] saves a local schematic to <worldmods>/bxschems
  • /bx_load_local [schematic-name] loads a local schematic from <worldmods>/bxschems
  • /bx_allocate_local [schematic-name] allocates a local schema

Online

Online commands, they call the remote-server with the http api

Read-only

  • /bx_info shows infos about the connected blockexchange server
  • /bx_license sets or displays the license of your uploaded schematics (defaults to CC0)
  • /bx_load [username] [schematic-name] load a schematic by name onto pos1
  • /bx_placer [username] [schematic-name] creates a placement tool for the schematic
  • /bx_load_update [area_id?] loads the changes of a loaded area
  • /bx_allocate [username] [schematic-name] allocates a schematic by name
  • /bx_login [username] [access_token] logs in with the username and token
  • /bx_cancel Cancels an active job

Write (needs a login)

  • /bx_save [schematic-name] saves/uploads the selected area as a new schematic
  • /bx_save_update [area_id?] saves the changes of a loaded area (use it with the position markers or it will upload the whole schematic)
  • /bx_autosave [area_id?] toggles the autosave flag for the area
  • /bx_logout logs out
  • /bx_login shows the login status

Privileges

  • blockexchange can use the blockexchange commands (admin)
  • blockexchange_protected_upload can upload self-protected areas (survival-compatible)

Settings

  • blockexchange.url URL to the central server

The mod also needs the http api:

secure.http_mods = blockexchange

Api docs

See: https://blockexchange.github.io/blockexchange/

License

blockexchange's People

Contributors

buckaroobanzay avatar dependabot-preview[bot] avatar dependabot[bot] avatar imgbotapp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

blockexchange's Issues

Compression

Minetest schematics tend to be bloated in terms of bytes and data, to save on bandwidth, have you considered integrating .zip compression? minetest has this built-in, though I don't think it's exposed to the lua api yet.

That said, there's also work ongoing to put better compression via zstd in, so be on the lookout for that. Great work! Just wanted to share something that might help:)

Temporary schemas

  • /bx_save temp name
  • Weekly cleanup
  • default login as temp user (no or common password)
  • no overwrite or delete possible with temp user

token parsing error

/home/thomas/.minetest/mods/blockexchange/token.lua:46: bad argument #1 to 'find' (string expected, got nil)
stack traceback:
	[C]: in function 'find'
	/home/thomas/.minetest/mods/blockexchange/token.lua:46: in function 'parse_token'
	...me/thomas/.minetest/mods/blockexchange/chat_user.lua:55: in function 'func'
	/usr/local/share/minetest/builtin/game/chat.lua:69: in function '?'
	/usr/local/share/minetest/builtin/game/register.lua:429: in function </usr/local/share/minetest/builtin/game/register.lua:413>

User management

  • Allow anonymous login
  • Login workflow / optional registration

Server UI

Needs #2

  • Search by description/tag/user
  • Preview? (needs worldedit parser and 3d renderer)

Add Logo

two arrows with blocks in the middle

worldedit import escape issue

-- Digiline Decoder\
-- Reads an 8 bit binary number (signed or unsigned) from the bus, and converts it to decimal notation\13-- by So.Po.Coder for Minetest Mesecons Lua Controller\13-- A: Clock, B: Digiline Out 1, C: Input 2, D: Input 1\13\13if (event.type == \"program\") then\
  mem.decoder = 1\13end\
\
-- create the bus array, insert the first two bits and pass to the next decoder in sequence\13if (event.type == \"on\" and event.pin.name == \"A\") then\13  bus = {}\13  table.insert(bus, pin.d and 1 or 0)\
  table.insert(bus, pin.c and 1 or 0)\13  digiline_send(\"decoder\" .. tonumber(mem.decoder + 1), bus) -- send to the next decoder\13end

Store block area info in node meta

As far as I know, the HUD element cannot remove. I suggest storing area info in metadata to avoid marking non-imported or exported blocks as Blockexcharge blocks.

Schema metadata

  • Description
  • Long text?
  • Tags?
  • API-Search by tag/description/user

/bx_ps bug

minetest_1        | 2020-05-22 19:04:32: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'blockexchange' in callback on_chat_message(): /data/world//worldmods/blockexchange/commands/ps.lua:10: attempt to perform arithmetic on field 'start_time' (a function value)
minetest_1        | 2020-05-22 19:04:32: ERROR[Main]: stack traceback:
minetest_1        | 2020-05-22 19:04:32: ERROR[Main]: 	/data/world//worldmods/blockexchange/commands/ps.lua:10: in function 'func'
minetest_1        | 2020-05-22 19:04:32: ERROR[Main]: 	/usr/local/share/minetest/builtin/game/chat.lua:69: in function </usr/local/share/minetest/builtin/game/chat.lua:48>
minetest_1        | 2020-05-22 19:04:32: ERROR[Main]: 	/usr/local/share/minetest/builtin/game/register.lua:429: in function </usr/local/share/minetest/builtin/game/register.lua:413>

blockexchange:controller block

UI

Inputs

  • Schema-name (readonly after uploading/downloading)

Buttons

  • Upload
  • Download
  • Check for update

Metadata

  • Extends +x/-x +y/-y +z/-z
  • Schema-name
  • Owner-name (ingame)
  • Owner-name (blockexchange)
  • Schema-timestamp (last down-/up-loaded)

Ingame UI

Needs #2

Save dialog

  • Description / Tags

Load dialog

  • Search query

Coworking proposal

Hello,

My association is working on a decentralized datacenter based on ScutlleButt, IPFS and G1 Libre Money... Only Libre Softwares!!

To prepare promotion to the system, we are willing to open a "Metaverse" interface.
We choose minetest, and found blockexchange that is close to what will need to do...

Quickly, every player will be in charge of it's own "datacenter" and "digital consumption".
To remember confinment time, each build a 100 cube size world (local) where he makes his ideal "natural living place".

Every 10 minutes, worlds replicates through IPFS (cyphered by a shared key), then any one in the swarm can arrange every "litlle worlds" into a bigger one. Using friendship relation a a graph for distance between them...

I would be really grateful if you could indicate in your code where this patch could be done...

Send email to [email protected] if you wish to participate.

chat command register crash

minetest_1        | 2020-04-16 15:57:39: ERROR[Main]: ModError: Failed to load and run script from /data/world//worldmods/blockexchange/init.lua:
minetest_1        | 2020-04-16 15:57:39: ERROR[Main]: ...ocal/share/minetest/builtin/profiler/instrumentation.lua:146: attempt to index local 'def' (a nil value)
minetest_1        | 2020-04-16 15:57:39: ERROR[Main]: stack traceback:
minetest_1        | 2020-04-16 15:57:39: ERROR[Main]: 	...ocal/share/minetest/builtin/profiler/instrumentation.lua:146: in function 'register_chatcommand'
minetest_1        | 2020-04-16 15:57:39: ERROR[Main]: 	/data/world//worldmods/blockexchange/chat_pos.lua:44: in main chunk
minetest_1        | 2020-04-16 15:57:39: ERROR[Main]: 	[C]: in function 'dofile'
minetest_1        | 2020-04-16 15:57:39: ERROR[Main]: 	/data/world//worldmods/blockexchange/init.lua:50: in main chunk

profiler.load = true + worldedit

minetest_1        | 2020-04-16 18:07:41: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'blockexchange' in callback on_chat_message(): /usr/local/share/minetest/builtin/game/chat.lua:69: attempt to call field 'func' (a nil value)
minetest_1        | 2020-04-16 18:07:41: ERROR[Main]: stack traceback:
minetest_1        | 2020-04-16 18:07:41: ERROR[Main]: 	/usr/local/share/minetest/builtin/game/chat.lua:69: in function </usr/local/share/minetest/builtin/game/chat.lua:48>
minetest_1        | 2020-04-16 18:07:41: ERROR[Main]: 	/usr/local/share/minetest/builtin/game/register.lua:429: in function </usr/local/share/minetest/builtin/game/register.lua:413>

minetest_1        | 2020-04-16 18:09:51: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'blockexchange' in callback on_chat_message(): .../world//worldmods/blockexchange/commands/upload_chat.lua:12: attempt to index field 'pos1' (a nil value)
minetest_1        | 2020-04-16 18:09:51: ERROR[Main]: stack traceback:
minetest_1        | 2020-04-16 18:09:51: ERROR[Main]: 	.../world//worldmods/blockexchange/commands/upload_chat.lua:12: in function 'func'
minetest_1        | 2020-04-16 18:09:51: ERROR[Main]: 	/usr/local/share/minetest/builtin/game/chat.lua:69: in function </usr/local/share/minetest/builtin/game/chat.lua:48>
minetest_1        | 2020-04-16 18:09:51: ERROR[Main]: 	/usr/local/share/minetest/builtin/game/register.lua:429: in function </usr/local/share/minetest/builtin/game/register.lua:413>

Make the need of insecure environment (for commands like /bx_load) clearer

I was using your mod (which is great!) and it took me a while to understand how I could allocate and load schematics directly from the website, as info are quite scattered. I suggest to make them available in game as well, either:

  • make http commands like /bx_allocate visible as well even if the mod is not in the insecure enviroment list (and print an error message when trying executing them, telling the player to enable the insecure env for the mod)
  • add a note in the local commands (e.g. /bx_allocate_local), telling players that they can use the online version if they put the mod in the insecure env list

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.