Inheritance: IPlugin, IChatEventHandler, IPlayerEventHandler, ICubeGridHandler, ICubeBlockEventHandler, ISectorEventHandler
        private void DoInit( string path )
        {
            Instance = this;
            //controlForm.Text = "Testing";
            _pluginPath = path;

            // Load our settings
            PluginSettings.Instance.Load( );

            // Setup process handlers
            _processHandlers = new List<ProcessHandlerBase>
                               {
                                   new ProcessGreeting( ),
                                   new ProcessRestart( ),
                                   new ProcessInfo( ),
                                   new ProcessBackup( ),
                                   new ProcessLoginTracking( ),
                                   new ProcessDockingZone( ),
                                   new ProcessConceal( ),
                                   new ProcessWaypoints( ),
                                   new ProcessCleanup( ),
                                   new ProcessBlockEnforcement( ),
                                   new ProcessReservedSlots(),
                                   new ProcessTimedCommands(  ),
                                   new ProcessSpeed(  ),
                                   new ProcessCargoShips(  ),
                                   new ProcessTicket(  ),
                                   new ProcessRagdoll(  ),
                               };

            // Setup chat handlers
            _chatHandlers = new List<ChatHandlerBase>
                            {
                                new HandleHelp( ),

                                //Admin Commands
                                new HandleAdminBackup( ),
                                new HandleAdminMemory( ),
                                new HandleAdminNotify( ),
                                new HandleAdminOwnershipChange( ),
                                new HandleAdminRestart( ),
                                new HandleAdminTest( ),
                                new HandleAdminVersion( ),
                                new HandleAdminStop( ),
                                new HandleAdminSpeed( ),
                                new HandleAdminIdentityCleanup(  ),
                                new HandleAdminFactionCleanup(  ),
                                new HandleAdminSpawnCargo(  ),
                                new HandleAdminPlayerCount(  ),

                                //Admin Scan
                                new HandleAdminScanAreaAt( ),
                                new HandleAdminScanAreaTowards( ),
                                new HandleAdminScanCleanup( ),
                                new HandleAdminScanEntityId( ),
                                new HandleAdminScanGrids( ),
                                new HandleAdminScanInactive( ),
                                new HandleAdminScanNoBeacon( ),
                                new HandleAdminScanOverlimit( ),

                                //Admin Delete
                                new HandleAdminDeleteCleanup( ),
                                new HandleAdminDeleteGrids( ),
                                new HandleAdminDeleteGridsArea( ),
                                new HandleAdminDeleteInactive( ),
                                new HandleAdminDeleteNoBeacon( ),
                                new HandleAdminDeleteShipsArea( ),
                                new HandleAdminDeleteStationsArea( ),
                                new HandleAdminDeleteFloating( ),

                                //Admin Move
                                new HandleAdminMoveAreaToPosition( ),
                                new HandleAdminMoveAreaTowards( ),
                                new HandleAdminMoveGridTo( ),
                                new HandleAdminMovePlayerPosition( ),
                                new HandleAdminMovePlayerTo( ),

                                //Admin Conceal
                                new HandleAdminConceal( ),
                                new HandleAdminReveal( ),

                                //Admin Player
                                new HandleAdminPlayerListActive( ),
                                new HandleAdminPlayerListInactive( ),

                                //Admin Settings
                                new HandleAdminSettings( ),

                                //Settings
                                new HandleSettingsEnableBlockEnforcement( ),
                                new HandleSettingsRemoveBlockEnforcement( ),
                                new HandleSettingsGetBlockEnforcement( ),
                                new HandleSettingsSetBlockEnforcement( ),
                                new HandleSettingsSetMOTD( ),

                                //Dock
                                new HandleDockValidate( ),
                                new HandleDockDock( ),
                                new HandleDockUndock( ),
                                new HandleDockList( ),

                                //Waypoints
                                new HandleWaypointAdd( ),
                                new HandleWaypointRemove( ),
                                new HandleWaypointList( ),
                                new HandleWaypointGroupAdd( ),
                                new HandleWaypointGroupRemove( ),
                                new HandleWaypointToggle( ),
                                new HandleWaypointRefresh( ),
                                new HandleWaypointFactionAdd( ),
                                new HandleWaypointFactionRemove( ),

                                //Utility
                                new HandleUtilityExportServer( ),
                                new HandleUtilityGridsList( ),
                                new HandleUtilityGridsCompare( ),

                                //Misc
                                new HandleInfo( ),
                                new HandleTimeleft( ),
                                new HandlePos( ),
                                new HandleMsg( ),
                                new HandleFaction( ),
                                new HandleFactionF( ),
                                new HandleMotd( ),
                                new HandleRevoke( ),

                                new HandleAdminResetAsteroid(  ),
                                new HandleAdminResetPlanet(  ),

                                //Tickets
                                new HandleTicketAdd(  ),
                                new HandleTicketExtend(  ),
                                new HandleTicketRemove(  ),
                                new HandleTicketTimeleft(  )
                            };

            //TODO: These should be in an init function somehere so we don't intercept network unless the user really needs it
            ServerNetworkManager.Instance.RegisterNetworkHandlers( new BlockNameHandler( ),
                                                                   new BlockOwnHandler( ),
                                                                   new BuildBlockHandler( ),
                                                                   new ColorBlockHandler( ),
                                                                   new ConvertPhyiscsHandler( ),
                                                                   new GridDeleteHandler( ),
                                                                   new RemoveBlockHandler( ),
                                                                   new SyncPropertyHandler( ) );

            _processThreads = new List<Thread>( );
            _processThread = new Thread( PluginProcessing );
            _processThread.Start( );

            MyAPIGateway.Entities.OnEntityAdd -= OnEntityAdd;
            MyAPIGateway.Entities.OnEntityRemove -= OnEntityRemove;
            MyAPIGateway.Entities.OnEntityAdd += OnEntityAdd;
            MyAPIGateway.Entities.OnEntityRemove += OnEntityRemove;

            Protection.Instance.Init( );
            ProcessReservedSlots.Init( );
            PlayerBlockEnforcement.Init();

            MyAPIGateway.Multiplayer.RegisterMessageHandler(9005, Communication.ReceiveMessageParts);
            MyAPIGateway.Multiplayer.RegisterMessageHandler( 9007, Communication.HandleAddConcealExempt );
            BlacklistManager.Instance.UpdateBlacklist();
            _drillUpdateVal= (int)typeof(MyDrillConstants).GetField("DRILL_UPDATE_INTERVAL_IN_FRAMES").GetValue(null);
            m_entitiesForUpdate10 = (CachingList<MyEntity>)typeof(MyEntities).GetField("m_entitiesForUpdate10", BindingFlags.NonPublic | BindingFlags.Static).GetValue(null);
            _countdownField = typeof(MyShipDrill).GetField("m_drillFrameCountdown", BindingFlags.NonPublic | BindingFlags.Instance);
            Log.Info( "Plugin '{0}' initialized. (Version: {1}  ID: {2})", Name, Version, Id );
        }
        private void DoInit( string path )
        {
            Instance = this;
            //controlForm.Text = "Testing";
            _pluginPath = path;

            // Load our settings
            PluginSettings.Instance.Load( );

            // Setup process handlers
            _processHandlers = new List<ProcessHandlerBase>
                               {
                                   new ProcessNewUserTransport( ),
                                   new ProcessGreeting( ),
                                   new ProcessRestart( ),
                                   new ProcessInfo( ),
                                   new ProcessCommunication( ),
                                   new ProcessBackup( ),
                                   new ProcessLoginTracking( ),
                                   new ProcessProtection( ),
                                   new ProcessDockingZone( ),
                                   new ProcessConceal( ),
                                   new ProcessWaypoints( ),
                                   new ProcessCleanup( ),
                                   new ProcessBlockEnforcement( ),
                                   new ProcessSpawnShipTracking( ),
                                   new ProcessVoxels(  )
                               };

            // Setup chat handlers
            _chatHandlers = new List<ChatHandlerBase>
                            {
                                new HandleInfo( ),
                                new HandleTimeleft( ),
                                new HandlePos( ),
                                new HandleMsg( ),
                                new HandleFaction( ),
                                new HandleFactionF( ),
                                new HandleMotd( ),

                                new HandleAdminScanAreaAt( ),
                                new HandleAdminScanAreaTowards( ),
                                new HandleAdminScanNoBeacon( ),
                                new HandleAdminScanInactive( ),
                                new HandleAdminScanEntityId( ),
                                new HandleAdminScanCleanup( ),
                                new HandleAdminScanOverlimit( ),
                                new HandleAdminScanGrids( ),

                                new HandleAdminMoveAreaToPosition( ),
                                new HandleAdminMoveAreaTowards( ),
                                new HandleAdminMovePlayerTo( ),
                                new HandleAdminMovePlayerPosition( ),
                                new HandleAdminMoveGridTo( ),

                                new HandleAdminDeleteGridsArea( ),
                                new HandleAdminDeleteShipsArea( ),
                                new HandleAdminDeleteStationsArea( ),
                                new HandleAdminDeleteNoBeacon( ),
                                new HandleAdminDeleteInactive( ),
                                new HandleAdminDeleteCleanup( ),
                                new HandleAdminDeleteGrids( ),

                                new HandleAdminSettings( ),
                                new HandleAdminNotify( ),
                                new HandleAdminBackup( ),
                                new HandleAdminRestart( ),
                                new HandleAdminMemory( ),

                                new HandleAdminOwnershipChange( ),

                                new HandleAdminPlayerListActive( ),
                                new HandleAdminPlayerListInactive( ),

                                new HandleAdminConceal( ),
                                new HandleAdminReveal( ),

                                new HandleDockValidate( ),
                                new HandleDockDock( ),
                                new HandleDockUndock( ),
                                new HandleDockList( ),

                                new HandleWaypointAdd( ),
                                new HandleWaypointRemove( ),
                                new HandleWaypointList( ),
                                new HandleWaypointGroupAdd( ),
                                new HandleWaypointGroupRemove( ),
                                new HandleWaypointToggle( ),
                                new HandleWaypointRefresh( ),
                                new HandleWaypointFactionAdd( ),
                                new HandleWaypointFactionRemove( ),

                                new HandleUtilityExportServer( ),
                                new HandleUtilityGridsList( ),
                                new HandleUtilityGridsRefresh( ),
                                new HandleUtilityGridsCompare( ),

                                new HandleAdminTest( )
                            };

            _processThreads = new List<Thread>( );
            _processThread = new Thread( PluginProcessing );
            _processThread.Start( );

            //MyAPIGateway.Entities.OnEntityAdd -= new Action<VRage.ModAPI.IMyEntity>(OnEn);
            MyAPIGateway.Entities.OnEntityAdd -= OnEntityAdd;
            MyAPIGateway.Entities.OnEntityRemove -= OnEntityRemove;
            MyAPIGateway.Entities.OnEntityAdd += OnEntityAdd;
            MyAPIGateway.Entities.OnEntityRemove += OnEntityRemove;

            Log.Info( "Plugin '{0}' initialized. (Version: {1}  ID: {2})", Name, Version, Id );
        }
Beispiel #3
0
        private void DoInit(string path)
        {
            m_instance = this;
            //controlForm.Text = "Testing";
            m_pluginPath = path;

            // Load our settings
            PluginSettings.Instance.Load();

            // Setup process handlers
            m_processHandlers = new List <ProcessHandlerBase>();
            m_processHandlers.Add(new ProcessNewUserTransport());
            m_processHandlers.Add(new ProcessGreeting());
            m_processHandlers.Add(new ProcessRestart());
            m_processHandlers.Add(new ProcessInfo());
            m_processHandlers.Add(new ProcessCommunication());
            m_processHandlers.Add(new ProcessBackup());
            m_processHandlers.Add(new ProcessLoginTracking());
            m_processHandlers.Add(new ProcessProtection());
            m_processHandlers.Add(new ProcessDockingZone());
            m_processHandlers.Add(new ProcessConceal());
            m_processHandlers.Add(new ProcessWaypoints());
            m_processHandlers.Add(new ProcessCleanup());
            m_processHandlers.Add(new ProcessBlockEnforcement());
            m_processHandlers.Add(new ProcessEnable());
            m_processHandlers.Add(new ProcessSpawnShipTracking());

            // Setup chat handlers
            m_chatHandlers = new List <ChatHandlerBase>();
            m_chatHandlers.Add(new HandleInfo());
            m_chatHandlers.Add(new HandleTimeleft());
            m_chatHandlers.Add(new HandlePos());
            m_chatHandlers.Add(new HandleMsg());
            m_chatHandlers.Add(new HandleFaction());
            m_chatHandlers.Add(new HandleFactionF());
            m_chatHandlers.Add(new HandleMotd());

            m_chatHandlers.Add(new HandleAdminScanAreaAt());                      //
            m_chatHandlers.Add(new HandleAdminScanAreaTowards());                 //
            m_chatHandlers.Add(new HandleAdminScanNoBeacon());                    //
            m_chatHandlers.Add(new HandleAdminScanInactive());                    //
            m_chatHandlers.Add(new HandleAdminScanEntityId());                    //
            m_chatHandlers.Add(new HandleAdminScanCleanup());
            m_chatHandlers.Add(new HandleAdminScanOverlimit());
            m_chatHandlers.Add(new HandleAdminScanGrids());

            m_chatHandlers.Add(new HandleAdminMoveAreaToPosition());              //
            m_chatHandlers.Add(new HandleAdminMoveAreaTowards());                 //
            m_chatHandlers.Add(new HandleAdminMovePlayerTo());                    //
            m_chatHandlers.Add(new HandleAdminMovePlayerPosition());              //
            m_chatHandlers.Add(new HandleAdminMoveGridTo());                      //

            m_chatHandlers.Add(new HandleAdminDeleteGridsArea());                 //
            m_chatHandlers.Add(new HandleAdminDeleteShipsArea());                 //
            m_chatHandlers.Add(new HandleAdminDeleteStationsArea());              //
            m_chatHandlers.Add(new HandleAdminDeleteNoBeacon());                  //
            m_chatHandlers.Add(new HandleAdminDeleteInactive());                  //
            m_chatHandlers.Add(new HandleAdminDeleteCleanup());
            m_chatHandlers.Add(new HandleAdminDeleteGrids());

            m_chatHandlers.Add(new HandleAdminSettings());
            m_chatHandlers.Add(new HandleAdminNotify());
            m_chatHandlers.Add(new HandleAdminBackup());
            m_chatHandlers.Add(new HandleAdminRestart());
            m_chatHandlers.Add(new HandleAdminMemory());

            m_chatHandlers.Add(new HandleAdminOwnershipChange());                 //

            m_chatHandlers.Add(new HandleAdminPlayerListActive());                //
            m_chatHandlers.Add(new HandleAdminPlayerListInactive());              //

            m_chatHandlers.Add(new HandleAdminConceal());
            m_chatHandlers.Add(new HandleAdminReveal());

            m_chatHandlers.Add(new HandleDockValidate());
            m_chatHandlers.Add(new HandleDockDock());
            m_chatHandlers.Add(new HandleDockUndock());
            m_chatHandlers.Add(new HandleDockList());

            m_chatHandlers.Add(new HandleWaypointAdd());
            m_chatHandlers.Add(new HandleWaypointRemove());
            m_chatHandlers.Add(new HandleWaypointList());
            m_chatHandlers.Add(new HandleWaypointGroupAdd());
            m_chatHandlers.Add(new HandleWaypointGroupRemove());
            m_chatHandlers.Add(new HandleWaypointToggle());
            m_chatHandlers.Add(new HandleWaypointRefresh());
            m_chatHandlers.Add(new HandleWaypointFactionAdd());
            m_chatHandlers.Add(new HandleWaypointFactionRemove());

            m_chatHandlers.Add(new HandleUtilityExportServer());
            m_chatHandlers.Add(new HandleUtilityGridsList());
            m_chatHandlers.Add(new HandleUtilityGridsRefresh());
            m_chatHandlers.Add(new HandleUtilityGridsCompare());

//			m_chatHandlers.Add(new HandleAdminPlayer());

            m_chatHandlers.Add(new HandleAdminTest());
//			m_chatHandlers.Add(new HandleAdmin());

            m_lastProcessUpdate = DateTime.Now;
            m_processThreads    = new List <Thread>();
            m_processThread     = new Thread(new ThreadStart(PluginProcessing));
            m_processThread.Start();

            Logging.WriteLineAndConsole(string.Format("Plugin '{0}' initialized. (Version: {1}  ID: {2})", Name, Version, Id));
        }
Beispiel #4
0
        private void DoInit(string path)
        {
            m_instance = this;
            //controlForm.Text = "Testing";
            m_pluginPath = path;

            // Load our settings
            PluginSettings.Instance.Load();

            // Setup process handlers
            m_processHandlers = new List<ProcessHandlerBase>();
            m_processHandlers.Add(new ProcessNewUserTransport());
            m_processHandlers.Add(new ProcessGreeting());
            m_processHandlers.Add(new ProcessRestart());
            m_processHandlers.Add(new ProcessInfo());
            m_processHandlers.Add(new ProcessCommunication());
            m_processHandlers.Add(new ProcessBackup());
            m_processHandlers.Add(new ProcessLoginTracking());
            m_processHandlers.Add(new ProcessProtection());
            m_processHandlers.Add(new ProcessDockingZone());
            m_processHandlers.Add(new ProcessWaypoints());
            m_processHandlers.Add(new ProcessCleanup());
            m_processHandlers.Add(new ProcessBlockEnforcement());
            m_processHandlers.Add(new ProcessSpawnShipTracking());
            //CC			m_processHandlers.Add(new ProcessConquest());
            m_processHandlers.Add(new ProcessRespawn());

            // Entity Managers
            m_processHandlers.Add(new ProcessConceal());
            m_processHandlers.Add(new ProcessTurrets());
            m_processHandlers.Add(new ProcessBlocks());
            //CC			m_processHandlers.Add(new ProcessClientConceal());

            // Setup chat handlers
            m_chatHandlers = new List<ChatHandlerBase>();
            m_chatHandlers.Add(new HandleInfo());
            m_chatHandlers.Add(new HandleTimeleft());
            m_chatHandlers.Add(new HandlePos());
            m_chatHandlers.Add(new HandleMsg());
            m_chatHandlers.Add(new HandleFaction());
            m_chatHandlers.Add(new HandleFactionF());
            m_chatHandlers.Add(new HandleMotd());
            m_chatHandlers.Add(new HandleLastSeen());

            m_chatHandlers.Add(new HandleAdminScanAreaAt());          //
            m_chatHandlers.Add(new HandleAdminScanAreaTowards());     //
            m_chatHandlers.Add(new HandleAdminScanNoBeacon());        //
            m_chatHandlers.Add(new HandleAdminScanInactive());        //
            m_chatHandlers.Add(new HandleAdminScanEntityId());        //
            m_chatHandlers.Add(new HandleAdminScanCleanup());
            m_chatHandlers.Add(new HandleAdminScanOverlimit());
            m_chatHandlers.Add(new HandleAdminScanGrids());

            m_chatHandlers.Add(new HandleAdminMoveAreaToPosition());  //
            m_chatHandlers.Add(new HandleAdminMoveAreaTowards());     //
            m_chatHandlers.Add(new HandleAdminMovePlayerTo());        //
            m_chatHandlers.Add(new HandleAdminMovePlayerPosition());  //
            m_chatHandlers.Add(new HandleAdminMoveGridTo());          //

            m_chatHandlers.Add(new HandleAdminDeleteGridsArea());     //
            m_chatHandlers.Add(new HandleAdminDeleteShipsArea());     //
            m_chatHandlers.Add(new HandleAdminDeleteStationsArea());  //
            m_chatHandlers.Add(new HandleAdminDeleteNoBeacon());      //
            m_chatHandlers.Add(new HandleAdminDeleteInactive());      //
            m_chatHandlers.Add(new HandleAdminDeleteCleanup());
            m_chatHandlers.Add(new HandleAdminDeleteGrids());

            m_chatHandlers.Add(new HandleAdminSettings());
            m_chatHandlers.Add(new HandleAdminNotify());
            m_chatHandlers.Add(new HandleAdminBackup());
            m_chatHandlers.Add(new HandleAdminRestart());
            m_chatHandlers.Add(new HandleAdminMemory());
            m_chatHandlers.Add(new HandleAdminStatistics());

            m_chatHandlers.Add(new HandleAdminOwnershipChange());     //

            m_chatHandlers.Add(new HandleAdminPlayerListActive());    //
            m_chatHandlers.Add(new HandleAdminPlayerListInactive());  //
            m_chatHandlers.Add(new HandleAdminPlayerCleanup());

            m_chatHandlers.Add(new HandleAdminConceal());
            m_chatHandlers.Add(new HandleAdminReveal());

            m_chatHandlers.Add(new HandleDockValidate());
            m_chatHandlers.Add(new HandleDockDock());
            m_chatHandlers.Add(new HandleDockUndock());
            m_chatHandlers.Add(new HandleDockList());
            m_chatHandlers.Add(new HandleAdminUndockAll());

            m_chatHandlers.Add(new HandleWaypointAdd());
            m_chatHandlers.Add(new HandleWaypointRemove());
            m_chatHandlers.Add(new HandleWaypointList());
            m_chatHandlers.Add(new HandleWaypointGroupAdd());
            m_chatHandlers.Add(new HandleWaypointGroupRemove());
            m_chatHandlers.Add(new HandleWaypointToggle());
            m_chatHandlers.Add(new HandleWaypointRefresh());
            m_chatHandlers.Add(new HandleWaypointFactionAdd());
            m_chatHandlers.Add(new HandleWaypointFactionRemove());

            m_chatHandlers.Add(new HandleUtilityExportServer());
            m_chatHandlers.Add(new HandleUtilityGridsList());
            m_chatHandlers.Add(new HandleUtilityGridsRefresh());
            m_chatHandlers.Add(new HandleUtilityGridsCompare());

            m_chatHandlers.Add(new HandleLeaderboardConquest());

            //			m_chatHandlers.Add(new HandleAdminPlayer());

            m_chatHandlers.Add(new HandleAdminTest());
            //			m_chatHandlers.Add(new HandleAdmin());

            m_lastProcessUpdate = DateTime.Now;
            m_processThreads = new List<Thread>();
            m_processThread = new Thread(new ThreadStart(PluginProcessing));
            m_processThread.Start();

            MyAPIGateway.Entities.OnEntityAdd -= OnEntityAdd;
            MyAPIGateway.Entities.OnEntityRemove -= OnEntityRemove;
            MyAPIGateway.Entities.OnEntityAdd += OnEntityAdd;
            MyAPIGateway.Entities.OnEntityRemove += OnEntityRemove;

            Logging.WriteLineAndConsole(string.Format("Plugin '{0}' initialized. (Version: {1}  ID: {2})", Name, Version, Id));
        }