[MUD-Dev] Spoof implementation

Eli Stevens wickedgrey at wickedgrey.com
Wed May 30 14:30:29 CEST 2001


Background on spoofs, JCL's scenarios, etc:

    http://www.kanga.nu/archives/MUD-Dev-L/1998Q2/msg00479.php
    http://www.kanga.nu/archives/MUD-Dev-L/2000Q1/msg00695.php
    http://www.kanga.nu/archives/MUD-Dev-L/1997Q2/msg01237.php

Note that some of the same information is copied between the various
posts, so it is not as much reading as one might expect.

The spoof model described above says that when the spoof is made it
copies the original object to another location and inserts itself into
the old object's original location.  Is that a conceptual model of
what happens, or does the implementation need to do so as well?

I have been thinking about it, and I cannot see any difference between
the above and the following (please excuse the gratuitous abuses of
C++):


    // encapsulates a request, as per the "Command" design pattern
    class MethodCall;

    class Spoof
    {
            MethodCall* CallMethod( MethodCall* method );
    };

    class GameObject
    {
        list<Spoof> currentSpoofs;

        MethodCall* CallMethod( MethodCall* method )
        {
            for( iterator spoof = currentSpoofs.begin();
                    spoof != currentSpoofs.end();
                    spoof++ )
            {
                    // this can leave the method unchanged,
                    // modify it, create a new one and return
                    // it instead, or handle it and return NULL
                method = spoof.CallMethod( method );
            }

            // actual method handling for the object goes here
        }
    };

Is there something that I am missing, or would an approach like this
work just as well as any other implementation?  It seems that the
method call would have a chance to be processed by all the spoofs
before finally getting to the game object, just like in the processed
described in the posts above.

TIA for any input,
Eli

--
"Ultimately, if it is possible for a consumer to hear or see protected
 content, then it will be technically possible for the consumer to copy
 that content." -- Dr. Edward Felten






_______________________________________________
MUD-Dev mailing list
MUD-Dev at kanga.nu
https://www.kanga.nu/lists/listinfo/mud-dev



More information about the mud-dev-archive mailing list