Exemple #1
0
 public override void Process(EventConnection ps)
 {
     if (CheckClassType(ps))
     {
         Functor.Dispatch(ps);
     }
 }
Exemple #2
0
        public override void Unpack(EventConnection ps, BitStream stream)
        {
            var gc = ps as GhostConnection;

            if (gc == null)
            {
                return;
            }

            if ((gc.DoesGhostTo() && RpcDirection == NetObjectRPCDirection.RPCToGhost) ||
                (gc.DoesGhostFrom() && RpcDirection == NetObjectRPCDirection.RPCToGhostParent))
            {
                if (stream.ReadFlag())
                {
                    var ghostIndex = (int)stream.ReadInt((byte)GhostConnection.GhostIdBitSize);
                    base.Unpack(ps, stream);

                    DestObject = RpcDirection == NetObjectRPCDirection.RPCToGhost ? gc.ResolveGhost(ghostIndex) : gc.ResolveGhostParent(ghostIndex);
                }
            }
            else
            {
                NetConnection.SetLastError("Invalid packet.");
            }
        }
Exemple #3
0
        public override void Process(EventConnection ps)
        {
            if (DestObject == null)
            {
                return;
            }

            if (!CheckClassType(DestObject))
            {
                return;
            }

            NetObject.SetRPCSourceConnection(ps as GhostConnection);

            Functor.Dispatch(DestObject);

            NetObject.SetRPCSourceConnection(null);
        }
Exemple #4
0
        public override void Pack(EventConnection ps, BitStream stream)
        {
            var gc = ps as GhostConnection;

            if (gc == null)
            {
                return;
            }

            var ghostIndex = -1;

            if (DestObject != null)
            {
                ghostIndex = gc.GetGhostIndex(DestObject);
            }

            if (!stream.WriteFlag(ghostIndex != -1))
            {
                return;
            }

            stream.WriteInt((uint)ghostIndex, (byte)GhostConnection.GhostIdBitSize);
            base.Pack(ps, stream);
        }
Exemple #5
0
 public virtual void NotifyDelivered(EventConnection ps, bool madeId)
 {
 }
Exemple #6
0
 public virtual void NotifySent(EventConnection ps)
 {
 }
Exemple #7
0
 public virtual void NotifyPosted(EventConnection ps)
 {
 }
Exemple #8
0
 public abstract void Process(EventConnection ps);
Exemple #9
0
 public abstract void Unpack(EventConnection ps, BitStream steam);
Exemple #10
0
 public override void Unpack(EventConnection ps, BitStream stream)
 {
     Functor.Read(stream);
 }
Exemple #11
0
 public override void Pack(EventConnection ps, BitStream stream)
 {
     Functor.Write(stream);
 }