2018-07-04 15:01:50 -06:00
|
|
|
// Copyright 2018 Dolphin Emulator Project
|
|
|
|
// Licensed under GPLv2+
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#include "Common/SFMLHelper.h"
|
|
|
|
|
|
|
|
#include <SFML/Network/Packet.hpp>
|
|
|
|
|
2018-10-02 02:45:36 -06:00
|
|
|
sf::Packet& operator>>(sf::Packet& packet, Common::BigEndianValue<u16>& data)
|
2018-07-04 15:01:50 -06:00
|
|
|
{
|
|
|
|
u16 tmp;
|
|
|
|
packet >> tmp;
|
2018-10-02 02:45:36 -06:00
|
|
|
data = tmp;
|
|
|
|
return packet;
|
2018-07-04 15:01:50 -06:00
|
|
|
}
|
|
|
|
|
2018-10-02 02:45:36 -06:00
|
|
|
sf::Packet& operator>>(sf::Packet& packet, Common::BigEndianValue<u32>& data)
|
2018-07-04 15:01:50 -06:00
|
|
|
{
|
|
|
|
u32 tmp;
|
|
|
|
packet >> tmp;
|
2018-10-02 02:45:36 -06:00
|
|
|
data = tmp;
|
|
|
|
return packet;
|
|
|
|
}
|
|
|
|
|
|
|
|
sf::Packet& operator>>(sf::Packet& packet, Common::BigEndianValue<u64>& data)
|
|
|
|
{
|
|
|
|
sf::Uint64 tmp;
|
|
|
|
packet >> tmp;
|
|
|
|
data = tmp;
|
|
|
|
return packet;
|
2018-07-04 15:01:50 -06:00
|
|
|
}
|
|
|
|
|
2018-10-02 02:45:36 -06:00
|
|
|
namespace Common
|
|
|
|
{
|
|
|
|
// SFML's Uint64 type is different depending on platform,
|
|
|
|
// so we have this for cleaner code.
|
2018-07-04 15:01:50 -06:00
|
|
|
u64 PacketReadU64(sf::Packet& packet)
|
|
|
|
{
|
2018-08-27 15:08:41 -06:00
|
|
|
sf::Uint64 value;
|
|
|
|
packet >> value;
|
|
|
|
return value;
|
2018-07-04 15:01:50 -06:00
|
|
|
}
|
|
|
|
} // namespace Common
|