Ok so my program is going to connect to a SQL database;
for it to do that it needs to know the username,password and adress.
How easy would it be for someone to steal that info from my program?
How can I stop that
you're going to store the username and password inside the executable?
uh
[editline]20th January 2012[/editline]
it would be laughably easy to obtain that information
[QUOTE=marcin1337;34306222]Ok so my program is going to connect to a SQL database;
for it to do that it needs to know the username,password and adress( inside the program ).
How easy would it be for someone to steal that info from my program?
How can I stop that[/QUOTE]
Uh oh, this is Super Meat Boy all over again!
[QUOTE=BlkDucky;34306245]you're going to store the username and password inside the executable?
uh
[editline]20th January 2012[/editline]
it would be laughably easy to obtain that information[/QUOTE]
That's why I am asking
[QUOTE=marcin1337;34306222]
How easy would it be for someone to steal that info from my program?[/QUOTE]
Very easy.
[QUOTE=marcin1337;34306222]
How can I stop that[/QUOTE]
Use a server between the application and the database.
[QUOTE=dajoh;34306382]Very easy.
Use a server between the application and the database.[/QUOTE]
so it would be like this.
my program sends a request for data to a secure server( that holds SQLDatabase login ) , that secure server connects to database and gets info and sends back
[QUOTE=marcin1337;34306440]so it would be like this.
my program sends a request for data to a secure server( that holds SQLDatabase login ) , that secure server connects to database and gets info and sends back[/QUOTE]
Exactly. Just don't send any important or private data as plaintext over the internet and make sure the server doesn't trust the client part of the application.
[QUOTE=Tamschi;34306474]Exactly. Just don't send any important or private data as plaintext over the internet and make sure the server doesn't trust the client part of the application.[/QUOTE]
you guys know any libs or programs to automate this?
You can use the WebRequest class with https:// urls to send secure requests to a server. (The Create method gives you a [URL="http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest(v=vs.100).aspx"]HttpWebRequest[/URL] in that case.)
It's roughly the same as sending forms from a browser. Most kinds of servers support this out of the box, but the backend needs to sanitize the request to prevent SQL injection.
If that's not flexible enough, you can use an [URL="http://msdn.microsoft.com/en-us/library/d50tfa1c.aspx"]SslStream[/URL].
It's more complicated as you'd have to create your own protocol, but that also means you can add things like server-client messages and better error correction more easily.
I'm currently working on a game engine. Would irrlicht be sufficient for high performance 3D? I know it says so on the site, but I'd rather have external sources on this, and it seems to be pretty easy and flexible to use.
I'll only be using the OpenGL part of the library, regardless of platform (if this helps any).
Would it be possible to reach a playable FPS with this library, when running visuals as "pretty" as Doom 3 on their Ultra setting, or should I rather make my own renderer?
[QUOTE=T3hGamerDK;34306719]I'm currently working on a game engine. Would irrlicht be sufficient for high performance 3D? I know it says so on the site, but I'd rather have external sources on this, and it seems to be pretty easy and flexible to use.
I'll only be using the OpenGL part of the library, regardless of platform (if this helps any).
Would it be possible to reach a playable FPS with this library, when running visuals as "pretty" as Doom 3 on their Ultra setting, or should I rather make my own renderer?[/QUOTE]
I'm working on a game engine myself and I went for making as much as possible from scratch. ( I did go with using GLM as the math library though. )
If you ask me, you make a game engine solo to learn how a game engine works behind the scenes. I don't ever expect mine to compete with the real game engines such as Unity or Unreal Engine etc...
I need to generate a random series of points that are a minimum distance away from each other. What's the best way to do this?
How would i smoothly move a Vector2 to another Vector2 in XNA?
[QUOTE=Funley;34308697]How would i smoothly move a Vector2 to another Vector2 in XNA?[/QUOTE]
[code]public static Vector2 Lerp(Vector2 a, Vector2 b, float mu) { return (b-a) * mu + a; }[/code]
"a" would be the start vector, "b" would be the end vector, "mu" would be a value between 0 and 1.
[QUOTE=thomasfn;34308911][code]public static Vector2 Lerp(Vector2 a, Vector2 b, float mu) { return (b-a) * mu + a; }[/code]
"a" would be the start vector, "b" would be the end vector, "mu" would be a value between 0 and 1.[/QUOTE] How does the "mu" affect the movement? Speed?
[QUOTE=Nigey Nige;34308231]I need to generate a random series of points that are a minimum distance away from each other. What's the best way to do this?[/QUOTE]
Look up "poisson disc generation"
First result links to a simple one-page [url=http://people.cs.ubc.ca/~rbridson/docs/bridson-siggraph07-poissondisk.pdf]paper[/url] with a fairly straightfoward algorithm.
[QUOTE=Funley;34309121]How does the "mu" affect the movement? Speed?[/QUOTE]
It's the relative position between the points. 0 is at a, 1 is at b, 0.5 is half way in between, and so on.
[QUOTE=Ziks;34309677]It's the relative position between the points. 0 is at a, 1 is at b, 0.5 is half way in between, and so on.[/QUOTE] So i would have to change it when i move? How?
[QUOTE=Funley;34311964]So i would have to change it when i move? How?[/QUOTE]
This should be pretty obvious, I think.
Mu controls the position between point a and point b. You want to move from a to b over some period of time. So mu is going to be some function of time. Setting mu=t-t[sub]0[/sub] (in seconds, where t[sub]0[/sub] is the initial time) means that mu will go from 0 to 1 in only 1 second. Now how do you make that time longer or shorter? Simple. You multiply or divide by some constant. So if you want to move from a to b over a period of five seconds, then you would set mu=(t-t[sub]0[/sub])/5
In .NET, how can I get InnerHtml based on class names?
I'm interested in getting the HTML from the tip-container class, as shown below:
[html]<div class="tip-container">
<article class="tip tip-color-15 splash" id="tip_1423">
<h1 unselectable="on">brotip #1415</h1>
<p unselectable="on">ladies, guys are sick of <br> hearing you ask where <br> all of the "nice guys" are. <br> they're in the friend zone, <br> where you left them.</p>
<footer unselectable="on" class="tip-footer"></footer>
<footer unselectable="on" class="tip-copyright">brotips.com</footer>
</article>
</div>[/html]
GetElementById doesn't work for classes (obviously). I can't predict the [I]tip_x[/I] ID (since for some reason it doesn't follow the tip number as shown on the page), so I can't use that to GetElementById
Well in javascript you can do getElementByClass, so if c# dom is similar that might just work
[QUOTE=ROBO_DONUT;34309357]Look up "poisson disc generation"
First result links to a simple one-page [url=http://people.cs.ubc.ca/~rbridson/docs/bridson-siggraph07-poissondisk.pdf]paper[/url] with a fairly straightfoward algorithm.[/QUOTE]
Thanks!
[quote][img]http://27.media.tumblr.com/tumblr_ly4dc3kun41r5x1ako1_500.jpg[/img][/quote]
[QUOTE=Within;34313645]In .NET, how can I get InnerHtml based on class names?
I'm interested in getting the HTML from the tip-container class, as shown below:
[html]<div class="tip-container">
<article class="tip tip-color-15 splash" id="tip_1423">
<h1 unselectable="on">brotip #1415</h1>
<p unselectable="on">ladies, guys are sick of <br> hearing you ask where <br> all of the "nice guys" are. <br> they're in the friend zone, <br> where you left them.</p>
<footer unselectable="on" class="tip-footer"></footer>
<footer unselectable="on" class="tip-copyright">brotips.com</footer>
</article>
</div>[/html]
GetElementById doesn't work for classes (obviously). I can't predict the [I]tip_x[/I] ID (since for some reason it doesn't follow the tip number as shown on the page), so I can't use that to GetElementById[/QUOTE]
what are you doing
[IMG]http://img809.imageshack.us/img809/7603/20120120211535.png[/IMG]
[img]http://img803.imageshack.us/img803/8751/20120120213514.png[/img]
I have a little VB2010 game i'm making
(please don't say anything about it, I need to take this class in order to go to java next year)
1.Is there anything I can do with the transparency settings, if I set the pictureboxes to be transparent the border of the image is still blocking the back.
2. What would i use in order to make the keys flash at random and require a keypress to shut them off?
3. is there a possible way to make the screen sidescroll with the character without scroll bars
I have double buffer for the form on all it did was make it smoother
Sorry to bother you all but I would like to find a good Java LWJGL tutorial series?
I've been trying to google for one for some time. I can just find some really basic ones that don't go indepth on all the Open gl stuff.
[QUOTE=thomasfn;34308911][code]public static Vector2 Lerp(Vector2 a, Vector2 b, float mu) { return (b-a) * mu + a; }[/code]
"a" would be the start vector, "b" would be the end vector, "mu" would be a value between 0 and 1.[/QUOTE]
You don't need to program this, C# provides it as MathHelper.Lerp().
I'm trying to hook the KeyboardProc of an app, but I can't seem to do it. The program just freezes when it receives keyboard input.
I haven't really dealt with DLLs or hooking before so I barely understand what I'm doing
Here's how I install the hook (I removed the checks that ensure that the handles etc. are all OK - they are):
[cpp]char *dllName = "full path to .dll";
char *procName = "_KeyboardP@12";
char *targetName = "Untitled - Notepad";
HWND targetWindow = 0;
DWORD targetThreadId = 0;
HOOKPROC hHookP = 0;
HINSTANCE hDll = 0;
HHOOK hHook = 0;
hDll = LoadLibrary(dllName);
hHookP = (HOOKPROC)GetProcAddress(hDll, procName);
targetWindow = FindWindow(0, targetName);
targetThreadId = GetWindowThreadProcessId(targetWindow, 0);
hHook = SetWindowsHookEx(WH_KEYBOARD, hHookP, hDll, targetThreadId);[/cpp]
Here's the hook in a .DLL:
[cpp]__declspec(dllexport) LRESULT WINAPI KeyboardP(int nCode, WPARAM wParam, LPARAM lParam)
{
return CallNextHookEx(0, nCode, wParam, lParam);
}[/cpp]
edit: read through some of the documentation, found my problem.
[QUOTE=Within;34313645]In .NET, how can I get InnerHtml based on class names?
I'm interested in getting the HTML from the tip-container class, as shown below:
[html]<div class="tip-container">
<article class="tip tip-color-15 splash" id="tip_1423">
<h1 unselectable="on">brotip #1415</h1>
<p unselectable="on">ladies, guys are sick of <br> hearing you ask where <br> all of the "nice guys" are. <br> they're in the friend zone, <br> where you left them.</p>
<footer unselectable="on" class="tip-footer"></footer>
<footer unselectable="on" class="tip-copyright">brotips.com</footer>
</article>
</div>[/html]
GetElementById doesn't work for classes (obviously). I can't predict the [I]tip_x[/I] ID (since for some reason it doesn't follow the tip number as shown on the page), so I can't use that to GetElementById[/QUOTE]
What I did was, instead of using the default shit that .NET has, use this instead:
[url]http://htmlagilitypack.codeplex.com/[/url]
It's a DLL so you'll have to add a reference to it in your project in VS. I found it very easy to use and I used it for some web scraping of my own. :smile:
I'm trying to load and draw two textured models in XNA, but it shoots back the error "Object refrence not set to an instance of an object" on this line of code; "meshPart.Effect = effect.Clone();"
[csharp]
private Model loadModel(string assetName, out Texture2D[] textures)
{
Model newModel = Content.Load<Model>(assetName);
textures = new Texture2D[newModel.Meshes.Count];
int i = 0;
foreach (ModelMesh mesh in newModel.Meshes)
foreach (BasicEffect currentEffect in mesh.Effects)
textures[i++] = currentEffect.Texture;
foreach (ModelMesh mesh in newModel.Meshes)
foreach (ModelMeshPart meshPart in mesh.MeshParts)
meshPart.Effect = effect.Clone();
return newModel;
}
//draws the starbox
private void drawSkyBox()
{
SamplerState ss = new SamplerState();
ss.AddressU = TextureAddressMode.Clamp;
ss.AddressV = TextureAddressMode.Clamp;
device.SamplerStates[0] = ss;
DepthStencilState dss = new DepthStencilState();
dss.DepthBufferEnable = false;
device.DepthStencilState = dss;
Matrix[] starboxTransforms = new Matrix[starboxModel.Bones.Count];
starboxModel.CopyAbsoluteBoneTransformsTo(starboxTransforms);
int i = 0;
foreach (ModelMesh mesh in starboxModel.Meshes)
{
foreach (Effect currentEffect in mesh.Effects)
{
Matrix worldMatrix = starboxTransforms[mesh.ParentBone.Index];
currentEffect.CurrentTechnique = currentEffect.Techniques["Textured"];
currentEffect.Parameters["xWorld"].SetValue(worldMatrix);
currentEffect.Parameters["xView"].SetValue(viewMatrix);
currentEffect.Parameters["xProjection"].SetValue(projectionMatrix);
currentEffect.Parameters["xTexture"].SetValue(starBoxTextures[i++]);
}
mesh.Draw();
}
dss = new DepthStencilState();
dss.DepthBufferEnable = true;
device.DepthStencilState = dss;
}
private void drawWeapon()
{
SamplerState ss = new SamplerState();
ss.AddressU = TextureAddressMode.Clamp;
ss.AddressV = TextureAddressMode.Clamp;
device.SamplerStates[0] = ss;
DepthStencilState dss = new DepthStencilState();
dss.DepthBufferEnable = true;
device.DepthStencilState = dss;
//Matrix worldMatrix = weaponPositionMatrix;
Matrix[] weaponTransforms = new Matrix[shipModel.Bones.Count];
shipModel.CopyAbsoluteBoneTransformsTo(weaponTransforms);
int i = 0;
foreach (ModelMesh mesh in shipModel.Meshes)
{
//sets the effects for all meshes in the model
foreach (Effect currentEffect in mesh.Effects)
{
worldMatrix = weaponTransforms[mesh.ParentBone.Index];
currentEffect.CurrentTechnique = currentEffect.Techniques["Textured"];
currentEffect.Parameters["xWorld"].SetValue(weaponTransforms[mesh.ParentBone.Index] * worldMatrix);
currentEffect.Parameters["xView"].SetValue(viewMatrix);
currentEffect.Parameters["xProjection"].SetValue(projectionMatrix);
currentEffect.Parameters["xEnableLighting"].SetValue(true);
currentEffect.Parameters["xLightDirection"].SetValue(sunAngle);
currentEffect.Parameters["xTexture"].SetValue(grenadeLauncherTextures[i++]);
currentEffect.Parameters["xAmbient"].SetValue(0.5f);
}
mesh.Draw();
}
}
[/csharp]
It was working fine until I decided to do some late night editing, and I have no idea what went wrong. Can anyone help me?
Sorry, you need to Log In to post a reply to this thread.