Batch Multiplayer

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
MavastDev
Posts: 1
Joined: 27 Sep 2015 13:29
Location: The Netherlands, Nijmegen

Batch Multiplayer

#1 Post by MavastDev » 27 Sep 2015 13:33

Hi guys! me and my friend wanted to make a Batch morpg kind of game that can be played with each other.
we know everything to make the game itself except for the online part :lol: .
for example, i would enter "trade (username)", i would want my friend (seperate computer, seperate wifi connection) to see "(username) wants to trade! accept?". something like that. please help us :D

TheHunterManX
Posts: 54
Joined: 14 Aug 2015 05:59

Re: Batch Multiplayer

#2 Post by TheHunterManX » 28 Sep 2015 07:04

Step 1. Get Your ftp server(you can make a free one here)(Also check it daily or it will delete or press protect when it is about to delete).
Step 2. Get your game done(well, it is almost done...)
Step 3. Get your ftp client(You can get a free one [url=winscp.net/download]here[/url], it must be winscp)
Step 4. Add your ftp adress on the winscp(You dont have to, but it is for managing your files!)
Step 5. Here is where it gets hard. In batch you have to add it. Here is a screenshot:
Image

Step 6. Ok, now add this to your game. Then it is finished.
If you need more help please leave it in the comments section. I will probably make a youtube video about it from now to 2-3 days. Channel:
https://www.youtube.com/channel/UCdXg0- ... 2GTi3u4orQ

ShadowThief
Expert
Posts: 1029
Joined: 06 Sep 2013 21:28
Location: Virginia, United States

Re: Batch Multiplayer

#3 Post by ShadowThief » 28 Sep 2015 07:14

There's a bit more to it than that. If both players try to do make a move simultaneously, some data is going to get overwritten. You'll need to throw in a lock file that states whose turn it is.

Squashman
Expert
Posts: 4288
Joined: 23 Dec 2011 13:59

Re: Batch Multiplayer

#4 Post by Squashman » 28 Sep 2015 09:15

And why screw around with using winscp. Just use the built in ftp client that windows has.

TheHunterManX
Posts: 54
Joined: 14 Aug 2015 05:59

Re: Batch Multiplayer

#5 Post by TheHunterManX » 28 Sep 2015 11:26

I use winscp because it is needeed in the SCRIPT. I understand that but this is alot faster and you can edit your ftp stuff using the exe. -No hate added

Squashman
Expert
Posts: 4288
Joined: 23 Dec 2011 13:59

Re: Batch Multiplayer

#6 Post by Squashman » 28 Sep 2015 13:21

TheHunterManX wrote:I use winscp because it is needeed in the SCRIPT. I understand that but this is alot faster and you can edit your ftp stuff using the exe. -No hate added

Would you care to explain your answers some more. I am not understanding your logic at all. I do data automation for a living, so if you could provide some examples as to why Winscp would be better than Windows own ftp.exe, I would appreciate your insight.

TheHunterManX
Posts: 54
Joined: 14 Aug 2015 05:59

Re: Batch Multiplayer

#7 Post by TheHunterManX » 28 Sep 2015 22:30

First, it can put out and recieve. Second, for some reason ftp doesnt work well with my windows xp, and some others. Third, it does not only have to work with batch, as it can be launched to put or delete or get files. Fourth, it shows the progress along with conections to see if it failed or worked(this is probably for ftp.exe the windows has). I dont know how to explain it better. Look up the two and compare them. I think you'll know who wins....

Squashman
Expert
Posts: 4288
Joined: 23 Dec 2011 13:59

Re: Batch Multiplayer

#8 Post by Squashman » 28 Sep 2015 23:08

Can you please provide examples for all four of your arguments and explain how Windows native capability cannot do what winscp can.

Thanks.

TheHunterManX
Posts: 54
Joined: 14 Aug 2015 05:59

Re: Batch Multiplayer

#9 Post by TheHunterManX » 29 Sep 2015 09:56

Understood.
1.
Putting out:
%R%\winscp.com /command ^
"open ftp://Username:Password@ftp.thehunterma ... ublic_html" ^
"put ""%MyPath%""" ^
"exit"
Getting:
%R%\winscp.com /command ^
"open ftp://Username:Password@ftp.thehunterma ... ublic_html" ^
"get Tictactoe.bat" ^
"exit"
------explination-----
As some free and paid ftp servers demand to put all files in a folder, this helps as with the native windows one cannot specify a folder from the ftp server, nor recieve ftp files(to my knoledge, I cant use it because my windows xp cannot run the native one properly). Also, this is from my game and it works.
2.
From a website(tested it, it works but keeps window open and doesnt actually upload it):
@echo off
echo user MyUserName> ftpcmd.dat
echo MyPassword>> ftpcmd.dat
echo bin>> ftpcmd.dat
echo put %1>> ftpcmd.dat
echo quit>> ftpcmd.dat
ftp -n -s:ftpcmd.dat SERVERNAME.COM
del ftpcmd.dat
-----Explination-----
It doesnt work aka. when i use it it does not give the file, as it finishes and keeps cmd open(have to x it out). When i check the file, it is not there.
3.
Say, you are making a server for your game.
For testing, you will like to check the file or delete it if you messed up or just to edit it.
But using the native one you will need to send for a long time (and you cant even recieve or delete the file!) for testing.
But with this Winscp exe you can log in without having to go to the website.
Its fast, and simple. And if you want you can even put the ftp on your desktop and save the password!
-----Explination-----
Log in to your account, then you can create folders, add files to ftp, delete files on ftp, obtain files from ftp, edit files from ftp, and much more. check it out.
4.
Again if you want to upload the server, if it is big (or any size) you will want to see how long it takes or the progression bar.
using the command, it shows the procent loaded.
-----Explination-----
Do i even need one? It shows the progression and if it connects to the server.

+
This is really handy in a gamelike batch file. It does not freeze, glitch(if you do it properly), and (dare I say) better than the native ftp("really, does external programs have nothing we dont like?").

Any more info needed or a better explination needed you know where to post!

Squashman
Expert
Posts: 4288
Joined: 23 Dec 2011 13:59

Re: Batch Multiplayer

#10 Post by Squashman » 29 Sep 2015 10:46

Read this link
http://ss64.com/nt/ftp.html

Then tell me how I cannot do 1, 2 & 3 with ftp.exe.

Argument 4 is trivial for data automation as I reroute all output from ftp.exe to a log file but in theory you can turn on the HASH to see how much has been done. Just need to do the quick math in your head which is easy enough to do when multiplying by 2. In theory, you could get the file size first. You could then read the ftp.log for how many hashes there are and display a progress bar in a separate window. But that is way more then is needed. If I need to manually move a file and see the progress I just use Filezilla.

Just to give you a little background as I said earlier I do data automation for a living. I have 4 application servers that have over 800 automation tasks programmed on them. Many of these tasks are FTP because I am the central HUB for all data. Data comes in and I redirect it to the correct system it needs to go to. I interface with Netware, Unix, Linux, Windows and Mainframe systems. I FTP to all of them. I can PUT files. I can GET files. I can delete files. I can create directories. I can delete directories. I can change to different directories. FTP.exe works just fine!

TheHunterManX
Posts: 54
Joined: 14 Aug 2015 05:59

Re: Batch Multiplayer

#11 Post by TheHunterManX » 30 Sep 2015 06:04

Thank you for the clarification.
I will test this however i will stick with my method(WINSCP) because my windows xp doesnt work with the ftp.

foxidrive
Expert
Posts: 6033
Joined: 10 Feb 2012 02:20

Re: Batch Multiplayer

#12 Post by foxidrive » 30 Sep 2015 09:02

You could test these:

A:

Code: Select all

@echo off
set "site=ftp.thehunterman.com"
(
echo.open %site%
echo.user anonymous password
put "%MyPath%"
)| ftp -n
pause



B:

Code: Select all

@echo off
set "site=ftp.thehunterman.com"
(
echo.open %site%
echo.user anonymous password
get Tictactoe.bat
)| ftp -n
pause


C:

Code: Select all

@echo off
set "site=ftp.thehunterman.com"
(
echo.open %site%
echo.user anonymous password
echo bin
echo put %1
)| ftp -n
pause




This code of yours doesn't open an FTP site. I'm not sure what you expect it to do.

Code: Select all

@echo off
echo user MyUserName> ftpcmd.dat
echo MyPassword>> ftpcmd.dat
echo bin>> ftpcmd.dat
echo put %1>> ftpcmd.dat
echo quit>> ftpcmd.dat
ftp -n -s:ftpcmd.dat SERVERNAME.COM
del ftpcmd.dat

Vats
Posts: 16
Joined: 15 May 2021 02:00
Contact:

Re: Batch Multiplayer

#13 Post by Vats » 03 Jun 2021 23:14

Hello there! Would need a small help in my online game. https://vatsalya.itch.io/ It is avaliable here. How do I make a online game system? :D

Post Reply