mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-07-30 00:15:57 -04:00
Merge branch 'master' of https://github.com/ProjectSWGCore/NGECore2
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
******************************************************************************/
|
||||
package services.object;
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.nio.ByteOrder;
|
||||
import java.sql.PreparedStatement;
|
||||
@@ -220,7 +221,7 @@ public class ObjectService implements INetworkDispatch {
|
||||
object.setAttachment("serverTemplate", ((customServerTemplate != null) ? customServerTemplate : object.getTemplate()));
|
||||
|
||||
object.setisInSnapshot(isSnapshot);
|
||||
loadServerTemplate(object);
|
||||
//loadServerTemplate(object);
|
||||
|
||||
objectList.put(objectID, object);
|
||||
|
||||
@@ -277,10 +278,12 @@ public class ObjectService implements INetworkDispatch {
|
||||
}
|
||||
}
|
||||
|
||||
} catch (FileNotFoundException e) {
|
||||
System.out.println("!File Not Found:" + template.toString());
|
||||
} catch (IOException e) {
|
||||
System.out.println("!IO error " + template.toString());
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public SWGObject createObject(String Template, Planet planet) {
|
||||
@@ -352,18 +355,6 @@ public class ObjectService implements INetworkDispatch {
|
||||
}
|
||||
}
|
||||
|
||||
if (object instanceof CreatureObject) {
|
||||
if (core.factionService.getFactionMap().containsKey(((CreatureObject) object).getFaction())) {
|
||||
if (FileUtilities.doesFileExist(filePath)) {
|
||||
PyObject method = core.scriptService.getMethod("scripts/" + object.getTemplate().split("shared_" , 2)[0].replace("shared_", ""), object.getTemplate().split("shared_" , 2)[1].replace(".iff", ""), "destroy");
|
||||
|
||||
if (method != null && method.isCallable()) {
|
||||
method.__call__(Py.java2py(core), Py.java2py(((TangibleObject) object).getKiller()), Py.java2py(object));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (object == null) {
|
||||
return;
|
||||
}
|
||||
@@ -457,10 +448,16 @@ public class ObjectService implements INetworkDispatch {
|
||||
String filePath = "scripts/" + object.getTemplate().split("shared_" , 2)[0].replace("shared_", "") + object.getTemplate().split("shared_" , 2)[1].replace(".iff", "") + ".py";
|
||||
|
||||
if (FileUtilities.doesFileExist(filePath)) {
|
||||
PyObject method = core.scriptService.getMethod("scripts/" + object.getTemplate().split("shared_" , 2)[0].replace("shared_", ""), object.getTemplate().split("shared_" , 2)[1].replace(".iff", ""), "useObject");
|
||||
filePath = "scripts/" + object.getTemplate().split("shared_" , 2)[0].replace("shared_", "");
|
||||
String fileName = object.getTemplate().split("shared_" , 2)[1].replace(".iff", "");
|
||||
|
||||
if (method != null && method.isCallable()) {
|
||||
method.__call__(Py.java2py(core), Py.java2py(creature), Py.java2py(object));
|
||||
PyObject method1 = core.scriptService.getMethod("scripts/" + object.getTemplate().split("shared_" , 2)[0].replace("shared_", ""), object.getTemplate().split("shared_" , 2)[1].replace(".iff", ""), "use");
|
||||
PyObject method2 = core.scriptService.getMethod("scripts/" + object.getTemplate().split("shared_" , 2)[0].replace("shared_", ""), object.getTemplate().split("shared_" , 2)[1].replace(".iff", ""), "useObject");
|
||||
|
||||
if (method1 != null && method1.isCallable()) {
|
||||
method1.__call__(Py.java2py(core), Py.java2py(creature), Py.java2py(object));
|
||||
} else if (method2 != null && method2.isCallable()) {
|
||||
method2.__call__(Py.java2py(core), Py.java2py(creature), Py.java2py(object));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user