You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have next trouble. If I use MessageBufferProtocol on Jet Server and on flash client then all fine, I can send and receive message in both ways.
But if I try use the AMF3 protocol on flash client:
in SessionFactory.as:
public function createAndConnectSession():Session {
var session:Session = createSession();
connectSession(session, new AMF3Protocol(), new LoginInOutCodecs());
return session;
}
and on jet server in ZombieSpringConfig.java: @Autowired @qualifier("amf3Protocol")
private Protocol messageBufferProtocol;
in debug mode I get next exception on flash client on incoming message in Main.as:
private function traceData(event:Event):void{
var jetEvent:JetEvent = event as JetEvent;
var messageBuffer:MessageBuffer = jetEvent.getSource() as MessageBuffer;
var buffer:ByteArray = messageBuffer.getBuffer();
trace("Remaining Human Population: " + buffer.readInt());
[Fault] exception, information=TypeError: Error #1009: messageBuffer is null here.
jetEventType = 28 [0x1c], source = Object ( @ 4e92fb9 ), timestamp = 1356590891591 [0x13bdb1e4247] , but messageBuffer is null after jetEvent.getSource() as MessageBuffer operation, and I not can read received buffer.
How to solve this trouble?
The text was updated successfully, but these errors were encountered:
Definitely there seems to be an initialization bug. In the AMF3Protocol class, I do not see the serializer and deserializer being initialized. They are null. There maybe other issues also. I will test this out and let you know.
The code you have pasted will not work as is. The reason is that, for the Zombie game, only integers are passed between client and server, to select defender/eat brains commad etc.
General usecase for the AMF3 protocol is when you need to pass a whole object between client and server-> Take a look at AMF3ProtocolTest class. It shows how a full object of type PlayerStats is encoded and decoded. You need to have similar class in your flash client and java server, only then you can pass them in between.
Hello, menacher.
Thank you for your jet server.
I have next trouble. If I use MessageBufferProtocol on Jet Server and on flash client then all fine, I can send and receive message in both ways.
But if I try use the AMF3 protocol on flash client:
in SessionFactory.as:
public function createAndConnectSession():Session {
var session:Session = createSession();
connectSession(session, new AMF3Protocol(), new LoginInOutCodecs());
return session;
}
and on jet server in ZombieSpringConfig.java:
@Autowired
@qualifier("amf3Protocol")
private Protocol messageBufferProtocol;
in debug mode I get next exception on flash client on incoming message in Main.as:
private function traceData(event:Event):void{
var jetEvent:JetEvent = event as JetEvent;
var messageBuffer:MessageBuffer = jetEvent.getSource() as MessageBuffer;
var buffer:ByteArray = messageBuffer.getBuffer();
trace("Remaining Human Population: " + buffer.readInt());
[Fault] exception, information=TypeError: Error #1009: messageBuffer is null here.
jetEventType = 28 [0x1c], source = Object ( @ 4e92fb9 ), timestamp = 1356590891591 [0x13bdb1e4247] , but messageBuffer is null after jetEvent.getSource() as MessageBuffer operation, and I not can read received buffer.
How to solve this trouble?
The text was updated successfully, but these errors were encountered: