public WvsTradeSocket( IChannel channel, uint seqSend, uint seqRecv, WvsTrade wvsTrade ) : base(channel, seqSend, seqRecv) => WvsTrade = wvsTrade;
private async Task OnMigrateIn(IPacket packet) { var characterID = packet.Decode <int>(); using (var db = WvsTrade.DataContextFactory.Create()) { var character = db.Characters .Include(c => c.Data) .ThenInclude(a => a.Account) .Include(c => c.Inventories) .ThenInclude(c => c.Items) .Single(c => c.ID == characterID); if (!await WvsTrade.TryMigrateFrom(character, WvsTrade.Info)) { await Disconnect(); } Character = character; using (var p = new Packet(SendPacketOperations.SetITC)) { character.EncodeData(p); p.Encode <string>(character.Data.Account.Username); // m_sNexonClubID p.Encode <int>(WvsTrade.Info.RegisterFeeMeso); p.Encode <int>(WvsTrade.Info.CommissionRate); p.Encode <int>(WvsTrade.Info.CommissionBase); p.Encode <int>(WvsTrade.Info.AuctionDurationMin); p.Encode <int>(WvsTrade.Info.AuctionDurationMax); p.Encode <long>(0); await SendPacket(p); } } }
private async Task OnTransferFieldRequest(IPacket packet) { var service = WvsTrade.Peers .OfType <GameServiceInfo>() .Where(g => g.WorldID == Character.Data.WorldID) .FirstOrDefault(g => g.Name == Character.Data.Account.PreviousConnectedService); if (service != null && !await WvsTrade.TryMigrateTo(this, Character, service)) { await Disconnect(); } }
public WvsTradeSocketFactory(WvsTrade wvsTrade) => _wvsShop = wvsTrade;