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

Pages: [1] 2 3 ... 6
1
Network / Reading/Writing raw data
« on: September 23, 2010, 06:03:37 pm »
Quote from: "Laurent"
Quote
I am talking about why SFML takes char instead of unsigned char. o.0

What would it change? The type doesn't really matter anyway, it could be char*, unsigned char*, or void* as well.

Generally raw data comes with encryption and it is a good idea to be using unsigned.

But you are right, the type doesn't really matter you can just cast.

2
Network / Reading/Writing raw data
« on: September 06, 2010, 01:54:51 am »
Quote from: "Mindiell"
neither char nor unisgned char, you'll have to cast to an int in order to see the byte value. a char (unsigned or not) will be showed on the console as a character (using the ASCII table).

So "8" will be a backspace for example.

I had the same problem while doing my Telnet class :)

I am talking about why SFML takes char instead of unsigned char. o.0

3
Network / Reading/Writing raw data
« on: August 31, 2010, 09:32:05 am »
Why char? Why not unsigned char?

4
Network / Reading/Writing raw data
« on: August 13, 2010, 05:14:50 pm »
I see special characters instead of numbers.

edit:
Just realized I forgot to perform a cast when printing to the console. Not in a position right now to check it out but would you agree this solves the problem?

5
Network / Client server system help
« on: August 13, 2010, 04:39:36 pm »
A better way to manage movement in a "client-server" architecture is to think of the server as the host that simply relays information and authenticates whether the client can do something or not. The client should simply perform requests to the server.

When the client wishes to move left, it should simply tell the server that it wants to move left. The server will receive a message that says the client wishes to move left. The server should decide whether this is possible and if so, update its information about the client and also inform other players that the client wishes to move left.

This not only saves bandwidth, it is also more secure.

6
Network / Reading/Writing raw data
« on: August 13, 2010, 04:31:13 pm »
I need to read and write raw data. By raw data I mean reading/writing bytes as you would see them using a packet sniffer like http://wpepro.net/

To do this I understand that SFML reads/writes a character array/char*

However, when I try to receive a packet I do not think it is being read correctly because when I print it to the console I see gibberish.

This is what a piece of my code looks like:
Code: [Select]
if ( _authServer.Connect( _authIP, _authPort, 10.0f ) == sf::Socket::Done )
    {
        std::cout << "[SYSTEM] - CONNECTED TO AUTHENTICATION SERVER.\n";

        char loginPacket[8] = { 0 };
        std::size_t received;
        _authServer.Receive( loginPacket, sizeof( loginPacket ), received );

        _crypt.Decrypt( (unsigned char*)loginPacket, 8 );
       
        for ( int i = 0; i < sizeof( loginPacket ); i++ )
        {
            std::cout << std::hex << loginPacket[i] << "\t";
        }
        std::cout << std::endl;
    }

7
General / Decoupled Engine Architecture
« on: July 25, 2010, 12:02:34 pm »
I am trying to develop an engine with a very decoupled architecture. This way, in the future I can easily replace the graphics component, input component, audio component, etc. easily.

The problem is that SFML's graphics and input seem to be closely coupled together.

Any ideas?

8
Graphics / Sprites and loading images
« on: July 12, 2010, 02:21:43 am »
Why don't you just store the images in a stl map container?

9
Graphics / Unload Image
« on: July 12, 2010, 01:31:13 am »
Based on a flag, I wanted to preload an image or load it the first time it is used and unload it when it is not used (after the rendering step, the image was not drawn).

10
Graphics / Unload Image
« on: July 11, 2010, 03:36:19 am »
Why isn't there an Unload() method when there is a Load() method?

If it is cleared in the destructor, why not load the image in the constructor?

11
Graphics / Sprite's X and Y
« on: July 10, 2010, 09:56:15 am »
Quote from: "Mindiell"
Personaly, I would not recommend this. The upper-left corner can be as interesting as the real center. I think this is just a point of view.


I disagree. But yeah, it is just a matter of point of view.

12
Graphics / Views
« on: July 10, 2010, 09:53:46 am »
I am not quite sure what you mean.

You move the view with SetCenter( ... ) and Move( ... )

13
Graphics / Unload Image
« on: July 10, 2010, 03:13:51 am »
How do you unload an image from memory? Right now I am assuming the image is cleared from memory in the destructor of sf::Image.

Although I was wondering if there was a way to put your sf::Image object back to the state before the invocation of: sf::Image::Load()

14
Graphics / Batch Rendering
« on: July 06, 2010, 11:56:17 pm »
Will SFML 2.0 support batch rendering?

15
Network / Packet Endian Conversions
« on: June 23, 2010, 02:23:10 pm »
What about changing to string before sending, then back after receiving?

Pages: [1] 2 3 ... 6