Beispiel #1
0
 /// <summary>
 /// Adds a local module to the chat room.
 /// </summary>
 /// <param name="module">The module to add.</param>
 public void AddModule(Module module)
 {
     Modules.Add(module);
 }
Beispiel #2
0
 /// <summary>
 /// Adds a local module to the chat room.
 /// </summary>
 /// <param name="module">The module to add.</param>
 public void AddModule(Module module)
 {
     Modules.Add(module);
 }
Beispiel #3
0
        public void AddModule(Module module)
        {
            if (module.Global)
            {
                _globalModules[module.Name] = module;

                // Run start on global modules whenever they're added.
                module.OnStart();
            }
            else
            {
                _localModulePaths.Add(module.Path);

                foreach (var chatroom in _chatroomModules.Keys)
                {
                    var chatModule = AddModuleToChatroom(module.Path, chatroom);
                    chatModule.OnStart();
                }
            }
        }
Beispiel #4
0
        private void CreateModule(string file)
        {
            var module = new Module(_steamNerd, file);

            var scope = module.Interpret(_steamNerd, _pyEngine);

            if (scope != null && CheckModule(module))
            {
                AddModule(module);
            }
        }
Beispiel #5
0
        /// <summary>
        /// Checks the module to see if it has everything that SteamNerd needs
        /// for a module.
        /// </summary>
        /// <param name="module"></param>
        /// <returns></returns>
        private bool CheckModule(Module module)
        {
            var fileName = Path.GetFileName(module.Path);

            // If it doesn't have a name, it's probably not a module.
            if (module.Name == null)
            {
                return false;
            }

            return true;
        }
Beispiel #6
0
        private Module AddModuleToChatroom(string path, SteamID chatroom)
        {
            var module = new Module(_steamNerd, path);
            module.Chatroom = chatroom;
            module.Interpret(_steamNerd, _pyEngine);
            _chatroomModules[chatroom][module.Name] = module;

            return module;
        }