I have read Mike Parks stickied post re: using the same ES version for client and server. I am using Electroserver v4.0.6 on both client and server, the server is running in a Linux environment and I am using the Actionscript 2 API on the client.
My problem arises when I attempt to send a pluginRequest from the client. Code snippet below:
public function sendMessage(plugin:String, command:String, parameters:Array, ignored:String):Void {
var values:EsObject = new EsObject();
values.setString("cmd", command);
values.setInteger("len", parameters.length);
trace("the esObject: " + values.toString());
var request:PluginRequest = new PluginRequest();
request.setPluginName("game");
request.setEsObject(values);
_es.send(request);
Here is the debug output on the client:
-- the esObject: {EsObject:
cmd:string = game
len:integer = 1
0:string = 23
}
-- [INFO] --> Sending :: conId: 0
-- [INFO] PluginRequest: C 1 3game0113113cmd13test013len111110undefinedundefine d23
-- [INFO] <-- Receiving :: conId: 0
-- [INFO] GenericErrorResponse
-- [INFO] Error occurred
-- [INFO] PluginRequest
-- [INFO] GenericError
-- [INFO] --connection closed-- id: 0
Here is the server stack trace:
11:24:29,159 [AnonymousIoService-11] WARN com.electrotank.electroserver4.servers.gateway.Cli entIoHandler - ClientIoHandler.exceptionCaught
java.lang.RuntimeException: Requested string is longer than available data
at com.electrotank.electroserver4.protocol.text.Messa geStringReader._nextString(MessageStringReader.jav a:230)
at com.electrotank.electroserver4.protocol.text.Messa geStringReader.nextInteger(MessageStringReader.jav a:44)
at com.electrotank.electroserver4.protocol.text.Messa geStringReader.nextPrefixedString(MessageStringRea der.java:36)
at com.electrotank.electroserver4.protocol.text.Messa geStringReader.nextString(MessageStringReader.java :40)
at com.electrotank.electroserver4.protocol.codecs.sha red.EsObjectCodec.decode(EsObjectCodec.java:177)
at com.electrotank.electroserver4.protocol.codecs.sha red.ClientInvokePluginRequestCodec.decode(ClientIn vokePluginRequestCodec.java:49)
at com.electrotank.electroserver4.protocol.codecs.ext ernal.PrefixingMessageCodecDecorator.decode(Prefix ingMessageCodecDecorator.java:56)
at com.electrotank.electroserver4.protocol.ProtocolFi lter.messageReceived(ProtocolFilter.java:119)
at org.apache.mina.common.support.AbstractIoFilterCha in.callNextMessageReceived(AbstractIoFilterChain.j ava:299)
at org.apache.mina.common.support.AbstractIoFilterCha in.access$1100(AbstractIoFilterChain.java:53)
at org.apache.mina.common.support.AbstractIoFilterCha in$EntryImpl$1.messageReceived(AbstractIoFilterCha in.java:648)
at org.apache.mina.common.IoFilterAdapter.messageRece ived(IoFilterAdapter.java:80)
at org.apache.mina.common.support.AbstractIoFilterCha in.callNextMessageReceived(AbstractIoFilterChain.j ava:299)
at org.apache.mina.common.support.AbstractIoFilterCha in.access$1100(AbstractIoFilterChain.java:53)
at org.apache.mina.common.support.AbstractIoFilterCha in$EntryImpl$1.messageReceived(AbstractIoFilterCha in.java:648)
at org.apache.mina.filter.codec.support.SimpleProtoco lDecoderOutput.flush(SimpleProtocolDecoderOutput.j ava:58)
at org.apache.mina.filter.codec.ProtocolCodecFilter.m essageReceived(ProtocolCodecFilter.java:174)
at org.apache.mina.common.support.AbstractIoFilterCha in.callNextMessageReceived(AbstractIoFilterChain.j ava:299)
at org.apache.mina.common.support.AbstractIoFilterCha in.access$1100(AbstractIoFilterChain.java:53)
at org.apache.mina.common.support.AbstractIoFilterCha in$EntryImpl$1.messageReceived(AbstractIoFilterCha in.java:648)
at org.apache.mina.filter.executor.ExecutorFilter.pro cessEvent(ExecutorFilter.java:219)
at org.apache.mina.filter.executor.ExecutorFilter$Pro cessEventsRunnable.run(ExecutorFilter.java:263)
at java.util.concurrent.ThreadPoolExecutor$Worker.run Task(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (Unknown Source)
at org.apache.mina.util.NamePreservingRunnabl


Reply With Quote
