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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - iride

Pages: 1 2 [3] 4 5 6
31
Network / accepting a socket that has already been accepted
« on: April 15, 2015, 06:20:57 am »
 What happens when I accept a socket that has already been accepted?
will it just continue to return sf::Socket::Done?
listener.accept(socket); //accepted
listener.accept(socket); //??


32
Network / sending one packet to multiple recipents
« on: January 22, 2014, 04:54:59 am »
I noticed that sf::Tcp::Socket::send  takes a reference to  a sf::Packet , not const sf::Packet
Does this mean that when I send a packet , the contents of the packet get modified so I can't send the same packet to the other clients?
or in code
sf::Packet packet;
packet<<"hi";
for(sf::TcpSocket & s : sockets)
    s.send(packet);//is this ok?
 

33
General / Re: using std::enable_if for sf::Packet overloads for enums
« on: January 20, 2014, 10:45:17 pm »
Wow thank you so much. Never heard of SFINAE before.
Anyways I think this overload will be a good addition for SFML since enums are frequently used in packets.
Could this be added to SFML when SFML supports c++11?

34
General / using std::enable_if for sf::Packet overloads for enums
« on: January 20, 2014, 08:28:30 pm »
I'm trying to write a function template for overloading enums with sf::Packet. What did I do wrong?

template <class Enum>
sf::Packet & operator<<(sf::Packet & packet, const typename std::enable_if<std::is_enum<Enum>::value, Enum>::type & t)
{
        return packet << static_cast<typename std::underlying_type<EnumT>::type>(t);
}

template <class Enum>
sf::Packet & operator>>(sf::Packet & packet, typename std::enable_if<std::is_enum<Enum>::value, Enum>::type & t)
{
        typename std::underlying_type<EnumT>::type i;
        packet >> i;
        t = static_cast<Enum>(i);
        return packet;
}

enum Month : sf::Int32
{
    January
}

//doesn't compile
sf::Packet packet;
packet<<January;
Month month;
packet>>month;
 

35
General / Re: Getting Error when creating a Singleton class
« on: January 04, 2014, 02:22:24 am »
singletons are bad. don't use them

36
SFML projects / Re: Thor 2.0
« on: January 03, 2014, 03:35:02 am »
I want particles to have random color. How can I do that using UniversalEmitter::setParticleColor?

37
Network / Re: problems with sf::TcpSocket
« on: December 29, 2013, 05:28:29 pm »
Go to cmd and type ipconfig or call system("ipconfig") in your program.
Then it will show you the IPv4 address. Use that address.

38
Network / interpolating
« on: December 28, 2013, 05:43:57 pm »
http://www.gabrielgambetta.com/fpm3.html

I'm trying to implement entity interpolation explained in this article. I understand that I have to display the game couple frames late, but I have no clue how to translate this into code.
 sf::Packet packet;
 receivePacket(packet);
 packet>>newX>>newY; //now what should I do with this new position?
 

39
Network / Re: issues with sf::Int8
« on: December 22, 2013, 06:26:45 am »
thanks!

40
Network / issues with sf::Int8
« on: December 22, 2013, 05:36:03 am »
I initially thought this was a issue with networking..

int main()
{

        sf::Int8 i = 1;
        std::cout << i;
        std::cin.get();
}

This piece of code prints a smiley face to the console screen, not 1

windows 8.1 visual studio 2013

41
Network / Re: Example network program doesn't work on school network
« on: October 24, 2013, 08:28:47 pm »
wait...  I got it to work now.

If the exectuable is located in a clouded drive, it doesn't work...
But if the  executable is in a computer's local drive(C: for example), everything suddenly works!
Appreciate the help anyways. Thanks :)

42
Network / Re: Example network program doesn't work on school network
« on: October 24, 2013, 06:00:07 pm »
Do you actually know which kind of antivirus/firewall is running on the PCs? I remember the Comodo Firewall causing rather weird API behavior, even while being deactivated (like crashing QT programs just because they tried to create a socket).

Also wouldn't consider Chrome being some reliable test, because most firewalls will most likely let it pass based on their own whitelists.
McAfee

This is probably a permission problem... can you use any other network program that isn't installed on the local machine? Or do they also fail to connect?
I downloaded Google Chrome and it works fine.

I can't confirm if your program is working because it closes to fast before I can see the output. I can't even run the  program from command prompt because it's disabled. Howerver, I tried running an old chat program that I made with SFML 2.0 and strangely, it works.

43
Network / Re: Example network program doesn't work on school network
« on: October 23, 2013, 10:13:22 pm »
This is probably a permission problem... can you use any other network program that isn't installed on the local machine? Or do they also fail to connect?
I downloaded Google Chrome and it works fine.

44
Network / Re: Example network program doesn't work on school network
« on: October 23, 2013, 05:12:24 pm »
IPv4 socket() failed: 10022
IPv6 socket() failed: 10022

45
Network / Re: Example network program doesn't work on school network
« on: October 22, 2013, 08:17:15 pm »
socket() failed: 10022

Pages: 1 2 [3] 4 5 6