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

Pages: 1 ... 8 9 [10] 11
136
Network / Handling Multiple TCP Connections
« on: December 23, 2010, 12:58:28 am »
I'm not sure what you want to know... It's exactly the same as sending something to all clients except the sender. Skip over then in a client array.

137
Graphics / GluPerspective vs. GlOrtho
« on: December 23, 2010, 12:51:03 am »
Well, OpenGL is an odd creature. What version of OpenGL do you want to use? OpenGL's version is set by the features of it you use, so it's odd. A lot of the core stuff is the same.

138
Graphics / GluPerspective vs. GlOrtho
« on: December 23, 2010, 12:48:08 am »
glOrtho is usually a bad choice - all objects appear the same size no matter how far away they are. It's all in the guide.

139
Graphics / GluPerspective vs. GlOrtho
« on: December 23, 2010, 12:40:43 am »
Please please please read The Red Book, it's at the link I sent you. This isn't an OpenGL forum. It has all you need to know in it.

http://www.opengl.org/documentation/red_book/ if you forgot.

140
General / SFML 1.6 Setup With code::blocks (problem)
« on: December 20, 2010, 10:47:57 am »
Have you set your compiler search directories?

141
Window / sf::Input.GetMouseX() and Y()
« on: December 20, 2010, 10:33:44 am »
I'll just use sf::Sleep(0.005). It gives the CPU(s) some idle time, and basically fixes my problem.

142
Graphics / Creating an OpenGL Cube Class
« on: December 20, 2010, 09:20:02 am »
You need to look more at how OpenGL works. Have a read of this:
http://www.opengl.org/documentation/red_book/

143
Network / Handling Multiple TCP Connections
« on: December 19, 2010, 11:46:17 pm »
Or, you could store an array of the IPs instead of the sockets. Then you can access the IP of the sender, and compare it to the array.

144
Network / Handling Multiple TCP Connections
« on: December 19, 2010, 11:43:43 pm »
Instead of skipping the IP, skip the socket. It's a lot easier.
e.g. from the SFML site:
Code: [Select]

    if (Socket == Listener)
    {
        // If the listening socket is ready, it means that we can accept a new connection
        sf::IPAddress Address;
        sf::SocketTCP Client;
        Listener.Accept(Client, &Address);
        std::cout << "Client connected ! (" << Address << ")" << std::endl;

        // Add it to the selector
        Selector.Add(Client);
    }


Here, they test the actual listener socket. You'll probably need pointers and stuff, but it's the same idea. Some of it you'll have to work out yourself. :wink:

145
Network / Handling Multiple TCP Connections
« on: December 19, 2010, 11:36:36 pm »
I don't see the need to access the sender's IP address when you recieve a message from them. You can sort of access their IP when they first connect:
Code: [Select]
       sf::IPAddress Address;
        sf::SocketTCP Client;
        Listener.Accept(Client, &Address);
        std::cout << "Client connected ! (" << Address << ")" << std::endl


For a dynamic array of Sockets (if you don't have a maximum allowable number of clients), look at using a vector:
Code: [Select]

#include vector
//other includes here

std::vector<sf::SocketTCP> Clients;


If you have a maximum number of clients:
Code: [Select]

sf::SocketTCP Clients[10];

Note that this example has a max of 10 clients - but you'll need to have checks in place. This only limits the size of the data structure.

146
Network / Handling Multiple TCP Connections
« on: December 19, 2010, 11:12:45 pm »
Right.
1. When a client connects, add their socket to a client array.
2. When a message comes in, loop through the client array sending the message to everyone except the person who sent it (test the socket of the client who sent the message against the array of clients to find out who to skip)

147
Network / Handling Multiple TCP Connections
« on: December 19, 2010, 11:02:58 pm »
So you effectively want to broadcast the message to everyone but the sender (and of course the listener)?

148
Network / Handling Multiple TCP Connections
« on: December 19, 2010, 10:16:13 pm »
Using the Socket Selector. It's a very useful tool for multiple connections.
http://www.sfml-dev.org/tutorials/1.6/network-selector.php

With the firewall, that's not problem with SFML. It's the firewall. The port you are using needs to be forwarded/allowed in the firewall settings.

149
Window / sf::Input.GetMouseX() and Y()
« on: December 19, 2010, 10:14:21 pm »
That is true, but using sf::Window::SetFrameLimit(60) doesn't fix my problem :(

150
Window / sf::Input.GetMouseX() and Y()
« on: December 19, 2010, 07:44:12 am »
Well, if someone has an older computer, I don't want them to have the 5ms pause because it will introduce more lag for the computer, i.e. I want the game to be able to run as fast as possible on any computer, without any built-in pauses.

Pages: 1 ... 8 9 [10] 11
anything