summaryrefslogtreecommitdiffstats
path: root/source/packets
diff options
context:
space:
mode:
authoradmin@omencraft.com <admin@omencraft.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2011-10-26 22:52:19 +0200
committeradmin@omencraft.com <admin@omencraft.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2011-10-26 22:52:19 +0200
commit88270be66928f3b73b73fc1f3b26a74358089223 (patch)
tree736a03b5343df0693638f59b39a9f3599d7d9057 /source/packets
parentMoved GAMEMODE declaration to a single place... cPacket.h. Player can't take damage any more but can still sometimes die on spawn. Not sure why. Falling through the void does not kill you yet. (diff)
downloadcuberite-88270be66928f3b73b73fc1f3b26a74358089223.tar
cuberite-88270be66928f3b73b73fc1f3b26a74358089223.tar.gz
cuberite-88270be66928f3b73b73fc1f3b26a74358089223.tar.bz2
cuberite-88270be66928f3b73b73fc1f3b26a74358089223.tar.lz
cuberite-88270be66928f3b73b73fc1f3b26a74358089223.tar.xz
cuberite-88270be66928f3b73b73fc1f3b26a74358089223.tar.zst
cuberite-88270be66928f3b73b73fc1f3b26a74358089223.zip
Diffstat (limited to 'source/packets')
-rw-r--r--source/packets/cPacket.h2
-rw-r--r--source/packets/cPacket_CreateInventoryAction.cpp6
-rw-r--r--source/packets/cPacket_CreateInventoryAction.h8
-rw-r--r--source/packets/cPacket_Login.h2
-rw-r--r--source/packets/cPacket_Respawn.h2
5 files changed, 9 insertions, 11 deletions
diff --git a/source/packets/cPacket.h b/source/packets/cPacket.h
index ff4366c7a..304d6b8d3 100644
--- a/source/packets/cPacket.h
+++ b/source/packets/cPacket.h
@@ -22,8 +22,6 @@ public:
virtual bool Send( cSocket & a_Socket) { a_Socket=0; printf("ERROR: Undefined NEW Send function %x\n", m_PacketID ); return false; }
virtual cPacket* Clone() const = 0;
- static const int GAMEMODE = 1; //0 = Survival, 1 = Creative;
-
unsigned char m_PacketID;
cSocket m_Socket; // Current socket being used
protected:
diff --git a/source/packets/cPacket_CreateInventoryAction.cpp b/source/packets/cPacket_CreateInventoryAction.cpp
index 19996769f..40aad22e8 100644
--- a/source/packets/cPacket_CreateInventoryAction.cpp
+++ b/source/packets/cPacket_CreateInventoryAction.cpp
@@ -6,7 +6,7 @@ cPacket_CreateInventoryAction::cPacket_CreateInventoryAction( const cPacket_Crea
m_Slot = a_Copy.m_Slot;
m_ItemID = a_Copy.m_ItemID;
m_Quantity = 0;
- m_Short = 0;
+ m_Damage = 0;
}
bool cPacket_CreateInventoryAction::Parse(cSocket & a_Socket)
@@ -15,7 +15,7 @@ bool cPacket_CreateInventoryAction::Parse(cSocket & a_Socket)
if( !ReadShort ( m_Slot ) ) return false;
if( !ReadShort ( m_ItemID ) ) return false;
if( !ReadShort ( m_Quantity ) ) return false;
- if( !ReadShort ( m_Short ) ) return false;
+ if( !ReadShort ( m_Damage ) ) return false;
return true;
}
@@ -34,7 +34,7 @@ bool cPacket_CreateInventoryAction::Send(cSocket & a_Socket)
AppendShort ( m_Slot, Message, i );
AppendShort ( m_ItemID, Message, i );
AppendShort ( m_Quantity, Message, i );
- AppendShort ( m_Short, Message, i );
+ AppendShort ( m_Damage, Message, i );
bool RetVal = !cSocket::IsSocketError( SendData( a_Socket, Message, TotalSize, 0 ) );
delete [] Message;
diff --git a/source/packets/cPacket_CreateInventoryAction.h b/source/packets/cPacket_CreateInventoryAction.h
index e4ed2d9f8..02af3a64e 100644
--- a/source/packets/cPacket_CreateInventoryAction.h
+++ b/source/packets/cPacket_CreateInventoryAction.h
@@ -10,8 +10,8 @@ public:
: m_Slot( 0 )
, m_ItemID( 0 )
, m_Quantity( 0 )
- , m_Short( 0 )
- { m_PacketID = E_CREATE_INVENTORY_ACTION; m_Short = 0; m_Quantity = 1; }
+ , m_Damage( 0 )
+ { m_PacketID = E_CREATE_INVENTORY_ACTION; m_Quantity = 1; }
cPacket_CreateInventoryAction( const cPacket_CreateInventoryAction & a_Copy );
virtual cPacket* Clone() const { return new cPacket_CreateInventoryAction(*this); }
@@ -21,7 +21,7 @@ public:
short m_Slot; // 0 = hold 1-4 = armor
short m_ItemID;
short m_Quantity;
- short m_Short;
+ short m_Damage;
- static const unsigned int c_Size = 1 + 4 + 2 + 2 + 2;
+ static const unsigned int c_Size = 1 + 2 + 2 + 2 + 2;
};
diff --git a/source/packets/cPacket_Login.h b/source/packets/cPacket_Login.h
index 81c8af39b..91919a799 100644
--- a/source/packets/cPacket_Login.h
+++ b/source/packets/cPacket_Login.h
@@ -10,7 +10,7 @@ public:
cPacket_Login()
: m_ProtocolVersion( 0 )
, m_MapSeed( 0 )
- , m_ServerMode( GAMEMODE ) //0 for survival, 1 for creative
+ , m_ServerMode( 0 )
, m_Dimension( 0 )
, m_Difficulty( 0 )
, m_WorldHeight( 0 )
diff --git a/source/packets/cPacket_Respawn.h b/source/packets/cPacket_Respawn.h
index 9a87d11ae..ab8fbe72a 100644
--- a/source/packets/cPacket_Respawn.h
+++ b/source/packets/cPacket_Respawn.h
@@ -9,7 +9,7 @@ public:
cPacket_Respawn()
: m_World( 0 )
, m_Difficulty( 0 )
- , m_CreativeMode( GAMEMODE )
+ , m_CreativeMode( 0 )
, m_WorldHeight( 0 )
, m_MapSeed( 0 )
{ m_PacketID = E_RESPAWN; }