Skip to main content
Participant
November 5, 2012
Answered

why "Assigning actions to events" doesn't work?

  • November 5, 2012
  • 1 reply
  • 1037 views

Dear,

        In my authorization plug-in, I set a method which I hope it can be called by SSAS when connect event occurs.

void FmsAuthAdaptor::notify(IFmsAuthEvent* pAev)

{

  processStats(pAev);

  MyFmsNotifyEvent(pAev, m_pFmsAuthServerContext).notify();

}

void FmsAuthAdaptor::processStats(IFmsAuthEvent* pAev)
{
      if (pAev->getType() == IFmsAuthEvent::E_CONNECT)

     {

           

  FmsVariant field;
  if (pAev->getField(IFmsAuthEvent::F_CLIENT_ID, field) == IFmsAuthEvent::S_SUCCESS)
  {
       m_pFmsAuthServerContext->log("before ssas method", IFmsServerContext::kInformation, false);

       I64 clientId = field.i64;
       IFmsNotifyAction* pAction = pAev->addNotifyAction("Notified by adaptor");
       pAction->setClientId(field);
       const char mtd[] = "my_test";
       field.setString(reinterpret_cast<I8*>(const_cast<char*>(mtd)));
       pAction->setMethodName(field);

// create and insert a U16 "12345" as the first parameter
field.setU16(12345);
pAction->addParam(field);

// create and insert clientId as a double as the second parameter
field.setDouble((double)clientId);
pAction->addParam(field);

m_pFmsAuthServerContext->log("after ssas method", IFmsServerContext::kInformation, false);

  }

      }

}

In my application directory, I create a script named as main.asc. I have the following codes:

application.onConnect = function(client)
{
  application.acceptConnection( client );

  trace("MJF:application.onConnect" );
 
  client.my_test = function(userParam, clientId)
  {
    trace("MJF:in my_test ");
  }
 
  trace("MJF: after my_test");
}

but, I don't know why:

when a client connected in, I can see the traces "MJF:application.onConnect", and "MJF: after my_test", but I can not see "MJF:in my_test". seems my_test method is not called by SSAS. Assigning actions to events doesn't work? why?

is there anyone who can tell me why? Thanks in advance!

This topic has been closed for replies.
Correct answer

Hi,

SS function is not getting called from the auth adaptor because that is being called under E_CONNECT event. Before calling a SS function, the connection has to go through, so try calling it under other events like E_PLAY. I tried this at my end and it was working for me.

1 reply

Adobe Employee
November 5, 2012

Please check the auth logs. You must have a action event logged. Check the status of this event.

Check for the core logs for any information or any asserts.

adit600Author
Participant
November 5, 2012

Dear Nitin,

Thanks for your reply.

I've checked the log files:

authMessage.00.log, core.00.log, authEvent.00.log and application.00.log: there is no error and assert in these log files.

In authMessage.00.log:

2012-11-05 15:15:39 5272 (i)2631180 Info from dll: Received notification type=2 id=065835C0

2012-11-05 15:15:39 5272 (i)2631180 Info from dll: Received authorization type=2 id=0658359C approved

from above logs, we can see: E_CONNECT event is notified and authorization is approved.

But according to the description of function addNotifyAction:

@param

  *  strText A customized description of an action. Used in the comment column of the authEvent.NN.log file if

  * that field and the action event are enabled in the Logging.xml file.

I can not find the string "Notified by adaptor" in authEvent.00.log file. what does this mean?

Correct answer
November 5, 2012

Hi,

SS function is not getting called from the auth adaptor because that is being called under E_CONNECT event. Before calling a SS function, the connection has to go through, so try calling it under other events like E_PLAY. I tried this at my end and it was working for me.