Ejemplo n.º 1
0
 public void OnBulletObservableSet(int observedID)
 {
     if (enableSend && owner.IsOriginal())
     {
         Coop_Model_ObjectBulletObservableSet coop_Model_ObjectBulletObservableSet = new Coop_Model_ObjectBulletObservableSet();
         coop_Model_ObjectBulletObservableSet.id         = owner.id;
         coop_Model_ObjectBulletObservableSet.observedID = observedID;
         SendBroadcast(coop_Model_ObjectBulletObservableSet, false, null, null);
     }
 }
Ejemplo n.º 2
0
    protected override bool HandleCoopEvent(CoopPacket packet)
    {
        switch (packet.packetType)
        {
        case PACKET_TYPE.OBJECT_DESTROY:
            if (owner is Self)
            {
                return(true);
            }
            return(owner.DestroyObject());

        case PACKET_TYPE.OBJECT_ATTACKED_HIT_OWNER:
        {
            Coop_Model_ObjectAttackedHitOwner model5 = packet.GetModel <Coop_Model_ObjectAttackedHitOwner>();
            model5.CopyAttackedHitStatus(out AttackedHitStatusOwner status2);
            if (owner.IsEnableAttackedHitOwner())
            {
                owner.OnAttackedHitOwner(status2);
                AttackedHitStatusFix status3 = new AttackedHitStatusFix(status2.origin);
                owner.OnAttackedHitFix(status3);
                if (owner.packetSender != null)
                {
                    owner.packetSender.OnAttackedHitFix(status3);
                }
            }
            break;
        }

        case PACKET_TYPE.OBJECT_ATTACKED_HIT_FIX:
        {
            Coop_Model_ObjectAttackedHitFix model4 = packet.GetModel <Coop_Model_ObjectAttackedHitFix>();
            model4.CopyAttackedHitStatus(out AttackedHitStatusFix status);
            owner.OnAttackedHitFix(status);
            break;
        }

        case PACKET_TYPE.OBJECT_KEEP_WAITING_PACKET:
        {
            Coop_Model_ObjectKeepWaitingPacket model3 = packet.GetModel <Coop_Model_ObjectKeepWaitingPacket>();
            owner.KeepWaitingPacket((StageObject.WAITING_PACKET)model3.type);
            break;
        }

        case PACKET_TYPE.OBJECT_BULLET_OBSERVABLE_SET:
        {
            Coop_Model_ObjectBulletObservableSet model2 = packet.GetModel <Coop_Model_ObjectBulletObservableSet>();
            owner.RegisterObservableID(model2.observedID);
            break;
        }

        case PACKET_TYPE.OBJECT_BULLET_OBSERVABLE_BROKEN:
        {
            Coop_Model_ObjectBulletObservableBroken model = packet.GetModel <Coop_Model_ObjectBulletObservableBroken>();
            owner.OnBreak(model.observedID);
            break;
        }

        default:
            Log.Warning(LOG.COOP, "not valid packet");
            return(true);
        }
        return(true);
    }