Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
Choose a Base Repository
cuberite/cuberite
36451/MCServer
4264/cuberite
Akheon23/cuberite
Alyxey/cuberite
Ba4life/cuberite
BrainShit/MCServer
C-Elegans/cuberite
ChriPiv/MCServer
Dam63/MCServer
DevToaster/MCServer
DjKiDD/MCServer
Erbelding/cuberite
ErrAza/MCServer
FX-Master/MCServer
Floppy012/MCServer
FullStackUnicorns/MCServer
GameClub2000/cuberite
HackerTon/MCServer
HaoTNN/cuberite
Haxi52/cuberite
HelenaKitty/EbooMC
Hillvith/MCServer
Hmaal/MCServer
Howaner/MCServer
Infinity-Codeur/MCServer
JABirchall/MCServer
JJOL/cuberite
JoeClacks/MCServer
JoseDiaz27/MCServer
Jothle12/MCServer
Kungfumoo/MCServer
Limb/MCServer
LinEvil/cuberite
MaxM357/MCServer
Motoburger1/MCServer
MuhammadWang/MCServer
Nerkyator/MCServer
Noraaron1/MCServer
Pheo/MCServer
PixeLInc/cuberite
PyroCybin/cuberite
Raekye/MCServer
RedEnraged96/MCServer-1
Redd-Dasan/cuberite
Renoh47/MCServer
Roro534/cuberite
SOSDAN/cuberite
SamMauldin/MCServer
Samvbnm/MCServer
Schwertspize/cuberite
Seadragon91/cuberite
Sentir101/MCServer
Solexid/MCServer
StefanNemeth/cuberite
Tank-D/MCServer
ThisIsAgent1k/MCServer
ThuGie/MCServer
TigerHix/MCServer
TonyMo/MCServer
Toyz/MCServer
Tri125/MCServer
UltraCoderRU/cuberite
WillEccles/cuberite
Xury/MCServer
Zeenjayli/MCServer
Zignixx/cuberite
acrade/cuberite
adesnos/cuberite
ameuret/cuberite
arekinath/MCServer
arnaudlahalle/cuberite
artemist/cuberite
axisd/MCServer
balika011/MCServer
bendl/cuberite
benhc123/MCServer
bibo38/Cuberite
birkett/cuberite
bowlofstew/MCServer
cacaxi/MCServer
carriercomm/cuberite
cedeel/MCServer
cheryl0047/MCServer
christopher-montagna/MCServer
codebucketdev/MCServer
coding12/cuberite
commshare/MCServer
crexalbo/MCServer
crosbymichael/MCServer
daemon777/MCServer
daniel0916/MCServer
darkzmii/cuberite
dave-tucker/cuberite
daveh86/MCServer
debug-stick/cuberal
deckerrj/cuberite
decterous/MCServer
default0/MCServer
dmonger/MCServer
dougvj/MCServer
electromatter/cuberite
ezhangle/cuberite
f0rb1d/MCServer
gdevillele/cuberite
geekpower14/MCServer
giriko/MCServer
greatman/MCServer
guijun/MCServer
gushromp/MCServer
hallucino/cuberite
hammermaps/MCServer
harryhare/MCServer
hide92795/cuberite
hmartinh/cuberite
ionux/MCServer
irrelevantdotcom/MCServer
jacky526/cuberite
jalons/MCServer
jamesliu96/MCServer
jamesmunns/MCServer
jamestait/cuberite
jamiepg1/MCServer
jammet/MCServer
jaumealoy/MCServer
jayr0flmc/cuberite
jimfinnis/MCServer
jimiy/cuberite
joeflezer/MCServer
john092/MCServer
josephcopenhaver/cuberite
joshi07/MCServer2
jpdamon/cuberite
kharashubham/cuberite
kjanku1/MCServer
lighth7015/cuberite
lima900/MCServer
linnemannr/MCServer
lkolbly/MCServer
lvshiling/MCServer
madtomic/MCServer
maki-chan/MCServer
maniak89/MCServer
marmot21/MCServer
martindev2/cuberite
marvinkopf/cuberite
meiavy/cuberite
mgueydan/MCServer
mhmd05/cuberite
mjhanninen/cuberite
mjssw/cuberite
mmdk95/cuberite
mrhabib/MCServer
narroo/MCServer
nathankot/MCServer
necrophcodr/cuberite
nesco/MCServer
nevercast/cuberite
nicodinh/cuberite
nounoursheureux/MCServer
p-mcgowan/MCServer
paizzj/cuberite
parlock/cuberite
patthekenny/MCServer
pillsbury7901/MCServer
planetx/MCServer
prabhjeet27/cuberite
psrivast7788/MCServer
ravenscroftj/MCServer
rcrimp/MCServer
rhamilton1415/cuberite
ricucremop/cuberite
ryansnewell/MCServer
scribblemaniac/cuberite
scriptsboy/cuberite
seijikun/MCServer
shaunstanislaus/MCServer
sircodes/MCServer
skarlitz/MCServer
soemthlng/cuberite
stpinker/MCServer
straemer/MCServer
thatchristoph/MCServer
then0rTh/cuberite
tomthoros/MCServer
tonetheman/MCServer
tt7truong/MCServer
ubiGG/cuberite
vyeluri5/MCServer
w00tc0d3/MCServer
waluoo/MCServer
wang108/MCServer
wnwkimo/cuberite
worktycho/MCServer
xanahopper/MCServer
yamamushi/MCServer
yinyunqiao/MCServer
yo4you/cuberite
zackp30/cuberite
zeliard/MCServer
Nothing to show
Choose a Head Repository
cuberite/cuberite
36451/MCServer
4264/cuberite
Akheon23/cuberite
Alyxey/cuberite
Ba4life/cuberite
BrainShit/MCServer
C-Elegans/cuberite
ChriPiv/MCServer
Dam63/MCServer
DevToaster/MCServer
DjKiDD/MCServer
Erbelding/cuberite
ErrAza/MCServer
FX-Master/MCServer
Floppy012/MCServer
FullStackUnicorns/MCServer
GameClub2000/cuberite
HackerTon/MCServer
HaoTNN/cuberite
Haxi52/cuberite
HelenaKitty/EbooMC
Hillvith/MCServer
Hmaal/MCServer
Howaner/MCServer
Infinity-Codeur/MCServer
JABirchall/MCServer
JJOL/cuberite
JoeClacks/MCServer
JoseDiaz27/MCServer
Jothle12/MCServer
Kungfumoo/MCServer
Limb/MCServer
LinEvil/cuberite
MaxM357/MCServer
Motoburger1/MCServer
MuhammadWang/MCServer
Nerkyator/MCServer
Noraaron1/MCServer
Pheo/MCServer
PixeLInc/cuberite
PyroCybin/cuberite
Raekye/MCServer
RedEnraged96/MCServer-1
Redd-Dasan/cuberite
Renoh47/MCServer
Roro534/cuberite
SOSDAN/cuberite
SamMauldin/MCServer
Samvbnm/MCServer
Schwertspize/cuberite
Seadragon91/cuberite
Sentir101/MCServer
Solexid/MCServer
StefanNemeth/cuberite
Tank-D/MCServer
ThisIsAgent1k/MCServer
ThuGie/MCServer
TigerHix/MCServer
TonyMo/MCServer
Toyz/MCServer
Tri125/MCServer
UltraCoderRU/cuberite
WillEccles/cuberite
Xury/MCServer
Zeenjayli/MCServer
Zignixx/cuberite
acrade/cuberite
adesnos/cuberite
ameuret/cuberite
arekinath/MCServer
arnaudlahalle/cuberite
artemist/cuberite
axisd/MCServer
balika011/MCServer
bendl/cuberite
benhc123/MCServer
bibo38/Cuberite
birkett/cuberite
bowlofstew/MCServer
cacaxi/MCServer
carriercomm/cuberite
cedeel/MCServer
cheryl0047/MCServer
christopher-montagna/MCServer
codebucketdev/MCServer
coding12/cuberite
commshare/MCServer
crexalbo/MCServer
crosbymichael/MCServer
daemon777/MCServer
daniel0916/MCServer
darkzmii/cuberite
dave-tucker/cuberite
daveh86/MCServer
debug-stick/cuberal
deckerrj/cuberite
decterous/MCServer
default0/MCServer
dmonger/MCServer
dougvj/MCServer
electromatter/cuberite
ezhangle/cuberite
f0rb1d/MCServer
gdevillele/cuberite
geekpower14/MCServer
giriko/MCServer
greatman/MCServer
guijun/MCServer
gushromp/MCServer
hallucino/cuberite
hammermaps/MCServer
harryhare/MCServer
hide92795/cuberite
hmartinh/cuberite
ionux/MCServer
irrelevantdotcom/MCServer
jacky526/cuberite
jalons/MCServer
jamesliu96/MCServer
jamesmunns/MCServer
jamestait/cuberite
jamiepg1/MCServer
jammet/MCServer
jaumealoy/MCServer
jayr0flmc/cuberite
jimfinnis/MCServer
jimiy/cuberite
joeflezer/MCServer
john092/MCServer
josephcopenhaver/cuberite
joshi07/MCServer2
jpdamon/cuberite
kharashubham/cuberite
kjanku1/MCServer
lighth7015/cuberite
lima900/MCServer
linnemannr/MCServer
lkolbly/MCServer
lvshiling/MCServer
madtomic/MCServer
maki-chan/MCServer
maniak89/MCServer
marmot21/MCServer
martindev2/cuberite
marvinkopf/cuberite
meiavy/cuberite
mgueydan/MCServer
mhmd05/cuberite
mjhanninen/cuberite
mjssw/cuberite
mmdk95/cuberite
mrhabib/MCServer
narroo/MCServer
nathankot/MCServer
necrophcodr/cuberite
nesco/MCServer
nevercast/cuberite
nicodinh/cuberite
nounoursheureux/MCServer
p-mcgowan/MCServer
paizzj/cuberite
parlock/cuberite
patthekenny/MCServer
pillsbury7901/MCServer
planetx/MCServer
prabhjeet27/cuberite
psrivast7788/MCServer
ravenscroftj/MCServer
rcrimp/MCServer
rhamilton1415/cuberite
ricucremop/cuberite
ryansnewell/MCServer
scribblemaniac/cuberite
scriptsboy/cuberite
seijikun/MCServer
shaunstanislaus/MCServer
sircodes/MCServer
skarlitz/MCServer
soemthlng/cuberite
stpinker/MCServer
straemer/MCServer
thatchristoph/MCServer
then0rTh/cuberite
tomthoros/MCServer
tonetheman/MCServer
tt7truong/MCServer
ubiGG/cuberite
vyeluri5/MCServer
w00tc0d3/MCServer
waluoo/MCServer
wang108/MCServer
wnwkimo/cuberite
worktycho/MCServer
xanahopper/MCServer
yamamushi/MCServer
yinyunqiao/MCServer
yo4you/cuberite
zackp30/cuberite
zeliard/MCServer
Nothing to show
  • 7 commits
  • 6 files changed
  • 0 commit comments
  • 2 contributors
Showing with 43 additions and 0 deletions.
  1. +2 −0 MCServer/Plugins/APIDump/APIDesc.lua
  2. +2 −0 src/Bindings/ManualBindings.cpp
  3. +16 −0 src/Root.cpp
  4. +3 −0 src/Root.h
  5. +17 −0 src/World.cpp
  6. +3 −0 src/World.h
@@ -2137,6 +2137,7 @@ cPluginManager.AddHook(cPluginManager.HOOK_CHAT, OnChatMessage);
BroadcastChatWarning = { Params = "MessageText", Return = "", Notes = "Broadcasts the specified message to all players, with its message type set to mtWarning. Use for concerning events, such as plugin reload etc." },
CreateAndInitializeWorld = { Params = "WorldName", Return = "{{cWorld|cWorld}}", Notes = "Creates a new world and initializes it. If there is a world whith the same name it returns nil.<br/><br/><b>NOTE</b>This function is currently unsafe, do not use!" },
FindAndDoWithPlayer = { Params = "PlayerName, CallbackFunction", Return = "", Notes = "Calls the given callback function for all players with names partially (or fully) matching the name string provided." },
DoWithPlayerByUUID = { Params = "PlayerUUID, CallbackFunction, [CallbackData]", Return = "bool", Notes = "If there is the player with the uuid, calls the CallbackFunction with the {{cPlayer}} parameter representing the player. The CallbackFunction has the following signature: <pre class=\"prettyprint lang-lua\">function Callback({{cPlayer|Player}}, [CallbackData])</pre> The function returns false if the player was not found, or whatever bool value the callback returned if the player was found." },
ForEachPlayer = { Params = "CallbackFunction", Return = "", Notes = "Calls the given callback function for each player. The callback function has the following signature: <pre class=\"prettyprint lang-lua\">function Callback({{cPlayer|cPlayer}})</pre>" },
ForEachWorld = { Params = "CallbackFunction", Return = "", Notes = "Calls the given callback function for each world. The callback function has the following signature: <pre class=\"prettyprint lang-lua\">function Callback({{cWorld|cWorld}})</pre>" },
Get = { Params = "", Return = "Root object", Notes = "(STATIC)This function returns the cRoot object." },
@@ -2406,6 +2407,7 @@ end
{ Params = "{{Vector3i|BlockCoords}}, BlockType, BlockMeta", Return = "", Notes = "Sets the block at the specified coords, without waking up the simulators or replacing the block entities for the previous block type. Do not use if the block being replaced has a block entity tied to it!" },
},
FindAndDoWithPlayer = { Params = "PlayerNameHint, CallbackFunction, [CallbackData]", Return = "bool", Notes = "If there is a player of a name similar to the specified name (weighted-match), calls the CallbackFunction with the {{cPlayer}} parameter representing the player. The CallbackFunction has the following signature: <pre class=\"prettyprint lang-lua\">function Callback({{cPlayer|Player}}, [CallbackData])</pre> The function returns false if the player was not found, or whatever bool value the callback returned if the player was found. Note that the name matching is very loose, so it is a good idea to check the player name in the callback function." },
DoWithPlayerByUUID = { Params = "PlayerUUID, CallbackFunction, [CallbackData]", Return = "bool", Notes = "If there is the player with the uuid, calls the CallbackFunction with the {{cPlayer}} parameter representing the player. The CallbackFunction has the following signature: <pre class=\"prettyprint lang-lua\">function Callback({{cPlayer|Player}}, [CallbackData])</pre> The function returns false if the player was not found, or whatever bool value the callback returned if the player was found." },
ForEachBlockEntityInChunk = { Params = "ChunkX, ChunkZ, CallbackFunction, [CallbackData]", Return = "bool", Notes = "Calls the specified callback for each block entity in the chunk. Returns true if all block entities in the chunk have been processed (including when there are zero block entities), or false if the callback has aborted the enumeration by returning true. The CallbackFunction has the following signature: <pre class=\"prettyprint lang-lua\">function Callback({{cBlockEntity|BlockEntity}}, [CallbackData])</pre> The callback should return false or no value to continue with the next block entity, or true to abort the enumeration. Use {{tolua}}.cast() to cast the Callback's BlockEntity parameter to the correct {{cBlockEntity}} descendant." },
ForEachChestInChunk = { Params = "ChunkX, ChunkZ, CallbackFunction, [CallbackData]", Return = "bool", Notes = "Calls the specified callback for each chest in the chunk. Returns true if all chests in the chunk have been processed (including when there are zero chests), or false if the callback has aborted the enumeration by returning true. The CallbackFunction has the following signature: <pre class=\"prettyprint lang-lua\">function Callback({{cChestEntity|ChestEntity}}, [CallbackData])</pre> The callback should return false or no value to continue with the next chest, or true to abort the enumeration." },
ForEachEntity = { Params = "CallbackFunction, [CallbackData]", Return = "bool", Notes = "Calls the specified callback for each entity in the loaded world. Returns true if all the entities have been processed (including when there are zero entities), or false if the callback function has aborted the enumeration by returning true. The callback function has the following signature: <pre class=\"prettyprint lang-lua\">function Callback({{cEntity|Entity}}, [CallbackData])</pre> The callback should return false or no value to continue with the next entity, or true to abort the enumeration." },
@@ -3368,6 +3368,7 @@ void ManualBindings::Bind(lua_State * tolua_S)
tolua_beginmodule(tolua_S, "cRoot");
tolua_function(tolua_S, "FindAndDoWithPlayer", tolua_DoWith <cRoot, cPlayer, &cRoot::FindAndDoWithPlayer>);
tolua_function(tolua_S, "DoWithPlayerByUUID", tolua_DoWith <cRoot, cPlayer, &cRoot::DoWithPlayerByUUID>);
tolua_function(tolua_S, "ForEachPlayer", tolua_ForEach<cRoot, cPlayer, &cRoot::ForEachPlayer>);
tolua_function(tolua_S, "ForEachWorld", tolua_ForEach<cRoot, cWorld, &cRoot::ForEachWorld>);
tolua_function(tolua_S, "GetFurnaceRecipe", tolua_cRoot_GetFurnaceRecipe);
@@ -3389,6 +3390,7 @@ void ManualBindings::Bind(lua_State * tolua_S)
tolua_function(tolua_S, "DoWithFlowerPotAt", tolua_DoWithXYZ<cWorld, cFlowerPotEntity, &cWorld::DoWithFlowerPotAt>);
tolua_function(tolua_S, "DoWithPlayer", tolua_DoWith< cWorld, cPlayer, &cWorld::DoWithPlayer>);
tolua_function(tolua_S, "FindAndDoWithPlayer", tolua_DoWith< cWorld, cPlayer, &cWorld::FindAndDoWithPlayer>);
tolua_function(tolua_S, "DoWithPlayerByUUID", tolua_DoWith< cWorld, cPlayer, &cWorld::DoWithPlayerByUUID>);
tolua_function(tolua_S, "ForEachBlockEntityInChunk", tolua_ForEachInChunk<cWorld, cBlockEntity, &cWorld::ForEachBlockEntityInChunk>);
tolua_function(tolua_S, "ForEachChestInChunk", tolua_ForEachInChunk<cWorld, cChestEntity, &cWorld::ForEachChestInChunk>);
tolua_function(tolua_S, "ForEachEntity", tolua_ForEach< cWorld, cEntity, &cWorld::ForEachEntity>);
View
@@ -633,6 +633,22 @@ bool cRoot::FindAndDoWithPlayer(const AString & a_PlayerName, cPlayerListCallbac
bool cRoot::DoWithPlayerByUUID(const AString & a_PlayerUUID, cPlayerListCallback & a_Callback)
{
for (WorldMap::iterator itr = m_WorldsByName.begin(); itr != m_WorldsByName.end();itr++)
{
if (itr->second->DoWithPlayerByUUID(a_PlayerUUID, a_Callback))
{
return true;
}
}
return false;
}
AString cRoot::GetProtocolVersionTextFromInt(int a_ProtocolVersion)
{
return cProtocolRecognizer::GetVersionTextFromInt(a_ProtocolVersion);
View
@@ -125,6 +125,9 @@ class cRoot
/// Finds a player from a partial or complete player name and calls the callback - case-insensitive
bool FindAndDoWithPlayer(const AString & a_PlayerName, cPlayerListCallback & a_Callback); // >> EXPORTED IN MANUALBINDINGS <<
/** Finds the player over his uuid and calls the callback */
bool DoWithPlayerByUUID(const AString & a_PlayerUUID, cPlayerListCallback & a_Callback); // >> EXPORTED IN MANUALBINDINGS <<
// tolua_begin
View
@@ -2729,6 +2729,23 @@ bool cWorld::FindAndDoWithPlayer(const AString & a_PlayerNameHint, cPlayerListCa
bool cWorld::DoWithPlayerByUUID(const AString & a_PlayerUUID, cPlayerListCallback & a_Callback)
{
cCSLock Lock(m_CSPlayers);
for (cPlayerList::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
{
if ((*itr)->GetUUID() == a_PlayerUUID)
{
return a_Callback.Item(*itr);
}
}
return false;
}
// TODO: This interface is dangerous!
cPlayer * cWorld::FindClosestPlayer(const Vector3d & a_Pos, float a_SightLimit, bool a_CheckLineOfSight)
{
View
@@ -323,6 +323,9 @@ class cWorld :
// TODO: This interface is dangerous - rewrite to DoWithClosestPlayer(pos, sight, action)
cPlayer * FindClosestPlayer(const Vector3d & a_Pos, float a_SightLimit, bool a_CheckLineOfSight = true);
/** Finds the player over his uuid and calls the callback */
bool DoWithPlayerByUUID(const AString & a_PlayerUUID, cPlayerListCallback & a_Callback); // >> EXPORTED IN MANUALBINDINGS <<
void SendPlayerList(cPlayer * a_DestPlayer); // Sends playerlist to the player
/** Adds the entity into its appropriate chunk; takes ownership of the entity ptr.

No commit comments for this range