HI:
when user reconnect:"Extension Request refused. Sender is not a User " why?
User login: { Zone: slots }, ( User Name: faecdcb4969b7f98023167dd89d46de3f6ed9dea, Id: 49916, Priv: 0, Sess: 172.31.46.150:56097 ) , Type: C++ API
06 Dec 2016 | 06:34:09,599 | WARN | com.smartfoxserver.v2.controllers.ExtensionController-872 | v2.controllers.ExtensionController | | com.smartfoxserver.v2.exceptions.SFSExtensionException: Extension Request refused. Sender is not a User: { Id: 117643, Type: DEFAULT, Logged: No, IP: 172.31.46.150:56095 }
Sender is not a User Why?
Re: Sender is not a User Why?
zynbasil wrote: { Id: 117643, Type: DEFAULT, Logged: No, IP: 172.31.46.150:56095 }
Not logged in. It's still a session, not an user yet.
Re: Sender is not a User Why?
As anhptoe said, this indicates that your client code is sending requests prior to having logged in or, alternatively, after a LOGIN_ERROR. In either case a client is not allowed to send requests if he's not successfully logged in.
Make sure to double check your client code for those two states.
Thanks
Make sure to double check your client code for those two states.
Thanks
Re: Sender is not a User Why?
Thanks~
Re: Sender is not a User Why?
Lapo wrote:As anhptoe said, this indicates that your client code is sending requests prior to having logged in or, alternatively, after a LOGIN_ERROR. In either case a client is not allowed to send requests if he's not successfully logged in.
Make sure to double check your client code for those two states.
Thanks
How client know it self logged in ? With some API?
case:
1.client lost connect
2.client reconnect
3.server session exist ->remove session ->sender is not a user
4.client lost connect
Re: Sender is not a User Why?
zynbasil wrote:.
In client, add a log listener:
Code: Select all
smartFox.AddLogListener(LogLevel.DEBUG, OnDebugMessage);
And add this function to show log:
Code: Select all
private static void OnDebugMessage(BaseEvent evt) {
string message = (string)evt.Params["message"];
Debug.Log("[SFS DEBUG] " + message);
}
private static void OnDebugMessage(string message) {
Debug.Log("[SFS DEBUG] " + message);
}
Re: Sender is not a User Why?
zynbasil wrote:How client know it self logged in ? With some API?
The client is logged in after having sent a LoginRequest and received the relative server response.
Before you can interact with the server you need to perform two steps:
1- Connect
2- Login
After these two steps are completed you can send any request. Your game/app interface should not show any buttons that trigger server requests until the login is completed successfully.
If this is still not entirely clear to you, I would highly recommend that you download our Example packs from here:
http://smartfoxserver.com/download/sfs2x#p=examples
In there you will find simple client examples that show you every step. Tutorials are available here:
http://docs2x.smartfoxserver.com/
cheers
-
- Posts: 33
- Joined: 28 Sep 2018, 19:47
Re: Sender is not a User Why?
I have the same problem.
So if I check "sfs.isConnected==true" before submitting a request it wouldn't be enough, right? What do you recommend to check if the login is currently valid?
Lapo wrote:
Before you can interact with the server you need to perform two steps:
1- Connect
2- Login
So if I check "sfs.isConnected==true" before submitting a request it wouldn't be enough, right? What do you recommend to check if the login is currently valid?
Re: Sender is not a User Why?
Hi,
the connection only establishes a channel of communication, but you need to be logged into a Zone to start sending any request.
Check this basic tutorial for more, if needed:
http://docs2x.smartfoxserver.com/Develo ... ogin-phase
So all you need to do is send the LoginRequest (after the connection is successful) and handle the two related events: SFSEvent.LOGIN and SFSEvent.LOGIN_ERROR
If you logged in successfully you can start sending requests, otherwise you will need to signal the error to the client and let him retry.
Hope it helps
the connection only establishes a channel of communication, but you need to be logged into a Zone to start sending any request.
Check this basic tutorial for more, if needed:
http://docs2x.smartfoxserver.com/Develo ... ogin-phase
So all you need to do is send the LoginRequest (after the connection is successful) and handle the two related events: SFSEvent.LOGIN and SFSEvent.LOGIN_ERROR
If you logged in successfully you can start sending requests, otherwise you will need to signal the error to the client and let him retry.
Hope it helps
Who is online
Users browsing this forum: Google [Bot] and 56 guests