public ChooseOperatorModel(int id) { var m = new MerchantManager(); merchant = m.GetMerchant(id); Operators = null; }
public async Task <IActionResult> Post([FromBody] MerchantManager model) { if (await _repository.ExistAsync(c => c.UserId == model.UserId && c.MerchantId == model.MerchantId)) { return(BadRequest(ResultModel.Fail <MerchantManager>("数据已存在"))); } await _repository.InsertAsync(model); return(Ok(ResultModel.Success(model))); }
public TestController(IRouletteEngine engine, MerchantManager manager) { _engine = engine; _manager = manager; }
// Start is called before the first frame update void Start() { UIM = this.GetComponent <UIManager>(); MerchantManager = UIM.MerchantManager; scrapImages = Resources.LoadAll("Sprites/ScrapPortraits", typeof(Sprite)); }
override public MerchantManager GetMerchantData(NPCSpawnList npcsl) { List <EQApplicationPacket> PacketList = Packets.PacketList; UInt32 OP_ShopRequest = OpManager.OpCodeNameToNumber("OP_ShopRequest"); UInt32 OP_ShopEnd = OpManager.OpCodeNameToNumber("OP_ShopEnd"); UInt32 OP_ItemPacket = OpManager.OpCodeNameToNumber("OP_ItemPacket"); MerchantManager mm = new MerchantManager(); for (int i = 0; i < PacketList.Count; ++i) { EQApplicationPacket p = PacketList[i]; if ((p.Direction == PacketDirection.ServerToClient) && (p.OpCode == OP_ShopRequest)) { ByteStream Buffer = new ByteStream(p.Buffer); UInt32 MerchantSpawnID = Buffer.ReadUInt32(); NPCSpawn npc = npcsl.GetNPC(MerchantSpawnID); UInt32 NPCTypeID; if (npc != null) { NPCTypeID = npc.NPCTypeID; } else { NPCTypeID = 0; } mm.AddMerchant(MerchantSpawnID); for (int j = i + 1; j < PacketList.Count; ++j) { p = PacketList[j]; if (p.OpCode == OP_ShopEnd) { break; } if (p.OpCode == OP_ItemPacket) { Buffer = new ByteStream(p.Buffer); UInt32 StackSize = Buffer.ReadUInt32(); Buffer.SkipBytes(4); UInt32 Slot = Buffer.ReadUInt32(); UInt32 MerchantSlot = Buffer.ReadUInt32(); UInt32 Price = Buffer.ReadUInt32(); Int32 Quantity = Buffer.ReadInt32(); Buffer.SetPosition(68); // Point to item name string ItemName = Buffer.ReadString(true); string Lore = Buffer.ReadString(true); string IDFile = Buffer.ReadString(true); UInt32 ItemID = Buffer.ReadUInt32(); //if (Quantity == -1) mm.AddMerchantItem(MerchantSpawnID, ItemID, ItemName, MerchantSlot, Quantity); } } } } return(mm); }
// Use this for initialization void Start() { instance = this; }
public override async void Begin(Job job) { var model = new Model(MerchantModel); if (MerchantModel != 0 && MerchantPosition != null) { var merchantId = $"merchant::{job.Attachment.ToString().ToLower()}"; var package = NetworkPackage.GetModule(); if (Session.IsSpawnHost() && !API.NetworkDoesNetworkIdExist(package.GetLoad <int>(merchantId).Get())) { await model.Request(5000); var ped = API.CreatePed(6, (uint)model.Hash, MerchantPosition.X, MerchantPosition.Y, MerchantPosition.Z, MerchantPosition.Heading, true, false); Merchant = new Merchant(ped) { Important = true, Position = MerchantPosition }; package.GetLoad <int>(merchantId).UpdateAndCommit(Merchant.NetworkModule.GetId()); await SafeTeleport.Teleport(ped, MerchantPosition); Merchant.Movable = false; } else { while ((Merchant = MerchantManager.GetModule() .GetMerchantById(package.GetLoad <int>(merchantId).Get())) == null) { await BaseScript.Delay(1000); } } } await Session.Loading(); var player = Cache.Player; var character = Cache.Character; var marker = new Marker(Armory) { Message = "Tryck ~INPUT_CONTEXT~ för att komma åt förrådet", Color = Color.Transparent, Condition = self => character.Metadata.Employment == job.Attachment }; marker.Callback += async() => { if (MerchantPosition != null && Merchant != null) { await player.Entity.AnimationQueue.PlayDirectInQueue(new AnimationBuilder() .Select("gestures@m@standing@casual", "gesture_hello") .AtPosition(Armory) ); } Callback?.Invoke(); }; marker.Show(); Atlas.AttachTickHandler(OnTick); }