js-dos
js-dos copied to clipboard
Can't use files without ZIP - PHP implementation
I need a dynamic implementation, but I could not do it without the EXTRACT from ZIP. How to execute the dos application (EXE) located in the server and calling the FILENAME (Already in the server too). I did not manage to that without the ZIP, unfortunately I have more than 30.000 files and ZIP all of then with the EXE would be a retarded move from my part. Any help very welcome.
Here is the command: main(["-c", "T.EXE 1002.LOG"]).then(function (ci) {
<script>
Dos(document.getElementById("jsdos"), {
wdosboxUrl: "./wdosbox.js",
cycles: 750,
}).ready(function (fs, main) {
fs.extract("test/vvt_dos.zip").then(function () {
main(["-c", "T.EXE 1002.LOG"]).then(function (ci) {
window.Module = ci.dos;
window.ci = ci;
//DosController.Qwerty(ci.getParentDiv(), ci.getKeyEventConsumer());
//DosController.Move(ci.getParentDiv(), ci.getKeyEventConsumer());
ci.simulateKeyPress(13);
setTimeout(() => { console.log("WaitCode"); }, 1000);
ci.simulateKeyPress(13);
});
});
});
</script>
You can create zip dynamically with php or javascript (game studio do this). There is simple library zip-js so you can load files as before and create zip from it (use zero compression to do it fast)
however I recommend wirte a bash script and process all files on server to create zip
also I recommend to switch on js-dos v7
That, my friend, is exactly outside the realm of my intentions. That generation would stress out, unnecessarily, the HD due to the demand of this application. In the long term this solution is precisely creating a duplicate EXE in each ZIP. I was (almost) certain that the ZIP was not mandatory. Thank you for your time and patience in this matter.
Just to show you the context why ZIP is needed. When you use js-dos v7 it's create a worker with dosbox, however the FS of this worker is empty, and so you need to transfer all your files to worker. Depends on game it can be simple or not. E.g. if game have 1 file you can send it, but if game something big like C&C you need to send hundreds of files to worker, moreover zip add compression that works great for old games, because of that transfer will be short and simple. Without it you can hang for long time while you sending files to worker.
If your typical program is small, then doing zip on client side with zip-js will be very fast. In case when your program is bit, is better to zip it on server with max compression ratio.
Anyway if I add something like you ask (sending unpacked bundles) I will do it using zip-js on client side. There is no other way to effectively send game data to worker.