Tweaked logging.
Less output for UI. More output for player pos confirming (FS #245) and for player spawning git-svn-id: http://mc-server.googlecode.com/svn/trunk@875 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
parent
60c29274d3
commit
578c9c4694
@ -752,10 +752,6 @@ void cProtocol125::SendWindowClose(char a_WindowID)
|
|||||||
|
|
||||||
void cProtocol125::SendWindowOpen(char a_WindowID, char a_WindowType, const AString & a_WindowTitle, char a_NumSlots)
|
void cProtocol125::SendWindowOpen(char a_WindowID, char a_WindowType, const AString & a_WindowTitle, char a_NumSlots)
|
||||||
{
|
{
|
||||||
LOGD("Sending a WindowOpen packet: ID = %d, Type = %d, Title = \"%s\", NumSlots = %d",
|
|
||||||
a_WindowID, a_WindowType, a_WindowTitle.c_str(), a_NumSlots
|
|
||||||
);
|
|
||||||
|
|
||||||
if (a_WindowType < 0)
|
if (a_WindowType < 0)
|
||||||
{
|
{
|
||||||
// Do not send for inventory windows
|
// Do not send for inventory windows
|
||||||
@ -1256,9 +1252,6 @@ void cProtocol125::SendPreChunk(int a_ChunkX, int a_ChunkZ, bool a_ShouldLoad)
|
|||||||
|
|
||||||
void cProtocol125::SendWindowSlots(char a_WindowID, int a_NumItems, const cItem * a_Items)
|
void cProtocol125::SendWindowSlots(char a_WindowID, int a_NumItems, const cItem * a_Items)
|
||||||
{
|
{
|
||||||
LOGD("Sending a InventoryWhole packet: WindowID = %d, NumItems = %d",
|
|
||||||
a_WindowID, a_NumItems
|
|
||||||
);
|
|
||||||
WriteByte (PACKET_INVENTORY_WHOLE);
|
WriteByte (PACKET_INVENTORY_WHOLE);
|
||||||
WriteByte (a_WindowID);
|
WriteByte (a_WindowID);
|
||||||
WriteShort((short)a_NumItems);
|
WriteShort((short)a_NumItems);
|
||||||
|
@ -24,7 +24,6 @@ cSlotArea::cSlotArea(int a_NumSlots, cWindow & a_ParentWindow) :
|
|||||||
m_NumSlots(a_NumSlots),
|
m_NumSlots(a_NumSlots),
|
||||||
m_ParentWindow(a_ParentWindow)
|
m_ParentWindow(a_ParentWindow)
|
||||||
{
|
{
|
||||||
LOGD("Created a new cSlotArea with %d slots", a_NumSlots);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -33,11 +32,13 @@ cSlotArea::cSlotArea(int a_NumSlots, cWindow & a_ParentWindow) :
|
|||||||
|
|
||||||
void cSlotArea::Clicked(cPlayer & a_Player, int a_SlotNum, bool a_IsRightClick, bool a_IsShiftPressed, const cItem & a_ClickedItem)
|
void cSlotArea::Clicked(cPlayer & a_Player, int a_SlotNum, bool a_IsRightClick, bool a_IsShiftPressed, const cItem & a_ClickedItem)
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
LOGD("Slot area with %d slots clicked at slot number %d, clicked item %s, slot item %s",
|
LOGD("Slot area with %d slots clicked at slot number %d, clicked item %s, slot item %s",
|
||||||
GetNumSlots(), a_SlotNum,
|
GetNumSlots(), a_SlotNum,
|
||||||
ItemToFullString(a_ClickedItem).c_str(),
|
ItemToFullString(a_ClickedItem).c_str(),
|
||||||
ItemToFullString(*GetSlot(a_SlotNum, a_Player)).c_str()
|
ItemToFullString(*GetSlot(a_SlotNum, a_Player)).c_str()
|
||||||
);
|
);
|
||||||
|
*/
|
||||||
|
|
||||||
ASSERT((a_SlotNum >= 0) && (a_SlotNum < GetNumSlots()));
|
ASSERT((a_SlotNum >= 0) && (a_SlotNum < GetNumSlots()));
|
||||||
|
|
||||||
@ -62,10 +63,9 @@ void cSlotArea::Clicked(cPlayer & a_Player, int a_SlotNum, bool a_IsRightClick,
|
|||||||
cItem Slot(*GetSlot(a_SlotNum, a_Player));
|
cItem Slot(*GetSlot(a_SlotNum, a_Player));
|
||||||
if (!Slot.IsEqual(a_ClickedItem))
|
if (!Slot.IsEqual(a_ClickedItem))
|
||||||
{
|
{
|
||||||
LOGD("*** Window lost sync ***");
|
LOGD("*** Window lost sync at item %d in SlotArea with %d items ***", a_SlotNum, m_NumSlots);
|
||||||
LOGD("My Type: %i Their Type: %i", Slot.m_ItemID, a_ClickedItem.m_ItemID);
|
LOGD("My item: %s", ItemToFullString(Slot).c_str());
|
||||||
LOGD("My Count: %i Their Count: %i", Slot.m_ItemCount, a_ClickedItem.m_ItemCount);
|
LOGD("Their item: %s", ItemToFullString(a_ClickedItem).c_str());
|
||||||
LOGD("My Dmg: %i Their Dmg: %i", Slot.m_ItemHealth, a_ClickedItem.m_ItemHealth);
|
|
||||||
bAsync = true;
|
bAsync = true;
|
||||||
}
|
}
|
||||||
cItem & DraggingItem = a_Player.GetDraggingItem();
|
cItem & DraggingItem = a_Player.GetDraggingItem();
|
||||||
|
@ -33,9 +33,6 @@ cWindow::cWindow(cWindow::WindowType a_WindowType, const AString & a_WindowTitle
|
|||||||
{
|
{
|
||||||
m_WindowID = 0;
|
m_WindowID = 0;
|
||||||
}
|
}
|
||||||
LOGD("Created a window at %p, type = %d, ID = %i, title = \"%s\".",
|
|
||||||
this, m_WindowType, m_WindowID, m_WindowTitle.c_str()
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -44,7 +41,6 @@ cWindow::cWindow(cWindow::WindowType a_WindowType, const AString & a_WindowTitle
|
|||||||
|
|
||||||
cWindow::~cWindow()
|
cWindow::~cWindow()
|
||||||
{
|
{
|
||||||
LOGD("Deleted a window at %p", this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -325,7 +321,6 @@ void cWindow::SendSlot(cPlayer & a_Player, cSlotArea * a_SlotArea, int a_Relativ
|
|||||||
|
|
||||||
void cWindow::Destroy(void)
|
void cWindow::Destroy(void)
|
||||||
{
|
{
|
||||||
LOGD("Destroying window %p (type %d)", this, m_WindowType);
|
|
||||||
if (m_Owner != NULL)
|
if (m_Owner != NULL)
|
||||||
{
|
{
|
||||||
m_Owner->CloseWindow();
|
m_Owner->CloseWindow();
|
||||||
|
@ -782,6 +782,8 @@ void cClientHandle::HandlePlayerMoveLook(double a_PosX, double a_PosY, double a_
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
LOGWARNING("Player \"%s\" sent a weird position confirmation %.2f blocks away, retrying", m_Username.c_str(), sqrt(Dist));
|
LOGWARNING("Player \"%s\" sent a weird position confirmation %.2f blocks away, retrying", m_Username.c_str(), sqrt(Dist));
|
||||||
|
LOGD(" Expected pos: {%0.2f, %0.2f, %0.2f}", m_ConfirmPosition.x, m_ConfirmPosition.y, m_ConfirmPosition.z);
|
||||||
|
LOGD(" Received pos: {%0.2f, %0.2f, %0.2f}", a_PosX, a_PosY, a_PosZ);
|
||||||
m_ConfirmPosition = m_Player->GetPosition();
|
m_ConfirmPosition = m_Player->GetPosition();
|
||||||
SendPlayerMoveLook();
|
SendPlayerMoveLook();
|
||||||
}
|
}
|
||||||
@ -1305,6 +1307,10 @@ void cClientHandle::SendPlayerSpawn(const cPlayer & a_Player)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LOG("Spawning player \"%s\" on client \"%s\" @ %s",
|
||||||
|
a_Player.GetName().c_str(), GetPlayer()->GetName().c_str(), GetIPString().c_str()
|
||||||
|
);
|
||||||
|
|
||||||
m_Protocol->SendPlayerSpawn(a_Player);
|
m_Protocol->SendPlayerSpawn(a_Player);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,44 +75,44 @@ public:
|
|||||||
|
|
||||||
bool IsPlaying(void) const {return (m_State == csPlaying); }
|
bool IsPlaying(void) const {return (m_State == csPlaying); }
|
||||||
|
|
||||||
void SendDisconnect(const AString & a_Reason);
|
void SendBlockAction (int a_BlockX, int a_BlockY, int a_BlockZ, char a_Byte1, char a_Byte2, BLOCKTYPE a_BlockType);
|
||||||
void SendInventorySlot(char a_WindowID, short a_SlotNum, const cItem & a_Item);
|
void SendBlockChange (int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta);
|
||||||
void SendChat(const AString & a_Message);
|
void SendBlockChanges (int a_ChunkX, int a_ChunkZ, const sSetBlockVector & a_Changes);
|
||||||
void SendPlayerAnimation(const cPlayer & a_Player, char a_Animation);
|
void SendChat (const AString & a_Message);
|
||||||
void SendEntityEquipment(const cEntity & a_Entity, short a_SlotNum, const cItem & a_Item);
|
void SendChunkData (int a_ChunkX, int a_ChunkZ, cChunkDataSerializer & a_Serializer);
|
||||||
void SendWindowOpen(char a_WindowID, char a_WindowType, const AString & a_WindowTitle, char a_NumSlots);
|
void SendCollectPickup (const cPickup & a_Pickup, const cPlayer & a_Player);
|
||||||
void SendWindowClose(char a_WindowID);
|
void SendDestroyEntity (const cEntity & a_Entity);
|
||||||
void SendWholeInventory(const cInventory & a_Inventory);
|
void SendDisconnect (const AString & a_Reason);
|
||||||
void SendWholeInventory(const cWindow & a_Window);
|
void SendEntHeadLook (const cEntity & a_Entity);
|
||||||
void SendTeleportEntity(const cEntity & a_Entity);
|
void SendEntLook (const cEntity & a_Entity);
|
||||||
void SendPlayerListItem(const cPlayer & a_Player, bool a_IsOnline);
|
void SendEntRelMove (const cEntity & a_Entity, char a_RelX, char a_RelY, char a_RelZ);
|
||||||
void SendPlayerPosition(void);
|
void SendEntRelMoveLook (const cEntity & a_Entity, char a_RelX, char a_RelY, char a_RelZ);
|
||||||
void SendEntRelMoveLook(const cEntity & a_Entity, char a_RelX, char a_RelY, char a_RelZ);
|
void SendEntityEquipment (const cEntity & a_Entity, short a_SlotNum, const cItem & a_Item);
|
||||||
void SendEntRelMove (const cEntity & a_Entity, char a_RelX, char a_RelY, char a_RelZ);
|
void SendEntityStatus (const cEntity & a_Entity, char a_Status);
|
||||||
void SendEntLook (const cEntity & a_Entity);
|
void SendGameMode (eGameMode a_GameMode);
|
||||||
void SendEntHeadLook (const cEntity & a_Entity);
|
void SendHealth (void);
|
||||||
void SendBlockAction (int a_BlockX, int a_BlockY, int a_BlockZ, char a_Byte1, char a_Byte2, BLOCKTYPE a_BlockType);
|
|
||||||
void SendHealth (void);
|
|
||||||
void SendRespawn(void);
|
|
||||||
void SendGameMode(eGameMode a_GameMode);
|
|
||||||
void SendDestroyEntity(const cEntity & a_Entity);
|
|
||||||
void SendPlayerMoveLook(void);
|
|
||||||
void SendEntityStatus(const cEntity & a_Entity, char a_Status);
|
|
||||||
void SendMetadata(const cPawn & a_Entity);
|
|
||||||
void SendInventoryProgress(char a_WindowID, short a_Progressbar, short a_Value);
|
void SendInventoryProgress(char a_WindowID, short a_Progressbar, short a_Value);
|
||||||
void SendPlayerSpawn(const cPlayer & a_Player);
|
void SendInventorySlot (char a_WindowID, short a_SlotNum, const cItem & a_Item);
|
||||||
void SendPickupSpawn(const cPickup & a_Pickup);
|
void SendMetadata (const cPawn & a_Entity);
|
||||||
void SendSpawnMob (const cMonster & a_Mob);
|
void SendPickupSpawn (const cPickup & a_Pickup);
|
||||||
void SendUpdateSign (int a_BlockX, int a_BlockY, int a_BlockZ, const AString & a_Line1, const AString & a_Line2, const AString & a_Line3, const AString & a_Line4);
|
void SendPlayerAnimation (const cPlayer & a_Player, char a_Animation);
|
||||||
void SendCollectPickup(const cPickup & a_Pickup, const cPlayer & a_Player);
|
void SendPlayerListItem (const cPlayer & a_Player, bool a_IsOnline);
|
||||||
void SendBlockChange(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta);
|
void SendPlayerMoveLook (void);
|
||||||
void SendBlockChanges(int a_ChunkX, int a_ChunkZ, const sSetBlockVector & a_Changes);
|
void SendPlayerPosition (void);
|
||||||
void SendUnloadChunk(int a_ChunkX, int a_ChunkZ);
|
void SendPlayerSpawn (const cPlayer & a_Player);
|
||||||
void SendWeather(eWeather a_Weather);
|
void SendRespawn (void);
|
||||||
void SendTimeUpdate(Int64 a_WorldTime);
|
void SendSoundEffect (const AString & a_SoundName, int a_SrcX, int a_SrcY, int a_SrcZ, float a_Volume, float a_Pitch); // a_Src coords are Block * 8
|
||||||
void SendThunderbolt(int a_BlockX, int a_BlockY, int a_BlockZ);
|
void SendSpawnMob (const cMonster & a_Mob);
|
||||||
void SendSoundEffect(const AString & a_SoundName, int a_SrcX, int a_SrcY, int a_SrcZ, float a_Volume, float a_Pitch); // a_Src coords are Block * 8
|
void SendTeleportEntity (const cEntity & a_Entity);
|
||||||
void SendChunkData(int a_ChunkX, int a_ChunkZ, cChunkDataSerializer & a_Serializer);
|
void SendThunderbolt (int a_BlockX, int a_BlockY, int a_BlockZ);
|
||||||
|
void SendTimeUpdate (Int64 a_WorldTime);
|
||||||
|
void SendUnloadChunk (int a_ChunkX, int a_ChunkZ);
|
||||||
|
void SendUpdateSign (int a_BlockX, int a_BlockY, int a_BlockZ, const AString & a_Line1, const AString & a_Line2, const AString & a_Line3, const AString & a_Line4);
|
||||||
|
void SendWeather (eWeather a_Weather);
|
||||||
|
void SendWholeInventory (const cInventory & a_Inventory);
|
||||||
|
void SendWholeInventory (const cWindow & a_Window);
|
||||||
|
void SendWindowClose (char a_WindowID);
|
||||||
|
void SendWindowOpen (char a_WindowID, char a_WindowType, const AString & a_WindowTitle, char a_NumSlots);
|
||||||
|
|
||||||
const AString & GetUsername(void) const; //tolua_export
|
const AString & GetUsername(void) const; //tolua_export
|
||||||
|
|
||||||
|
@ -85,8 +85,6 @@ void cFurnaceEntity::Destroy()
|
|||||||
|
|
||||||
void cFurnaceEntity::UsedBy(cPlayer * a_Player)
|
void cFurnaceEntity::UsedBy(cPlayer * a_Player)
|
||||||
{
|
{
|
||||||
LOG("Used a furnace");
|
|
||||||
|
|
||||||
if (GetWindow() == NULL)
|
if (GetWindow() == NULL)
|
||||||
{
|
{
|
||||||
OpenWindow(new cFurnaceWindow(m_PosX, m_PosY, m_PosZ, this));
|
OpenWindow(new cFurnaceWindow(m_PosX, m_PosY, m_PosZ, this));
|
||||||
|
Loading…
Reference in New Issue
Block a user