From 92e85cc96030285bba74837759925866c1be7235 Mon Sep 17 00:00:00 2001 From: andrew Date: Thu, 13 Feb 2014 17:13:09 +0200 Subject: Implementation of in-game maps --- src/ClientHandle.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/ClientHandle.cpp') diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index 1b3ebc3d4..8e44a61fd 100644 --- a/src/ClientHandle.cpp +++ b/src/ClientHandle.cpp @@ -2057,6 +2057,24 @@ void cClientHandle::SendInventorySlot(char a_WindowID, short a_SlotNum, const cI +void cClientHandle::SendMapColumn(int a_ID, int a_X, int a_Y, const Byte * a_Colors, unsigned int a_Length) +{ + m_Protocol->SendMapColumn(a_ID, a_X, a_Y, a_Colors, a_Length); +} + + + + + +void cClientHandle::SendMapInfo(int a_ID, unsigned int a_Scale) +{ + m_Protocol->SendMapInfo(a_ID, a_Scale); +} + + + + + void cClientHandle::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_ParticleAmmount) { m_Protocol->SendParticleEffect(a_ParticleName, a_SrcX, a_SrcY, a_SrcZ, a_OffsetX, a_OffsetY, a_OffsetZ, a_ParticleData, a_ParticleAmmount); -- cgit v1.2.3 From 5b92b877bcc0c5072dbea98b6c54106f954aa758 Mon Sep 17 00:00:00 2001 From: andrew Date: Fri, 14 Feb 2014 16:21:16 +0200 Subject: Send map when selected --- src/ClientHandle.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/ClientHandle.cpp') diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index 8e44a61fd..a2cbaefff 100644 --- a/src/ClientHandle.cpp +++ b/src/ClientHandle.cpp @@ -1190,6 +1190,19 @@ void cClientHandle::HandleSlotSelected(short a_SlotNum) { m_Player->GetInventory().SetEquippedSlotNum(a_SlotNum); m_Player->GetWorld()->BroadcastEntityEquipment(*m_Player, 0, m_Player->GetInventory().GetEquippedItem(), this); + + const cItem & Item = m_Player->GetInventory().GetEquippedItem(); + if (Item.m_ItemType == E_ITEM_MAP) + { + // TODO 2014-02-14 xdot: Do not hardcode this. + cMap * Map = m_Player->GetWorld()->GetMapData(Item.m_ItemDamage); + + if (Map != NULL) + { + // TODO 2014-02-14 xdot: Optimization - Do not send the whole map. + Map->SendTo(*this); + } + } } -- cgit v1.2.3 From cf96e69716e0ccd0657cf275720bb11b915361c4 Mon Sep 17 00:00:00 2001 From: andrew Date: Sat, 15 Feb 2014 20:06:47 +0200 Subject: cMap::UpdateRadius --- src/ClientHandle.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/ClientHandle.cpp') diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index a2cbaefff..ff8775771 100644 --- a/src/ClientHandle.cpp +++ b/src/ClientHandle.cpp @@ -1199,6 +1199,8 @@ void cClientHandle::HandleSlotSelected(short a_SlotNum) if (Map != NULL) { + Map->UpdateRadius(*m_Player, 128); // Temporary + // TODO 2014-02-14 xdot: Optimization - Do not send the whole map. Map->SendTo(*this); } -- cgit v1.2.3 From 3b24bc870bb39a8b8812ed307250e1188b9ff788 Mon Sep 17 00:00:00 2001 From: andrew Date: Mon, 17 Feb 2014 16:27:12 +0200 Subject: Map item handler; Fixed several bugs --- src/ClientHandle.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/ClientHandle.cpp') diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index ff8775771..a2cbaefff 100644 --- a/src/ClientHandle.cpp +++ b/src/ClientHandle.cpp @@ -1199,8 +1199,6 @@ void cClientHandle::HandleSlotSelected(short a_SlotNum) if (Map != NULL) { - Map->UpdateRadius(*m_Player, 128); // Temporary - // TODO 2014-02-14 xdot: Optimization - Do not send the whole map. Map->SendTo(*this); } -- cgit v1.2.3 From 393ca0221dfdb6dabadcf293fea86a830453c938 Mon Sep 17 00:00:00 2001 From: andrew Date: Tue, 18 Feb 2014 20:50:08 +0200 Subject: Map decorators; Map clients --- src/ClientHandle.cpp | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'src/ClientHandle.cpp') diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index a2cbaefff..efc5a9f64 100644 --- a/src/ClientHandle.cpp +++ b/src/ClientHandle.cpp @@ -1190,19 +1190,6 @@ void cClientHandle::HandleSlotSelected(short a_SlotNum) { m_Player->GetInventory().SetEquippedSlotNum(a_SlotNum); m_Player->GetWorld()->BroadcastEntityEquipment(*m_Player, 0, m_Player->GetInventory().GetEquippedItem(), this); - - const cItem & Item = m_Player->GetInventory().GetEquippedItem(); - if (Item.m_ItemType == E_ITEM_MAP) - { - // TODO 2014-02-14 xdot: Do not hardcode this. - cMap * Map = m_Player->GetWorld()->GetMapData(Item.m_ItemDamage); - - if (Map != NULL) - { - // TODO 2014-02-14 xdot: Optimization - Do not send the whole map. - Map->SendTo(*this); - } - } } @@ -2079,6 +2066,15 @@ void cClientHandle::SendMapColumn(int a_ID, int a_X, int a_Y, const Byte * a_Col +void cClientHandle::SendMapDecorators(int a_ID, const cMapDecoratorList & a_Decorators) +{ + m_Protocol->SendMapDecorators(a_ID, a_Decorators); +} + + + + + void cClientHandle::SendMapInfo(int a_ID, unsigned int a_Scale) { m_Protocol->SendMapInfo(a_ID, a_Scale); -- cgit v1.2.3