diabloweb icon indicating copy to clipboard operation
diabloweb copied to clipboard

Help Modifying App.js To Statically Load diabdat.mpq From Public Folder

Open stshow opened this issue 4 years ago • 2 comments

App version: DiabloWeb 1.0.39 (Shareware)

Question

In reference to https://github.com/d07RiV/diabloweb/issues/47#issuecomment-518014517, I am having trouble understanding the modifications to App.js necessary to statically load my own copy of diabdat.mpq via the public folder on the server. @d07RiV appears to indicate that this line must be modified to be True:

https://github.com/d07RiV/diabloweb/blob/6440d69ad5d8b0f535bc4b9859e3447e11f71167/src/App.js#L230

The desired behavior is that my legitimate copy of diabdat.mpq be hosted on my private server, in the public folder, similar to the way that spawn.mpq is hosted here: https://d07riv.github.io/diabloweb/

The author seems to indicate that this is possible in https://github.com/d07RiV/diabloweb/issues/47#issuecomment-518014517. Can anyone suggest the proper modifications to App.js that would achieve this?

stshow avatar Jun 14 '20 17:06 stshow

Setting the PUBLIC_URL appropriately seems to give me the desired behavior without modification to the latest master branch of App.js. For example, if I am running the server on my local host, then I set PUBLIC_URL=http://localhost. This seems to appropriately redirect the hosted diabdat.mpq.

Once this environment variable is set, I choose to start the shareware version. This then loads the full version of the game, since a legitimate diabdat.mpq was present in the public folder at compile.

Additionally, I set the VERSION environment variable to retail--although upon further reading of App.js I am not confident this variable is doing anything at all (see process.env.VERSION in App.js).

Anyway, I would still appreciate a sanity check, if possible.


Update: After further testing, this only seems to work when playing the game on the same host that is hosting diabloweb--which defeats the purpose.

stshow avatar Jun 14 '20 23:06 stshow

@stshow have you found solution to host instead the diabdat.mpq of spawn ?

imneckro avatar Feb 22 '22 17:02 imneckro