Game Development Community

File Upload Code Assistance PLEASE

by Ronald J Nelson · in Torque Game Engine Advanced · 10/06/2008 (10:52 pm) · 4 replies

I have been at this for days now and I am just getting angry with repeated failures. For some reason I am getting packet errors every time the first packet is transferred. I am providing all of my code fils in hopes someone can tell me where I am going wrong.

www.savefile.com/files/1825356

Seriously, I really could use another set of eyes to tell me where I am messing up.

#1
10/06/2008 (11:00 pm)
BTW the main file is gameConnectionExtensions.cpp. The rest are all of the stock files I modified to set this up and it is TGEA 1.03. Not sure how much of a difference that will make.

Also they might have some of my modifications on them for other stuff I have done. Seriously, I am willing to pay for the help on this one if that is the only way I am going to get it. Just keep in mind, I am far from rich.
#2
10/07/2008 (3:49 am)
Not sure I can help with the problems you're getting but have you checked out the TCPObject Binary transfer resource which lets you send files over the net.

I've implemented it in TGE 1.5.2 and TGEA 1.7.1 and it works really well apart from one factor, it loads all of the file into memory and only once it's got the last block does it save to disk, which does crash the engine if you send huge files. When I get chance I intend to update the resource to write out to disk as it goes along (or to cache certain amounts in memory and write out every say 1mb).
#3
10/07/2008 (9:13 pm)
Well thanks Andy but my reason for this is to use a method similar to the file download that is already present, but to upload a file to the server. Distribution after that is rather easy in terms of downloading to other clients.

I have tried setting up alternate methods that used TCP and HTTP already and they were too unreliable based upon different servers to be used for my needs. With this method I can use Torque's already present packet gaurantee system to ensure the file is delivered. I just need to figure out what it is that I am doing wrong here. My code is very much like the download system already present with a few exceptions like I am not actually using file lists, just one file.

I suppose what might be possible is that I am only using a netEvent that is nearly identical to FileChunkEvent but not adding another like FileDownloadRequestEvent to control the transfer. My main concern with that was trying to reverse the flow and I was not totally certain if there are any additional checks beyond one that I found with Con::getBoolVariable("$NetConnection::neverUploadFiles")).
#4
10/08/2008 (10:29 pm)
Nothing huh? Well that is disappointing.