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 - Shinao

Pages: [1]
1
I don't use it anymore because I do not create mini games like I used to.

That's an amazing list of ressources you've got there ! You have been productive on SFML :O
I wonder what kind of things are created that I don't know about that would have simplified all this, hm.

Thanks for your answer :)

2
Hello,

I've finished my project for more than two month now but never got any feedback on it so it will be appreciated.

Link: https://github.com/Shinao/JustAGame

Basically what I wanted to do is a framework for all my mini games, I've had a lot of ideas and simple things to create but I had to redo some things every time and if I wanted to make it multiplayer it was really painful.

What's great about it is the simplicity to integrate a new game. The sample Tic Tac Toe is a shared library that will be loaded on runtime by the game framework when you join a server, if you don't have this game it will download it so that you don't have to keep updating your games manually to the clients.

I don't really use it anymore but some classes can be useful for some people since it's cross-platform. It probably have some bugs since I could not test it on a large scale.

Do you guys have also some libraries/classes that you re-use all the time ? What are they ?

Good day.

3
Network / Re: SocketSelector isReady always return false
« on: April 05, 2014, 05:16:15 am »
Hm... I think I had it and deleted it to have a minimal example.

Well thank you for your time !

4
Network / Re: SocketSelector isReady always return false
« on: April 04, 2014, 06:43:31 pm »
I allow myself to reply one more time just to be sure I'm seen.

Binding before adding to the selector doesn't seem to do the trick.
I tried on Linux with an older version of SFML and I got the same result (just to be sure it wasn't a mingw problem).

So now I'm really confused. Do you have the same result than me ?

Thanks

5
Network / Re: SocketSelector isReady always return false
« on: April 04, 2014, 01:12:11 pm »
Oh, I should have thought of that.
Thanks anyway.

Edit: I tried and got the same problem. Any idea ?

6
Network / SocketSelector isReady always return false
« on: April 04, 2014, 07:08:23 am »
Hi,

Here is my minimal example
./a.out foo
will launch the server
and ./a.out will launch the client
The client will send a udp message to the server which will display received.
But if we uncomment the isReady function, then we can see that it always return false.

What am I doing wrong ?
By the way, I just pulled the git repository, so I've got the last 'version'.

#include <SFML/Network.hpp>
#include <SFML/System.hpp>
#include <iostream>

void    server();
void    client();

int     main(int ac, char **av)
{
  if (ac > 1)
    server();
  else
    client();
}

void    server()
{
  sf::SocketSelector _listener;
  sf::UdpSocket _socket;

  _listener.add(_socket);
  if (_socket.bind(25052) != sf::Socket::Done)
  {
    std::cout << "can't bind" << std::endl;
    return ;
  }

  char buffer[1024];
  std::size_t received = 0;
  sf::IpAddress sender;
  unsigned short port;

  _socket.setBlocking(true);
  while (1)
  {
    // if (_listener.isReady(_socket))
    // {
      _socket.receive(buffer, sizeof(buffer), received, sender, port);
      std::cout << "received" << std::endl;
    // }

    sf::sleep(sf::milliseconds(2000));
  }
}

void    client()
{
  sf::UdpSocket _socket;

  if (_socket.bind(52025) != sf::Socket::Done)
  {
    std::cout << "can't bind" << std::endl;
    return ;
  }

  _socket.send("ping", 5, sf::IpAddress::Broadcast, 25052);
}

Pages: [1]