superzanti / ServerSync

Sync files between client and server for Minecraft Forge
GNU General Public License v3.0
161 stars 26 forks source link

Folders inside "Config" #12

Closed maxhenkes closed 9 years ago

maxhenkes commented 9 years ago

It appears to me that while it downloads every text file inside the Config folder, it doesn't actually download any folders like CoFH, Buildcraft etc and their content.

While this is not a problem for most mods since the server takes priority, some stuff can crash the client easily.

superzanti commented 9 years ago

What about sub folders inside mods?

P3rf3ctXZer0 commented 9 years ago

I think what he is saying is this.

mods/anything/content = mods/anything in other words downloading a subfolder in the mods folder causes server sync to fail to download contents of said subfolder. It just grabs the subfolder not the contents within.

superzanti commented 9 years ago

iPencil, can you confirm?

maxhenkes commented 9 years ago

No idea what he tried to say :S

Config folder has all config files, but no sub folders for me.

maxhenkes commented 9 years ago

Also mods inside sub folders of /mods (like 1.7.10) are missing as well.

superzanti commented 9 years ago

Okay, so if there are sub folders it is not working for you, correct? Does it simply not download anything? Can you see in your logs if it even checks those files?

P3rf3ctXZer0 commented 9 years ago

It does not search for content within sub folders no.

P3rf3ctXZer0 commented 9 years ago

If you wanted a quick fix why not just have mods and config folders also include recursive files such as example mods my mod 1 My mod 2.jar

P3rf3ctXZer0 commented 9 years ago

I would make it infinite check or later you will have more issues.

superzanti commented 9 years ago

Would you mind sending me your client console log when you are updating? (change the server value so that you can update again).

I need both iPencil and DPxKnightxZero to do this. Pastbin the log. If it is indeed the case that it is not currently searching recursively then I will fix it immediately. But I suspect it's something else.

maxhenkes commented 9 years ago

Okay, just done an entire redownload of the client with JUST serversync installed and I can confirm now that there are NO subfolders at all. Only the files directy IN /mods/ and /config/ are downloaded.

Client log as requested: http://creepgaming.com/latest.log (uploaded to my website because of file size restraint of pastebin)

superzanti commented 9 years ago

I wanted you to do it with subfolders so i could check if serversync is actually accessing these folders. Could you do it like that?

Just do your original modpack that you got it working with before.

maxhenkes commented 9 years ago

No i redownloaded the pack with JUST serversync installed (aka pulled the whole modpack from just this mod). Subfolders were included.

superzanti commented 9 years ago

were there files in the subfolders?

maxhenkes commented 9 years ago

Yes. There were lots of files in those sub folders on the server, sometimes even more subfolders! On the client, nothing tho, not even the subfolders itself.

superzanti commented 9 years ago

Awesome. I'll take a look at your log.

superzanti commented 9 years ago

Ahh, looking at your config this might indeed be an issue.

Try something for me to confirm my suspicions. Add a bunch of subfolders and files to the client that are not on the server. Then run through the update process. Does serversync delete these files?

superzanti commented 9 years ago

I found the bug!!! Horray!

Well... It's not really a bug if the code was doing exactly what I told it to now is it. I have a function to get all the files in the mods directory and the config directory:

    private static ArrayList<String> dirContents(String dir) {
        ServerSyncRegistry.logger.info("Getting all of " + dir.replace('\\', '/') + "'s folder contents");
        File f = new File(dir);
        File[] files = f.listFiles();
        ArrayList<String> dirList = new ArrayList<String>();
        // Loop through all the directories and only add to the list if it's a file
        for (File file : files) {
            if (file.isDirectory()) {
                dirContents(file.getPath());
            } else {
                dirList.add(file.toString());
            }
        }
        return dirList;
    }

Notice how when I check to see if it's a directory I run the function again as a recursive call, but I never update the list that contains all your files.

This will be fixed within the next 6 hours and released as version 2.3

I'm so glad you found this for me. Thank you!

maxhenkes commented 9 years ago

Derp yeah I see what you did there :D. Awesome that you will be able to fix it so quickly!

superzanti commented 9 years ago

I'll close this issue as soon as I release 2.3.

Did you have any other problems with the mod?

maxhenkes commented 9 years ago

So far not, I'll switch over to this for my beta testing and see what people say about it. I'll report anything I find :)

superzanti commented 9 years ago

Sorry, life happened.

It's been more than 6 hours. I'll do this as soon as I have time I promise.

Also, everyone here please see bug / issue #10

P3rf3ctXZer0 commented 9 years ago

I understand life happens.

superzanti commented 9 years ago

I just updated but have not changed the version. I am at work so I cannot do testing at the moment. Would you mind testing the new version for me?

https://github.com/superzanti/ServerSync/blob/master/build/libs/serversync-2.2.jar

I still have it labeled 2.2 but I can assure you things have changed.

Get back to me on weather or not this fixes the issue.

P3rf3ctXZer0 commented 9 years ago

I can't tell if if is doing anything it just did this when I tried it. 2015-06-10_16 15 20

superzanti commented 9 years ago

You did not update your client manually. Or you did not update the servers update variable.

P3rf3ctXZer0 commented 9 years ago

Server update variable?

superzanti commented 9 years ago

Server side, every time you want your clients to update you must change this variable:

S:LAST_UPDATE=20150608_000500
P3rf3ctXZer0 commented 9 years ago

That would have been fantastic to know much sooner! Huffs in agony ... alright I will debug the other issues now that I know something completely necessary was overlooked ... In the feature please put in big bold print above anything in the config

##############################################################################

MAKE SURE YOU UPDATE SERVER VARIABLE WITH EACH CHANGE OR CLIENTS WILL NOT## ##UPDATED. NOT DOING SO WILL RESULT IN THE CLIENT THINKING IT IS UP TO DATE!

##############################################################################

superzanti commented 9 years ago

I did not design this mod for just any user. It was not designed to have good documentation.

Given the security risks of this mod I designed it so developers could test their mod. If you're not a developer trying to figure this mod out then that's you're own fault. I made it hard for a reason. That being said. I will probably not add it. Somebody else will have to dig up this issue if they want to know why their mods aren't updating.

With great power comes great responsibility.

P3rf3ctXZer0 commented 9 years ago

Okay I change the server side variable and received this error. 2015-06-10_16 30 53

P3rf3ctXZer0 commented 9 years ago

S:LAST_UPDATE=20150608_000501 <- Server S:LAST_UPDATE=20150608_000500 <- Client

superzanti commented 9 years ago

The picture does not help. Please pastebin the server log and the client log. For me to help you in the fastest way possibly this should be common practice.

P3rf3ctXZer0 commented 9 years ago

http://pastebin.com/UjmMAacj

superzanti commented 9 years ago

This is not the full log, you also did not include the server's log. I need the full log.

P3rf3ctXZer0 commented 9 years ago

Pastebin sucks here is why

You have exceeded the maximum file size of 512 kilobytes per paste. PRO users don't have this limit!

P3rf3ctXZer0 commented 9 years ago

Also if you want debuggers you may want to explain all possible require changes also even if you have mild security issues you can avoid viruses and hackers worrying about supposed secruity isn't a reason to not explain things its silly. I have host file protection anti pvp privacy breaches anti worm and trojan security and I will let you try and hack my pc and fail since I had friend try and DDoS me and fail. Please explain all variables especially since I learn from hands on. Anyways all that aside here is my google drive with the logs you requested.

I made a folder called debugging just for you. https://drive.google.com/folderview?id=0B1fY2sKXiHd7ZFl3SWFOdDh3TVU&usp=sharing

P3rf3ctXZer0 commented 9 years ago

Pixelmon has similar breaches and guess what they still explain how to use their mod. :(

maxhenkes commented 9 years ago

I honestly don't even know why he is still giving you support. I would have stopped this nonsense on anything I made a while ago...

superzanti commented 9 years ago

iPencil, Patience is one of my strong suits. BTW, did you get this mod working?

DPxKnightxZero, Pastebin pro accounts are free. Just sign up. But don't paste big blocks of logs here. Pixelmon may do that, but I don't. I did this for fun. I don't get paid, and I hardly have time. I working on my Master's right now on top of a 40hr a week position. I released this mod a week ago, give me some time and I may change my mind. But for now this is how it is. Also, if you're seriously challenging me to hack your PC just cause you have some antivirus to prove a point.... It's not working. haha

But thank you very much for the logs. Now this is helpful. I can see all of the exceptions and line numbers. I will work on figuring out what caused this problem later tonight.

On another note: I will gladly accept github pull/push requests if they look good.

P3rf3ctXZer0 commented 9 years ago

@superzanti I want to apologize for snapping ... its just how can I be of any proper use if you aren't being upfront about the way your mod works? I understand you are trying to protect people in your own way which is good. Its just that "how can I help fix problems if I don't know what caused them to begin with." I am not a fool but I do not have an affinity for coding due to suffering from ADD and Bipolar. I suffer each day but I seldom let it stop me. Anyways all that aside I truly appreciate what you do. Just remember this in the future please; "You can't fix fix what you don't know is broken."

@iPencil I realize you seem irritated with me and yes I have been a little out of line but when you spend close to 12 hours working with a mod that you didn't know required something simple like that it hurts and the only reason I overlooked such a crucial detail is because I suffer from ADD. I still tried knowing that the mod is great and that at the end of all the ordeal I could finally have a way to update things and my clans server could finally work as intended. You don't know what its like to want to be able to code and be able to do what 1000's can do and study your heart out just to learn how to make the hello world app. Its my dream to be a great technician but I can't even make advanced Java applications because I can only learn hands on. Please don't take my frustration as being ungrateful.

maxhenkes commented 9 years ago

We're testing the changes I made yesterday so we aren't actually in need of any updates right now and I rather not have them download stuff today again. I will do it in 1-2 days and report back. So far it looks good.

superzanti commented 9 years ago

Cool thank you.

There is a current bug that I'm aware of that I am working on fixing. So if you don't want to bother your clients, give it another few days for me to release the next version, then have them update with that.

Alternatively, I also have to update my clients so I'm working on self updating the mod so you wouldn't have to send the file out. I know what you're going to say: "well superzanti, doesn't it already do this?" Well, yeah, It's supposed to, but when the client is running the update process it has a lock on all the jar files. So i can delete them, but not update them. I'm working on a solution now.

maxhenkes commented 9 years ago

Okay, we're in no hurry here. I had the wish for something like this ever since forge popped up, so I can wait a bit longer :D. We're in a heavy phase of testing atm anyways so I'm not currently updating my mod every hour or so like I used to do on some days so we are fine.

So currently it can't update itself? Heh, didn't really expect it to be able to. In a perfect world, being not such a giant mod, you would expect this to be done and working for a long time at some point. But people always seem to find ways to break things

maxhenkes commented 9 years ago

@DPxKnightxZero I'm not gonna reply to the rest of your post, let's just forget about it ever happened and move on.

The reason why superzanti doesn't explain things is because, in his right, made this mod for developers to distribute their mods to their beta testers, not for regular modpacks. Hence it is to expect that only other developers would use this.

What gave the version thing away for me was in his curse page it says:

"Version 2.1:

Added feature to ask the server if there has been any updates before ever updating This allows to update all configs regardless of if they change"

So it was pretty clear what it meant. After my client would not update properly, I simply set the values to something different and it would at least download the files. (THIS WAS DISCUSSED IN THE OTHER THREAD AND SAID MULTIPLE TIMES)

I'm currently using this mod so I can quickly push out my own mod on my own server when we are testing. I don't plan to use this once I'm done and using technic/ftb/atl and neither should you!

P3rf3ctXZer0 commented 9 years ago

@iPencil I plan on using this to keep mods up to date on my modpack because mods like cofh update there mods daily and it is usually to fix a break in the game. I get tired of repacking the modpack again and again with insane upload and download times. Its a nightmare and it causes me a great deal of stress. I spend close to 12 hours a day working on things related to minecraft because I am the sever admin of the minecraft death plague gaming community.

superzanti commented 9 years ago

@DPxKnightxZero So waiting a bit longer for this mod isn't a problem then :)

P3rf3ctXZer0 commented 9 years ago

@superzanti Not at all I appreciate you working on it. I don't have the skill so beggars can't be choosers :P

superzanti commented 9 years ago

There appears to only be one issue left in the mod that I am aware of (I started a new thread for it). I am closing this issue for now.