1
inherit "/classes/Object";
5
static int iRemote_ObjectID; // the id of the remote object
6
static string sRemote_ServerID; // the remote server the object is located
8
static int iTemporary = -1;
9
static function fExecuteRemote;
11
static mapping fTableRemote = ([ ]);
14
void set_remote_ObjectID(int objectID)
16
iRemote_ObjectID = objectID;
17
write(sprintf("\nSet_remote_ObjectID to: %d\n",iRemote_ObjectID));
21
void set_remote_ServerID(string serverID)
23
sRemote_ServerID = serverID;
27
int get_remote_ObjectID()
29
return iRemote_ObjectID;
32
string get_remote_ServerID()
34
return sRemote_ServerID;
40
write("Shadow.pike: set_temporary!\n");
44
mixed `[](mixed index)
49
if (m = fTableRemote[index]) {
53
fTableRemote[index] = getlambda(index);
54
return fTableRemote[index];
57
write("\nShadow> Failed Indexing: "+ index +"\n");
61
function getlambda (string fname)
63
return lambda (mixed args) {
64
return remote_call(fname, args);
69
static mixed remote_call(string fname, mixed args)
71
write( sIdentifier + "("+ iObjectID +")" + ": remote_call on: ");
72
write(sprintf("%d@%s",iRemote_ObjectID, sRemote_ServerID));
75
mixed result = fExecuteRemote(this_user(), iRemote_ObjectID,
76
sRemote_ServerID, fname, args);
78
write("\nShadow: Kein Result!\n");
84
object cluster = get_module("Cluster");
85
if ( objectp(cluster) )
86
return cluster->send_command(
87
sRemote_ServerID, iRemote_ObjectID, fname, args);
88
steam_error("Failed to locate server cluster.");