Exemplo n.º 1
0
 public virtual void Init(IClientNetworking client, int entityId)
 {
     Client   = client;
     EntityId = entityId;
     // TODO: Managers?
     client.AddListener <EntityDestroyPacket>(entityId, OnEntityDestroyPacket);
 }
Exemplo n.º 2
0
    public override void Init(IClientNetworking client, int entityId)
    {
        base.Init(client, entityId);

        client.AddListener <WorldEntityPacket>(entityId, OnWorldEntityPacket);
        client.OnTick += OnTick;
        positionalTracker.Set(transform.position, transform.rotation);
    }
Exemplo n.º 3
0
    public ProxyManager(IClientNetworking client, WorldEntityManager worldEntityManager)
    {
        this.client             = client;
        this.worldEntityManager = worldEntityManager;

        clientSettings = Resources.Load <ClientSettings>("ClientSettings");

        client.AddListener <PlayerFullPacket>(OnPlayerFullPacket);
    }
Exemplo n.º 4
0
    public override void Init(IClientNetworking client, int entityId)
    {
        base.Init(client, entityId);

        movementController = GetComponent <ProxyNetworkPlayerMovementController>();

        moves = new Queue <MovementUpdate>(4);
        //This helps kick us off at the start, the update relies on having at least 2 movement updates (to calculate the time between them).
        moves.Enqueue(new MovementUpdate(transform.position, transform.rotation, DateTime.UtcNow.ToUnixMilliseconds()));
        moves.Enqueue(new MovementUpdate(transform.position, transform.rotation, DateTime.UtcNow.ToUnixMilliseconds()));

        AdvanceToNextMove();

        client.AddListener <WorldEntityPacket>(entityId, OnWorldEntityPacket);
    }
Exemplo n.º 5
0
 public WorldEntityManager(IClientNetworking client)
 {
     this.client   = client;
     worldEntities = new Dictionary <int, ClientWorldEntity>();
     client.AddListener <EntityDestroyPacket>(OnEntityDestroy);
 }
Exemplo n.º 6
0
 public override void Init(IClientNetworking client, int entityId)
 {
     base.Init(client, entityId);
     client.AddListener <NPC_BlackBoard>(entityId, ReceiveBBPacket);
     client.AddListener <NPC_BTState>(entityId, ReceiveBTPacket);
 }
Exemplo n.º 7
0
 public ClientNPCManager(IClientNetworking client, WorldEntityManager worldEntityManager)
 {
     this.client             = client;
     this.worldEntityManager = worldEntityManager;
     client.AddListener <NPCFullPacket>(OnNPCFullPacket);
 }