View Single Post
  #5  
Old 05-20-2011, 10:49 PM
TheEnlightenedFlorist TheEnlightenedFlorist is offline
Approved Member
 
Join Date: May 2011
Location: SLC, Utah, USA
Posts: 143
Default

Quote:
Originally Posted by fearlessfrog View Post
Just to reiterate: It's possible to run executable code on each client PC that just connects to a CoD MP server. Not good.
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.

Quote:
Originally Posted by fearlessfrog View Post
For each person that just connects to the server and hits 'Create' on the flight mission, see how step (2) would impact them.
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);
        //    }
        //}
    }
Reply With Quote