ActionPtr ActionRegistry::CreateById(unsigned short usActionId)
{
    switch(usActionId)
    {
    case actionDecreaseHealthPoints:
        return ActionPtr(new DecreaseHealthPointsAction);
        break;
    };

    CString cszText;
    cszText.Format(_T("Unknown action id=%04x"), usActionId);
    throw Exception(cszText, __FILE__, __LINE__);
}
예제 #2
0
ActionPtr WanderPackage::CreateAction() const
{
	return ActionPtr(new action::Wander());
}
예제 #3
0
VirtualServer::VirtualServer(const VirtualServerOptions &opts, QObject *parent) :
  QObject(parent),
  d(new VirtualServerPrivate(this)),
  _opts(opts),
  _corServer(this),
  _connections(),
  _nextClientId(0),
  _clients(),
  _nextChannelId(0),
  _channels(),
  _participants(),
  _mediaSocketHandler(nullptr),
  _tokens(),
  _wsStatusServer(nullptr)
{
  d->registerAction(ActionPtr(new AuthenticationAction()));
  d->registerAction(ActionPtr(new GoodbyeAction()));
  d->registerAction(ActionPtr(new HeartbeatAction()));
  d->registerAction(ActionPtr(new JoinChannelAction()));
  d->registerAction(ActionPtr(new JoinChannel2Action()));
  d->registerAction(ActionPtr(new EnableVideoAction()));
  d->registerAction(ActionPtr(new DisableVideoAction()));
  d->registerAction(ActionPtr(new EnableRemoteVideoAction()));
  d->registerAction(ActionPtr(new DisableRemoteVideoAction()));

  // Admin actions (RequiresAdminPrivileges)
  d->registerAction(ActionPtr(new AdminAuthAction()));
  d->registerAction(ActionPtr(new KickClientAction()));
}