• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

System for transmitting data between a warcraft map and external program.

Status
Not open for further replies.
Level 6
Joined
Jul 30, 2013
Messages
282
Hey

So one day i was scanning the sharpcraft forums and thought .. hey that HTTP thing is really awesome..

But it took an entire 2 seconds to realize we would never be able to use it on an actual map :( .. because if a map wont even start without a custom version of warcraft 3 it would be completely unable to spread and the community would be doomed.

I therefore set out to develop a solution to this problem.. and.. well now i would like to present the very first proof of consept :)

What you can use this for:
  • Asking for the users compuiter to do something. such as say the local time.. or well cuple of things. they do need to be precoded in the external application tho.(users without it CAN still play the game but not use the features..)
  • generate a HTTP request to an external web service.
  • something i was too tired to think of ..

How it works:
  1. you run the external service application*
  2. you start warcraft3 and start the map.
  3. your JASS creates a new SystemRequest instance and initializes it with all relevant data.
  4. you commit the request.. (SR.commit() or SR.get(callback))
  5. a file will be crated on your hard drive with the request data.
  6. SR timer will periodically poll the response file to see if the anwser is there..
  7. external app reads file and processes it.
  8. external app writes back response file and deletes query file.
  9. jass finds response file and reads it in.
  10. jass creates a file with a special DEL token.
  11. external application deletes all files for that request. and does any other cleanup.
  12. jass code calls the callback function if set.
  13. jass code will auto-destroy the request unless said otherwise (8k instances.. need reuse em indexes! :p)

Misc
It is possible to trick warcraft into using RAM in stead of the hard drive(TESTED). so you can all just shelve all of the tis'-gon'-killz-meh-HD-arguments..

I'll be posting the code in a few days hopefully. would likle to get rid of the most embarrassing bugs before u all hate me for it :vw_sad:
 
Level 6
Joined
Jul 30, 2013
Messages
282
in order to use the features the user needs an external program installed.
however.. if the user does NOT have the external program he can still play the game as if nothing was wrong.

with sharpcraft the users game would crash.

this means with this system you can host the game on batle.net and everybody can join and play just fine! this means you can expand your userbas with no huge duplication effort or drawing a line between pros/noobs never meeting in game etc..
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
This is only feasible if the features you are making are eye candy and don't really matter.
For anything else (game play), everyone will have to have said program anyway, in which case it is a lot less reliable than directly hacking the game (SharpCraft).
 
Last edited:
Another thing:

With SharpCraft, you can also add functionality to certain existing natives. For example, in the SharpCraft thread, the attached map does particular things in response to a particular Cheat("") command. As such, it still opens just fine for regular users, but it won't have any effect unless you are using SharpCraft with that script/plug-in. I suppose you could use that to get it to work for everyone.
 
Level 6
Joined
Jul 30, 2013
Messages
282
a) only visuals?
* Networking library can be used to sync up data for all users. (Analogous to how Nestharus did codeless save/load in many ways)
Thus (with limited bandwidth requirements) you can have only 1 player with the local program and have all the players enjoy the benefits!
b) SharpCraft
hmm.. well there are some things that sharpcraft CAN do and this CANT.. but.. most of them are such that using them would exclude regular users.
there is a common subset (honestly.. my system would prolly be entirely covered by sharpcraft)
sharpcraft could have an advantage if it can somehow speed up the syncing of data across clients. and perhaps UI department with mouse position.

I am very excited about SharpCraft to be honest. but i got very nervous when i learned that it can easily crash users without custom executable if you use some functionality. Since this system works entirely on the official blizzard version of warcraft 3 there is no such risks (unless you do something stupid like SetUnitX without syncing data).
 
Level 6
Joined
Jul 30, 2013
Messages
282
Hmm.. i guess i should probably upload what i got..

Tho the long term solution will probably be SharpCraft with tweaks so maps can run on regular war3 too.
 
Status
Not open for further replies.
Top