2013-09-03 17:51:44 +02:00
|
|
|
|
namespace LOC.Core.Tokens.Client
|
2013-08-27 17:14:08 +02:00
|
|
|
|
{
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using Model.Account;
|
|
|
|
|
using Model.Sales;
|
|
|
|
|
using Model.Server.PvpServer;
|
|
|
|
|
|
|
|
|
|
public class ClientToken
|
|
|
|
|
{
|
|
|
|
|
public ClientToken()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ClientToken(Account account)
|
|
|
|
|
{
|
|
|
|
|
AccountId = account.AccountId;
|
|
|
|
|
|
|
|
|
|
FilterChat = account.FilterChat;
|
|
|
|
|
Name = account.Name;
|
2014-04-20 05:53:55 +02:00
|
|
|
|
Uuid = account.Uuid;
|
2013-08-27 17:14:08 +02:00
|
|
|
|
Rank = account.Rank.Name;
|
2014-10-11 10:32:22 +02:00
|
|
|
|
RankPerm = account.RankPerm;
|
|
|
|
|
RankExpire = account.RankExpire.ToShortDateString();
|
|
|
|
|
|
2014-06-28 05:24:44 +02:00
|
|
|
|
Time = (long)TimeUtil.GetCurrentMilliseconds();
|
2013-08-27 17:14:08 +02:00
|
|
|
|
|
|
|
|
|
EconomyBalance = account.EconomyBalance;
|
|
|
|
|
|
|
|
|
|
FishTokens = new List<FishToken>();
|
|
|
|
|
|
|
|
|
|
if (account.FishCatches != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var fishCatch in account.FishCatches)
|
|
|
|
|
{
|
|
|
|
|
FishTokens.Add(new FishToken(fishCatch));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
AccountToken = new AccountToken(account);
|
|
|
|
|
DonorToken = new DonorToken
|
|
|
|
|
{
|
|
|
|
|
Gems = account.Gems,
|
2014-08-07 09:33:24 +02:00
|
|
|
|
Coins = account.Coins,
|
2013-08-27 17:14:08 +02:00
|
|
|
|
Donated = account.Donated,
|
|
|
|
|
SalesPackages = new List<int>(),
|
|
|
|
|
UnknownSalesPackages = new List<string>(),
|
2014-08-18 21:46:23 +02:00
|
|
|
|
Transactions = new List<AccountTransactionToken>(),
|
2014-08-21 22:55:09 +02:00
|
|
|
|
CoinRewards = new List<CoinTransactionToken>(),
|
2013-08-27 17:14:08 +02:00
|
|
|
|
CustomBuilds = new List<CustomBuildToken>(),
|
|
|
|
|
Pets = new List<PetToken>(),
|
|
|
|
|
PetNameTagCount = account.PetNameTagCount
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
if (account.Clan != null)
|
|
|
|
|
{
|
|
|
|
|
ClanToken = new ClientClanToken
|
|
|
|
|
{
|
|
|
|
|
Name = account.Clan.Name,
|
|
|
|
|
Role = account.ClanRole.Name
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (account.IgnoredPlayers == null)
|
|
|
|
|
account.IgnoredPlayers = new List<string>();
|
|
|
|
|
|
|
|
|
|
IgnoredPlayers = account.IgnoredPlayers;
|
|
|
|
|
|
|
|
|
|
if (account.PvpTransactions == null)
|
|
|
|
|
account.PvpTransactions = new List<GameTransaction>();
|
|
|
|
|
|
|
|
|
|
foreach (var transaction in account.PvpTransactions)
|
|
|
|
|
{
|
|
|
|
|
DonorToken.SalesPackages.Add(transaction.GameSalesPackageId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (account.AccountTransactions == null)
|
2014-08-21 22:55:09 +02:00
|
|
|
|
account.AccountTransactions = new List<AccountTransaction>();
|
2013-08-27 17:14:08 +02:00
|
|
|
|
|
|
|
|
|
foreach (var transaction in account.AccountTransactions)
|
|
|
|
|
{
|
|
|
|
|
DonorToken.UnknownSalesPackages.Add(transaction.SalesPackageName);
|
2014-08-18 21:46:23 +02:00
|
|
|
|
DonorToken.Transactions.Add(new AccountTransactionToken(transaction));
|
2013-08-27 17:14:08 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (account.CustomBuilds == null)
|
|
|
|
|
account.CustomBuilds = new List<CustomBuild>();
|
|
|
|
|
|
|
|
|
|
foreach (var customBuild in account.CustomBuilds)
|
|
|
|
|
{
|
|
|
|
|
DonorToken.CustomBuilds.Add(new CustomBuildToken(customBuild));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (account.Pets == null)
|
|
|
|
|
account.Pets = new List<OwnedPet>();
|
|
|
|
|
|
|
|
|
|
foreach (var pet in account.Pets)
|
|
|
|
|
{
|
|
|
|
|
DonorToken.Pets.Add(new PetToken { PetType = pet.PetType, PetName = pet.PetName });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (account.Punishments == null)
|
|
|
|
|
account.Punishments = new List<Punishment>();
|
|
|
|
|
|
|
|
|
|
Punishments = account.Punishments;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int AccountId { get; set; }
|
|
|
|
|
|
|
|
|
|
public bool FilterChat { get; set; }
|
|
|
|
|
|
|
|
|
|
public string Name { get; set; }
|
2014-04-20 05:53:55 +02:00
|
|
|
|
|
|
|
|
|
public string Uuid { get; set; }
|
|
|
|
|
|
2013-08-27 17:14:08 +02:00
|
|
|
|
public string Rank { get; set; }
|
|
|
|
|
|
2014-10-11 10:32:22 +02:00
|
|
|
|
public bool RankPerm { get; set; }
|
|
|
|
|
|
|
|
|
|
public string RankExpire { get; set; }
|
|
|
|
|
|
2014-06-28 05:24:44 +02:00
|
|
|
|
public long Time { get; set; }
|
|
|
|
|
|
2013-08-27 17:14:08 +02:00
|
|
|
|
public int EconomyBalance { get; set; }
|
|
|
|
|
|
2013-09-03 17:51:44 +02:00
|
|
|
|
public List<Punishment> Punishments { get; set; }
|
|
|
|
|
|
2013-08-27 17:14:08 +02:00
|
|
|
|
public List<FishToken> FishTokens;
|
|
|
|
|
|
|
|
|
|
public List<string> IgnoredPlayers { get; set; }
|
|
|
|
|
|
|
|
|
|
public AccountToken AccountToken;
|
|
|
|
|
public DonorToken DonorToken;
|
|
|
|
|
public ClientClanToken ClanToken;
|
|
|
|
|
}
|
|
|
|
|
}
|