VeriorPies / ParrelSync

(Unity3D) Test multiplayer without building
MIT License
4.51k stars 318 forks source link

[BUG] Legacy Issues #27

Closed TheYellowArchitect closed 3 years ago

TheYellowArchitect commented 3 years ago

I am using Unity 2018.1.f1, Windows 7, ParrelSync 1.4.1

Error: "Symbolic Links cannot be used because it is not part of the C# 4.0 language specification" The bug is at https://github.com/VeriorPies/ParrelSync/blob/master/ParrelSync/Editor/ClonesManager.cs#L301

The fix is obvious var command = "ln -s " + sourcePath + " " + destinationPath; and no matter what I do, after I fix it, I get a bunch of errors, probably related to my legacy stuff Like, Path.Combine taking 3 arguments, and my library can take only up to 2.

Image below is all errors I get. Is there an alternative for that code?
For example, Path.Combine(x,y,z) can be Path.Combine(x,Path.Combine(y,z)) image

Update:

static long GetLocalDirectorySize(string p) { // 1. Get array of all file names. string[] a = Directory.GetFiles(p, ".");

        // 2. Calculate total bytes of all files in a loop.
        long b = 0;
        foreach (string name in a)
        {
            // 3. Use FileInfo to get length of each file.
            FileInfo info = new FileInfo(name);
            b += info.Length;
        }
        // 4. Return total size
        return b;
    }


If my hacky edits work, I will close this issue (and hopefully take the time to push them, with an #if_.NET_4.0 declaration)
TheYellowArchitect commented 3 years ago

The above seem to work, as my ParrelSync runs finely. I will push them when I find the time

However, can someone confirm, the above work? Not run the code, but manually skim the code and confirm for any logic errors Because, for example, in the GetDirectorySize - that is all for visuals I think (progress bar), so if I am wrong, I may be running buggy behaviour (and push that onto development fork :sweat_smile: )

314pies commented 3 years ago

Fixes #33