| Anyone seen this error with the faction plugin | |
|
|
Author | Message |
---|
Lou Experienced Newbie
Posts : 19 Join date : 2012-03-02 Location : Usa- east coast
| Subject: Anyone seen this error with the faction plugin Mon 26 Mar - 11:02 | |
| Hi, Trying to get the Faction plugin going and am getting an error with the entry in worldmessages.py ...
ERROR [2012-03-25 19:49:33,078] main ScriptManager.runPYFile: file=C:\loufiles\multiverse\config\Chronicles\worldmessages.py Traceback (innermost last): File "C:\loufiles\multiverse\config\Chronicles\worldmessages.py", line 31, in ? at multiverse.msgsys.MessageCatalog.addMsgTypeTranslation(MessageCatalog.java:137)
at multiverse.msgsys.MessageCatalog.addMsgTypeTranslation(MessageCatalog.java:123)
at multiverse.msgsys.MessageCatalog.addMsgTypeTranslation(MessageCatalog.java:114)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
java.lang.RuntimeException: java.lang.RuntimeException: MessageCatalog.addMsgTypeTranslation: a translation for msg type 'null' already exists in catalog 'worldMessageCatalog' Traceback (innermost last): File "C:\loufiles\multiverse\config\Chronicles\worldmessages.py", line 31, in ? at multiverse.msgsys.MessageCatalog.addMsgTypeTranslation(MessageCatalog.java:137)
at multiverse.msgsys.MessageCatalog.addMsgTypeTranslation(MessageCatalog.java:123)
at multiverse.msgsys.MessageCatalog.addMsgTypeTranslation(MessageCatalog.java:114)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
java.lang.RuntimeException: java.lang.RuntimeException: MessageCatalog.addMsgTypeTranslation: a translation for msg type 'null' already exists in catalog 'worldMessageCatalog'
at org.python.core.Py.JavaError(Unknown Source) at org.python.core.Py.JavaError(Unknown Source) at org.python.core.PyReflectedFunction.__call__(Unknown Source) at org.python.core.PyReflectedFunction.__call__(Unknown Source) at org.python.core.PyObject.__call__(Unknown Source) at org.python.core.PyObject.invoke(Unknown Source) at org.python.pycode._pyx2.f$0(C:\loufiles\multiverse\config\Chronicles\worldmessages.py:31) at org.python.pycode._pyx2.call_function(C:\loufiles\multiverse\config\Chronicles\worldmessages.py) at org.python.core.PyTableCode.call(Unknown Source) at org.python.core.PyCode.call(Unknown Source) at org.python.core.Py.runCode(Unknown Source) at multiverse.server.engine.ScriptManager.runPYFile(ScriptManager.java:181) at multiverse.server.engine.ScriptManager.runFile(ScriptManager.java:94) at multiverse.server.engine.Engine.processPreScripts(Engine.java:509) at multiverse.server.engine.Engine.main(Engine.java:331) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at multiverse.server.marshalling.Trampoline.main(Trampoline.java:150)
I have the definition in my FactionClient Class. I also have the code in my FactionPlugin class. Not sure what else I need to do. Any hints would be appreciated. Lou
| |
|
| |
Tristan Administrator
Posts : 306 Join date : 2011-08-03 Location : Liverpool, UK
| Subject: Re: Anyone seen this error with the faction plugin Mon 26 Mar - 13:59 | |
| Hi Lou, I personally won't be able to help you with this problem However, if you posted your worldmessages.py file, it would be helpful for those who can! Tristan | |
|
| |
Delurin Head of Platform Development
Posts : 424 Join date : 2011-08-03
| Subject: Re: Anyone seen this error with the faction plugin Tue 27 Mar - 8:25 | |
| It is possible that the plugin is not being loaded by the worldmessages.py but generally it would throw a different error...As Tristan said please post your worldmessages.py file so that we can see what it says on the referenced line. | |
|
| |
Lou Experienced Newbie
Posts : 19 Join date : 2012-03-02 Location : Usa- east coast
| Subject: Re: Anyone seen this error with the faction plugin Wed 28 Mar - 1:05 | |
| Hi, Here is my WorldMessages.py file. - Code:
-
from java.util import * from java.lang import * from multiverse.msgsys import * from Chronicles_FactionPlugin import * #FactionClient
# # This python file creates a world-specific message catalog, and # contains definitions for world-specific message types, if # your world makes use of them. Not all worlds actually # need to define their own message types, but if if your world does # need world-specific message types, they must be added to your # world-specific message catalog by listing them in this file #
# # Create the world message catalog. Multiverse reserves message numbers # from 1 through 500; the world-specific catalog defined below allocates # message type numbers from the range 501-1000. # worldMessageCatalog = MessageCatalog.addMsgCatalog("worldMessageCatalog", 501, 500);
# # Add your world-specific messages here. Each call to addMsgTypeTranslation # adds the message type which is the second argument to the world message # catalog. Each message type must be defined in YourWorldModule by a call # to MessageType.intern(message_type_string); # #MessageCatalog.addMsgTypeTranslation(worldMessageCatalog, YourWorldModule.MSG_TYPE_YOUR_MESSAGE_TYPE) MessageCatalog.addMsgTypeTranslation(worldMessageCatalog, FactionClient.MSG_TYPE_GET_FACTION_NAME) MessageCatalog.addMsgTypeTranslation(worldMessageCatalog, FactionClient.MSG_TYPE_NEW_FACTION)
| |
|
| |
Delurin Head of Platform Development
Posts : 424 Join date : 2011-08-03
| Subject: Re: Anyone seen this error with the faction plugin Wed 28 Mar - 1:33 | |
| I am guessing that in the FactionClient you defined - Code:
-
public static final MessageType MSG_TYPE_NEW_FACTION = MessageType.intern(null); or - Code:
-
public static final MessageType MSG_TYPE_NEW_FACTION; you need to set the MessageType to be a MessageType.intern(StringIdentifier) where you set the StringIdentifier to be some string. | |
|
| |
Lou Experienced Newbie
Posts : 19 Join date : 2012-03-02 Location : Usa- east coast
| Subject: Re: Anyone seen this error with the faction plugin Wed 28 Mar - 4:27 | |
| Hi, Thanks for looking. I have it defined as follows: - Code:
-
public static final MessageType MSG_TYPE_GET_FACTION_NAME = MessageType.intern("faction.MSG_TYPE_GET_FACTION_NAME"); public static final MessageType MSG_TYPE_NEW_FACTION = MessageType.intern("faction.MSG_TYPE_NEW_FACTION");
Then in faction-ads.txt in both common and my Chronicles folder I have it defined. | |
|
| |
Delurin Head of Platform Development
Posts : 424 Join date : 2011-08-03
| Subject: Re: Anyone seen this error with the faction plugin Wed 28 Mar - 5:03 | |
| That looks good, as does the python implementation. The only thing left that I can think of is that maybe your custom jar is not loading or it is not initializing your FactionPlugin/FactionClient to define that MessageType. Can you confirm your FactionPlugin is loading? If you followed the formula you should have a message in the logs with something like factionplugin.py: starting factionplugin.py: done if not wherever you register the plugin put - Code:
-
Log.debug("factionplugin.py: starting") classesPlugin = Engine.registerPlugin("Chronicles_FactionPlugin.FactionPlugin") Log.debug("factionplugin.py: done") and make sure the factionplugin.py: done is outputted. | |
|
| |
Lou Experienced Newbie
Posts : 19 Join date : 2012-03-02 Location : Usa- east coast
| Subject: Re: Anyone seen this error with the faction plugin Wed 28 Mar - 5:42 | |
| Ahhh Okay I see it is not loading, there is a problem in my FactionCLient class. - Code:
-
package Chronicles_FactionPlugin;
import multiverse.server.engine.*;
import multiverse.server.objects.*; import multiverse.server.network.MVByteBuffer; import multiverse.server.plugins.*; import multiverse.server.util.Log; import multiverse.mars.plugins.*; import multiverse.msgsys.*; import java.io.IOException; import java.util.*;
public class FactionClient { public static Namespace NAMESPACE = null; //this requires initializing Namespace in a common script file // or public static final Namespace NAMESPACE = Namespace.intern("NS.faction"); //This is working for me. public static final MessageType MSG_TYPE_GET_FACTION_NAME = MessageType.intern("faction.MSG_TYPE_GET_FACTION_NAME"); public static final MessageType MSG_TYPE_NEW_FACTION = MessageType.intern("faction.MSG_TYPE_NEW_FACTION");
public static String getFactionName(long mOid) { //Make sure it's a mob! //WorldManagerClient.ObjectInfo info; //info = WorldManagerClient.getObjectInfo(mOid);
//if (info.objType != ObjectTypes.player) //{ // return ""; //}
//Create request message
SubjectMessage m = new SubjectMessage(FactionClient.MSG_TYPE_GET_FACTION_NAME, mOid); return (String)Engine.getAgent().sendRPCReturnString(m); } public static void registerFaction(Faction f) { if (Log.loggingDebug) Log.debug("Registering faction " + f.getName()); registerFactionMessage message = new registerFactionMessage(f); Engine.getAgent().sendBroadcast(message); } public static class registerFactionMessage extends GenericMessage { public registerFactionMessage(Faction payload) { super(MSG_TYPE_NEW_FACTION); this.payload = payload;
}
public void setPayload(Faction payload) {this.payload = payload; }
public Faction getPayload() {return payload; }
private Faction payload; private static final long serialVersionUID = 1L;
} }
It does not like the registerFaction() Method. I see this error in my logs. for line 40 which points to the method. - Code:
-
java.lang.Error: java.lang.Error: Unresolved compilation problem:
Traceback (innermost last): File "C:\loufiles\multiverse\config\Chronicles\factionplugin.py", line 9, in ?
[b]at Chronicles_FactionPlugin.FactionClient.registerFaction(FactionClient.java:40) [/b] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
The Code compiles fine though, very weird. Do I need to break out the registerFactionMessage class into a seperate file, I thought the way the directions said it was to define it as a class within FactionClient, maybe that is not correct? Lou | |
|
| |
Delurin Head of Platform Development
Posts : 424 Join date : 2011-08-03
| Subject: Re: Anyone seen this error with the faction plugin Wed 28 Mar - 5:52 | |
| That code looks fine check your Faction code to see if there is an Error there | |
|
| |
Lou Experienced Newbie
Posts : 19 Join date : 2012-03-02 Location : Usa- east coast
| Subject: Re: Anyone seen this error with the faction plugin Fri 6 Apr - 4:05 | |
| I have abandoned this for the time being. Working in Eclipse kept generating more errors and I ended up breaking more of the code. | |
|
| |
Sponsored content
| Subject: Re: Anyone seen this error with the faction plugin | |
| |
|
| |
| Anyone seen this error with the faction plugin | |
|