示例#1
0
 internal SandboxedWorld(IWorld world)
 {
     _world = world;
     _accessor = new SandboxedObjectAccessor(_world.Objects);
     _chatListener = new OnChatDelegate(TriggerChat);
     _newUserListener = new OnNewUserDelegate(TriggerNewUser);
 }
示例#2
0
        /// <summary>
        /// Constructor. Takes as a parameter the configuration file which defines how the system is to be initialised.
        /// </summary>
        /// <param name="configFile">The configuration file with all the details of how the system is to be loaded and any parameters that are relevant</param>
        public EntryPoint(string configFile)
        {
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(uncaughtException);
            this.configFile = configFile;

            listening = new HashSet<UUID>();
            touchListeners = new HashSet<UUID>();
            touchDelegate = touchListener;
            chatDelegate = chatListener;

            init();
        }
示例#3
0
        /// <summary>
        /// Constructor. Takes as a parameter the configuration file which defines how the system is to be initialised.
        /// </summary>
        /// <param name="configFile">The configuration file with all the details of how the system is to be loaded and any parameters that are relevant</param>
        public EntryPoint(string configFile)
        {
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(uncaughtException);
            this.configFile = configFile;

            listening      = new HashSet <UUID>();
            touchListeners = new HashSet <UUID>();
            touchDelegate  = touchListener;
            chatDelegate   = chatListener;

            init();
        }
 public SingleTouchScript()
 {
     _chatListener = Listen;
 }
示例#5
0
        public MRMPrimFactory(IHost host, IWorld world, IAsynchQueueFactory queueFactory, IKeyTableFactory tableFactory, IConfigSource config, UUID hostID)
        {
            IConfig mrmConfig = config.Configs["MRM"];

            if (mrmConfig == null)
            {
                mrmConfig = config.Configs[0];
            }

            _world = world;
            _host  = host;

            _logger        = LogManager.GetLogger(typeof(MRMPrimFactory));
            _prims         = new MapKeyTable <IPrim>();
            _createdPrims  = new List <UUID>();
            _freeObjects   = new Dictionary <UUID, IObject>();
            _chatListeners = new Dictionary <int, List <ChatDelegate> >();

            //_factoryQ = queueFactory.MakeQueue();
            _factoryQ = queueFactory.SharedQueue;

            CheckWait = mrmConfig.GetInt("CheckWait", CheckWait);
            _recycle  = mrmConfig.GetBoolean("Recycle", true);

            try {
                _hostPrim = new MRMPrim(hostID, this);
            } catch (Exception e) {
                _hostPrim = null;
                throw new Exception("Problem getting Host Prim: " + e.Message + "\n" + e.StackTrace);
            }

            _chatListener += (sender, args) => {
                _world = sender;
                if (_chatListeners.ContainsKey(args.Channel))
                {
                    lock (_chatListeners)
                        foreach (var listener in _chatListeners[args.Channel])
                        {
                            listener(args.Sender.Name, args.Sender.GlobalID, args.Text, args.Channel);
                        }
                }
                if (OnChat != null)
                {
                    OnChat(args.Sender.Name, args.Sender.GlobalID, args.Text, args.Channel);
                }
            };
            _world.OnChat += _chatListener;

            _checkThread      = new Thread(CheckThread);
            _checkThread.Name = "MRMPrimFactory Check Thread";
            _checkThread.Start();



            _linkButtons = new Dictionary <uint, TouchButton>();
            _chatButtons = new Dictionary <UUID, TouchButton>();

            _knowButtons = new Dictionary <string, HashSet <UUID> >();
            _pingChannel = mrmConfig.GetInt("PingChannel", -50);
            _ping        = mrmConfig.Get("ButtonPing", "Ping");
            _pingAck     = mrmConfig.Get("ButtonPingAck", "Pong");
            _chanAck     = mrmConfig.Get("ButtonChannelAck", "ACK");
            InitTouchButtons();
        }
 public SingleTouchScript()
 {
     _chatListener = Listen;
 }