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

Pages: [1]
1
Network / simple client
« on: March 31, 2012, 10:11:38 am »
Hello i want write a client/server to my game but i have problem with connection server show me client is connected but client don't do that : / what i do wrong?

Code: [Select]
#include "Client.h"


void Client::Init( std::string server )
{
    Server.SetBlocking( false );
    ServerAddress = server;
    do
    {
    }
    while (!ServerAddress.IsValid());

    if ( Server.Connect(Port, ServerAddress) == sf::Socket::Done ) { IsConnected = false; std::cout << "Blad przy laczeniu z serwerem " << ServerAddress << std::endl; }

    else if ( Server.Connect(Port, ServerAddress) == sf::Socket::Done ) { IsConnected = true; std::cout << "Polaczono z serwerem " << ServerAddress << std::endl; }

    else if ( Server.Connect(Port, ServerAddress) == sf::Socket::NotReady ) { std::cout << "Trwa laczenie z " << ServerAddress << std::endl; }

    else if ( Server.Connect(Port, ServerAddress) == sf::Socket::Disconnected ) { std::cout << "Utracono polaczenie z " << ServerAddress << std::endl; }

}

void Client::Recv()
{
    Server.Receive( Buffer, sizeof( Buffer ), Rec );
    std::cout << Buffer << std::endl;
}

Code: [Select]
#include <iostream>
#include "Client.h"

int main()
{
    Client GameClient;
    std::string serv;
    std::cout << "Podaj ip" << std::endl;
    std:: cin >> serv;
    GameClient.Init( serv );
    while( true )
    {
        if( GameClient.IsConnected == false )
        {
        }
        else if( GameClient.IsConnected == true )
        {
            GameClient.Recv();
        }
    }
}
sorry for my english :P

2
Window / sharing window on the frame
« on: March 25, 2012, 10:01:44 pm »
Hey, how i can share window on the frame?
i need it to share my window to Game frame, stats frame chat frame : P

3
General discussions / SFML 2.0
« on: January 31, 2012, 03:51:55 pm »
Hello i have a question about sfml elements : P
why in sfml 2.0 Sprite don't have GetPixel function and SetImage?

same with sf::texture don't have createmaskfromcolor but sf::image got?

and i think in sf::Keyboard can will be useful GetKeyCode funtion it make textbox easier to create :D

sorry for my english but my english isn't pretty good

Pages: [1]
anything