Exemple #1
0
        // Program start
        static void Main(string[] args)
        {
            DataManager _dataManager = new SQLDataManager();
            FileManager _fileManager = new HierarchicalFileManager();
            UserManager _userManager = new UserManager(_dataManager, _fileManager);

            ServerInterface _interface = new TCPInterface();

            _interface.Run();


            ActionProvider _provider = new ConsoleReaderActionProvider();

            ServerAction action;

            while ((action = _provider.Dequeue()).ExitServer == false)
            {
                if (!action.IsEmpty)
                {
                    action.PerformAction(_userManager, _fileManager, _dataManager);
                }
            }


            _interface.Stop();
        }
Exemple #2
0
        public void Stop()
        {
            Running = false;

            socketServer.Stop();

            foreach (Bot bot in bots)
            {
                bot.Disconnect();
            }
        }
Exemple #3
0
        public void Stop()
        {
            Running = false;

            socketServer.Stop();

            Console.WriteLine("Shutting down steambots...");

            foreach (Bot bot in bots)
            {
                bot.Disconnect();
            }
        }
Exemple #4
0
        static void Main(string[] args)
        {
            var config = new TCPConfiguration();

            config.publications  = new System.Collections.Generic.Dictionary <string, TCPConfiguration.TCPPublicationInstruction>();
            config.subscriptions = new System.Collections.Generic.Dictionary <string, TCPConfiguration.TCPSubscriptionInstruction>();

            config.publications.Add("instr1", new TCPConfiguration.TCPPublicationInstruction()
            {
                EventId = "testEvent", Ip = "127.0.0.1", Port = 1884
            });

            var fPtr    = msb.separate.Interfaces.BaseInterfaceUtils.CreateFunctionPointer(typeof(funktionen).GetMethod("funktion"), null);
            var intFlow = new System.Collections.Generic.Dictionary <string, string>()
            {
                { "a", "hallo" }, { "b", "hallo2" }
            };

            config.subscriptions.Add("instr1", new TCPConfiguration.TCPSubscriptionInstruction()
            {
                EventId = "testEvent", Ip = "127.0.0.1", Port = 1884, FunctionPointer = fPtr, IntegrationFlow = intFlow
            });

            var tcp = new TCPInterface(config);

            tcp.Start();

            System.Threading.Thread.Sleep(1000);

            tcp.PublishEvent(new msb.separate.EventData()
            {
                Id = "testEvent", Data = new System.Collections.Generic.Dictionary <string, object> {
                    { "hallo", "123" }, { "hallo2", "321" }
                }
            });

            System.Threading.Thread.Sleep(1000);

            tcp.Stop();

            Console.ReadLine();
        }