Dont get the LOGIN_ERROR
Dont get the LOGIN_ERROR
hey guys
when i type in a wrong password or username my server throws a sfsloginexception but my client just receives this:
[SFS DEBUG] Error handling data: Index (zero based) must be greater than or equal to zero and less than the size of the argument list. at System.String.FormatHelper (System.Text.StringBuilder result, IFormatProvider provider, System.String format, System.Object[] args) [0x00000] in <filename unknown>:0
at System.String.Format (IFormatProvider provider, System.String format, System.Object[] args) [0x00000] in <filename unknown>:0
at System.String.Format (System.String format, System.Object[] args) [0x00000] in <filename unknown>:0
at Sfs2X.Util.SFSErrorCodes.GetErrorMessage (Int32 code, System.Object[] args) [0x00000] in <filename unknown>:0
at Sfs2X.Controllers.SystemController.FnLogin (IMessage msg) [0x00000] in <filename unknown>:0
at Sfs2X.Controllers.SystemController.HandleMessage (IMessage message) [0x00000] in <filename unknown>:0
at Sfs2X.Core.SFSProtocolCodec.DispatchRequest (ISFSObject requestObject) [0x00000] in <filename unknown>:0
at Sfs2X.Core.SFSProtocolCodec.OnPacketRead (Sfs2X.Util.ByteArray packet) [0x00000] in <filename unknown>:0
at Sfs2X.Core.SFSIOHandler.HandlePacketData (Sfs2X.Util.ByteArray data) [0x00000] in <filename unknown>:0
can anybody help me?
its the default login:
public void OnLoginError(BaseEvent evt) {
Debug.Log("Login error: "+evt.Params["errorMessage"].ToString());
}
thanks
when i type in a wrong password or username my server throws a sfsloginexception but my client just receives this:
[SFS DEBUG] Error handling data: Index (zero based) must be greater than or equal to zero and less than the size of the argument list. at System.String.FormatHelper (System.Text.StringBuilder result, IFormatProvider provider, System.String format, System.Object[] args) [0x00000] in <filename unknown>:0
at System.String.Format (IFormatProvider provider, System.String format, System.Object[] args) [0x00000] in <filename unknown>:0
at System.String.Format (System.String format, System.Object[] args) [0x00000] in <filename unknown>:0
at Sfs2X.Util.SFSErrorCodes.GetErrorMessage (Int32 code, System.Object[] args) [0x00000] in <filename unknown>:0
at Sfs2X.Controllers.SystemController.FnLogin (IMessage msg) [0x00000] in <filename unknown>:0
at Sfs2X.Controllers.SystemController.HandleMessage (IMessage message) [0x00000] in <filename unknown>:0
at Sfs2X.Core.SFSProtocolCodec.DispatchRequest (ISFSObject requestObject) [0x00000] in <filename unknown>:0
at Sfs2X.Core.SFSProtocolCodec.OnPacketRead (Sfs2X.Util.ByteArray packet) [0x00000] in <filename unknown>:0
at Sfs2X.Core.SFSIOHandler.HandlePacketData (Sfs2X.Util.ByteArray data) [0x00000] in <filename unknown>:0
can anybody help me?
its the default login:
public void OnLoginError(BaseEvent evt) {
Debug.Log("Login error: "+evt.Params["errorMessage"].ToString());
}
thanks
-
- Posts: 1297
- Joined: 14 Mar 2008, 07:52
- Location: Sweden
Definitely a bug - will look into it
/Thomas
/Thomas
Full Control - maker of Unity/C# and Java SFS API and indie games
Follow on twitter: http://twitter.com/thomas_h_lund
Follow on twitter: http://twitter.com/thomas_h_lund
[SFS - error]
Robbilie wrote:any updates?
we are also getting semilar error. even though entered corret password.
[SFS - ERROR] Error handling data: Index (zero based) must be greater than or equal to zero and less than the size of the argument list. at System.String.FormatHelper (System.Text.StringBuilder result, IFormatProvider provider, System.String format, System.Object[] args) [0x00000] in <filename unknown>:0
at System.String.Format (IFormatProvider provider, System.String format, System.Object[] args) [0x00000] in <filename unknown>:0
at System.String.Format (System.String format, System.Object[] args) [0x00000] in <filename unknown>:0
at Sfs2X.Util.SFSErrorCodes.GetErrorMessage (Int32 code, System.Object[] args) [0x00000] in <filename unknown>:0
at Sfs2X.Controllers.SystemController.FnLogin (IMessage msg) [0x00000] in <filename unknown>:0
at Sfs2X.Controllers.SystemController.HandleMessage (IMessage message) [0x00000] in <filename unknown>:0
at Sfs2X.Core.SFSProtocolCodec.DispatchRequest (ISFSObject requestObject) [0x00000] in <filename unknown>:0
at Sfs2X.Core.SFSProtocolCodec.OnPacketRead (Sfs2X.Util.ByteArray packet) [0x00000] in <filename unknown>:0
at Sfs2X.Core.SFSIOHandler.HandlePacketData (Sfs2X.Util.ByteArray data) [0x00000] in <filename unknown>:0
is their a fix for this..
-
- Posts: 1297
- Joined: 14 Mar 2008, 07:52
- Location: Sweden
Might be that I inadvertently fixed this - but cant reproduce the error.
I'm doing this on the server as per tutorial:
And on the client side I get this:
from this code:
This is with my latest SVN stuff - so as said can be that I fixed it earlier without realizing. Or its a rc3 fix.
If anyone wants to try this themselves, send me a pm and I can give you a SVN version compiled API
/T
I'm doing this on the server as per tutorial:
Code: Select all
if (!verifyLogin(session, name, pwd)) {
// Create the error code to send to the client
SFSErrorData errData = new SFSErrorData(SFSErrorCode.LOGIN_BAD_USERNAME);
errData.addParameter(name);
throw new SFSLoginException(errorMessage, errData);
}
And on the client side I get this:
Code: Select all
[SFS - INFO] Message: Login { Message id: 1 }
{ Dump: }
(short) ec: 2
(utf_string_array) ep: [System.String[]]
Login error: User name test is not recognized
from this code:
Code: Select all
public void OnLoginError(BaseEvent e) {
Console.WriteLine("Login error: "+(string)e.Params["errorMessage"]);
}
This is with my latest SVN stuff - so as said can be that I fixed it earlier without realizing. Or its a rc3 fix.
If anyone wants to try this themselves, send me a pm and I can give you a SVN version compiled API
/T
Full Control - maker of Unity/C# and Java SFS API and indie games
Follow on twitter: http://twitter.com/thomas_h_lund
Follow on twitter: http://twitter.com/thomas_h_lund
Instead of that :
use this :
And you'll have the error.
By the way, where is the SFSErrorCode enum in the C# API? I would like to do something like that :
Code: Select all
public void OnLoginError(BaseEvent e) {
Console.WriteLine("Login error: "+(string)e.Params["errorMessage"]);
}
use this :
Code: Select all
public void OnLoginError (BaseEvent e)
{
Debug.Log(SFSErrorCodes.GetErrorMessage((int) evt.Params["errorCode"]));
}
And you'll have the error.
By the way, where is the SFSErrorCode enum in the C# API? I would like to do something like that :
Code: Select all
public void OnLoginError (BaseEvent e)
{
SFSErrorCode code = (SFSErrorCode) evt.Params["errorCode"]);
switch (code)
{
case LOGIN_BAD_PASSWORD :
// Do something
break;
etc ..
}
-
- Posts: 1297
- Joined: 14 Mar 2008, 07:52
- Location: Sweden
LeMageFou wrote:Instead of that :Code: Select all
public void OnLoginError(BaseEvent e) {
Console.WriteLine("Login error: "+(string)e.Params["errorMessage"]);
}
use this :Code: Select all
public void OnLoginError (BaseEvent e)
{
Debug.Log(SFSErrorCodes.GetErrorMessage((int) evt.Params["errorCode"]));
}
And you'll have the error.
My code was from a unit test - and thus perfectly fine.
By the way, where is the SFSErrorCode enum in the C# API? I would like to do something like that :Code: Select all
public void OnLoginError (BaseEvent e)
{
SFSErrorCode code = (SFSErrorCode) evt.Params["errorCode"]);
switch (code)
{
case LOGIN_BAD_PASSWORD :
// Do something
break;
etc ..
}
SFSErrorCode is not an enum unfortunately. Its a basic int sent by the server and then used by SFS2X.Util.SFSErrorCode static class via this static method public static string GetErrorMessage(int code, params object[] args) to return a readable message.
/Thomas
Full Control - maker of Unity/C# and Java SFS API and indie games
Follow on twitter: http://twitter.com/thomas_h_lund
Follow on twitter: http://twitter.com/thomas_h_lund
-
- Posts: 1297
- Joined: 14 Mar 2008, 07:52
- Location: Sweden
Robbilie wrote:doesnt work for me...
As said - it might be something that was fixed by doing something else. Poke me with an email in a pm and you can get latest SVN dll to test if it works in your end or not with that.
I cant reproduce the error anyways here.
/Thomas
Full Control - maker of Unity/C# and Java SFS API and indie games
Follow on twitter: http://twitter.com/thomas_h_lund
Follow on twitter: http://twitter.com/thomas_h_lund
hey guys look here !!!
different error and OnLoginError is mentioned DDD
Code: Select all
[SFS DEBUG] Error dispatching event loginError :Cannot cast from source type to destination type. at LobbyGUI.OnLoginError (Sfs2X.Core.BaseEvent evt) [0x00000] in H:\Project\SFS2X FPS Tutorial\Unity FPS Client\SFS2XFPSTutorial\Assets\Lobby\Scripts\LobbyGUI.cs:298
at Sfs2X.Core.EventDispatcher.DispatchEvent (Sfs2X.Core.BaseEvent evt) [0x00000] in <filename unknown>:0
UnityEngine.Debug:Log(Object)
LobbyGUI:OnDebugMessage(BaseEvent) (at Assets/Lobby/Scripts/LobbyGUI.cs:320)
Sfs2X.Core.EventDispatcher:DispatchEvent(BaseEvent)
Sfs2X.Logging.Logger:DispatchEvent(LoggerEvent)
Sfs2X.Logging.Logger:Log(LogLevel, String)
Sfs2X.Logging.Logger:Error(String[])
Sfs2X.Core.EventDispatcher:DispatchEvent(BaseEvent)
Sfs2X.SmartFox:ProcessEvents()
LobbyGUI:FixedUpdate() (at Assets/Lobby/Scripts/LobbyGUI.cs:242)
different error and OnLoginError is mentioned DDD
Who is online
Users browsing this forum: No registered users and 40 guests