Sim-eth-basic on android


#10

Afaik, JME RMI layer is not the same Java RMI.


#11

the client log is hard to read… https://imgur.com/ZkaNqqB

The error is deserializing object -48 which the client didn’t get ( or shouldn’t get )

ps need to charge my phone again after all this testing :blush:


#13

HINT: GameLoop

/**
     *  Sets the period of time in milliseconds that the update loop will
     *  wait between time interval checks.  This defaults to 0 because on
     *  Windows the default 60 FPS update rate will cause frame drops for
     *  a idle sleep time of 1 or more.  However, 0 causes the loop to consume
     *  a noticable amount of CPU.  For lower framerates, 1 is recommended
     *  and will be set automically based on the current frame rate interval
     *  if null is specified.
     */
    public final void setIdleSleepTime( Long millis ) {
        if( millis == null ) {
            // Configure a reasonable default
            if( updateRate > FPS_60 ) {
                // Can probably get away with more sleep
                this.idleSleepTime = 1;
            } else {
                // Else on Windows, sleep > 0 will take almost as long as
                // a frame
                this.idleSleepTime = 0;
            }
        } else {
            this.idleSleepTime = millis;
        }
}

#14

I don’t see this error message in the log you provided.


#15

after android “join game” it appears… i haven’t tracked down the source of it.
Imgur


#16

thank you kaloyan, maybe its timing related…


#17

Lemur popup does not display the full stack trace,
It comes from this line.

Full stack trace should be logged somewhere in android device.
If you can not find it, an easy way is to add this after line 293:

throw new RuntimeException(t);


#18

I edited your post to make the log more readable.


#19

At quick glance, I’m not sure what is happening. -48 seems not to be registered to anything… but then it’s still strange that it’s specifically sent.

Are you registering classes after the server has been started or after the client connects?

By the way, I’m more interested in that list on the server… though the client one is useful too as it turns out.


#20

thank you all! all most 4 am here… will pickup soon


#21

Also there is this problem… Happens more on Linux than Windows on my experience. Android is basically Linux so… You could try adding a delay, see SimEthereal Questions


#22

ran the server with a windows client success and android client fail and compared the logs. In the Server Debugger, I’m not get passed the setClient(client) callable for the Android client.

Imgur

@pspeed

I don’t think i’m registering classes after the server has been started… however I’ve seen the number(ing) of the classes vary…

The win server side logs… with the delay code from tonihele in Gameserver ( thank you)
(sorry… if this didn’t format… not sure howto yet )

20:31:36,967 INFO  [GameServer] Initializing game systems...
20:31:36,968 INFO  [GameServer] Starting game server...
20:31:37,204 DEBUG [SelectorKernel] Hosting TCP connection:0.0.0.0/0.0.0.0:4000.
20:31:37,205 DEBUG [SelectorKernel] Kernel started for connection:0.0.0.0/0.0.0.0:4000.
20:31:37,210 DEBUG [UdpKernel] Hosting UDP connection:0.0.0.0/0.0.0.0:4000.
20:31:37,210 DEBUG [UdpKernel] Kernel started for connection:0.0.0.0/0.0.0.0:4000.
20:31:37,211 DEBUG [SelectorKernel] Hosting TCP connection:0.0.0.0/0.0.0.0:4001.
20:31:37,212 DEBUG [ServiceManager] Starting service:com.jme3.network.service.serializer.ServerSerializerRegistrationsService[serviceManager.class=class com.jme3.network.service.HostedServiceManager]
20:31:37,212 DEBUG [SelectorKernel] Kernel started for connection:0.0.0.0/0.0.0.0:4001.
20:31:37,213 DEBUG [SerializerRegistrationsMessage] Number of registered classes:14
20:31:37,213 DEBUG [SerializerRegistrationsMessage]     Registration[-19 = com.jme3.math.Vector3f, serializer=com.jme3.network.serializing.serializers.Vector3Serializer]
20:31:37,213 DEBUG [SerializerRegistrationsMessage]     Registration[-41 = com.jme3.network.serializing.serializers.FieldSerializer, serializer=null]
20:31:37,213 DEBUG [SerializerRegistrationsMessage]     Registration[-43 = [I, serializer=com.jme3.network.serializing.serializers.ArraySerializer]
20:31:37,213 DEBUG [SerializerRegistrationsMessage]     Registration[-46 = [Lcom.jme3.network.message.SerializerRegistrationsMessage$Registration;, serializer=com.jme3.network.serializing.serializers.ArraySerializer]
20:31:37,213 DEBUG [SerializerRegistrationsMessage]     Registration[-49 = [Ljava.lang.Object;, serializer=com.jme3.network.serializing.serializers.ArraySerializer]
20:31:37,213 DEBUG [SerializerRegistrationsMessage]     Registration[-48 = com.jme3.network.service.rpc.msg.RpcCallMessage, serializer=null]
20:31:37,213 DEBUG [SerializerRegistrationsMessage]     Registration[-50 = com.jme3.network.service.rpc.msg.RpcResponseMessage, serializer=null]
20:31:37,214 DEBUG [SerializerRegistrationsMessage]     Registration[-51 = com.jme3.network.service.rmi.ClassInfo, serializer=null]
20:31:37,214 DEBUG [SerializerRegistrationsMessage]     Registration[-52 = com.jme3.network.service.rmi.MethodInfo, serializer=null]
20:31:37,214 DEBUG [SerializerRegistrationsMessage]     Registration[-53 = com.jme3.math.Quaternion, serializer=null]
20:31:37,214 DEBUG [SerializerRegistrationsMessage]     Registration[-54 = com.simsilica.ethereal.net.ClientStateMessage, serializer=null]
20:31:37,214 DEBUG [SerializerRegistrationsMessage]     Registration[-56 = [B, serializer=com.jme3.network.serializing.serializers.ArraySerializer]
20:31:37,214 DEBUG [SerializerRegistrationsMessage]     Registration[-55 = com.simsilica.ethereal.net.ObjectStateMessage, serializer=null]
20:31:37,214 DEBUG [SerializerRegistrationsMessage]     Registration[-57 = com.simsilica.mathd.Vec3d, serializer=null]
20:31:37,214 DEBUG [ServiceManager] Starting service:example.net.server.GameServer$DelayService[serviceManager.class=class com.jme3.network.service.HostedServiceManager]
DelayService.start()
DelayService.delay done
20:31:42,214 DEBUG [ServiceManager] Starting service:com.jme3.network.service.rpc.RpcHostedService[serviceManager.class=class com.jme3.network.service.HostedServiceManager]
20:31:42,214 DEBUG [ServiceManager] Starting service:com.jme3.network.service.rmi.RmiHostedService[serviceManager.class=class com.jme3.network.service.HostedServiceManager]
20:31:42,214 DEBUG [ServiceManager] Starting service:example.net.server.AccountHostedService[serviceManager.class=class com.jme3.network.service.HostedServiceManager]
20:31:42,214 DEBUG [ServiceManager] Starting service:example.net.server.GameSessionHostedService[serviceManager.class=class com.jme3.network.service.HostedServiceManager]
20:31:42,214 DEBUG [ServiceManager] Starting service:example.net.chat.server.ChatHostedService[serviceManager.class=class com.jme3.network.service.HostedServiceManager]
20:31:42,214 DEBUG [ServiceManager] Starting service:com.simsilica.ethereal.EtherealHost[serviceManager.class=class com.jme3.network.service.HostedServiceManager]
20:31:42,215 INFO  [StateCollector] Starting state collector.
20:31:42,215 INFO  [GameServer] Game server started.

#23

#24

Hmmm… that shouldn’t be the case. If you are always registering the classes the same then there should be consistent ordering/numbering.


#25

Seems to be related:


#26

Ugh, I dont read android posts so sorry I missed this.


#27

thanks Ali_RS

The masked exception ( class ID:-48 error ) in the client is:
attempt to unlock read lock, not locked by current thread

In my case/testing, I don’t think the delayservice in GameServer.java for:
serialization object , class ID:-48 exception is a solution.

D/com.jme3.network.serializing.Serializer: FINE Registered class[-57]:class com.simsilica.mathd.Vec3d to:com.jme3.network.serializing.serializers.FieldSerializer@cf43e0d
D/com.jme3.network.message.SerializerRegistrationsMessage: FINE    result:SerializerRegistration[-57, class com.simsilica.mathd.Vec3d, com.jme3.network.serializing.serializers.FieldSerializer@cf43e0d]
D/com.jme3.network.message.SerializerRegistrationsMessage: FINE Done registering serializable classes.

D/com.jme3.network.serializing.serializers.FieldSerializer: FINER Reading field:private java.lang.Object[] com.jme3.network.service.rpc.msg.RpcCallMessage.args using serializer:com.jme3.network.serializing.serializers.ArraySerializer@a7e080e
                                                            FINER Reading field:private com.jme3.network.service.rmi.MethodInfo[] com.jme3.network.service.rmi.ClassInfo.methods using serializer:com.jme3.network.serializing.serializers.ArraySerializer@a7e080e
D/com.jme3.network.serializing.serializers.FieldSerializer: FINER Reading field:private com.jme3.network.service.rmi.CallType com.jme3.network.service.rmi.MethodInfo.callType using serializer:com.jme3.network.serializing.serializers.EnumSerializer@9e733dc
                                                            FINER Reading field:private short com.jme3.network.service.rmi.MethodInfo.id using serializer:com.jme3.network.serializing.serializers.ShortSerializer@1b9bc8f
D/com.jme3.network.serializing.serializers.FieldSerializer: FINER Reading field:private java.lang.String com.jme3.network.service.rmi.MethodInfo.representation using serializer:com.jme3.network.serializing.serializers.StringSerializer@2847838
                                                            FINER Reading field:private com.jme3.network.service.rmi.CallType com.jme3.network.service.rmi.MethodInfo.callType using serializer:com.jme3.network.serializing.serializers.EnumSerializer@9e733dc
                                                            FINER Reading field:private short com.jme3.network.service.rmi.MethodInfo.id using serializer:com.jme3.network.serializing.serializers.ShortSerializer@1b9bc8f
                                                            FINER Reading field:private java.lang.String com.jme3.network.service.rmi.MethodInfo.representation using serializer:com.jme3.network.serializing.serializers.StringSerializer@2847838
D/com.jme3.network.serializing.serializers.FieldSerializer: FINER Reading field:private java.lang.String com.jme3.network.service.rmi.ClassInfo.name using serializer:com.jme3.network.serializing.serializers.StringSerializer@2847838
                                                            FINER Reading field:private short com.jme3.network.service.rmi.ClassInfo.typeId using serializer:com.jme3.network.serializing.serializers.ShortSerializer@1b9bc8f
                                                            FINER Reading field:private byte com.jme3.network.service.rpc.msg.RpcCallMessage.channel using serializer:com.jme3.network.serializing.serializers.ByteSerializer@db5a969
                                                            FINER Reading field:private long com.jme3.network.service.rpc.msg.RpcCallMessage.msgId using serializer:com.jme3.network.serializing.serializers.LongSerializer@4f67325
                                                            FINER Reading field:private short com.jme3.network.service.rpc.msg.RpcCallMessage.objId using serializer:com.jme3.network.serializing.serializers.ShortSerializer@1b9bc8f
D/com.jme3.network.serializing.serializers.FieldSerializer: FINER Reading field:private short com.jme3.network.service.rpc.msg.RpcCallMessage.procId using serializer:com.jme3.network.serializing.serializers.ShortSerializer@1b9bc8f
D/com.jme3.network.base.DefaultClient: FINER com.jme3.network.base.DefaultClient@1091cf8 received:RpcCallMessage[#-1, channel=-2, async, objId=-1, procId=0, args.length=1]
D/com.jme3.opencl.OpenCLObjectManager: FINE no active natives
D/com.jme3.network.base.MessageListenerRegistry: FINER Delivering RpcCallMessage[#-1, channel=-2, async, objId=-1, procId=0, args.length=1] to:com.jme3.network.util.ObjectMessageDelegator@9e5e827
D/com.jme3.network.service.rpc.RpcConnection: FINEST handleMessage(RpcCallMessage[#-1, channel=-2, async, objId=-1, procId=0, args.length=1])
D/com.jme3.network.service.rmi.RmiRegistry: FINEST rmiUpdate(0, [ClassInfo[example.net.AccountSession]])
D/com.jme3.network.serializing.serializers.FieldSerializer: FINER Reading field:private java.lang.Object[] com.jme3.network.service.rpc.msg.RpcCallMessage.args using serializer:com.jme3.network.serializing.serializers.ArraySerializer@a7e080e
D/com.jme3.network.serializing.serializers.FieldSerializer: FINER Reading field:private byte com.jme3.network.service.rpc.msg.RpcCallMessage.channel using serializer:com.jme3.network.serializing.serializers.ByteSerializer@db5a969
D/com.jme3.network.serializing.serializers.FieldSerializer: FINER Reading field:private long com.jme3.network.service.rpc.msg.RpcCallMessage.msgId using serializer:com.jme3.network.serializing.serializers.LongSerializer@4f67325
D/com.jme3.network.serializing.serializers.FieldSerializer: FINER Reading field:private short com.jme3.network.service.rpc.msg.RpcCallMessage.objId using serializer:com.jme3.network.serializing.serializers.ShortSerializer@1b9bc8f
D/com.jme3.network.serializing.serializers.FieldSerializer: FINER Reading field:private short com.jme3.network.service.rpc.msg.RpcCallMessage.procId using serializer:com.jme3.network.serializing.serializers.ShortSerializer@1b9bc8f
D/com.jme3.opencl.OpenCLObjectManager: FINE no active natives
D/com.jme3.network.base.DefaultClient: FINER com.jme3.network.base.DefaultClient@1091cf8 received:RpcCallMessage[#-1, channel=-2, async, objId=-1, procId=1, args.length=4]
D/com.jme3.network.base.MessageListenerRegistry: FINER Delivering RpcCallMessage[#-1, channel=-2, async, objId=-1, procId=1, args.length=4] to:com.jme3.network.util.ObjectMessageDelegator@9e5e827
D/com.jme3.network.service.rpc.RpcConnection: FINEST handleMessage(RpcCallMessage[#-1, channel=-2, async, objId=-1, procId=1, args.length=4])
D/com.jme3.network.service.rmi.RmiRegistry: FINEST rmiUpdate(1, [-2, 1, example.net.AccountSession, 0])
D/com.jme3.network.service.rmi.RmiRegistry: FINEST addRemoveObject(1, example.net.AccountSession, ClassInfo[example.net.AccountSession])
D/com.jme3.opencl.OpenCLObjectManager: FINE no active natives
D/com.jme3.network.base.DefaultClient: FINER com.jme3.network.base.DefaultClient@1091cf8 received:com.jme3.network.message.ClientRegistrationMessage[id=-1, gameName=null, version=0]
D/com.jme3.network.base.DefaultClient: FINE Starting client services.
D/com.jme3.network.service.ServiceManager: FINE Starting service:com.jme3.network.service.serializer.ClientSerializerRegistrationsService[serviceManager.class=class com.jme3.network.service.ClientServiceManager]
D/com.jme3.network.service.ServiceManager: FINE Starting service:com.jme3.network.service.rpc.RpcClientService[serviceManager.class=class com.jme3.network.service.ClientServiceManager]
D/com.jme3.network.service.ServiceManager: FINE Starting service:com.jme3.network.service.rmi.RmiClientService[serviceManager.class=class com.jme3.network.service.ClientServiceManager]
D/com.jme3.opencl.OpenCLObjectManager: FINE no active natives
E/AndroidRuntime: FATAL EXCEPTION: com.jme3.network.kernel.tcp.SocketConnector@8a0b5e
                  Process: example.sim, PID: 14065
                  java.lang.RuntimeException: java.lang.IllegalMonitorStateException: attempt to unlock read lock, not locked by current thread
                      at example.ConnectionState$ConnectionObserver.handleError(ConnectionState.java:297)
                      at example.ConnectionState$ConnectionObserver.handleError(ConnectionState.java:273)
                      at com.jme3.network.base.DefaultClient.handleError(DefaultClient.java:425)
                      at com.jme3.network.base.DefaultClient$Redispatch.handleError(DefaultClient.java:517)
                      at com.jme3.network.base.ConnectorAdapter.handleError(ConnectorAdapter.java:149)
                      at com.jme3.network.base.ConnectorAdapter.run(ConnectorAdapter.java:178)
                   Caused by: java.lang.IllegalMonitorStateException: attempt to unlock read lock, not locked by current thread
                      at java.util.concurrent.locks.ReentrantReadWriteLock$Sync.unmatchedUnlockException(ReentrantReadWriteLock.java:446)
                      at java.util.concurrent.locks.ReentrantReadWriteLock$Sync.tryReleaseShared(ReentrantReadWriteLock.java:430)
                      at java.util.concurrent.locks.AbstractQueuedSynchronizer.releaseShared(AbstractQueuedSynchronizer.java:1365)
                      at java.util.concurrent.locks.ReentrantReadWriteLock$ReadLock.unlock(ReentrantReadWriteLock.java:888)
                      at com.jme3.network.service.rmi.ClassInfoRegistry.getClassInfo(ClassInfoRegistry.java:92)
                      at com.jme3.network.service.rmi.RmiRegistry.share(RmiRegistry.java:131)
                      at com.jme3.network.service.rmi.RmiClientService.start(RmiClientService.java:169)
                      at com.jme3.network.service.ServiceManager.start(ServiceManager.java:86)
                      at com.jme3.network.base.DefaultClient.startServices(DefaultClient.java:397)
                      at com.jme3.network.base.DefaultClient.dispatch(DefaultClient.java:472)
                      at com.jme3.network.base.DefaultClient$Redispatch.messageReceived(DefaultClient.java:508)
                      at com.jme3.network.base.ConnectorAdapter.dispatch(ConnectorAdapter.java:132)
                      at com.jme3.network.base.ConnectorAdapter.run(ConnectorAdapter.java:174)

#28

Because you tried it and it didn’t work… or you just don’t expect it to work?


#29

yes, i tried… pasted the code in from previous post before the commit.
Compared the commit to what i tested… same same. You can see a delay in the server log


#30

they don’t vary… my bad