[Plugin] CuboidPlus r4 - Building/Landscaping/Terraforming
#21
You know, a "please" would take you a long wayTongue

For the plugin author: The GetAllPlayers() method is not implemented in newer MCS versions and has been replaced with calls to ForEachPlayer() (due to multithreading issues). The Core plugin already uses this approach so you can see how it's used there.

Basically the issue is that GetAllPlayers() returned a player instance and another thread could invalidate that instance before the lua plugin could even touch it. So instead you provide a callback that is called for each player and the mechanism guarantees that the player instance is valid throughout the callback's execution. Note though that you should NOT store the player instance for later processing (same issue as with GetAllPlayers() ) and you should make the callback as fast as possible, avoiding heavy calculations or such, because a critical section is held during the callback which effectively stops all other MCS threads from touching the players list.
Reply
Thanks given by:
#22
How i can install this plugin?
I creater CuboidPlus dir and copy content of zip, but in mcserver log have this error:

Error in plugin CuboidPlus: Could not find function Initialize()

Thanks for reply
Reply
Thanks given by:
#23
This plugin is old, it needs to be updated before it can work in the latest MCServer version
Reply
Thanks given by:
#24
(03-27-2012, 08:47 PM)FakeTruth Wrote: This plugin is old, it needs to be updated before it can work in the latest MCServer version

I have modified, now script loaded, I can enable it, select area, but after command for example /set 0 server crash.


.lua   CuboidPlus.lua (Size: 106.33 KB / Downloads: 342)
Reply
Thanks given by:
#25
You're mixing the old plugin style with the new plugin style. I'll try to find the source of the crash
Reply
Thanks given by:
#26
(03-29-2012, 12:40 AM)FakeTruth Wrote: You're mixing the old plugin style with the new plugin style. I'll try to find the source of the crash

Sorry I dont know old/new style. I would like only make the plugin work :-)
Reply
Thanks given by:
#27
Revision 440 should no longer crash with your plugin. However, the plugin does not work either.

These are the most important things you should change
Code:
...
local CuboidPlusPlugin = {} // delete this

CuboidPlusPlugin.__index = CuboidPlusPlugin // delete this

...

function CuboidPlusPlugin:new() // Delete all this
    local t = {}
    setmetatable(t, CuboidPlusPlugin)
    local w = Lua__cPlugin:new()
    tolua.setpeer(w, t)
    w:tolua__set_instance(w)
    return w
end

...

function Initialize() // Change to
function Initialize( Plugin ) // this

...

function CuboidPlusPlugin:OnPlayerJoin( Player ) // Change to
function OnPlayerJoin( Player ) // this

...

function CuboidPlusPlugin:OnBlockPlace( PacketData, Player ) // Change to
function OnBlockPlace( PacketData, Player ) // this

...

function CuboidPlusPlugin:OnBlockDig( PacketData, Player ) // Change to
function OnBlockDig( PacketData, Player ) // this

...

Plugin = CuboidPlusPlugin:new() // Delete these 3 lines
cRoot:Get():GetPluginManager():AddPlugin( Plugin )
cRoot:Get():GetServer():SendMessage("CuboidPlus Reloaded.")

After that try to fix the errors you get, should be really easy to do
Reply
Thanks given by:
#28
(03-29-2012, 04:16 AM)FakeTruth Wrote: Revision 440 should no longer crash with your plugin. However, the plugin does not work either.

These are the most important things you should change
[
After that try to fix the errors you get, should be really easy to do

Thank a lot. Plugin looks like work. Can create for example sphere etc.
Reply
Thanks given by:
#29
If you modified the plugin so that it works, could you attach it here for others, too?
Thanks.
Reply
Thanks given by:
#30
(03-30-2012, 10:40 PM)xoft Wrote: If you modified the plugin so that it works, could you attach it here for others, too?
Thanks.

Ok, in the attachment.


Attached Files
.lua   CuboidPlus.lua (Size: 105.93 KB / Downloads: 432)
Reply
Thanks given by:




Users browsing this thread: 18 Guest(s)