English Easy Server Transfer List Creating icon

5 comments
11.01.18 11:47:29 am
like 3 like it!
973 b, 33 Downloads
Masea
Super User
Offline Off
This very small script allows you to create your server transfer list much faster and easy just by using a single function.

> How to
The only function you can use with this script is
writeFilesToServertransfer(folderPath, refresh)
You'll just specify folderPath and make refresh true if you want to your old
servertransfer.lst
be deleted. folderPath would be like "gfx/bf2d", "sfx/weapon_sounds", "gfx/map_images/map1" and so on. If more folders come up in the specified directories, those will also be checked. You cannot attempt to write a basic file there, folderPath always must be a directory! And lastly, make sure to restart the server when writting is done to get use of it.

∗ Furthermore, if you don't make refresh true, it also checks if the files are gonna be written do already exist or not. If does, it skips that file.

∗ You can also set up what file formats can be written in your server transfer list. See:
Code:
formats = {".jpg", ".png", ".bmp", ".wav", ".ogg"}
I just wanted to add there most common formats being used in CS2D. You can add new formats(not sure CS2D supports more formats than this though), remove some and even make it empty but it will surely cause no files written in your server transfer list.

Hope you find it useful.
edited 9×, last 10.03.18 12:07:17 pm
ok This file has been reviewed and approved by Yates (11.01.18 12:04:36 pm)

Comments

5 comments
Goto Page
To the start Previous 1 Next To the start

Log in!

You need to log in to be able to write comments!Log in
12.01.18 09:16:00 am
like I like it!
Up
BcY
User
Offline Off
Well-done work. Thanks for making my life easier.
11.01.18 04:27:47 pm
like I like it!
Up
AtomKuh
User
Offline Off
sounds nice
11.01.18 12:02:55 pm
like I like it!
Up
Yates
Reviewer
Offline Off
Best would be to convert the file to a table, merge it with your list, remove the duplicates then add them to the file (overwriting everything all the time).

I also can't see where you check if the file exists? (I see a function but it's never used)

I have a lot of checks which may help server owners figure out what is going wrong, maybe you can use a few of them: https://github.com/IvaWonderbush/Y.A.T.E.S/blob/development/core/autoload/utilities/serverlist.lua

If you add at least the duplicate and file exists check I'll give it a like
edited 1×, last 11.01.18 04:29:47 pm
11.01.18 11:57:47 am
Up
Masea
Super User
Offline Off
@user Yates: It does not - for now. Thanks for a quick idea. Gonna make it now!
11.01.18 11:54:29 am
like I like it!
Up
Yates
Reviewer
Offline Off
I can't test it right now, but does it add files already in the server transfer list or does it ignore them (to prevent duplicates)?
To the start Previous 1 Next To the start