PDA

View Full Version : .server() and Channel handlers


Dodgy
02-10-2007, 07:35 AM
Hi all,

How do I get the server method to work with channel handlers? I'm tried

myserver=mychannel.server(SERVER_CHANNEL_H,i);
myserver=item.server(SERVER_CHANNEL_H,i);

but neither return anything other than 'nil' . Anyone any ideas? Or is this a bug?

Thanks,
Mike

Sensei
02-10-2007, 08:14 AM
In LW SDK ItemInfo->Server() is starting at 1, not 0.. Does it work the same in LScript?

Dodgy
02-10-2007, 08:48 AM
You mean for the plugin index? Yes it does. I do this:


item=Scene().firstSelect();

pluginstate=nil;
i=1;
while(mychannel)
{
myserver=item.server("ChannelHandler",i);
if(myserver)
{
pluginstate[i]=item.serverFlags("ChannelHandler",i);
EnableServer("ChannelHandler",i,0); //0 enables, 1 disables
i++;
}
mychannel=item.nextChannel();
}


This works with IA(motion) scripts, but not CM(channel scripts).