Files
MinecraftConsoles/Minecraft.Client/Durango/Network/NetworkPlayerDurango.cpp
ModMaker101 a9be52c41a Project modernization (#630)
* Fixed boats falling and a TP glitch #266

* Replaced every C-style cast with C++ ones

* Replaced every C-style cast with C++ ones

* Fixed boats falling and a TP glitch #266

* Updated NULL to nullptr and fixing some type issues

* Modernized and fixed a few bugs

- Replaced most instances of `NULL` with `nullptr`.
- Replaced most `shared_ptr(new ...)` with `make_shared`.
- Removed the `nullptr` macro as it was interfering with the actual nullptr keyword in some instances.

* Fixing more conflicts

* Replace int loops with size_t and start work on overrides
2026-03-08 09:56:03 +07:00

113 lines
2.1 KiB
C++

#include "stdafx.h"
#include "NetworkPlayerDurango.h"
NetworkPlayerDurango::NetworkPlayerDurango(DQRNetworkPlayer *qnetPlayer)
{
m_dqrPlayer = qnetPlayer;
m_pSocket = nullptr;
}
unsigned char NetworkPlayerDurango::GetSmallId()
{
return m_dqrPlayer->GetSmallId();
}
void NetworkPlayerDurango::SendData(INetworkPlayer *player, const void *pvData, int dataSize, bool lowPriority)
{
m_dqrPlayer->SendData( static_cast<NetworkPlayerDurango *>(player)->m_dqrPlayer, pvData, dataSize );
}
bool NetworkPlayerDurango::IsSameSystem(INetworkPlayer *player)
{
return m_dqrPlayer->IsSameSystem(static_cast<NetworkPlayerDurango *>(player)->m_dqrPlayer);
}
int NetworkPlayerDurango::GetSendQueueSizeBytes( INetworkPlayer *player, bool lowPriority )
{
return m_dqrPlayer->GetSendQueueSizeBytes();
}
int NetworkPlayerDurango::GetSendQueueSizeMessages( INetworkPlayer *player, bool lowPriority )
{
return m_dqrPlayer->GetSendQueueSizeMessages();
}
int NetworkPlayerDurango::GetCurrentRtt()
{
return 0; // TODO
}
bool NetworkPlayerDurango::IsHost()
{
return m_dqrPlayer->IsHost();
}
bool NetworkPlayerDurango::IsGuest()
{
return false; // TODO
}
bool NetworkPlayerDurango::IsLocal()
{
return m_dqrPlayer->IsLocal();
}
int NetworkPlayerDurango::GetSessionIndex()
{
return m_dqrPlayer->GetSessionIndex();
}
bool NetworkPlayerDurango::IsTalking()
{
return m_dqrPlayer->IsTalking();
}
bool NetworkPlayerDurango::IsMutedByLocalUser(int userIndex)
{
return false;
}
bool NetworkPlayerDurango::HasVoice()
{
return m_dqrPlayer->HasVoice();
}
bool NetworkPlayerDurango::HasCamera()
{
return false; // TODO
}
int NetworkPlayerDurango::GetUserIndex()
{
return m_dqrPlayer->GetLocalPlayerIndex();
}
void NetworkPlayerDurango::SetSocket(Socket *pSocket)
{
m_pSocket = pSocket;
}
Socket *NetworkPlayerDurango::GetSocket()
{
return m_pSocket;
}
const wchar_t *NetworkPlayerDurango::GetOnlineName()
{
return m_dqrPlayer->GetName();
}
wstring NetworkPlayerDurango::GetDisplayName()
{
return m_dqrPlayer->GetDisplayName();
}
PlayerUID NetworkPlayerDurango::GetUID()
{
return m_dqrPlayer->GetUID();
}
void NetworkPlayerDurango::SetUID(PlayerUID UID)
{
m_dqrPlayer->SetUID(UID);
}