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
@:nativeGen
class UserLogin extends BaseServerEventHandler
{
@:overload
override public function handleServerEvent(event:ISFSEvent):Void
{
var credentials:SFSObject = event.getParameter(cast SFSEventParam.LOGIN_IN_DATA);
var user:User = event.getParameter(cast SFSEventParam.USER);
this.trace(ExtensionLogLevel.WARN, java.NativeArray.make(user.getName()+" joined the game with the sid: "+credentials.getUtfString("sid")));
}
@:nativeGen
class UserLogin extends BaseServerEventHandler
{
@:overload
override public function handleServerEvent(event:ISFSEvent):Void
{
var user:String = event.getParameter(cast SFSEventParam.LOGIN_NAME);
var params:SFSObject = event.getParameter(cast SFSEventParam.LOGIN_IN_DATA);
var sid:String = params.getUtfString("sid");
this.trace(ExtensionLogLevel.WARN, java.NativeArray.make(user+" joined the game with the sid : "+sid));
}
Hi again,
I'm having some problems creating a base server to read the login credentials from the client you made. Here's my code:
HaxeExtension.hx
`package;
import java.Lib;
import com.smartfoxserver.v2.extensions.SFSExtension;
import com.smartfoxserver.v2.extensions.ExtensionLogLevel;
import com.smartfoxserver.v2.core.SFSEventType;
@:nativeGen
class HaxeExtension extends SFSExtension
{
@:overload override public function init()
{
this.log("Extension started");
}`
UserLogin.hx
`package;
import com.smartfoxserver.v2.entities.User;
import com.smartfoxserver.v2.core.ISFSEvent;
import com.smartfoxserver.v2.core.SFSEventParam;
import com.smartfoxserver.v2.entities.data.ISFSObject;
import com.smartfoxserver.v2.entities.data.SFSObject;
import com.smartfoxserver.v2.extensions.BaseServerEventHandler;
import com.smartfoxserver.v2.extensions.ExtensionLogLevel;
@:nativeGen
class UserLogin extends BaseServerEventHandler
{
}`
Here's what I get in the logs:
The text was updated successfully, but these errors were encountered: