View Single Post
  #8  
Old 05-22-2011, 04:07 PM
fearlessfrog fearlessfrog is offline
Approved Member
 
Join Date: Jul 2010
Posts: 64
Default

Quote:
Originally Posted by TheEnlightenedFlorist View Post
Are you sure this is true? I can't see any reason why the scripts would need to be downloaded onto each clients computer and ran there. Sure, a script could mess up a server, but that's the server admin's responsibility.

I don't even think the mission files are downloaded to clients' computers, just the info about where things are and such.

If this is true, it means that every client is a server and they are somehow collaborating to keep everybody's game the same. A pretty silly way to do it and not what I would expect from the dev team.



I don't have any friends to connect to my servers but somebody might as well try it. I have a feeling anything like that would only affect the server.

Anyway, here's code that will create a directory and file in the root directory of the c: partition. Uncomment the commented stuff to delete it. It works on a server, I doubt it will work on a client connected to a server.

Code:
public override void Init(maddox.game.ABattle battle, int missionNumber)
    {
        base.Init(battle, missionNumber);

        // Specify a "currently active folder"
        string activeDir = @"c:\youve\been\";

        System.IO.Directory.CreateDirectory(activeDir);

        string newFileName = "duped";

        string newPath = System.IO.Path.Combine(activeDir, newFileName);

        if (!System.IO.File.Exists(newPath))
        {
            using (System.IO.FileStream fs = System.IO.File.Create(newPath))
            {
                for (byte i = 0; i < 100; i++)
                {
                    fs.WriteByte(i);
                }
            }
        }

        // Delete a directory and all subdirectories with Directory static method...
        //if (System.IO.Directory.Exists(@"c:\youve"))
        //{
        //    try
        //    {
        //        System.IO.Directory.Delete(@"c:\youve", true);
        //    }

        //    catch (System.IO.IOException e)
        //    {
        //        Console.WriteLine(e.Message);
        //    }
        //}
    }
Thanks for that.

For me it looks like MP is ok, but SP needs a sandbox.

Agreed?
Reply With Quote