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.


Topics - lohr

Pages: [1]
1
Network / Multithread Server
« on: July 01, 2008, 11:28:48 am »
Hi,

I wanted to ask if there is any Code Example for a MultiThread Server?
I know SFML has the Selector Function but it is more comfortable with a MultiThread Server...

Best regards,
lohr

2
Network / Packet Send and Receive
« on: June 30, 2008, 11:38:57 am »
Hello,

I want to send and receive a packet with the following structure:

Code: [Select]
struct Position
{
    int     x;
    int y;
int rot;
};


now thats my server Init:

Code: [Select]
sf::SocketTCP Server;

    if (!Server.Listen(1000))
        return EXIT_FAILURE;

    sf::IPAddress ClientAddress;
    sf::SocketTCP Client;
    Server.Accept(Client, &ClientAddress);

sf::Packet RegularPacket;
Position P;


and thats my client Init:

Code: [Select]
sf::IPAddress ServerAddress = sf::IPAddress::GetLocalAddress();

    sf::SocketTCP Client;

    if (!Client.Connect(1000, ServerAddress))
        return EXIT_FAILURE;

sf::Packet RegularPacket;
Position P;



Here is the Receive Part of the Server:

Code: [Select]
if (Client.Receive(RegularPacket) != sf::Socket::Done)
return EXIT_FAILURE;
if (RegularPacket >> P)
{
s_auto.SetPosition(P.x,P.y);
s_auto.SetRotation(P.rot);
}


Here is the Send Part of the Client:

Code: [Select]
P.x = pos.x;
P.y = pos.x;
P.rot = rot;

if (RegularPacket << P)
{
if (Client.Send(RegularPacket) != sf::Socket::Done)
return EXIT_FAILURE;
}

if (Client.Send(RegularPacket) != sf::Socket::Done)
return EXIT_FAILURE;


Its a litte Car Racing game where i am trying to send the position of the client car to the server, but it isnt working...
The Connection is established betweeen them.

Do you find anything wrong?

Best regards,
lohr

3
General / [Solved] Executable isnt running on other systems
« on: June 26, 2008, 09:54:25 am »
Hello,

I am using VS Prof 2005 and i have built a little game.
Now I compiled and linked it, and it runs nice on my developer machine.

But if I show it to a friend on a different PC there comes an error msg "...Application could not be started, because the applicationconfiguration failed...".

How could i fix this?
I read very much at google but nothing really helped (which dll, i need on the target machine or static linking?)

Thank you very much!

4
Graphics / Intersection
« on: June 25, 2008, 11:32:30 am »
Hello,

I am want to program a little racer game, so i have to check for the border of my race circuit.
Now I was wondering about, that the Sprite class has no function "intersects" but rectangle has it?

How could I solve my problem best, because my car sure has to move :) Could i use a Rect instead of Sprite or are there other possibilities?

Best regards,
Alex "lohr"

5
Graphics / [Solved] Problems with Sprite and Shapes
« on: June 24, 2008, 08:59:48 am »
Hello,

I have 2 different problems...I am actually working me through the different tutorials and now i have my first problems.
I am using the Microsoft VC 2005 Full.

If I do this(same with sprites and images):
Code: [Select]
if (!BackgroundImage.LoadFromFile("background.jpg"))
        return EXIT_FAILURE;

i get following error:
Quote
Unbehandelte Ausnahme bei 0x7c43eba2 in SFML.exe: 0xC0000005: Zugriffsverletzung beim Lesen an Position 0x00133000.

the picture is at the right place...

If i want to run the shape tutorial, i am getting this:
Quote
Unbehandelte Ausnahme bei 0x104817fd (msvcp80d.dll) in SFML.exe: 0xC0000005: Zugriffsverletzung beim Schreiben an Position 0xcccccccc.

and he is jumping to debuging in "xutility"...

Any tips here?
Thank you very much!

Regards,
Alex "lohr"

Pages: [1]