Exemplo n.º 1
0
        public Player()
        {
            position = 3;
            health = 4;

            replica = new ReplicaMember(this);

            if (Program.isServer)
                Program.replicaManager.Construct(replica, false, RakNetBindings.UNASSIGNED_SYSTEM_ADDRESS, true);

            if (Program.isServer)
            {
                Program.replicaManager.DisableReplicaInterfaces(replica, RakNetBindings.REPLICA_RECEIVE_DESTRUCTION | RakNetBindings.REPLICA_RECEIVE_SCOPE_CHANGE);
            }
            else
            {
                Program.replicaManager.DisableReplicaInterfaces(replica, RakNetBindings.REPLICA_SEND_CONSTRUCTION | RakNetBindings.REPLICA_SEND_DESTRUCTION | RakNetBindings.REPLICA_SEND_SCOPE_CHANGE);
            }
        }
Exemplo n.º 2
0
        public Monster()
        {
            position = 1;
            health = 2;

            replica = new ReplicaMember();
            // You must set a listener. By a method of to set constructor or to use parent member.
            replica.Parent = this;

            if (Program.isServer)
                Program.replicaManager.Construct(replica, false, RakNetBindings.UNASSIGNED_SYSTEM_ADDRESS, true);

            if (Program.isServer)
            {
                Program.replicaManager.DisableReplicaInterfaces(replica, RakNetBindings.REPLICA_RECEIVE_DESTRUCTION | RakNetBindings.REPLICA_RECEIVE_SCOPE_CHANGE);
            }
            else
            {
                Program.replicaManager.DisableReplicaInterfaces(replica, RakNetBindings.REPLICA_SEND_CONSTRUCTION | RakNetBindings.REPLICA_SEND_DESTRUCTION | RakNetBindings.REPLICA_SEND_SCOPE_CHANGE);
            }
        }