Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 13 Jul 2011
Offline Last Active Jul 17 2015 12:35 AM

Topics I've Started

Game login - password sending security

15 July 2015 - 10:43 AM


For a while i started with network programming. So far i created networking part for my game and a simple game server. To play the game, players have to log in with their username and password. So far, the login procedure is simple, player sends their user name and password as simple strings. Passwords on the server are also stored as simple text files. When player attempts to log in, server reads the password from file and compares it with the received password.

At this point we really can't talk about security, so here is what i wanted to ask. I have read that passwords are usually stored in a salted hash form. The salt is also stored. When the server receives password from player it tries to hash it again and then compares it with stored hash.

Now to the question: How do i send the password over the LAN / internet? Sending plain text isn't secure. What are the usual methods to send passwords? What are the usual methods to log in to games that require user name, password?

Combination n choose 2 - multithreading

23 June 2015 - 03:12 AM

Hello all,

Let's say i have an array of objects and i want to test each object in this array with every other object in this array. The single threaded solution would be a for for test:

for (UINT i=0; i < v_obj.size() - 1; i++)    // -1 - no need to test the last one
    for (UINT j = i + 1; j < v_obj.size(); j++)
        doSomething(v_obj[i], v_obj[j]);

I want to ask how the multithreaded solution would look like?

I was thinking about leaving the first for loop and dividing the second based on number of threads. Each thread would do the test with part of the remaining array.

Is there a standard way to do tests like this?

How would your solution to this look like?

Texture render target size

10 February 2015 - 01:55 AM

After few completed projects with DirectX 9 i started to learn DirectX 11. Now i'm trying to implement blured shadow maps but i have problems render the scene to textures. When i render the first scene depths to shadow map texture, the image is a bit distored. Then i use orthogonal projection to render this texture to a temporary quad with x blur shader then back to shadow map texture with y blur shader but the final result is completly distored.

In RasterTek tutorial i somewhere readed that render target textures need to have the same aspect ratio like screen.

So i tried to create render target textures every time the window is resized with half the window width and height but not even this worked so i created these textures with original window width and height and only that worked so far.

So now i have a question. Is it somehow possible to create render target textures with custom size?

Unsigned int in vertex shader

14 September 2014 - 10:49 AM

I'm trying to pass unsigned int number to vertex shader, but the shader acts like it gets only the first byte of that number.


Vertex structure:

    D3DXVECTOR3 pos;
    D3DXVECTOR3 norm;
    D3DXVECTOR2 tex;
    UINT texID;

Vertex declaration




HLSL code:

unsigned int vTexHeight : TEXCOORD1
out float oTH[8] : TEXCOORD3

unsigned int retnum=vTexHeight % 0x10;
retnum=retnum % 0x10;

retnum=retnum % 0x10;

retnum=retnum % 0x10;


Problem: Only oTH[0] and oTH[1] works, all other ale allways 0. It looks like vertex shader gets only the first byte of vTexHeight.
Everything above 0xff is ignored.
How can i pass unsigned int to vertex shader? Why is current vertex shader ignoring anything above the first byte?

XAudio2 Exception 80000003

31 January 2014 - 01:55 AM

First, idon't know where i should post this, so i post it here.

I'm using XAudio2 in my game for sound. Playing unmodified sound works well but when i use SetOutputMatrix program crashes with Exception 80000003.

void AUDIO_STATE::UpdateAudio(simpleSound *in_ss)
	X3DAudioCalculate( x3DInstance, &listener, &in_ss->emitter, dwCalcFlags, &dspSettings );

	if (in_ss->p_SV)
		in_ss->p_SV->SetFrequencyRatio( dspSettings.DopplerFactor );
		in_ss->p_SV->SetOutputMatrix( pMasteringVoice, INPUTCHANNELS, nChannels, matrixCoefficients );
		in_ss->p_SV->SetOutputMatrix( pSubmixVoice, 1, 1, &dspSettings.ReverbLevel );

		XAUDIO2_FILTER_PARAMETERS FilterParametersDirect = { LowPassFilter, 2.0f * sinf(X3DAUDIO_PI/6.0f * dspSettings.LPFDirectCoefficient), 1.0f };
		in_ss->p_SV->SetOutputFilterParameters(pMasteringVoice, &FilterParametersDirect);
		XAUDIO2_FILTER_PARAMETERS FilterParametersReverb = { LowPassFilter, 2.0f * sinf(X3DAUDIO_PI/6.0f * dspSettings.LPFReverbCoefficient), 1.0f };
		in_ss->p_SV->SetOutputFilterParameters(pSubmixVoice, &FilterParametersReverb);

When i remove lines in_ss->p_SV->SetOutputMatrix, there are no problems, the sound plays.

Did someone ever had similar problem? Do you know what could cause this?


Also most of initialization of my sound engine is a modification to DX sdk XAudio2Sound3D.