// protected constructor to force Singleton instantiation BuildTable() { CSAI = CSAI.GetInstance(); aicallback = CSAI.aicallback; logfile = LogFile.GetInstance(); modname = aicallback.GetModName(); int numunitdefs = aicallback.GetNumUnitDefs(); logfile.WriteLine( "calling GetUnitDefList, for " + numunitdefs + " units ... " ); //availableunittypes = aicallback.GetUnitDefList(); availableunittypes = new IUnitDef[numunitdefs + 1]; for (int i = 1; i <= numunitdefs; i++) { availableunittypes[i] = aicallback.GetUnitDefByTypeId(i); logfile.WriteLine( i + " " + availableunittypes[i].name + " " + availableunittypes[i].humanName ); } logfile.WriteLine( "... done" ); if( !LoadCache( modname ) ) { aicallback.SendTextMsg( "Creating new cachefile for mod " + modname, 0 ); GenerateBuildTable( modname ); SaveCache( modname ); } }
public TankController( IPlayStyle playstyle ) { this.playstyle = playstyle; csai = CSAI.GetInstance(); aicallback = csai.aicallback; logfile = LogFile.GetInstance(); unitdefhelp = new UnitDefHelp( aicallback ); unitcontroller = UnitController.GetInstance(); enemycontroller = EnemyController.GetInstance(); buildtable = BuildTable.GetInstance(); enemyselector = new EnemySelector( 110, false, false ); attackpackcoordinator = new AttackPackCoordinator( TankDefsById ); spreadsearchpackcoordinator = new SpreadSearchPackCoordinator( TankDefsById ); movetopackcoordinator = new MoveToPackCoordinator( TankDefsById ); guardpackcoordinator = new GuardPackCoordinator( TankDefsById ); packcoordinatorselector = new PackCoordinatorSelector(); packcoordinatorselector.LoadCoordinator( attackpackcoordinator ); packcoordinatorselector.LoadCoordinator( spreadsearchpackcoordinator ); packcoordinatorselector.LoadCoordinator( movetopackcoordinator ); packcoordinatorselector.LoadCoordinator( guardpackcoordinator ); logfile.WriteLine( "*TankController Initialized*" ); }
public TankController( Dictionary< int,IUnitDef>UnitDefsById, IUnitDef typicalunitdef) { csai = CSAI.GetInstance(); aicallback = csai.aicallback; logfile = LogFile.GetInstance(); this.DefsById = UnitDefsById; this.typicalunitdef = typicalunitdef; unitcontroller = UnitController.GetInstance(); enemycontroller = EnemyController.GetInstance(); buildtable = BuildTable.GetInstance(); enemyselector = new EnemySelector2( typicalunitdef.speed * 2, typicalunitdef ); // speed here is experimental attackpackcoordinator = new AttackPackCoordinator(DefsById); spreadsearchpackcoordinator = new SpreadSearchPackCoordinator(DefsById); movetopackcoordinator = new MoveToPackCoordinator(DefsById); guardpackcoordinator = new GuardPackCoordinator(DefsById); packcoordinatorselector = new PackCoordinatorSelector(); packcoordinatorselector.LoadCoordinator( attackpackcoordinator ); packcoordinatorselector.LoadCoordinator( spreadsearchpackcoordinator ); packcoordinatorselector.LoadCoordinator( movetopackcoordinator ); packcoordinatorselector.LoadCoordinator( guardpackcoordinator ); logfile.WriteLine( "*TankController Initialized*" ); }
// protected constructor to force Singleton instantiation BuildTable() { CSAI = CSAI.GetInstance(); aicallback = CSAI.aicallback; logfile = LogFile.GetInstance(); modname = aicallback.GetModName(); logfile.WriteLine( "calling GetUnitDefList... " ); List<IUnitDef> unittypeslist = new List<IUnitDef>(); int numunittypes = aicallback.GetNumUnitDefs(); for (int i = 1; i <= numunittypes; i++) { unittypeslist.Add( aicallback.GetUnitDefByTypeId( i ) ); } availableunittypes = unittypeslist.ToArray(); logfile.WriteLine( "... done" ); if( !LoadCache( modname ) ) { aicallback.SendTextMsg( "Creating new cachefile for mod " + modname, 0 ); GenerateBuildTable( modname ); SaveCache( modname ); } }
LosMap() { csai = CSAI.GetInstance(); aicallback = csai.aicallback; logfile = LogFile.GetInstance(); unitcontroller = UnitController.GetInstance(); unitcontroller.UnitAddedEvent += new UnitController.UnitAddedHandler( UnitAdded ); unitcontroller.UnitRemovedEvent += new UnitController.UnitRemovedHandler( UnitRemoved ); friendlyunitpositionobserver = FriendlyUnitPositionObserver.GetInstance(); csai.TickEvent += new CSAI.TickHandler( Tick ); mapwidth = aicallback.GetMapWidth(); mapheight = aicallback.GetMapHeight(); logfile.WriteLine( "LosMap, create losarray" ); LastSeenFrameCount = new int[ mapwidth / 2, mapheight / 2 ]; logfile.WriteLine( "losarray created, initializing..." ); for( int y = 0; y < mapheight / 2; y++ ) { for( int x = 0; x < mapwidth / 2; x++ ) { LastSeenFrameCount[ x, y ] = -1000000; } } logfile.WriteLine( "losarray initialized" ); if (csai.DebugOn) { csai.RegisterVoiceCommand("dumplosmap", new CSAI.VoiceCommandHandler(DumpLosMap)); } }
// int BuildOffsetDistance = 25; // protected constructor to enforce Singleton pattern CommanderController() { random = new Random(); csai = CSAI.GetInstance(); aicallback = csai.aicallback; logfile = LogFile.GetInstance(); unitcontroller = UnitController.GetInstance(); buildtable = BuildTable.GetInstance(); metal = Metal.GetInstance(); // factorycontroller = PlayStyleManager.GetInstance().GetCurrentPlayStyle().GetFirstControllerOfType( typeof( IFactoryController ) ) as FactoryController; //csai.UnitFinishedEvent += new CSAI.UnitFinishedHandler( UnitFinished ); //csai.UnitDestroyedEvent += new CSAI.UnitDestroyedHandler( UnitDestroyed ); csai.UnitIdleEvent += new CSAI.UnitIdleHandler( UnitIdle ); //csai.UnitDamagedEvent += new CSAI.UnitDamagedHandler( UnitDamaged ); csai.TickEvent += new CSAI.TickHandler( Tick ); unitcontroller.UnitAddedEvent += new UnitController.UnitAddedHandler( UnitAdded ); unitcontroller.UnitRemovedEvent += new UnitController.UnitRemovedHandler( UnitRemoved ); csai.RegisterVoiceCommand( "commandermove", new CSAI.VoiceCommandHandler( VoiceCommandMoveCommander ) ); csai.RegisterVoiceCommand( "commandergetpos", new CSAI.VoiceCommandHandler( VoiceCommandCommanderGetPos ) ); csai.RegisterVoiceCommand( "commanderbuildat", new CSAI.VoiceCommandHandler( VoiceCommandCommanderBuildAt ) ); csai.RegisterVoiceCommand( "commanderbuild", new CSAI.VoiceCommandHandler( VoiceCommandCommanderBuild ) ); csai.RegisterVoiceCommand( "commanderbuildpower", new CSAI.VoiceCommandHandler( VoiceCommandCommanderBuildPower ) ); csai.RegisterVoiceCommand( "commanderbuildextractor", new CSAI.VoiceCommandHandler( VoiceCommandCommanderBuildExtractor ) ); csai.RegisterVoiceCommand( "commanderisactive", new CSAI.VoiceCommandHandler( VoiceCommandCommanderIsActive ) ); }
Ownership() { csai = CSAI.GetInstance(); aicallback = csai.aicallback; logfile = logfile.GetInstance(); csai.UnitCreatedEvent += new CSAI.UnitCreatedHandler(csai_UnitCreatedEvent); }
public MovementMaps() { csai = CSAI.GetInstance(); aicallback = csai.aicallback; logfile = LogFile.GetInstance(); GenerateMaps(); }
public PlayStyle() { csai = CSAI.GetInstance(); aicallback = csai.aicallback; logfile = LogFile.GetInstance(); PlayStyleManager.GetInstance().RegisterPlayStyle( this ); }
public MobileFusionController() { csai = CSAI.GetInstance(); aicallback = csai.aicallback; logfile = LogFile.GetInstance(); UnitController.GetInstance().UnitAddedEvent += new UnitController.UnitAddedHandler(MobileFusionController_UnitAddedEvent); UnitController.GetInstance().AllUnitsLoaded += new UnitController.AllUnitsLoadedHandler(MobileFusionController_AllUnitsLoaded); }
public void Go() { csai = CSAI.GetInstance(); aicallback = csai.aicallback; logfile = LogFile.GetInstance(); csai.RegisterVoiceCommand( "dumppoints", new CSAI.VoiceCommandHandler( this.DumpPoints ) ); csai.RegisterVoiceCommand( "drawradii", new CSAI.VoiceCommandHandler( this.DrawRadii ) ); }
// string defaultplaystylename = "tankrush"; PlayStyleManager() { csai = CSAI.GetInstance(); aicallback = csai.aicallback; logfile = LogFile.GetInstance(); csai.RegisterVoiceCommand( "showplaystyles", new CSAI.VoiceCommandHandler( this.VoiceCommandListPlayStyles ) ); csai.RegisterVoiceCommand( "chooseplaystyle", new CSAI.VoiceCommandHandler( this.VoiceCommandChoosePlayStyle ) ); }
public RadarController( IPlayStyle playstyle ) { this.playstyle = playstyle; csai = CSAI.GetInstance(); aicallback = csai.aicallback; logfile = LogFile.GetInstance(); unitcontroller = UnitController.GetInstance(); buildtable = BuildTable.GetInstance(); }
public Workflow() { csai = CSAI.GetInstance(); aicallback = csai.aicallback; logfile = LogFile.GetInstance(); if (csai.DebugOn) { csai.RegisterVoiceCommand("dumpworkflow", new CSAI.VoiceCommandHandler(DumpWorkFlow)); } }
BuildPlanner() { csai = CSAI.GetInstance(); aicallback = csai.aicallback; logfile = LogFile.GetInstance(); unitdefhelp = new UnitDefHelp( aicallback ); mapwidth = aicallback.GetMapWidth(); mapheight = aicallback.GetMapHeight(); }
//public delegate void AttackPackDeadHandler(); //public event AttackPackDeadHandler AttackPackDeadEvent; // can pass in pointer to a hashtable in another class if we want // ie other class can directly modify our hashtable public AttackPackCoordinator(Dictionary<int, IUnitDef> UnitDefListByDeployedId) { this.UnitDefListByDeployedId = UnitDefListByDeployedId; csai = CSAI.GetInstance(); aicallback = csai.aicallback; logfile = LogFile.GetInstance(); debugon = csai.DebugOn; csai.TickEvent += new CSAI.TickHandler( this.Tick ); }
//public delegate void AttackPackDeadHandler(); //public event AttackPackDeadHandler AttackPackDeadEvent; // can pass in pointer to a hashtable in another class if we want // ie other class can directly modify our hashtable public AttackPackCoordinatorUseGroup( Hashtable UnitDefListByDeployedId ) { this.UnitDefListByDeployedId = UnitDefListByDeployedId; csai = CSAI.GetInstance(); aicallback = csai.aicallback; logfile = LogFile.GetInstance(); debugon = csai.DebugOn; csai.TickEvent += new CSAI.TickHandler( this.Tick ); }
List<CommandInfo> recentcommands = new List<CommandInfo>(); // for debugging, logging #endregion Fields #region Constructors GiveOrderWrapper() { csai = CSAI.GetInstance(); aicallback = csai.aicallback; logfile = LogFile.GetInstance(); csai.TickEvent += new CSAI.TickHandler(csai_TickEvent); if (csai.DebugOn) { csai.RegisterVoiceCommand("dumporders", new CSAI.VoiceCommandHandler(DumpOrders)); } }
// can pass in pointer to a hashtable in another class if we want // ie other class can directly modify our hashtable public SpreadSearchPackCoordinator( Hashtable UnitDefListByDeployedId ) { this.UnitDefListByDeployedId = UnitDefListByDeployedId; csai = CSAI.GetInstance(); aicallback = csai.aicallback; logfile = LogFile.GetInstance(); debugon = csai.DebugOn; csai.TickEvent += new CSAI.TickHandler( this.Tick ); csai.UnitIdleEvent += new CSAI.UnitIdleHandler( UnitIdle ); }
public FactoryController( IPlayStyle playstyle ) { this.playstyle = playstyle; csai = CSAI.GetInstance(); aicallback = csai.aicallback; logfile = LogFile.GetInstance(); buildtable = BuildTable.GetInstance(); unitcontroller = UnitController.GetInstance(); unitdefhelp = new UnitDefHelp( aicallback ); csai.RegisterVoiceCommand( "dumpfactories", new CSAI.VoiceCommandHandler( DumpFactories ) ); }
Dictionary<int, OwnershipOrder> ordersbyconstructorid = new Dictionary<int, OwnershipOrder>(); // index of orders by constructorid, to allow removal later #endregion Fields #region Constructors Ownership() { csai = CSAI.GetInstance(); aicallback = csai.aicallback; logfile = LogFile.GetInstance(); csai.UnitCreatedEvent += new CSAI.UnitCreatedHandler(csai_UnitCreatedEvent); csai.UnitDestroyedEvent += new CSAI.UnitDestroyedHandler(csai_UnitDestroyedEvent); csai.UnitFinishedEvent += new CSAI.UnitFinishedHandler(csai_UnitFinishedEvent); if (csai.DebugOn) { csai.RegisterVoiceCommand("dumpownership", new CSAI.VoiceCommandHandler(DumpOwnership)); } }
public EnemySelector( double maxenemyspeed, bool WaterOk, bool BadTerrainOk ) { csai = CSAI.GetInstance(); aicallback = csai.aicallback; logfile = LogFile.GetInstance(); // csai.EnemyEntersLOSEvent += new CSAI.EnemyEntersLOSHandler( EnemyEntersLOS ); enemycontroller = EnemyController.GetInstance(); unitdefhelp = new UnitDefHelp( aicallback ); this.maxenemyspeed = maxenemyspeed; this.WaterOk = WaterOk; this.BadTerrainOk = BadTerrainOk; }
// do we need this??? handled by specific controllers??? //IntArrayList commanders = new IntArrayList(); //IntArrayList constructors = new IntArrayList(); //IntArrayList metalcollectors = new IntArrayList(); //IntArrayList energycollectors = new IntArrayList(); //IntArrayList groundattack = new IntArrayList(); UnitController() { csai = CSAI.GetInstance(); aicallback = csai.aicallback; logfile = LogFile.GetInstance(); unitdefhelp = new UnitDefHelp( aicallback ); csai.UnitFinishedEvent += new CSAI.UnitFinishedHandler( this.NewUnitFinished ); csai.UnitDestroyedEvent += new CSAI.UnitDestroyedHandler( this.UnitDestroyed ); csai.RegisterVoiceCommand( "killallfriendly", new CSAI.VoiceCommandHandler( this.VoiceCommandKillAllFriendly ) ); csai.RegisterVoiceCommand( "countunits", new CSAI.VoiceCommandHandler( this.VoiceCommandCountUnits ) ); logfile.WriteLine ("*UnitController initialized*"); }
// can pass in pointer to a hashtable in another class if we want // ie other class can directly modify our hashtable public SpreadSearchPackCoordinatorWithSearchGrid(Dictionary<int, IUnitDef> UnitDefListByDeployedId) { this.UnitDefListByDeployedId = UnitDefListByDeployedId; csai = CSAI.GetInstance(); aicallback = csai.aicallback; logfile = LogFile.GetInstance(); mapwidth = aicallback.GetMapWidth(); mapheight = aicallback.GetMapHeight(); debugon = csai.DebugOn; csai.TickEvent += new CSAI.TickHandler( this.Tick ); csai.UnitIdleEvent += new CSAI.UnitIdleHandler( UnitIdle ); }
// protected constructor to force Singleton instantiation Metal() { csai = CSAI.GetInstance(); aicallback = csai.aicallback; logfile = LogFile.GetInstance(); unitcontroller = UnitController.GetInstance(); unitdefhelp = new UnitDefHelp( aicallback ); ExtractorRadius = aicallback.GetExtractorRadius(); unitcontroller.UnitAddedEvent += new UnitController.UnitAddedHandler( UnitAdded ); unitcontroller.UnitRemovedEvent += new UnitController.UnitRemovedHandler( UnitRemoved ); csai.RegisterVoiceCommand( "showmetalspots", new CSAI.VoiceCommandHandler( this.DrawMetalSpotsCommand ) ); }
BuildMap() { csai = CSAI.GetInstance(); aicallback = csai.aicallback; logfile = LogFile.GetInstance(); unitdefhelp = new UnitDefHelp( aicallback ); unitcontroller = UnitController.GetInstance(); csai.UnitCreatedEvent += new CSAI.UnitCreatedHandler( UnitCreated ); csai.UnitDestroyedEvent += new CSAI.UnitDestroyedHandler( UnitDestroyed ); unitcontroller.UnitAddedEvent += new UnitController.UnitAddedHandler( UnitCreated ); Init(); }
// int terrainwidth; // int terrainheight; public ScoutControllerRaider() { csai = CSAI.GetInstance(); aicallback = csai.aicallback; logfile = LogFile.GetInstance(); random = new Random(); unitcontroller = UnitController.GetInstance(); // buildtable = BuildTable.GetInstance(); enemycontroller = EnemyController.GetInstance(); searchcoordinator = new SpreadSearchPackCoordinatorWithSearchGrid( ScoutUnitDefsById ); logfile.WriteLine( "*ScoutControllerRaider initialized*" ); }
public ScoutControllerRandomSearch( IPlayStyle playstyle ) { random = new Random(); this.playstyle = playstyle; csai = CSAI.GetInstance(); aicallback = csai.aicallback; logfile = LogFile.GetInstance(); unitcontroller = UnitController.GetInstance(); buildtable = BuildTable.GetInstance(); searchcoordinator = new SpreadSearchPackCoordinatorWithSearchGrid( ScoutUnitDefsById ); logfile.WriteLine( "*ScoutController initialized*" ); }
FriendlyUnitPositionObserver() { csai = CSAI.GetInstance(); aicallback = csai.aicallback; logfile = LogFile.GetInstance(); //csai.UnitFinishedEvent += new CSAI.UnitFinishedHandler( this.NewUnitFinished ); //csai.UnitDestroyedEvent += new CSAI.UnitDestroyedHandler( this.UnitDestroyed ); csai.TickEvent += new CSAI.TickHandler( Tick ); unitcontroller = UnitController.GetInstance(); unitcontroller.UnitAddedEvent += new UnitController.UnitAddedHandler( UnitAdded ); unitcontroller.UnitRemovedEvent += new UnitController.UnitRemovedHandler( UnitRemoved ); unitdefhelp = new UnitDefHelp( aicallback ); }
public EnemySelector2(double maxenemyspeed, IUnitDef typicalunitdef) { csai = CSAI.GetInstance(); aicallback = csai.aicallback; logfile = LogFile.GetInstance(); // csai.EnemyEntersLOSEvent += new CSAI.EnemyEntersLOSHandler( EnemyEntersLOS ); enemycontroller = EnemyController.GetInstance(); unitdefhelp = new UnitDefHelp(aicallback); this.maxenemyspeed = maxenemyspeed; this.WaterOk = WaterOk; this.BadTerrainOk = BadTerrainOk; this.typicalunitdef = typicalunitdef; // startarea = MovementMaps.GetInstance().GetArea(typicalunitdef, startpos); }
public void InitAI(IAICallback aicallback, int team) { this.aicallback = aicallback; Thread.CurrentThread.CurrentCulture = new CultureInfo("en-GB"); try{ Directory.CreateDirectory(AIDirectoryPath); this.Team = team; logfile = LogFile.GetInstance().Init(Path.Combine(AIDirectoryPath, "csharpai_team" + team + ".log")); logfile.WriteLine("C# AI started v" + AIVersion + ", team " + team + " ref " + reference + " map " + aicallback.GetMapName() + " mod " + aicallback.GetModName()); logfile.WriteLine("RL Date/time: " + DateTime.Now.ToString()); if (File.Exists(AIDirectoryPath + "/debug.flg")) // if this file exists, activate debug mode; saves manually changing this for releases { logfile.WriteLine("Toggling debug on"); DebugOn = true; } if (DebugOn) { //new Testing.RunTests().Go(); } InitCache(); /* * IUnitDef unitdef = aicallback.GetUnitDefByTypeId(34); * aicallback.SendTextMsg(unitdef.name,0); * aicallback.SendTextMsg(unitdef.id.ToString(), 0); * aicallback.SendTextMsg(unitdef.humanName, 0); * aicallback.SendTextMsg(unitdef.movedata.moveType.ToString(), 0); * aicallback.SendTextMsg(unitdef.movedata.maxSlope.ToString(), 0); * aicallback.GetMetalMap(); * aicallback.GetLosMap(); * aicallback.GetRadarMap(); * aicallback.GetFriendlyUnits(); * aicallback.GetFeatures(); * aicallback.GetEnemyUnitsInRadarAndLos(); * * Metal.GetInstance(); */ //aicallback.GetElevation(300,300); //new SlopeMap().GetSlopeMap(); //double[,] _SlopeMap = new double[256, 256]; //LosMap.GetInstance(); //MovementMaps.GetInstance(); //BuildMap.GetInstance().Init(); //return; // -- test stuff here -- logfile.WriteLine("Is game paused? : " + aicallback.IsGamePaused()); // -- end test stuff -- BuildEconomy buildeconomy = new BuildEconomy(); // UnitController.GetInstance().LoadExistingUnits(); // need this if we're being reloaded in middle of a game, to get already existing units SendTextMsg("C# AI initialized v" + AIVersion + ", team " + team); } catch (Exception e) { logfile.WriteLine("Exception: " + e.ToString()); SendTextMsg("Exception: " + e.ToString()); } }
public PackCoordinatorSelector() { logfile = LogFile.GetInstance(); }
public SlopeMap() { csai = CSAI.GetInstance(); aicallback = csai.aicallback; logfile = LogFile.GetInstance(); }
EnergyController() { csai = CSAI.GetInstance(); aicallback = csai.aicallback; logfile = LogFile.GetInstance(); }
//int numOfUnits = 0; //IUnitDef[] unitList; //IUnitDef solarcollectordef; public void InitAI(IAICallback aicallback, int team) { Thread.CurrentThread.CurrentCulture = new CultureInfo("en-GB"); this.aicallback = aicallback; try{ this.Team = team; logfile = LogFile.GetInstance().Init(team); logfile.WriteLine("C# AI started v" + AIVersion + ", team " + team + " ref " + reference + " map " + aicallback.GetMapName() + " mod " + aicallback.GetModName()); csaiuserinteraction = CSAIUserInteraction.GetInstance(); if (File.Exists("AI/CSAI/debug.flg")) // if this file exists, activate debug mode; saves manually changing this for releases { logfile.WriteLine("Toggling debug on"); DebugOn = true; } if (DebugOn) { new Testing.RunTests().Go(); } InitCache(); PlayStyleManager.GetInstance(); LoadPlayStyles.Go(); metal = Metal.GetInstance(); CommanderController.GetInstance(); BuildTable.GetInstance(); UnitController.GetInstance(); EnemyController.GetInstance(); FriendlyUnitPositionObserver.GetInstance(); EnergyController.GetInstance(); MovementMaps.GetInstance(); BuildMap.GetInstance(); LosMap.GetInstance(); //FactoryController.GetInstance(); //RadarController.GetInstance(); //TankController.GetInstance(); //ScoutController.GetInstance(); //ConstructorController.GetInstance(); metal.Init(); BuildPlanner.GetInstance(); UnitController.GetInstance().LoadExistingUnits(); // need this if we're being reloaded in middle of a game, to get already existing units EnemyController.GetInstance().LoadExistingUnits(); StrategyController.GetInstance(); LoadStrategies.Go(); PlayStyleManager.GetInstance().ChoosePlayStyle("tankrush"); if (aicallback.GetModName().ToLower().IndexOf("aass") == 0 || aicallback.GetModName().ToLower().IndexOf("xtape") == 0) { SendTextMsg("C# AI initialized v" + AIVersion + ", team " + team); SendTextMsg("Please say '.csai help' for available commands"); PlayStyleManager.GetInstance().ListPlayStyles(); //CommanderController.GetInstance().CommanderBuildPower(); } else { SendTextMsg("Warning: CSAI needs AA2.23 or XTA7 to run correctly at this time"); logfile.WriteLine("*********************************************************"); logfile.WriteLine("*********************************************************"); logfile.WriteLine("**** ****"); logfile.WriteLine("**** Warning: CSAI needs AA2.23 or XTA7 to run correctly at this time ****"); logfile.WriteLine("**** ****"); logfile.WriteLine("*********************************************************"); logfile.WriteLine("*********************************************************"); } } catch (Exception e) { logfile.WriteLine("Exception: " + e.ToString()); SendTextMsg("Exception: " + e.ToString()); } }