[Plugin] McRainbow r2 UPDATED - Printable Version +- Cuberite Forum (https://forum.cuberite.org) +-- Forum: Plugins (https://forum.cuberite.org/forum-1.html) +--- Forum: Plugin Releases (https://forum.cuberite.org/forum-2.html) +---- Forum: Archived Plugins (https://forum.cuberite.org/forum-18.html) +---- Thread: [Plugin] McRainbow r2 UPDATED (/thread-239.html) Pages:
1
2
|
RE: [Plugin] McRainbow r2 UPDATED - mtilden - 12-29-2011 Thanks for getting around to an update, hopefully this version doesn't have crashes and issues like v1. STR, for now you can edit the files yourself or simply choose one plugin to load before the other, whichever you prefer. RE: [Plugin] McRainbow r2 UPDATED - Luthrandel - 12-29-2011 (12-29-2011, 07:02 AM)STR_Warrior Wrote: the /i and /item has an conflict with core.lua I can see that /gm should conflict with the most recent core.lua but there is neither /i nor /item in mcrainbow. I suspect further plugin treachery but I would start by removing /gm from mcrainbow and getting the most recent core.lua from *link*. I wasn't able to confirm this conflict on my test server so I'm shooting blind here. RE: [Plugin] McRainbow r2 UPDATED - Taugeshtu - 06-05-2012 I've fixed that for compatibility (just changed GetWorld() to GetDefaultWorld()) All credits to Ronald McDonald now! WARNING! It wasn't tested! So if all your data accidently got removed - I'm not responsible for that RE: [Plugin] McRainbow r2 UPDATED - NiLSPACE - 06-05-2012 eh i don't see it in the pluginlist when i do /pluginlist :S oh wait i just had to restart RE: [Plugin] McRainbow r2 UPDATED - NiLSPACE - 06-05-2012 mcrainbow still doestn't work verry well. if there was a plugin that only is for the weather. RE: [Plugin] McRainbow r2 UPDATED - batekman - 06-28-2012 I changed the deprecated World:GetAllPlayers() method with World:ForEachPlayer(). (Sorry for my defective English ) RE: [Plugin] McRainbow r2 UPDATED - xoft - 07-02-2012 batekman, welcome to the forums. You seem to have a good grasp of Lua if you managed to spot how things are done Your change probably works okay most of the time, but there's a potential for it to crash the server: The point of ForEachPlayer() callback mechanism is to force Lua plugins not to handle cPlayer instances anywhere else than in the callback. Imagine this situation: Your plugin enumerates all players in the world (getPlayerByName() function). But just as this function is about to return the player object, another thread detects that the player has just disconnected, and removes the player from the world. Now Lua has an invalid cPlayer object, but doesn't know it, and as soon as the plugin tries to call a method on this object, the server crashes. The Correct Way to handle this is to write a small handler function for each action that should be done with the found player, for example: Code: function HandleKill(Split, InitiatorPlayer) I think I'll add a cWorld:DoWithPlayer(PlayerName, Callback) function later, that would call the callback only for the player of the specified name, so that the callback function can really do only the core minimum that it needs to do. Probably later RE: [Plugin] McRainbow r2 UPDATED - xoft - 07-02-2012 So I added the DoWithPlayer() function in Rev 639, here's an actual code that kills a player specified: Code: function HandleKill(Split, InitiatorPlayer) RE: [Plugin] McRainbow r2 UPDATED - SashaSansay - 11-19-2012 doesn't work on r1024 |