summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Bindings/ManualBindings.cpp14
-rw-r--r--src/ClientHandle.h14
-rw-r--r--src/Entities/Player.h8
-rw-r--r--src/Root.h15
4 files changed, 25 insertions, 26 deletions
diff --git a/src/Bindings/ManualBindings.cpp b/src/Bindings/ManualBindings.cpp
index d8134f159..f4764447c 100644
--- a/src/Bindings/ManualBindings.cpp
+++ b/src/Bindings/ManualBindings.cpp
@@ -1957,26 +1957,20 @@ static int tolua_cPlayer_PermissionMatches(lua_State * tolua_S)
// Check the params:
cLuaState L(tolua_S);
if (
- !L.CheckParamUserType(1, "cPlayer") ||
- !L.CheckParamString (2, 3) ||
- !L.CheckParamEnd (4)
+ !L.CheckParamUserTable(1, "cPlayer") ||
+ !L.CheckParamString (2, 3) ||
+ !L.CheckParamEnd (4)
)
{
return 0;
}
// Get the params:
- cPlayer * self = (cPlayer *)tolua_tousertype(tolua_S, 1, NULL);
- if (self == NULL)
- {
- LOGWARNING("%s: invalid self (%p)", __FUNCTION__, self);
- return 0;
- }
AString Permission, Template;
L.GetStackValues(2, Permission, Template);
// Push the result of the match:
- L.Push(self->PermissionMatches(StringSplit(Permission, "."), StringSplit(Template, ".")));
+ L.Push(cPlayer::PermissionMatches(StringSplit(Permission, "."), StringSplit(Template, ".")));
return 1;
}
diff --git a/src/ClientHandle.h b/src/ClientHandle.h
index 1f22762c0..20592c190 100644
--- a/src/ClientHandle.h
+++ b/src/ClientHandle.h
@@ -145,7 +145,9 @@ public:
void SendCollectEntity (const cEntity & a_Entity, const cPlayer & a_Player);
void SendDestroyEntity (const cEntity & a_Entity);
void SendDisconnect (const AString & a_Reason);
+ void SendDisplayObjective (const AString & a_Objective, cScoreboard::eDisplaySlot a_Display);
void SendEditSign (int a_BlockX, int a_BlockY, int a_BlockZ);
+ void SendEntityAnimation (const cEntity & a_Entity, char a_Animation); // tolua_export
void SendEntityEffect (const cEntity & a_Entity, int a_EffectID, int a_Amplifier, short a_Duration);
void SendEntityEquipment (const cEntity & a_Entity, short a_SlotNum, const cItem & a_Item);
void SendEntityHeadLook (const cEntity & a_Entity);
@@ -156,6 +158,8 @@ public:
void SendEntityRelMoveLook (const cEntity & a_Entity, char a_RelX, char a_RelY, char a_RelZ);
void SendEntityStatus (const cEntity & a_Entity, char a_Status);
void SendEntityVelocity (const cEntity & a_Entity);
+ void SendExperience (void);
+ void SendExperienceOrb (const cExpOrb & a_ExpOrb);
void SendExplosion (double a_BlockX, double a_BlockY, double a_BlockZ, float a_Radius, const cVector3iArray & a_BlocksAffected, const Vector3d & a_PlayerMotion);
void SendGameMode (eGameMode a_GameMode);
void SendHealth (void);
@@ -164,15 +168,14 @@ public:
void SendMapDecorators (int a_ID, const cMapDecoratorList & a_Decorators, unsigned int m_Scale);
void SendMapInfo (int a_ID, unsigned int a_Scale);
void SendPaintingSpawn (const cPainting & a_Painting);
- void SendPickupSpawn (const cPickup & a_Pickup);
- void SendEntityAnimation (const cEntity & a_Entity, char a_Animation); // tolua_export
void SendParticleEffect (const AString & a_ParticleName, float a_SrcX, float a_SrcY, float a_SrcZ, float a_OffsetX, float a_OffsetY, float a_OffsetZ, float a_ParticleData, int a_ParticleAmount);
+ void SendPickupSpawn (const cPickup & a_Pickup);
void SendPlayerAbilities (void);
void SendPlayerListAddPlayer (const cPlayer & a_Player);
void SendPlayerListRemovePlayer (const cPlayer & a_Player);
+ void SendPlayerListUpdateDisplayName(const cPlayer & a_Player, const AString & a_CustomName);
void SendPlayerListUpdateGameMode (const cPlayer & a_Player);
void SendPlayerListUpdatePing (const cPlayer & a_Player);
- void SendPlayerListUpdateDisplayName(const cPlayer & a_Player, const AString & a_CustomName);
void SendPlayerMaxSpeed (void); ///< Informs the client of the maximum player speed (1.6.1+)
void SendPlayerMoveLook (void);
void SendPlayerPosition (void);
@@ -180,11 +183,8 @@ public:
void SendPluginMessage (const AString & a_Channel, const AString & a_Message); // Exported in ManualBindings.cpp
void SendRemoveEntityEffect (const cEntity & a_Entity, int a_EffectID);
void SendRespawn (eDimension a_Dimension, bool a_ShouldIgnoreDimensionChecks = false);
- void SendExperience (void);
- void SendExperienceOrb (const cExpOrb & a_ExpOrb);
- void SendScoreboardObjective (const AString & a_Name, const AString & a_DisplayName, Byte a_Mode);
void SendScoreUpdate (const AString & a_Objective, const AString & a_Player, cObjective::Score a_Score, Byte a_Mode);
- void SendDisplayObjective (const AString & a_Objective, cScoreboard::eDisplaySlot a_Display);
+ void SendScoreboardObjective (const AString & a_Name, const AString & a_DisplayName, Byte a_Mode);
void SendSoundEffect (const AString & a_SoundName, double a_X, double a_Y, double a_Z, float a_Volume, float a_Pitch); // tolua_export
void SendSoundParticleEffect (int a_EffectID, int a_SrcX, int a_SrcY, int a_SrcZ, int a_Data);
void SendSpawnFallingBlock (const cFallingBlock & a_FallingBlock);
diff --git a/src/Entities/Player.h b/src/Entities/Player.h
index ffd0b7e03..22d6a2ae2 100644
--- a/src/Entities/Player.h
+++ b/src/Entities/Player.h
@@ -182,11 +182,11 @@ public:
/** Sets the player team, NULL if none */
void SetTeam(cTeam * a_Team);
+ // tolua_end
+
/** Forces the player to query the scoreboard for his team */
cTeam * UpdateTeam(void);
- // tolua_end
-
/** Return the associated statistic and achievement manager. */
cStatManager & GetStatManager() { return m_Stats; }
@@ -421,9 +421,13 @@ public:
/** Sets the player's bed (home) position */
void SetBedPos(const Vector3i & a_Pos) { m_LastBedPos = a_Pos; }
+
+ // tolua_end
/** Update movement-related statistics. */
void UpdateMovementStats(const Vector3d & a_DeltaPos);
+
+ // tolua_begin
/** Returns wheter the player can fly or not. */
virtual bool CanFly(void) const { return m_CanFly; }
diff --git a/src/Root.h b/src/Root.h
index 9a482556c..84c6a98ec 100644
--- a/src/Root.h
+++ b/src/Root.h
@@ -41,11 +41,12 @@ namespace Json
class cRoot
{
public:
- static bool m_TerminateEventRaised;
-
static cRoot * Get() { return s_Root; }
// tolua_end
+ static bool m_TerminateEventRaised;
+
+
cRoot(void);
~cRoot();
@@ -129,15 +130,15 @@ public:
/// Sends a chat message to all connected clients (in all worlds)
void BroadcastChat (const AString & a_Message, eMessageType a_ChatPrefix = mtCustom);
- void BroadcastChatInfo (const AString & a_Message) { BroadcastChat(a_Message, mtInformation); }
+ void BroadcastChat (const cCompositeChat & a_Message);
+ void BroadcastChatDeath (const AString & a_Message) { BroadcastChat(a_Message, mtDeath); }
void BroadcastChatFailure(const AString & a_Message) { BroadcastChat(a_Message, mtFailure); }
- void BroadcastChatSuccess(const AString & a_Message) { BroadcastChat(a_Message, mtSuccess); }
- void BroadcastChatWarning(const AString & a_Message) { BroadcastChat(a_Message, mtWarning); }
void BroadcastChatFatal (const AString & a_Message) { BroadcastChat(a_Message, mtFailure); }
+ void BroadcastChatInfo (const AString & a_Message) { BroadcastChat(a_Message, mtInformation); }
void BroadcastChatJoin (const AString & a_Message) { BroadcastChat(a_Message, mtJoin); }
void BroadcastChatLeave (const AString & a_Message) { BroadcastChat(a_Message, mtLeave); }
- void BroadcastChatDeath (const AString & a_Message) { BroadcastChat(a_Message, mtDeath); }
- void BroadcastChat (const cCompositeChat & a_Message);
+ void BroadcastChatSuccess(const AString & a_Message) { BroadcastChat(a_Message, mtSuccess); }
+ void BroadcastChatWarning(const AString & a_Message) { BroadcastChat(a_Message, mtWarning); }
/// Returns the textual description of the protocol version: 49 -> "1.4.4". Provided specifically for Lua API
static AString GetProtocolVersionTextFromInt(int a_ProtocolVersionNum);