[Opensim-dev] Upcoming work on alternative client stack
Mike Mazur
mmazur at gmail.com
Mon Aug 18 00:08:43 UTC 2008
Hi Adam,
On Sun, 17 Aug 2008 14:27:12 -0400
"Frisby, Adam" <adam at deepthink.com.au> wrote:
> Please be careful here.
>
> I'm doing some work with the RealXtend guys to move their custom code
> into a set of Region Modules, however I need the SendPacket(Packet x)
> function on IClientAPI to do so.
>
> Now admittedly there's only a few custom packets, and we could extend
> IClientAPI to support them - these are:
>
> 1. GenericMessagePacket - Rex has moved to using these to
> overload all their messages onto (so that the existing client ignores
> them safely), we don't have a IClientAPI.SendGenericMessage(string[]
> msg) equivalent yet. This could be one way we get around this.
>
> 2. Convert to SendPacket(Byte[] x), then run
> GenericMessagePacket.ToBytes() before passing it to IClientAPI?
I'm not sure I fully understand the issue.
My changes in IClientAPI is to replace Packet with object:
IClientAPI:
- void InPacket(Packet NewPack);
+ void InPacket(object NewPack);
This way the interface doesn't dictate the datatype of the packet, but
the implementing class does:
LLClientView (implements IClientAPI):
- public virtual void InPacket(Packet NewPack)
+ public virtual void InPacket(object NewPack)
{
- m_PacketHandler.InPacket(NewPack);
+ // Cast NewPack to Packet.
+ m_PacketHandler.InPacket((Packet) NewPack);
}
Since the interface expects an object, anything can be passed around,
be it byte[], Packet or GenericMessagePacket.
Does that still pose any issues for you?
Mike
More information about the Opensim-dev
mailing list