Zisu
December 14th, 2004, 08:11 AM
What I'm trying to accomplish is Redirected Downloads to an old UT based game Rune (I'm in a team creating a patch).
Unreal engine runs in one thread and hard locks if native C++ code takes too much time. This is why I need to create a new thread, for downloading files, unzipping and installing them.
For those who know some unrealscript, I plan to spawn a clientside class subclassing actor. This subclass will contain the native code that is implemented in dll (which in general is just a package of functions). When native function (which runs in the same thread as engine) is called, it will create a thread and return. I want the thread to stay running and complete its task. This, I think, is the easy part.
I don't think I can store the threadid anywhere (execution of the code, lets say X, that created this thread is finished) so it has to be standalone. Moreover, I want to inform the user about progress and when all is finished, I want to connect to the server. This can only be done by passing function pointers from X to the thread in the argument struct, since the thread cant directly connect to the engine. But can this passing of function pointers be done (and I dont want to include all the h files from X)? Anything that you find or otherwise comment in this is appreciated.
Unreal engine runs in one thread and hard locks if native C++ code takes too much time. This is why I need to create a new thread, for downloading files, unzipping and installing them.
For those who know some unrealscript, I plan to spawn a clientside class subclassing actor. This subclass will contain the native code that is implemented in dll (which in general is just a package of functions). When native function (which runs in the same thread as engine) is called, it will create a thread and return. I want the thread to stay running and complete its task. This, I think, is the easy part.
I don't think I can store the threadid anywhere (execution of the code, lets say X, that created this thread is finished) so it has to be standalone. Moreover, I want to inform the user about progress and when all is finished, I want to connect to the server. This can only be done by passing function pointers from X to the thread in the argument struct, since the thread cant directly connect to the engine. But can this passing of function pointers be done (and I dont want to include all the h files from X)? Anything that you find or otherwise comment in this is appreciated.