WorldEdit
(11-22-2015, 02:05 AM)Safwat Wrote: There used to be a Bukkit WorldEdit extension called SafeEdit. It would update the world a bit by bit in a configurable interval and not all at once. It was great for large updates. I wonder if somthing similar could be done here.

AsyncWorldEdit is the current plugin that does that. It's premium, but it wasn't always and you can still get the older non-premium versions for free.

For making cuberite's WE have an AsyncWorldEdit addon/option, could you use tick by tick callbacks and figure out how many blocks to set based on how long the previous tick took?
Reply
Thanks given by:
(11-24-2015, 01:27 PM)Zee1234 Wrote: could you use tick by tick callbacks and figure out how many blocks to set based on how long the previous tick took?

A simpler approach would be configuring the amount of blocks in a config file.
Reply
Thanks given by:
If this is implemented we could do something like this:
function OnPluginsLoaded()
	cPluginManager:CallPlugin("WorldEdit", "ExecuteString", [[
	-- Retrieve the size of each portion, and ticks between each partion write
	local PartionSize, TicksBetweenWrite = ...
	PartionSize = Vector3i(PartionSize, PartionSize, PartionSize)
	
	function cBlockArea:Write(a_World, a_Position, a_Y, a_Z)
		if (type(a_Position) ~= "Vector3i") then
			a_Position = Vector3i(a_Positoin, a_Y, a_Z)
		end
		
		local SizeX, SizeY, SizeZ = self:GetCoordRange()
		local Positions = {}
		for X = 0, SizeX, PartionSize do
			for Y = 0, SizeY, PartionSize do
				for Z = 0, SizeZ, PartionSize do
					table.insert(Positions, Vector3i(X, Y, Z))
				end
			end
		end

		local function WriteIntoWorld = function(a_World)
			-- TODO add a Max value in Positoins[1] + PortionSize
			self:WritePortion(a_World, a_Position + Positions[1], Positions[1], Positions[1] + PartionSize, cBlockArea.baTypes + cBlockArea.baMetas)
			table.remove(Positions, 1)
			if (Positions[1] ~= nil) then
				a_World:ScheduleTask(WriteIntoWorld, TicksBetweenWrite)
			end
		end
		WriteIntoWorld(a_World)
	end
	]], 25, 40)
end
Reply
Thanks given by:
Well, would you look at that Smile
[Image: cdef4b39cf.png]

It's a little inconsistent though. Sometimes it just doesn't get anything back from github, so the connection closed callback doesn't get called until a while later, but without content.

Also, @xoft, what happens when a plugin uses the cNetwork API but it the server gets reloaded? I've noticed the server sometimes getting an error that the OnRemoteClosed callback failed, but nothing went wrong. Is that because the callback doesn't exist anymore due to the reload?:
[Image: b1a17ffa19.png]
Reply
Thanks given by:
Hmm, the same is happening when I try to download the ZIP file. I only managed to download the ZIP file correctly once. Otherwise it either doesn't get anything, just like my problem when checking the version, or it doesn't receive all the information making the download corrupted. Anyone has an idea what could be wrong?
Reply
Thanks given by:
It is HTTP+TLS, right? It could be that the HTTPS server closes the connection and the TLS decoder gets that information too soon, so it doesn't process the last bit of data.
Reply
Thanks given by:
So it's not something I can fix in the plugin :/ I'll upload my code soon in case you want to test it.
Reply
Thanks given by:
Done: https://github.com/cuberite/WorldEdit/pull/95
Reply
Thanks given by:
I wanted to do some more work on WorldEdit this weekend, but I'm having some trouble with my laptop. I just bought an SSD, but when I have both the SSD and my HDD in the laptop Windows doesn't want to boot normally. It boots just fine when I go into the boot loader using F12 and select Windows there or if I only have the SSD installed, but otherwise it keeps repeating the Lenovo logo when booting.
Reply
Thanks given by:
Kind of sounds like a boot order issue or something. You might need to set the drive order in the BIOS. You probably already tried that though.
Reply
Thanks given by:




Users browsing this thread: 1 Guest(s)