Jump to content
  • Advertisement

Wavarian

Member
  • Content count

    1106
  • Joined

  • Last visited

Community Reputation

850 Good

About Wavarian

  • Rank
    Contributor
  1. Sadly, my host won't enable error logging for my "economy" plan. If I had the time, I'd set up a local LAMP stack and test it myself.   At one point, I did have the "charset=utf-8" token specified, but ended up stripping everything away until I found the cause of the problem. I was actually trying to upload binary files (application/octet-stream) when I first encountered the bug.   In terms of response codes and the like, I receive absolutely nothing back from the server. I send my request, a few seconds go by, and then I get disconnected without any response, after which all other valid requests (from say, a web browser) are disregarded - "The connection was reset".   During this time, I can still FTP into the host, and if I use a VPN to change my IP address, I can once again send valid requests to the server and get a response.   After around 30 minutes, the server responds to requests again like nothing happened... Until I try sending another 5-byte file.
  2. This issue only occurs when you try to upload a 5-byte file though; it works for all other file sizes (up to max filesize).
  3. Lately I've been tinkering around with uploading files to a PHP server via winsock, and today encountered an issue where I'd receive no response from the server, and for the next 30 minutes or so, all attempts to access the server via a browser would produce the dreaded "The connection was reset" error. Investigating further, I was actually able to connect to the server, but immediately upon sending a request, the server would close the connection.   The cause? You tell me. Server was running PHP 5.2. Mind you, "1", "12", "123", and "1234" all work as well.   This works: REQUEST> POST /bug/index.php HTTP/1.1 Host: sample.com Connection: close Content-Type: multipart/form-data; boundary=HTTPClientBoundary Content-Length: 144 --HTTPClientBoundary Content-Disposition: form-data; name="moo"; filename="cow.txt" Content-Type: text/plain 123456 --HTTPClientBoundary-- RESPONSE> SAVED: cow.txt This doesn't: REQUEST> POST /bug/index.php HTTP/1.1 Host: sample.com Connection: close Content-Type: multipart/form-data; boundary=HTTPClientBoundary Content-Length: 143 --HTTPClientBoundary Content-Disposition: form-data; name="moo"; filename="cow.txt" Content-Type: text/plain 12345 --HTTPClientBoundary-- RESPONSE> <disconnect> index.php <?php if(!empty($_FILES)) { $upload_dir = pathinfo($_SERVER['SCRIPT_FILENAME'], PATHINFO_DIRNAME) . '/'; foreach($_FILES as $entry) { if(is_uploaded_file($entry['tmp_name']) && ($entry['error'] === UPLOAD_ERR_OK)) { if(move_uploaded_file($entry['tmp_name'], $upload_dir . $entry['name'])) { echo 'SAVED: ' . $entry['name']; } else { unlink($entry['tmp_name']); } } } }
  4. Blame the consumers. No one will touch your $0.99 game, but making it freemium and charging $100 to unlock each level somehow makes it more alluring.   Definitely reminds me of the 80's video game industry crash though.
  5. Wavarian

    Breaking out of a nested loop

    Locally-defined strutures to the rescue!11 void MyFunction() { struct S { static bool DoStuff(int& i, int& j) { for(i = 0; i < 10; ++i) { for(j = 0; j < 10; ++j) { if((i - 1) == (j + 1)) return true; } } return false; } }; // ... S::DoStuff(i, j); } But seriously, just use goto.
  6. Wavarian

    hi all developers

    Such a game would encounter many legal issues varying from country to country. Coupled with the high risk of corruption either through exploits or staff "rigging the system", to account hacks and scams, it kinda goes against a game developer's mantra of wanting to make fun games.
  7. Wavarian

    Upgrade Complete!

      QFT. The 2500K turned out to be a great investment for sure. Isn't it 4-5 years old now?
  8.   What if you upset someone who works for Microsoft or knows of someone who does? Police already illegally access metadata in order to check up on their daughter's boyfriends, new neighbours, etc.   In any case, Microsoft collects and sells this metadata to government agencies.   You know one of the first things the Nazis did was raid local council buildings for citizenship records in order to determine who was and was not Jewish. Call me paranoid and tell me to take off my tinfoil hat, but I can't believe that we've managed to completely overlook past events to the point where it's suddenly okay to collect, store, and sell someone's entire online profile.
  9. In my opinion, the best operating system should be one that you don't even realise is there. "Features" being added which get in the way of what you need to do is a step in the wrong direction.   "If you don't like it, stick with what you're already using"   While this might be a good idea in the short term, eventually people are going to have to migrate to the newer version no matter what.   "Who cares if Microsoft spies on you. You have a smartphone, a Google account, and a Facebook account, what's the difference?"   There's a massive difference between your operating system spying on you and Google spying on you. At least if you're going to go watch midget porn you know to use a VPN to evade Google's prying eyes, but how do you hide your fetish from Windows? And when was the last time you watched porn on your phone?   "Cortana and the XBox apps aren't bloatware - they're features!"   Cortana maybe, but I still wouldn't find it useful. I fail to see what's so hard about opening a web browser and typing in your search query. Is there a reason why everyone wants to talk to their operating system at 2 in the morning while everyone else is trying to sleep? And what if I don't own an XBox?   "Apple does the same with their operating system, so you shouldn't have a problem with it"   There's a reason why we're PC users though. We typically know what we're doing. We build our own machines and customise everything including our operating system so that it behaves in a way that we can control.   As for the compulsory updates I can't wait for all the surprise features which Microsoft want to spring on its users. Skype anyone?   And what about my parent's PCs which I've locked down so tight that they can't mess anything up; will I get to look forward to them calling me to tell me that for some reason the start button has disappeared again, or that XYZ keeps crashing?   What about my sister's laptop which she only uses once every 3 months or so. One time I had to wait 2 hours for it to install an update before I was allowed to use it, and she told me that it happens to her all the time and that she'd just find other things to do while waiting. That was running Windows 8 which thankfully I was able to disable updates for - sister has been super happy ever since.   Ho hum.
  10. If it's blowing out hot air then your heatsink is working (unless the fan isn't spinning fast enough to accomodate). When my laptop was overheating I was able to touch the copper without burning myself and even at 90C+ the vents were blowing out cold air.   For a long while I changed the max output of my CPU to 70% in Window's power options to stop it from shutting down.   EDIT: I can see from the image you posted that the manufacturer decided to use a single heatpipe to cool both the CPU and GPU which was the same mistake HP made with its earlier consumer laptops. Has your laptop always had overheating issues or has it just degraded overtime?
  11. I think you'll find that your heatsink will need to be replaced. The copper pipes actually contain a gas to help the heat travel along them; over time this gas can leak, rendering your heatsink useless. You can tell if this is the case by opening up your laptop and touching the copper pipe while your laptop is on - if it's cold to the touch, you'll need to replace it. Feeling cold air coming out the vent while the laptop is overheating would also indicate this.   I wouldn't bother trying to use copper shims. I spent at least $30 trying to avoid replacing the heatsink in my laptop, when I should have spent that on a new heatsink to begin with.   You can easily order a replacement heatsink from China using a website such as aliexpress.
  12. Many thanks - I'll check out SharpDX
  13. I'm guessing that I'll need to reset the device whenever rendering fails like so: // // D3DForm.cs // // // Includes // using System.Drawing; using System.Windows.Forms; using Microsoft.DirectX; using Microsoft.DirectX.Direct3D; // // D3DForm class definition // class D3DForm : Form { // // Used to manage a D3D rendering device // private Device m_device = null; //========================================================================= // // DESCRIPTION // // Constructor // // PARAMETERS // // RETURNS // //========================================================================= public D3DForm() { // // Initialize the form // this.ClientSize = new Size(640, 480); } //========================================================================= // // DESCRIPTION // // Initializes the D3D rendering device // // PARAMETERS // // RETURNS // // Returns true if successful // //========================================================================= public bool InitializeGraphics() { try { PresentParameters present_params = new PresentParameters(); present_params.Windowed = true; present_params.SwapEffect = SwapEffect.Discard; if(m_device == null) { m_device = new Device ( 0, DeviceType.Hardware, this, CreateFlags.SoftwareVertexProcessing, present_params ); } else { m_device.Reset(present_params); } } catch(DirectXException) { return false; } return true; } //========================================================================= // // DESCRIPTION // // Renders the scene // // PARAMETERS // // RETURNS // //========================================================================= public void Render() { if(m_device != null) { try { m_device.Clear(ClearFlags.Target, Color.Blue, 1.0f, 0); m_device.BeginScene(); m_device.EndScene(); m_device.Present(); } catch(DirectXException) { InitializeGraphics(); } } } //========================================================================= // // DESCRIPTION // // Application entry point // // PARAMETERS // // RETURNS // //========================================================================= private static void Main() { using(D3DForm form = new D3DForm()) { if(form.InitializeGraphics()) { form.Show(); // // Application loop // while(form.Created) { form.Render(); Application.DoEvents(); } } } } } No idea if this is the proper solution though.
  14. Hey guys, figured I'd finally take a break from OpenGL to look at some Direct3D in C# and stumbled upon this tutorial:   http://msdn.microsoft.com/en-us/library/windows/desktop/bb153258%28v=vs.85%29.aspx   Works fine except for when you resize the window such that its client-height becomes 0; in which case the device suddenly becomes invalid and throws an InvalidCallException whenever you try to use it again.   This is the code I wrote while following the tutorial: // // D3DForm.cs // // // Includes // using System.Drawing; using System.Windows.Forms; using Microsoft.DirectX; using Microsoft.DirectX.Direct3D; // // D3DForm class definition // class D3DForm : Form { // // Used to manage a D3D rendering device // private Device m_device = null; //========================================================================= // // DESCRIPTION // // Constructor // // PARAMETERS // // RETURNS // //========================================================================= public D3DForm() { // // Initialize the form // this.ClientSize = new Size(640, 480); } //========================================================================= // // DESCRIPTION // // Initializes the D3D rendering device // // PARAMETERS // // RETURNS // // Returns true if successful // //========================================================================= public bool InitializeGraphics() { try { PresentParameters present_params = new PresentParameters(); present_params.Windowed = true; present_params.SwapEffect = SwapEffect.Discard; m_device = new Device ( 0, DeviceType.Hardware, this, CreateFlags.SoftwareVertexProcessing, present_params ); } catch(DirectXException) { return false; } return true; } //========================================================================= // // DESCRIPTION // // Renders the scene // // PARAMETERS // // RETURNS // //========================================================================= public void Render() { if(m_device != null) { m_device.Clear(ClearFlags.Target, Color.Blue, 1.0f, 0); // InvalidCallException thrown m_device.BeginScene(); m_device.EndScene(); m_device.Present(); } } //========================================================================= // // DESCRIPTION // // Application entry point // // PARAMETERS // // RETURNS // //========================================================================= private static void Main() { using(D3DForm form = new D3DForm()) { if(form.InitializeGraphics()) { form.Show(); // // Application loop // while(form.Created) { form.Render(); Application.DoEvents(); } } } } } How do I repair the device once this happens? How do I prevent it from becoming invalid - do I have to prevent the window's client-size from becoming zero?   Thanks!
  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!