Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: [SOLVED]operator>>  (Read 2623 times)

0 Members and 1 Guest are viewing this topic.

Soul

  • Newbie
  • *
  • Posts: 44
    • View Profile
[SOLVED]operator>>
« on: March 02, 2013, 12:20:34 pm »
hey, idk why but i can't compile operator >> from packet

client.cpp
sf::Packet& operator >>(sf::Packet& packet, Client &c)
{
    packet >> c.family >> c.action;
}
 

client.h
class Client
{
    public:
        sf::TcpSocket Socket;
        sf::Packet Send;
        sf::Packet Recv;
        Packet::PacketFamily family;
        Packet::PacketAction action;
        int ClientID;
};

 sf::Packet& operator <<(sf::Packet& packet, Client &c);
 sf::Packet& operator >>(sf::Packet& packet, Client &c);

packet.h
namespace Packet
{
    enum PacketFamily : unsigned char
    {
        PACKET_A_INIT = 0,
        PACKET_B_INIT = 1
    };

    enum PacketAction : unsigned char
    {
        PACKET_REQUEST = 1,
        PACKET_ACCEPT = 2,
        PACKET_REPLY = 3
    };
    std::string GetFamilyName(PacketFamily family);
    std::string GetActionName(PacketAction action);
}
 
what's wrong?
« Last Edit: March 02, 2013, 02:12:41 pm by Soul »

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: operator>>
« Reply #1 on: March 02, 2013, 01:48:52 pm »
what's wrong?
That's what you should tell us. What is the error message? Can you reproduce a minimal and complete example so that we're sure the problem lies not elsewhere in your code?
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Soul

  • Newbie
  • *
  • Posts: 44
    • View Profile
Re: [SOLVED]operator>>
« Reply #2 on: March 02, 2013, 02:12:54 pm »
problem solved ; p

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: [SOLVED]operator>>
« Reply #3 on: March 02, 2013, 02:57:04 pm »
This is your 4th thread in the Network section within a few days. Please invest at least a few minutes trying to solve your problems. This includes reading error messages carefully, searching on the internet (and especially this forum) for existing solutions, and using the debugger.

If your problem persists after a long time, you can still ask a question here. But if you do so, describe your problem in a meaningful way and show at least some initiative. See also Read before posting.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development: