Make my C# MMO-interface application (using unmanaged DLL) thread-safe

This project was successfully completed by debabratamandal for £55 GBP in 3 days.

Get free quotes for a project like this
Project Budget
£20 - £250 GBP
Completed In
3 days
Total Bids
Project Description

This should be a quick fix for someone with experience of threading; and, given the nature of the app, it might make an interesting change from typical coding jobs. If you accept this project, I will provide you with temporary login credentials for the MMO world in question, which can be used to test the app.

I am attempting to create a C# application to host automated word games in an ancient social MMO called VZones ([url removed, login to view]): this is a virtual world using 2D graphics and a text frame. Many similar existing applications use a DLL called [url removed, login to view], whose code is unavailable, which encapsulates the DDE functionality that allows communication with the VZones host.

Using SharpDevelop 4.3.1, I have built a C# Windows application that imports the required functions from the DLL. Please see the code of [url removed, login to view] (attached): the code is 181 lines long at the moment, and much of that is comprised of comments, blank lines and window control event handlers. When the DDE connection is established, the C# app passes pointers to three callback processing functions. The key functions are:

DLL C# callback processor

--- ---------------------

DapiCommunicate -> ProcesAckData

DapiGetAllText -> ProcessGetAllText

The test app, as it stands, contains three buttons that make the user's avatar issue three types of utterance (Say, Think, ESP) via DapiCommuniate; another button that calls DapiCommunicate to get all text from the VZones text buffer; a text box to receive that text; and two checkboxes that turn on/off some timers, which issue regular, automatic calls to DapiCommunicate and DapiGetAllText.

Everything works fine for the first few tens of seconds that the application runs, while a single thread is running; but as soon as a second thread is spawned, it crashes with a NullReferenceException error. I have a long history of dabbling in various programming languages, but I have not had to deal with threading errors before, and my attempts at fixing this issue have failed.

I will provide you with a ZIP archive of the full source of my SharpDevelop C# project, temporary VZones login credentials and instructions on how to install the VZones client software. What I want you to do is:

1. Log in to VZones, run my app, check the autoSayChk and autoGetTextChk checkboxes, and observe the NullReferenceException error, which should occur within a matter of seconds.

2. Make my code thread-safe, so that, when the autoSayTmr and autoGetTextTmr timers run with an interval of 500 ms, the application will perform automated calls to DapiCommunicate and DapiGetAllText at that interval, and will run for 10 minutes without crashing.

3. Vet my C# newbie code and fix it according to good OO coding practice, where appropriate. I assigned "public" access modifiers to the functions willy-nilly, just to get the test code to run. Feel free to change the code of [url removed, login to view] as you see fit, as long as the visual layout of the form remains the same, and the functions operate as described above.

Full payment will be sent when I verify that the application does not crash when I test it according to the criteria in point 2 above.

Completed by:
Skills Required

Looking to make some money?

  • Set your budget and the timeframe
  • Outline your proposal
  • Get paid for your work

Hire Freelancers who also bid on this project

    • Forbes
    • The New York Times
    • Time
    • Wall Street Journal
    • Times Online