public LeechApp(ILeechConfig config, IBotManager botManager, IBotsConfiguration botsConfig, ITickDispatcher tickDisp, IDataStorage dataStorage, IInstrumTable insTable, IStopOrderTable stopOrderTable, IOrderTable orderTable, ITradeTable tradeTable, IHoldingTable holdingTable, ICashTable positionTable, AccountTable accountTable, IInsStoreData insStoreData, ILogger logger) { _config = config; _scheduler = new Scheduler(logger); _botsConfig = botsConfig; _tickDispatcher = tickDisp; _botManager = botManager; _dataStorage = dataStorage; _accountTable = accountTable; _instrumTable = insTable; _orderTable = orderTable; _tradeTable = tradeTable; _stopOrderTable = stopOrderTable; _holdingTable = holdingTable; _cashTable = positionTable; _insStoreData = insStoreData; _logger = logger; _dataProtect = IoC.Resolve <DataProtect>(); _lpClientApp = new LpClientApp(_dataProtect, _instrumTable, _accountTable, _stopOrderTable, _orderTable, _tradeTable, _cashTable, _holdingTable, _tickDispatcher, _logger); _allTradesData = new AllTradesData(_instrumTable, _insStoreData, _logger); _alorTrade = new AlorTradeWrapper(_instrumTable, _stopOrderTable, _orderTable, _tradeTable, _holdingTable, _cashTable, _accountTable, _tickDispatcher, _config, _logger); }
public void botSetState(string bot, string State) { //this is a test case of being able to get access to a property //of the actual rexbot itself through the botAPI IBotManager manager = World.RequestModuleInterface <IBotManager>(); if (manager != null) { RexBot rxbot; rxbot = (RexBot)manager.GetBot(UUID.Parse(bot)); //follow up with this switch (State.ToLower()) { case "walking": rxbot.State = RexBot.RexBotState.Walking; break; case "idle": rxbot.State = RexBot.RexBotState.Idle; break; case "flying": rxbot.State = RexBot.RexBotState.Flying; break; default: rxbot.State = RexBot.RexBotState.Unknown; break; } } }
public void llPursue(LSL_String target, LSL_List options) { IBotManager botManager = World.RequestModuleInterface <IBotManager>(); if (botManager != null) { float fuzz = 2; Vector3 offset = Vector3.Zero; bool requireLOS = false; // 20131224 not used bool intercept; = false; //Not implemented for (int i = 0; i < options.Length; i += 2) { LSL_Integer opt = options.GetLSLIntegerItem(i); if (opt == ScriptBaseClass.PURSUIT_FUZZ_FACTOR) { fuzz = (float)options.GetLSLFloatItem(i + 1).value; } if (opt == ScriptBaseClass.PURSUIT_OFFSET) { offset = options.GetVector3Item(i + 1).ToVector3(); } if (opt == ScriptBaseClass.REQUIRE_LINE_OF_SIGHT) { requireLOS = options.GetLSLIntegerItem(i + 1) == 1; } // 20131224 not used if (opt == ScriptBaseClass.PURSUIT_INTERCEPT) // 20131224 not used intercept = options.GetLSLIntegerItem(i + 1) == 1; } botManager.FollowAvatar(m_host.ParentEntity.UUID, target.m_string, fuzz, fuzz, requireLOS, offset, m_host.ParentEntity.OwnerID); } }
public void botSetMap(string keyOfBot, LSL_List positions, LSL_List movementType, LSL_Integer flags) { if (!ScriptProtection.CheckThreatLevel(ThreatLevel.Moderate, "botSetMap", m_host, "bot", m_itemID)) { return; } List <Vector3> PositionsMap = new List <Vector3>(); for (int i = 0; i < positions.Length; i++) { LSL_Vector pos = positions.GetVector3Item(i); PositionsMap.Add(new Vector3((float)pos.x, (float)pos.y, (float)pos.z)); } List <TravelMode> TravelMap = new List <TravelMode>(); for (int i = 0; i < movementType.Length; i++) { LSL_Integer travel = movementType.GetLSLIntegerItem(i); TravelMap.Add((TravelMode)travel.value); } IBotManager manager = World.RequestModuleInterface <IBotManager>(); if (manager != null) { manager.SetBotMap(UUID.Parse(keyOfBot), PositionsMap, TravelMap, flags.value, m_host.OwnerID); } }
public Game() { GameBuilder builder = new GameBuilder(); Cg = builder.CustomGameBuilder(); Phases = builder.PhaseManagerBuilder(); _loop = builder.LoopBuilder(Phases); Chat = builder.ChatBuilder(Cg.Chat); //ISlotContentHistory slotContentHistory = builder.SlotContentHistoryBuilder(); BotsModifiedFlag modifiedFlag = new BotsModifiedFlag(); Slots = builder.SlotBuilder(Cg.AI, FilledSlotsFunc, modifiedFlag); Bots = builder.BotBuilder(Cg.AI, Slots, modifiedFlag); //Players = new PlayerManager(this); //Match = new MatchManager(this); //Logger = new MatchLogger(this); //Maps = new MapChooser(this, Map.A_HorizonLunarColony); //todolater get this from the user. Also need to load preset //Joins = new JoinManager(this); //Loop.AddPhaselessLoop(IncrementTime, 1); }
public App(ILogger logger, IConfiguration configuration, IBotManager manager, ILiteDatabase database) { _logger = logger; _config = configuration; _manager = manager; _database = database; }
/// <summary> /// Initializes an instance of middleware /// </summary> /// <param name="next">Instance of request delegate</param> /// <param name="botManager">Bot manager for the bot</param> /// <param name="logger">Logger for this middleware</param> public TelegramGameScoreMiddleware(RequestDelegate next, IBotManager <TBot> botManager, ILogger <TelegramGameScoreMiddleware <TBot> > logger) { _next = next; _logger = logger; _botManager = (IInternalBotManager <TBot>)botManager; }
/// <summary> /// Initializes an instance of middleware /// </summary> /// <param name="next">Instance of request delegate</param> /// <param name="botManager">Bot manager for the bot</param> /// <param name="logger">Logger for this middleware</param> public TelegramBotMiddleware(RequestDelegate next, IBotManager <TBot> botManager, ILogger <TelegramBotMiddleware <TBot> > logger) { _next = next; _botManager = botManager; _logger = logger; }
public BotNotifier(IMapper mapper, IBotManager botManager, IServiceScopeFactory serviceScopeFactory) { _mapper = mapper; _botManager = botManager; _serviceScopeFactory = serviceScopeFactory; }
public void llDeleteCharacter() { IBotManager botManager = World.RequestModuleInterface <IBotManager>(); if (botManager != null) { botManager.RemoveCharacter(m_host.ParentEntity.UUID); } }
public void botSendChatMessage(string bot, string message, int sayType) { IBotManager manager = World.RequestModuleInterface <IBotManager> (); if (manager != null) { manager.SendChatMessage(UUID.Parse(bot), message, sayType); } }
public void botSetPathMap(string bot, string pathMap, int x, int y, int cornerstoneX, int cornerstoneY) { IBotManager manager = World.RequestModuleInterface <IBotManager> (); if (manager != null) { manager.ReadMap(UUID.Parse(bot), pathMap, x, y, cornerstoneX, cornerstoneY); } }
public void botRemoveBot(string bot) { IBotManager manager = World.RequestModuleInterface <IBotManager> (); if (manager != null) { manager.RemoveAvatar(UUID.Parse(bot), m_host.ParentEntity.Scene); } }
public void botStopFollowAvatar(string bot, string avatarName) { IBotManager manager = World.RequestModuleInterface <IBotManager> (); if (manager != null) { manager.StopFollowAvatar(UUID.Parse(bot), avatarName); } }
public void botStart(string bot) { IBotManager manager = World.RequestModuleInterface <IBotManager>(); if (manager != null) { manager.EnableAutoMove(UUID.Parse(bot)); } }
public void botResume(string bot) { IBotManager manager = World.RequestModuleInterface <IBotManager>(); if (manager != null) { manager.UnpauseAutoMove(UUID.Parse(bot)); } }
public void botSetShouldFly(string keyOfBot, int ShouldFly) { IBotManager manager = World.RequestModuleInterface <IBotManager> (); if (manager != null) { manager.SetBotShouldFly(UUID.Parse(keyOfBot), ShouldFly == 1); } }
public string botCreateBot(string FirstName, string LastName, string appearanceToClone) { IBotManager manager = World.RequestModuleInterface <IBotManager>(); if (manager != null) { return(manager.CreateAvatar(FirstName, LastName, m_host.ParentEntity.Scene, UUID.Parse(appearanceToClone)).ToString()); } return(""); }
public void botFindPath(string bot, LSL_Vector startPos, LSL_Vector endPos) { IBotManager manager = World.RequestModuleInterface <IBotManager> (); if (manager != null) { manager.FindPath(UUID.Parse(bot), new Vector3((float)startPos.x, (float)startPos.y, (float)startPos.z), new Vector3((float)endPos.x, (float)endPos.y, (float)endPos.z)); } }
public void llCreateCharacter(LSL_List options) { IBotManager botManager = World.RequestModuleInterface <IBotManager>(); if (botManager != null) { botManager.CreateCharacter(m_host.ParentEntity.UUID, World); llUpdateCharacter(options); } }
/// <summary> /// Removes and disables webhooks for bot /// </summary> /// <typeparam name="TBot">Type of bot</typeparam> /// <param name="app">Instance of IApplicationBuilder</param> /// <param name="ensureWebhookDisabled">If true, a request is immediately made to delete webhook</param> /// <returns>Instance of IApplicationBuilder</returns> public static IApplicationBuilder UseTelegramBotLongPolling <TBot>(this IApplicationBuilder app, bool ensureWebhookDisabled = true) where TBot : BotBase <TBot> { IBotManager <TBot> botManager = FindBotManager <TBot>(app); if (ensureWebhookDisabled) { botManager.SetWebhookStateAsync(false).Wait(); } return(app); }
public string botSpawnAttackBot(string FirstName, string LastName, string appearanceToClone, string AvatarToFollowName) { UUID botUUID; IBotManager manager = World.RequestModuleInterface <IBotManager>(); if (manager != null) { botUUID = manager.SpawnAttackBot(FirstName, LastName, m_host.ParentEntity.Scene, UUID.Parse(appearanceToClone), AvatarToFollowName); return(botUUID.ToString()); } return(""); }
/// <summary> /// Add Telegram bot webhook handling functionality to the pipeline /// </summary> /// <typeparam name="TBot">Type of bot</typeparam> /// <param name="app">Instance of IApplicationBuilder</param> /// <param name="ensureWebhookEnabled">Whether to set the webhook immediately by making a request to Telegram bot API</param> /// <returns>Instance of IApplicationBuilder</returns> public static IApplicationBuilder UseTelegramBotWebhook <TBot>(this IApplicationBuilder app, bool ensureWebhookEnabled = true) where TBot : BotBase <TBot> { IBotManager <TBot> botManager = FindBotManager <TBot>(app); if (ensureWebhookEnabled) { botManager.SetWebhookStateAsync(true).Wait(); } return(app.UseMiddleware <TelegramBotMiddleware <TBot> >()); }
public void botAddTag(string bot, string tag) { if (!ScriptProtection.CheckThreatLevel(ThreatLevel.Moderate, "botAddTag", m_host, "bot", m_itemID)) { return; } IBotManager manager = World.RequestModuleInterface <IBotManager>(); if (manager != null) { manager.AddTagToBot(UUID.Parse(bot), tag, m_host.OwnerID); } }
public void botSendIM(string bot, string user, string message) { if (!ScriptProtection.CheckThreatLevel(ThreatLevel.Moderate, "botSendIM", m_host, "bot", m_itemID)) { return; } IBotManager manager = World.RequestModuleInterface <IBotManager>(); if (manager != null) { manager.SendIM(UUID.Parse(bot), UUID.Parse(user), message, m_host.OwnerID); } }
public void botSendChatMessage(string bot, string message, int channel, int sayType) { if (!ScriptProtection.CheckThreatLevel(ThreatLevel.Moderate, "botSendChatMessage", m_host, "bot", m_itemID)) { return; } IBotManager manager = World.RequestModuleInterface <IBotManager>(); if (manager != null) { manager.SendChatMessage(UUID.Parse(bot), message, sayType, channel, m_host.OwnerID); } }
public void botStopFollowAvatar(string bot) { if (!ScriptProtection.CheckThreatLevel(ThreatLevel.Moderate, "botStopFollowAvatar", m_host, "bot", m_itemID)) { return; } IBotManager manager = World.RequestModuleInterface <IBotManager>(); if (manager != null) { manager.StopFollowAvatar(UUID.Parse(bot), m_host.OwnerID); } }
public void botSetShouldFly(string keyOfBot, int ShouldFly) { if (!ScriptProtection.CheckThreatLevel(ThreatLevel.Moderate, "botSetShouldFly", m_host, "bot", m_itemID)) { return; } IBotManager manager = World.RequestModuleInterface <IBotManager>(); if (manager != null) { manager.SetBotShouldFly(UUID.Parse(keyOfBot), ShouldFly == 1, m_host.OwnerID); } }
public void botRemoveBotsWithTag(string tag) { if ( !ScriptProtection.CheckThreatLevel(ThreatLevel.Moderate, "botRemoveBotsWithTag", m_host, "bot", m_itemID)) { return; } IBotManager manager = World.RequestModuleInterface <IBotManager>(); if (manager != null) { manager.RemoveBots(tag, m_host.OwnerID); } }
public void botSetSpeed(LSL_Key bot, LSL_Float SpeedModifier) { if (!ScriptProtection.CheckThreatLevel(ThreatLevel.Moderate, "botSetSpeed", m_host, "OSSL", m_itemID)) { return; } IBotManager manager = World.RequestModuleInterface <IBotManager>(); if (manager != null) { manager.SetSpeed(UUID.Parse(bot), m_host.OwnerID, (float)SpeedModifier); } }
public StartCommand(IDatabaseService db, IBotManager bot) { _db = db; _bot = bot; }
public UnknownCommand(IBotManager bot) { _bot = bot; }
public AllowUserCommand(IBotManager bot, Lazy<IDatabaseService> db) { _bot = bot; _db = db; }
public ListCommand(IBotManager bot, IDatabaseService db, ICommandHelper commandHelper) { _bot = bot; _db = db; _commandHelper = commandHelper; }
public CustomUserCommand(IDatabaseService databaseService, IBotManager botManager) { _db = databaseService; _bot = botManager; }
public AddCommand(IBotManager bot, IDatabaseService db) { _bot = bot; _db = db; }
public AdminCommand(IBotManager bot) { _bot = bot; }
public SettingsCommand(IBotManager bot) { _bot = bot; }
public HelpCommand(ICommandHelper commandHelper, IBotManager bot) { _commandHelper = commandHelper; _bot = bot; }
public AliasCommand(IDatabaseService databaseService, IBotManager botManager, ICommandHelper commandHelper) { _db = databaseService; _bot = botManager; _commandHelper = commandHelper; }