[Opensim-dev] Restructuring IClientAPI - thoughts wanted

Frisby, Adam adam at deepthink.com.au
Sun Sep 14 02:41:15 UTC 2008


I'm in the process of adding support for some alternate clients to OpenSim, and one of the things I'm noticing is that there is one one chunk of OpenSim in particular that is highly "LL-Specific" in how it treats things - it's also comparatively a very small chunk of OpenSim that might actually be fixable quite easily.

That is to say, IClientAPI - I'm thinking of replacing IClientAPI with a very small interface:

bool                       IClientAPI.HasInterface<T>();
type[]                   IClientAPI.GetInterfaces();

Then replacing the current web of .Xyz with smaller more discrete interfaces such as:


IClientInstantMessage {

SendMessage(...);

event OnNewMessage;

}

We can do checks on them in our modules, where once we did:

OnNewClient(IClientAPI client) {
     client.OnNewMessage += messageHandler;
}

We replace with


OnNewClient(IClientAPI client) {

     If(client.HasInterface<IClientInstantMessage>()) {

          ((IClientInstantMessage)client).OnNewMessage += messageHandler;

}

}

The resulting code is then more friendly for third party clients, and clients don't need to support the full set of functionality to register as valid Clients inside of OpenSim.

What's everyone's thoughts here?

Good idea / bad / anyone got any better?

Adam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://opensimulator.org/pipermail/opensim-dev/attachments/20080913/56112f33/attachment-0001.html>


More information about the Opensim-dev mailing list