Advertisement Jump to content
  • Advertisement

avianRR

Member
  • Content Count

    344
  • Joined

  • Last visited

Community Reputation

100 Neutral

About avianRR

  • Rank
    Member
  1. avianRR

    username and password encryption

    thanks, Antheus. I will probably drop worrying about implemnting ssl for now. I'm charged with the programming end of the project someone else is doing the hardware. but the setup that is being planned is this. one system will be exposed to the net and take all requests. it will then access the database on a seperate internal network. the database server(s) will be dedicated. i.e. no other uses so everything except the port to access the database will be locked out. In fact that network will only carry database trafic, all database management will have to be done on a computer specifically set up for that purpous on that network. the system exposed to the net will have everything except the port used for the software blocked. hopefully that will prevent most attacks and keep things realativly secure. which is why the only real concern I should have on my part are... 1) not allowing information to be intercepted en route. 2) not allowing the software to allow access to the local system. I'm confident that (so far) I have (2) covered but the first one is my major concern.
  2. avianRR

    username and password encryption

    ok, sorry for the confusion. I posted that after spending about 8 hrs trying to figure out the openssl source so I could implement ssl in my program. your responses answered the first problem... that simply encrypting the username and password before sending them would not be a suffecient defense. my question was based not on the possability of a sysadmin at the isp with a packet sniffer but a hacker that cracked a home wireless network or was listening on a public wifi hotspot. So now I know I definatly need to implement SSL but still have a headace from trying to figure out openssl. anyone know of a simpler ssl that is "free", uses C++ can be compiled into the program (no dll's) and can be used in comercial software? (hopefully this project WILL go comercial, I need the money.)
  3. I'm trying to find a decent way to encrypt username and password information. I was considering using something like sha-256. but it occurs to me that anyone could intercept the packet with the username and password data and then using some means to intercpet and modify the packets being sent to the server simply insert the values from an intercepted packet into the outgoing packet to break the account. I'm also planning on using SSL for at least the authentification stages of connection so this may prevent the problem. I'm still pretty new to the whole encryption thing. So if anyone has any suggestions on how I should handle this please coment.
  4. I'm trying to get Font.MeasureString to work in C#. I've found some info that it might be the version of the dll that I'm referanceing so I changed the referance for Direct3DX from 2902 to 2911 and it recognized the function but there's no corrosponding version of Direct3D so I get an incompatable version error. anyone have any sucess with this?
  5. I'm looking for tutorials or ideas on how to do this. So far I haven't found anything good. I want to add footprints to the sand on my terrain, bullet holes to walls, etc... For the terrain I'm using the alpha channel of the texture to hold a value of how well the footprint would appear. Since the terrain is always solid. So it would not appear at all on rock and would be very clear on sand. Since the alpha fades as the textures fade together the footprints will fade as you move from one surface to another. My problem is I'm not sure how to actually render the footprints. Same goes for bullet holes, craters, etc... I'm developing the app in XNA but DX or even OGL tutorials that showed how to do this would be helpfull to.
  6. ok, stupid mistake.... in the code VertexPointSprite[] vps = { new VertexPointSprite(new Vector3(0, 0, 0), 20, new Color(1, 0, 0)), new VertexPointSprite(new Vector3(0, -2, 0), 5, new Color(1, 1, 1)) }; I entered color values based on floats (0 to 1) but the compiler took them as bytes (0 to 255) so the color was (1/256) I changed to code to... VertexPointSprite[] vps = { new VertexPointSprite(new Vector3(0, 0, 0), 20, new Color(1.0f, 0, 0)), new VertexPointSprite(new Vector3(0, -2, 0), 5, new Color(1.0f, 1.0f, 1.0f)) }; and now it works...
  7. I'm new to HLSL and I'm trying to get this shader to work. for some reason the color information is getting lost somewhere and everything turns black. This is my fx file float4x4 World; float4x4 View; float4x4 Projection; texture ColorMap; sampler2D ColorMapSampler = sampler_state{ Texture = <ColorMap>; magfilter = LINEAR; minfilter = LINEAR; mipfilter = LINEAR; addressU = mirror; addressV = mirror; }; struct VertexShaderInput { float4 Position : POSITION0; float Size : PSIZE0; float4 Color : COLOR0; }; struct VertexShaderOutput{ float4 Position : POSITION0; float Size : PSIZE0; float4 Color : COLOR0; }; VertexShaderOutput VertexShaderFunction(VertexShaderInput input){ VertexShaderOutput output; float4 worldPosition = mul(input.Position, World); float4 viewPosition = mul(worldPosition, View); output.Position = mul(viewPosition, Projection); output.Color = input.Color; output.Size = input.Size; return output; } struct PixelShaderInput{ float3 Position : POSITION0; #ifdef XBOX360 float4 TexCoords : SPRITETEXCOORD0; #else float2 TexCoords : TEXCOORD0; #endif float4 Color : COLOR0; }; float4 PixelShaderFunction(PixelShaderInput input) : COLOR0{ float2 texCoords; #ifdef XBOX360 texCoords = abs(input.TexCoords.zw); #else texCoords = input.TexCoords.xy; #endif float4 output; output = tex2D(ColorMapSampler,texCoords); output *= input.Color; return output; } technique PointSpriteFX{ pass Pass1{ PointSpriteEnable = true; VertexShader = compile vs_2_0 VertexShaderFunction(); PixelShader = compile ps_2_0 PixelShaderFunction(); } } and this is my drawing code psEffect.Parameters["World"].SetValue(Matrix.Identity); psEffect.Parameters["View"].SetValue(mCamera.mViewMatrix); psEffect.Parameters["Projection"].SetValue(mCamera.mProjectionMatrix); psEffect.Parameters["ColorMap"].SetValue(mTexture); psEffect.CurrentTechnique = psEffect.Techniques["PointSpriteFX"]; VertexPointSprite[] vps = { new VertexPointSprite(new Vector3(0, 0, 0), 20, new Color(1, 1, 1)), new VertexPointSprite(new Vector3(0, -2, 0), 5, new Color(1, 1, 1)) }; VertexDeclaration vd = new VertexDeclaration(GraphicsDevice, VertexPointSprite.VertexElements); psEffect.Begin(); foreach (EffectPass Pass in psEffect.CurrentTechnique.Passes) { Pass.Begin(); GraphicsDevice.VertexDeclaration = vd; GraphicsDevice.DrawUserPrimitives<VertexPointSprite>(PrimitiveType.PointList, vps, 0, 2); Pass.End(); } psEffect.End(); If I remove the line output *= input.Color; from the pixel shader then I get the texture drawn with it's actual colors but with it I get a black shape. Only the alpha seams to be unaffected. Any tips would be appreciated. p.s. how do you add a code window to a post? Edit... forgot this part public struct VertexPointSprite { public Vector3 Position; public float PointSize; public Color PointColor; public VertexPointSprite(Vector3 nPosition, float nSize, Color nColor) { Position = nPosition; PointSize = nSize; PointColor = nColor; } public static int SizeInBytes = 8 * sizeof(float); public static VertexElement[] VertexElements = { new VertexElement(0,0,VertexElementFormat.Vector3,VertexElementMethod.Default,VertexElementUsage.Position,0), new VertexElement(0,sizeof(float)*3,VertexElementFormat.Single,VertexElementMethod.Default,VertexElementUsage.PointSize,0), new VertexElement(0,sizeof(float)*4,VertexElementFormat.Color,VertexElementMethod.Default,VertexElementUsage.Color,0) }; };
  8. thanks rdragon. I was looking at the log file option but it's problematic at best. I already started working on a way to record/display errors in the game itself. Theres only 3 lines of code that are criticaly dependant and thats the line to create the graphics device manager, sprite batch and default font objects. The only one that should even have a chance at failing is the font object (unless something horable has happened) and the only reason I could see for that is if the spritfont file was missing. Those 3 lines are the very first in the program after that I use a little class object I whiped up. public class MyError { static public List<string> ErrorList = new List<string>(); static public void WriteError(string nError) { System.Diagnostics.Debug.WriteLine(nError); ErrorList.Add(nError); } static public void draw(SpriteBatch nSpriteBatch,SpriteFont nFont) { nSpriteBatch.Begin(); int y = 5; foreach (string s in ErrorList) { nSpriteBatch.DrawString(nFont, s, new Vector2(10, y), Color.White); y += nFont.LineSpacing; } nSpriteBatch.End(); } } then in my sprite, model and texture classes I added. public void LoadContent(ContentManager nContentManager, string nAssetName) { try { mSpriteTexture = nContentManager.Load<Texture2D>(nAssetName); } catch { MyError.WriteError("Sprite \"" + nAssetName + "\" could not be loaded."); return; } mSize.X = mSpriteTexture.Width; mSize.Y = mSpriteTexture.Height; } And finally in my draw function I have protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.Black); GraphicsDevice.RenderState.DepthBufferEnable = true; // if there were errors list them if (MyError.ErrorList.Count > 0) { MyError.draw(spriteBatch, DefaultFont); return; } // rest of draw code here... } and in update protected override void Update(GameTime gameTime) { KeyboardState kbs = Keyboard.GetState(PlayerIndex.One); // if there were errors list them if (MyError.ErrorList.Count > 0) { // Allows the game to exit if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed) Exit(); if (kbs.IsKeyDown(Keys.Escape) == true) Exit(); return; } // rest of update code here... } It's not perfect but it seams to be working so far. If anyone has any ideas on how it could be made better please let me know.
  9. In theroy yes but durring testing I'd like to be able to display a message in case something goes wrong. Theres also the possability of damaged/corrupted files. (bad sector on the hard drive or cd/dvd is damaged) Maybe it's just the 10 years of application development where you make sure possable errors are handled that's keeping me form just letting it go but it seams to me to be bad programming practice to not handle possable errors in a responsable manner.
  10. I am trying to find a way to display a usefull message to the user so they can try to figure out why the program is failing to load if for instance a texture isn't found durring the loadcontent function. normaly I'd use a MessageBox but I want to maintin xbox compatability in my code. for example.... try { mSpriteTexture = nContentManager.Load<Texture2D>(mAssetName); } catch { // display error message here i.e. "nAssetName not found." return false; } any ideas would be appreciated.
  11. avianRR

    XNA and CSG

    I'm new to DX/XNA and I'm trying to create some objects at runtime using CSG techniques. I can generate all the data I just haven't been able to find a decent tutorial on how to construct the mesh at run time. Any help would be appreciated.
  12. Ok, this is how I got it working. HWND hWnd = (HWND)this->Handle.ToInt32(); hDC = GetDC(hWnd); Maybe someday I'll get the hang of this .NET stuff...
  13. Actually what I need is a HDC. I need to pass the value to a function in a dll. It won't let me typecast the IntPtr to a HDC value.
  14. I need to get the HDC of a System::Windows::Forms::UserControl object. All I've found so far is a Handle that's a IntPtr and won't work for the dll function I need to call.
  15. avianRR

    fork or pthread_create?

    Thank you both. I did not realize that about fork. I also have not used it in aobut 4 years. Since my code is being written from the start for both linux and windows I will be useing pthread_create. P.S. I will undoutedly be back when I have mutex and semaphore issues! :(
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!