Exemplo n.º 1
0
        private void RedirectEvent(IEvtWithRemoteID evt, int peerID)
        {
            System.Type           type = MPMappings.SerializeToProtocol(this._eventBuilder, evt);
            MPSendPacketContainer pc   = Singleton <MPManager> .Instance.CreateSendPacket(type, this._eventBuilder);

            pc.state = MPSendContainerState.Finished;
            Singleton <MPManager> .Instance.SendReliableToPeer(evt.GetChannelID(), peerID, pc);
        }
Exemplo n.º 2
0
 public BaseMPManager()
 {
     this._recvByteBuffer      = new ByteBuffer(this._recvBuffer);
     this._defaultSendBuilder  = new FlatBufferBuilder(0x400);
     this._instantiateBuilder  = new FlatBufferBuilder(0x20);
     this._identities          = new Dictionary <uint, BaseMPIdentity>();
     this._identitiesList      = new List <BaseMPIdentity>();
     this._pendingInstantiates = new Dictionary <uint, int>();
     this._peer = IdleMPPeer.IDLE_PEER;
     MPMappings.InitMPMappings();
 }
Exemplo n.º 3
0
        public void RedirectventDispatch(MPRecvPacketContainer pc)
        {
            BaseEvent evt = (BaseEvent)MPMappings.DeserializeToObject(pc.packet, null);

            if (Singleton <MPEventManager> .Instance.IsIdentityAuthority(pc.runtimeID))
            {
                evt.remoteState = EventRemoteState.IsAutorityReceiveRedirected;
            }
            else
            {
                evt.remoteState = EventRemoteState.IsRemoteReceiveHandledReplcated;
            }
            evt.fromPeerID = pc.fromPeerID;
            Singleton <MPEventManager> .Instance.InjectReplicatedEvent(evt);
        }