Random Chitchat 2017
@NiLSPACE Added a call to collectgarbage, it doesn't print the log message on first time. After every additional call it prints the message.
Thanks given by:
Could you show your code?
Thanks given by:
I started testing bound checking in cBlockArea. Here the small code:

Code:
function Initialize(Plugin)
    Plugin:SetName( "TestPlugin" )
    Plugin:SetVersion( 1 )
    
    cPluginManager:BindConsoleCommand("doit", CommandDoit , "doit")
    
    return true
end

function CommandDoit(a_Split)
    local area = cBlockArea()
    area:Create(500, 100, 100)
    for x = 0, 499 do
        for y = 0, 99 do
            for z = 0, 99 do
                area:SetBlockType(x, y, z, 1)
            end
        end
    end
    
    collectgarbage()
    print("finished")
    return true
end
Thanks given by:
Could you try this?:
function CommandDoit(a_Split)
	do
		local area = cBlockArea()
		area:Create(500, 100, 100)
		for x = 0, 499 do
			for y = 0, 99 do
				for z = 0, 99 do
					area:SetBlockType(x, y, z, 1)
				end
			end
		end
	end
	collectgarbage()
	print("finished")
	return true
end
Thanks given by: Seadragon91
@NiLSPACE That works.
Thanks given by:
@Seadragon91 In your code, when calling the collectgarbage() function, the area variable is still in scope so it is not collected yet. Upon the next call, the cBlockArea from the previous call is collected and the current one is still kept, and so on.
(Yes, garbage collection is difficult Smile

NiLSPACE's code fixes that by enclosing the inner code in yet another do .. end, which makes the area variable go out of scope before calling the collectgarbage() function, allowing it to be collected.
Thanks given by: NiLSPACE , Seadragon91
@xoft I see this in the travis builds from LuaThreadStress-testing. Is this a problem or can it be ignored?

Code:
Invalidate: Inconsistent callback at 0x2abac4000990, has a CS but an invalid Ref. This should not happen
Thanks given by:
That is indeed a problem, I'd need to look at that. But I can't seem to reproduce it on neither Win or Linux builds of mine.
Thanks given by:
Do we have a thread about metadata for items? I think this could be also used for items like: firework rocket, firework star, books and for a few more.
Thanks given by:
Found this: http://www.actuino.fr/raspi/minecraft-raspberry.html
Thanks given by: Seadragon91 , sphinxc0re , xoft




Users browsing this thread: 1 Guest(s)