blob: 1b8052c6db459b28801f97121d4c1185b4b6479b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
package NET.worlds.scape;
import NET.worlds.core.IniFile;
import NET.worlds.network.URL;
import java.util.Enumeration;
import java.util.Vector;
class DroneLoader {
private int MaxDroneLoadingRate = 2000;
static final boolean debug = false;
DroneLoader() {
int numAvs = IniFile.gamma().getIniInt("avatars", 24);
int droneRate = IniFile.gamma().getIniInt("droneLoadRate", 8000);
this.MaxDroneLoadingRate = droneRate / numAvs;
}
public synchronized void load(Vector droneList) {
try {
if (droneList.size() > 0) {
Vector listCopy = (Vector)droneList.clone();
Enumeration enums = listCopy.elements();
while (enums.hasMoreElements()) {
PendingDrone pd = (PendingDrone)enums.nextElement();
if (pd.getDrone().discarded) {
droneList.removeElement(pd);
} else {
loadDrone(pd);
droneList.removeElement(pd);
}
}
}
this.wait();
} catch (InterruptedException var5) {
}
}
public synchronized void wakeUp() {
this.notify();
}
private static void loadDrone(PendingDrone pd) {
if (!pd.getLoaded()) {
Enumeration e = PosableShape.getComponentAvatars(pd.getUrl());
if (e != null) {
while (e.hasMoreElements()) {
String avURL = (String)e.nextElement();
pd.download(URL.make(avURL));
}
}
PosableShape ps;
if (VehicleShape.isVehicle(pd.getUrl())) {
ps = new VehicleShape();
} else {
ps = new PosableShape();
}
boolean prog = ProgressiveAdder.get().enabled();
if (prog) {
ProgressiveAdder.get().scheduleForAdd(pd.getDrone(), ps);
}
ps.setURL(pd.getUrl());
ps.setVisible(true);
ps.setBumpable(false);
if (!pd.getDrone().isPilotDrone(pd.getUrl())) {
ps.enableLOD(true);
}
if (!prog) {
pd.getDrone().SetPendingShape(ps);
}
pd.setLoaded();
}
}
}
|