BUG login by error user name bug in android client sfs2x

Post here your questions about the Java client / Android API for SFS2X

Moderators: Lapo, Bax

maomao
Posts: 18
Joined: 08 Nov 2011, 04:48

BUG login by error user name bug in android client sfs2x

Postby maomao » 05 Dec 2011, 02:50

by my test i found this:
1.
android client :

Code: Select all

service.getSfsClient().send(new LoginRequest(userNameStr,userPasStr,getResources().getString(R.string.zoneName)))


exception :

Code: Select all

11-10 05:07:55.694: W/s*.c*.c*.SystemControl*(8831): Error in handling event: java.util.MissingFormatArgumentException: Format specifier: s
11-10 05:07:55.694: W/System.err(8831): java.util.MissingFormatArgumentException: Format specifier: s
11-10 05:07:55.704: W/System.err(8831):    at java.util.Formatter.getArgument(Formatter.java:1131)
11-10 05:07:55.704: W/System.err(8831):    at java.util.Formatter.doFormat(Formatter.java:1096)
11-10 05:07:55.704: W/System.err(8831):    at java.util.Formatter.format(Formatter.java:1062)
11-10 05:07:55.714: W/System.err(8831):    at java.util.Formatter.format(Formatter.java:1031)
11-10 05:07:55.714: W/System.err(8831):    at java.lang.String.format(String.java:2177)
11-10 05:07:55.714: W/System.err(8831):    at java.lang.String.format(String.java:2151)
11-10 05:07:55.714: W/System.err(8831):    at sfs2x.client.util.SFSErrorCodes.getErrorMessage(SFSErrorCodes.java:63)
11-10 05:07:55.714: W/System.err(8831):    at sfs2x.client.controllers.system.ResLogin.handleResponse(ResLogin.java:60)
11-10 05:07:55.714: W/System.err(8831):    at sfs2x.client.controllers.SystemController.handleMessage(SystemController.java:104)
11-10 05:07:55.724: W/System.err(8831):    at sfs2x.client.core.SFSProtocolCodec.dispatchRequest(SFSProtocolCodec.java:144)
11-10 05:07:55.724: W/System.err(8831):    at sfs2x.client.core.SFSProtocolCodec.onPacketRead(SFSProtocolCodec.java:50)
11-10 05:07:55.724: W/System.err(8831):    at sfs2x.client.core.SFSIOHandler.handlePacketData(SFSIOHandler.java:283)
11-10 05:07:55.724: W/System.err(8831):    at sfs2x.client.core.SFSIOHandler.onDataRead(SFSIOHandler.java:132)
11-10 05:07:55.724: W/System.err(8831):    at sfs2x.client.bitswarm.BitSwarmClient.onSocketData(BitSwarmClient.java:364)
11-10 05:07:55.724: W/System.err(8831):    at sfs2x.client.bitswarm.BitSwarmClient.access$2(BitSwarmClient.java:358)
11-10 05:07:55.724: W/System.err(8831):    at sfs2x.client.bitswarm.BitSwarmClient$3.dispatch(BitSwarmClient.java:105)
11-10 05:07:55.734: W/System.err(8831):    at sfs2x.client.core.EventDispatcher.dispatchEvent(EventDispatcher.java:52)
11-10 05:07:55.734: W/System.err(8831):    at sfs2x.client.core.sockets.TCPSocketLayer.callOnData(TCPSocketLayer.java:146)
11-10 05:07:55.734: W/System.err(8831):    at sfs2x.client.core.sockets.TCPSocketLayer.handleBinaryData(TCPSocketLayer.java:140)
11-10 05:07:55.734: W/System.err(8831):    at sfs2x.client.core.sockets.TCPSocketLayer.access$6(TCPSocketLayer.java:139)
11-10 05:07:55.734: W/System.err(8831):    at sfs2x.client.core.sockets.TCPSocketLayer$NettyIOHandler.messageReceived(TCPSocketLayer.java:269)
11-10 05:07:55.734: W/System.err(8831):    at org.jboss.netty.channel.SimpleChannelHandler.handleUpstream(SimpleChannelHandler.java:100)
11-10 05:07:55.734: W/System.err(8831):    at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:545)
11-10 05:07:55.744: W/System.err(8831):    at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:540)
11-10 05:07:55.744: W/System.err(8831):    at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:274)
11-10 05:07:55.744: W/System.err(8831):    at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:261)
11-10 05:07:55.744: W/System.err(8831):    at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:350)
11-10 05:07:55.744: W/System.err(8831):    at org.jboss.netty.channel.socket.nio.NioWorker.processSelectedKeys(NioWorker.java:281)
11-10 05:07:55.744: W/System.err(8831):    at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:201)
11-10 05:07:55.754: W/System.err(8831):    at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
11-10 05:07:55.754: W/System.err(8831):    at org.jboss.netty.util.internal.IoWorkerRunnable.run(IoWorkerRunnable.java:46)
11-10 05:07:55.754: W/System.err(8831):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
11-10 05:07:55.754: W/System.err(8831):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
11-10 05:07:55.754: W/System.err(8831):    at java.lang.Thread.run(Thread.java:1019)


---------------------------------------------------------------------------------------
2.when i login by a error user name
android client:

Code: Select all

      ISFSObject sfsObj =  SFSObject.newInstance();
      sfsObj.putUtfString("login_type","1");
      
      String userNameStr = loginName.getText().toString();
      String userPasStr  = loginPas.getText().toString();
      
      service.getSfsClient().send(new LoginRequest(userNameStr,userPasStr,
      getResources().getString(R.string.zoneName),sfsObj));



exception throw:

Code: Select all

11-10 05:01:59.464: W/s*.c*.c*.SystemControl*(8681): Error in handling event: java.util.MissingFormatArgumentException: Format specifier: s
11-10 05:01:59.464: W/System.err(8681): java.util.MissingFormatArgumentException: Format specifier: s
11-10 05:01:59.464: W/System.err(8681):    at java.util.Formatter.getArgument(Formatter.java:1131)
11-10 05:01:59.464: W/System.err(8681):    at java.util.Formatter.doFormat(Formatter.java:1096)
11-10 05:01:59.474: W/System.err(8681):    at java.util.Formatter.format(Formatter.java:1062)
11-10 05:01:59.474: W/System.err(8681):    at java.util.Formatter.format(Formatter.java:1031)
11-10 05:01:59.484: W/System.err(8681):    at java.lang.String.format(String.java:2177)
11-10 05:01:59.484: W/System.err(8681):    at java.lang.String.format(String.java:2151)
11-10 05:01:59.484: W/System.err(8681):    at sfs2x.client.util.SFSErrorCodes.getErrorMessage(SFSErrorCodes.java:63)
11-10 05:01:59.484: W/System.err(8681):    at sfs2x.client.controllers.system.ResLogin.handleResponse(ResLogin.java:60)
11-10 05:01:59.484: W/System.err(8681):    at sfs2x.client.controllers.SystemController.handleMessage(SystemController.java:104)
11-10 05:01:59.484: W/System.err(8681):    at sfs2x.client.core.SFSProtocolCodec.dispatchRequest(SFSProtocolCodec.java:144)
11-10 05:01:59.494: W/System.err(8681):    at sfs2x.client.core.SFSProtocolCodec.onPacketRead(SFSProtocolCodec.java:50)
11-10 05:01:59.494: W/System.err(8681):    at sfs2x.client.core.SFSIOHandler.handlePacketData(SFSIOHandler.java:283)
11-10 05:01:59.494: W/System.err(8681):    at sfs2x.client.core.SFSIOHandler.onDataRead(SFSIOHandler.java:132)
11-10 05:01:59.494: W/System.err(8681):    at sfs2x.client.bitswarm.BitSwarmClient.onSocketData(BitSwarmClient.java:364)
11-10 05:01:59.494: W/System.err(8681):    at sfs2x.client.bitswarm.BitSwarmClient.access$2(BitSwarmClient.java:358)
11-10 05:01:59.494: W/System.err(8681):    at sfs2x.client.bitswarm.BitSwarmClient$3.dispatch(BitSwarmClient.java:105)
11-10 05:01:59.494: W/System.err(8681):    at sfs2x.client.core.EventDispatcher.dispatchEvent(EventDispatcher.java:52)
11-10 05:01:59.504: W/System.err(8681):    at sfs2x.client.core.sockets.TCPSocketLayer.callOnData(TCPSocketLayer.java:146)
11-10 05:01:59.504: W/System.err(8681):    at sfs2x.client.core.sockets.TCPSocketLayer.handleBinaryData(TCPSocketLayer.java:140)
11-10 05:01:59.504: W/System.err(8681):    at sfs2x.client.core.sockets.TCPSocketLayer.access$6(TCPSocketLayer.java:139)
11-10 05:01:59.504: W/System.err(8681):    at sfs2x.client.core.sockets.TCPSocketLayer$NettyIOHandler.messageReceived(TCPSocketLayer.java:269)
11-10 05:01:59.504: W/System.err(8681):    at org.jboss.netty.channel.SimpleChannelHandler.handleUpstream(SimpleChannelHandler.java:100)
11-10 05:01:59.504: W/System.err(8681):    at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:545)
11-10 05:01:59.504: W/System.err(8681):    at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:540)
11-10 05:01:59.514: W/System.err(8681):    at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:274)
11-10 05:01:59.514: W/System.err(8681):    at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:261)
11-10 05:01:59.514: W/System.err(8681):    at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:350)
11-10 05:01:59.514: W/System.err(8681):    at org.jboss.netty.channel.socket.nio.NioWorker.processSelectedKeys(NioWorker.java:281)
11-10 05:01:59.514: W/System.err(8681):    at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:201)
11-10 05:01:59.514: W/System.err(8681):    at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
11-10 05:01:59.514: W/System.err(8681):    at org.jboss.netty.util.internal.IoWorkerRunnable.run(IoWorkerRunnable.java:46)
11-10 05:01:59.524: W/System.err(8681):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
11-10 05:01:59.524: W/System.err(8681):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
11-10 05:01:59.524: W/System.err(8681):    at java.lang.Thread.run(Thread.java:1019)



I hope the problem can be resolved quickly,think you ï¼
Last edited by maomao on 05 Dec 2011, 12:02, edited 1 time in total.
User avatar
Lapo
Site Admin
Posts: 21012
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 05 Dec 2011, 09:36

Hi,
what you have posted is not enough to understand.
Please post the entire code snippet using the proper [code] tag to format it and also the full stack trace of the error.

thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Re: BUG login by error user name bug in android client sfs2x

Postby ThomasLund » 30 May 2012, 05:41

Pretty sure I know whats wrong!

But need to investigate and take a look.

Certain that you are running latest jar? (Just checking, so I do not look in the API code for something that has been fixed already)

/Thomas
Full Control - maker of Unity/C# and Java SFS API and indie games
Follow on twitter: http://twitter.com/thomas_h_lund
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Re: BUG login by error user name bug in android client sfs2x

Postby ThomasLund » 03 Jul 2012, 11:38

I think you are not running the latest jar.

The current code for error lookup is inside a general try/catch:

Code: Select all

   public static String getErrorMessage(short code, Object[] args) {
      try {
         return String.format(errorsByCode[code], args);
      }
      catch (Exception e) {
         return "Error in converting error code to text for code: " + code + ". Cause: " + e.getMessage();
      }
   }


So your error should never ever happen.

/Thomas
Full Control - maker of Unity/C# and Java SFS API and indie games

Follow on twitter: http://twitter.com/thomas_h_lund

Return to “SFS2X Java / Android API”

Who is online

Users browsing this forum: No registered users and 1 guest