1
0

final update

This commit is contained in:
Labality
2021-08-19 16:35:32 +07:00
parent c2e012237f
commit f4fa1d8085
11877 changed files with 1192560 additions and 0 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,4 @@
C:\Work\Nautilus\Minecraft\Website\DBTesting\bin\Debug\DBTesting.dll
C:\Work\Nautilus\Minecraft\Website\DBTesting\bin\Debug\DBTesting.pdb
C:\Work\Nautilus\Minecraft\Website\DBTesting\obj\Debug\DBTesting.dll
C:\Work\Nautilus\Minecraft\Website\DBTesting\obj\Debug\DBTesting.pdb

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,4 @@
C:\Work\Nautilus\Minecraft\Website\DBTesting\bin\Release\DBTesting.dll
C:\Work\Nautilus\Minecraft\Website\DBTesting\bin\Release\DBTesting.pdb
C:\Work\Nautilus\Minecraft\Website\DBTesting\obj\Release\DBTesting.dll
C:\Work\Nautilus\Minecraft\Website\DBTesting\obj\Release\DBTesting.pdb

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework">
<parameters>
<parameter value="Data Source=.\SQLEXPRESS; Integrated Security=True; MultipleActiveResultSets=True" />
</parameters>
</defaultConnectionFactory>
</entityFramework>
</configuration>

View File

@ -0,0 +1,7 @@
namespace LOC.Core.Data
{
public static class ContentType
{
public static string Json = "application/json";
}
}

View File

@ -0,0 +1,183 @@
namespace LOC.Core.Data
{
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using System.Data.Metadata.Edm;
using System.Data.Objects;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Text.RegularExpressions;
public static class ContextExtensions
{
private const string INDITIFY_OBJECT = "SELECT * FROM sys.indexes where name='{0}'";
public static object[] KeyValuesFor<TEntity>(this DbContext context, TEntity entity) where TEntity : class
{
var entry = context.Entry(entity);
return context.KeysFor(entity.GetType()).Select(x => entry.Property(x).CurrentValue).ToArray();
}
public static IQueryable<TEntity> LoadNavigationProperties<TEntity>(this IQueryable<TEntity> query, DbContext context)
where TEntity : class
{
var entityType = GetEntityType(context, typeof(TEntity));
if (entityType == null)
{
throw new ArgumentException(string.Format("The type '{0}' is not mapped as an entity type.", entityType.Name));
}
return entityType.NavigationProperties.Aggregate(
query,
(current, navigationProperty) => current.Include(navigationProperty.Name));
}
public static void LoadNavigationProperties<TEntity>(this TEntity entity, DbContext context) where TEntity : class
{
if (entity == null)
{
return;
}
var objectContext = ((IObjectContextAdapter)context).ObjectContext;
var items = objectContext.MetadataWorkspace.GetItems<EntityType>(DataSpace.OSpace);
var item = items == null
? null
: items.FirstOrDefault(x => x.Name.Equals(ObjectContext.GetObjectType(entity.GetType()).Name));
var navigationPropertyNames = item == null ? new List<string>() : item.NavigationProperties.Select(x => x.Name);
foreach (var prop in navigationPropertyNames)
{
objectContext.LoadProperty(entity, prop);
}
}
public static void CreateIndex<T>(this DbContext context, Expression<Func<T, object>> expression, bool isUnique) where T : class
{
var database = context.Database;
if (database == null)
{
throw new ArgumentNullException("context", @"Database is null");
}
var realtableName = GetTableName<T>(context);
var tablename = typeof(T).Name;
var columnName = GetColumnExpressionName(expression.Body);
var indexColumnName = GetColumnName(expression.Body);
var indexName = string.Format("IX_{0}_{1}", tablename, columnName);
var createIndexSql = string.Format(
isUnique ? "CREATE UNIQUE INDEX {0} ON {1} ({2})" : "CREATE INDEX {0} ON {1} ({2})",
indexName,
realtableName,
indexColumnName);
//TODO Check index?
var checkIndex = string.Format(INDITIFY_OBJECT, indexName);
var result = database.SqlQuery<object>(checkIndex).Count();
if (result <= 0)
{
//TODO Create index
database.ExecuteSqlCommand(createIndexSql);
}
}
private static string GetColumnExpressionName(Expression expression)
{
var memberExps = expression as NewExpression;
if (memberExps != null)
{
var sb = new StringBuilder();
foreach (var memberExp in memberExps.Arguments)
{
var member = memberExp as MemberExpression;
if (memberExp == null
|| member == null)
{
throw new ArgumentException(@"Cannot get name from expression", "expression");
}
sb.Append(member.Member.Name);
sb.Append("_");
}
return sb.ToString().Substring(0, sb.ToString().Length - 1);
}
return string.Empty;
}
private static string GetColumnName(Expression expression)
{
var memberExps = expression as NewExpression;
if (memberExps != null)
{
var sb = new StringBuilder();
foreach (var memberExp in memberExps.Arguments)
{
var member = memberExp as MemberExpression;
if (memberExp == null
|| member == null)
{
throw new ArgumentException(@"Cannot get name from expression", "expression");
}
sb.Append(member.Member.Name);
sb.Append(",");
}
return sb.ToString().Substring(0, sb.ToString().Length - 1);
}
return string.Empty;
}
private static EntityType GetEntityType(IObjectContextAdapter context, Type entityType)
{
entityType = ObjectContext.GetObjectType(entityType);
var workspace = context.ObjectContext.MetadataWorkspace;
var itemCollection = (ObjectItemCollection)workspace.GetItemCollection(DataSpace.OSpace);
EntityType type;
if (workspace == null)
{
type = null;
}
else
{
var types = workspace.GetItems<EntityType>(DataSpace.OSpace);
type = types == null ? null : types.SingleOrDefault(t => itemCollection.GetClrType(t) == entityType);
}
return type;
}
private static string GetTableName<T>(IObjectContextAdapter context) where T : class
{
var objectContext = context.ObjectContext;
return GetTableName<T>(objectContext);
}
private static string GetTableName<T>(ObjectContext context) where T : class
{
var sql = context.CreateObjectSet<T>().ToTraceString();
var regex = new Regex("FROM (?<table>.*) AS");
var match = regex.Match(sql);
var table = match.Groups["table"].Value;
return table;
}
private static IEnumerable<string> KeysFor(this IObjectContextAdapter context, Type entityType)
{
var type = GetEntityType(context, entityType);
if (type == null)
{
throw new ArgumentException(
string.Format("The type '{0}' is not mapped as an entity type.", entityType.Name), "entityType");
}
return type.KeyMembers.Select(k => k.Name);
}
}
}

View File

@ -0,0 +1,10 @@
namespace LOC.Core.Data
{
using System;
public interface IRestCallJsonWrapper
{
T MakeCall<T>(object data, Uri uri, RestCallType restCallType, double timeoutInSeconds = 100);
void MakeCall(object data, Uri uri, RestCallType restCallType, double timeoutInSeconds = 100);
}
}

View File

@ -0,0 +1,64 @@
namespace LOC.Core.Data
{
using System;
using System.IO;
using System.Net;
using System.Web;
using Newtonsoft.Json;
public class RestCallJsonWrapper : IRestCallJsonWrapper
{
public T MakeCall<T>(object data, Uri uri, RestCallType restCallType, double timeoutInSeconds)
{
var response = InitiateRequest(uri, restCallType, data, timeoutInSeconds);
T result;
using (var streamReader = new StreamReader(response.GetResponseStream()))
{
var responseText = streamReader.ReadToEnd();
result = JsonConvert.DeserializeObject<T>(responseText);
}
return result;
}
public void MakeCall(object data, Uri uri, RestCallType restCallType, double timeoutInSeconds)
{
var response = InitiateRequest(uri, restCallType, data);
if (response.StatusCode
!= HttpStatusCode.OK)
{
// TODO: need handling code here
throw new HttpException((int)response.StatusCode, "Received a not OK response from the server.");
}
}
private static HttpWebResponse InitiateRequest(Uri uri, RestCallType restCallType, object data, double timeoutInSeconds = 100)
{
var request = (HttpWebRequest)WebRequest.Create(uri);
request.Timeout = (int)TimeSpan.FromSeconds(timeoutInSeconds).TotalMilliseconds;
request.ContentType = "application/json";
switch (restCallType)
{
case RestCallType.Get:
request.Method = "GET";
break;
case RestCallType.Post:
request.Method = "POST";
break;
default:
throw new HttpException("REST call type not defined.");
}
if (data != null)
{
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
var json = JsonConvert.SerializeObject(data);
streamWriter.Write(json);
}
}
return (HttpWebResponse)request.GetResponse();
}
}
}

View File

@ -0,0 +1,8 @@
namespace LOC.Core.Data
{
public enum RestCallType
{
Get,
Post
}
}

View File

@ -0,0 +1,12 @@
namespace LOC.Core.DependencyResolution
{
using System;
using System.Collections.Generic;
public interface IResolver
{
object GetService(Type serviceType);
IEnumerable<object> GetServices(Type serviceType);
T GetService<T>();
}
}

View File

@ -0,0 +1,20 @@
namespace LOC.Core.DependencyResolution
{
using StructureMap;
public static class IoC
{
public static IContainer Initialize()
{
ObjectFactory.Initialize(
x => x.Scan(
scan =>
{
scan.TheCallingAssembly();
scan.AssembliesFromApplicationBaseDirectory();
scan.WithDefaultConventions();
}));
return ObjectFactory.Container;
}
}
}

View File

@ -0,0 +1,72 @@
namespace LOC.Core.DependencyResolution
{
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using StructureMap;
public class Resolver : IResolver
{
private readonly IContainer _container;
static Resolver()
{
try
{
ObjectFactory.Initialize(
x =>
{
x.Scan(
scan =>
{
scan.TheCallingAssembly();
scan.WithDefaultConventions();
scan.AssembliesFromApplicationBaseDirectory(
a =>
a.FullName.StartsWith("LOC"));
});
x.For<IResolver>().Use(r => Current);
});
Current = new Resolver(ObjectFactory.Container);
}
catch (Exception e)
{
var path = Path.Combine(Path.GetFullPath(AppDomain.CurrentDomain.BaseDirectory), "Log.txt");
var contents = new List<string> { DateTime.Now.ToString(), e.Message, e.StackTrace };
File.AppendAllLines(path, contents);
throw;
}
}
private Resolver(IContainer container)
{
_container = container;
}
public static IResolver Current { get; private set; }
public T GetService<T>()
{
return (T)GetService(typeof(T));
}
public object GetService(Type serviceType)
{
if (serviceType == null)
{
return null;
}
return serviceType.IsAbstract || serviceType.IsInterface
? _container.TryGetInstance(serviceType)
: _container.GetInstance(serviceType);
}
public IEnumerable<object> GetServices(Type serviceType)
{
return _container.GetAllInstances(serviceType).Cast<object>();
}
}
}

View File

@ -0,0 +1,42 @@
namespace LOC.Core.DependencyResolution
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using StructureMap;
public class SmDependencyResolver : IDependencyResolver
{
private readonly IContainer _container;
public SmDependencyResolver(IContainer container)
{
_container = container;
}
public object GetService(Type serviceType)
{
if (serviceType == null)
{
return null;
}
try
{
return serviceType.IsAbstract || serviceType.IsInterface
? _container.TryGetInstance(serviceType)
: _container.GetInstance(serviceType);
}
catch
{
return null;
}
}
public IEnumerable<object> GetServices(Type serviceType)
{
return _container.GetAllInstances(serviceType).Cast<object>();
}
}
}

View File

@ -0,0 +1,28 @@
namespace LOC.Core
{
using System.IO;
using System.Web.Mvc;
using Newtonsoft.Json;
public class JsonModelBinder : DefaultModelBinder
{
public override object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext)
{
if (!IsJsonRequest(controllerContext))
return base.BindModel(controllerContext, bindingContext);
var request = controllerContext.HttpContext.Request;
var stream = request.InputStream;
if (stream.Length == 0)
return null;
stream.Position = 0;
var jsonStringData = new StreamReader(stream).ReadToEnd();
return JsonConvert.DeserializeObject(jsonStringData, bindingContext.ModelType);
}
private static bool IsJsonRequest(ControllerContext controllerContext)
{
var contentType = controllerContext.HttpContext.Request.ContentType;
return contentType.Contains("application/json");
}
}
}

View File

@ -0,0 +1,170 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{A994B28E-8AAA-4A53-BDFE-0E72F1B0F4AD}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>LOC.Core</RootNamespace>
<AssemblyName>LOC.Core</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\EntityFramework.5.0.0\lib\net40\EntityFramework.dll</HintPath>
</Reference>
<Reference Include="LinqKit">
<HintPath>..\Libraries\LinqKit.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json">
<HintPath>..\packages\Newtonsoft.Json.4.5.2\lib\net40\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="StructureMap, Version=2.6.4.0, Culture=neutral, PublicKeyToken=e60ad81abae3c223, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\structuremap.2.6.4.1\lib\net40\StructureMap.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Core" />
<Reference Include="System.Data.Entity" />
<Reference Include="System.Web" />
<Reference Include="System.Web.Mvc, Version=3.0.0.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Data\ContextExtensions.cs" />
<Compile Include="Model\Account\Account.cs" />
<Compile Include="Model\Account\OwnedPet.cs" />
<Compile Include="Model\Account\Punishment.cs" />
<Compile Include="Model\Account\MacAddress.cs" />
<Compile Include="Model\Account\RemovedPunishment.cs" />
<Compile Include="Model\Sales\AccountTransaction.cs" />
<Compile Include="Model\Sales\CoinTransaction.cs" />
<Compile Include="Model\Sales\GemTransaction.cs" />
<Compile Include="Model\Server\GameServer\CaptureThePig\Stats\CaptureThePigGameStatsToken.cs" />
<Compile Include="Model\Server\GameServer\CaptureThePig\Stats\CaptureThePigPlayerStatsToken.cs" />
<Compile Include="Model\Server\GameServer\Dominate\Stats\DominatePlayerStatsToken.cs" />
<Compile Include="Model\Server\GameServer\Dominate\Stats\DominateGameStatsToken.cs" />
<Compile Include="Model\Server\GameServer\MineKart\KartArmor.cs" />
<Compile Include="Model\Server\GameServer\MineKart\MineKart.cs" />
<Compile Include="Model\Server\GameServer\MineKart\MineKartStats.cs" />
<Compile Include="Model\Server\PvpServer\Weapon.cs" />
<Compile Include="SearchConf.cs" />
<Compile Include="Tokens\AccountBatchToken.cs" />
<Compile Include="Tokens\AccountNameToken.cs" />
<Compile Include="Tokens\AccountTask.cs" />
<Compile Include="Tokens\Client\AccountTransactionToken.cs" />
<Compile Include="Tokens\Client\CoinTransactionToken.cs" />
<Compile Include="Tokens\Client\RankUpdateToken.cs" />
<Compile Include="Tokens\Client\DonationBenefitToken.cs" />
<Compile Include="Model\Server\PetExtra.cs" />
<Compile Include="Model\Server\FilteredWord.cs" />
<Compile Include="Model\Server\GameServer\CaptureThePig\Stats\CaptureThePigPlayerStats.cs" />
<Compile Include="Model\Server\Pet.cs" />
<Compile Include="Model\Server\PvpServer\Clan\Clan.cs" />
<Compile Include="Model\Server\PvpServer\Clan\ClanRole.cs" />
<Compile Include="Model\Server\PvpServer\Clan\Territory.cs" />
<Compile Include="Model\Server\PvpServer\Clan\Alliance.cs" />
<Compile Include="Model\Server\PvpServer\Clan\War.cs" />
<Compile Include="Model\Server\PvpServer\FieldMonster.cs" />
<Compile Include="Model\Server\PvpServer\CustomBuild.cs" />
<Compile Include="Model\Server\PvpServer\FieldOre.cs" />
<Compile Include="Model\Server\PvpServer\FieldBlock.cs" />
<Compile Include="Model\Server\PvpServer\FishCatch.cs" />
<Compile Include="Model\Server\PvpServer\BenefitItem.cs" />
<Compile Include="Model\Server\GameServer\Dominate\Stats\DominatePlayerStats.cs" />
<Compile Include="Model\Sales\Transaction.cs" />
<Compile Include="Model\Sales\GameTransaction.cs" />
<Compile Include="Model\Sales\SalesPackage.cs" />
<Compile Include="Data\ContentType.cs" />
<Compile Include="Data\IRestCallJsonWrapper.cs" />
<Compile Include="Data\RestCallJsonWrapper.cs" />
<Compile Include="Data\RestCallType.cs" />
<Compile Include="DependencyResolution\IoC.cs" />
<Compile Include="DependencyResolution\IResolver.cs" />
<Compile Include="DependencyResolution\Resolver.cs" />
<Compile Include="DependencyResolution\SmDependencyResolver.cs" />
<Compile Include="Model\Server\PvpServer\Item.cs" />
<Compile Include="Model\Server\PvpServer\PvpClass.cs" />
<Compile Include="Model\Server\Server.cs" />
<Compile Include="Model\Server\ServerHistory.cs" />
<Compile Include="Model\Server\ServerStatus.cs" />
<Compile Include="Model\Server\ServerUpdate.cs" />
<Compile Include="Model\Sales\GameSalesPackage.cs" />
<Compile Include="Model\Server\PvpServer\Skill.cs" />
<Compile Include="LogEntry.cs" />
<Compile Include="JsonModelBinder.cs" />
<Compile Include="Model\Account\Login.cs" />
<Compile Include="Model\Account\LoginAddress.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Model\Account\Rank.cs" />
<Compile Include="PunishmentType.cs" />
<Compile Include="TimeUtil.cs" />
<Compile Include="Tokens\Clan\ClanGeneratorToken.cs" />
<Compile Include="Tokens\Clan\ClanMemberToken.cs" />
<Compile Include="Tokens\Clan\AllianceToken.cs" />
<Compile Include="Tokens\Clan\ClanTerritoryToken.cs" />
<Compile Include="Tokens\Clan\ClanToken.cs" />
<Compile Include="Tokens\Clan\ClanWarRechargeToken.cs" />
<Compile Include="Tokens\Clan\WarToken.cs" />
<Compile Include="Tokens\Client\AccountToken.cs" />
<Compile Include="Tokens\Client\ClientIgnoreToken.cs" />
<Compile Include="Tokens\Client\DamageToken.cs" />
<Compile Include="Tokens\Client\DeathStatToken.cs" />
<Compile Include="Tokens\Client\PlayerSetupToken.cs" />
<Compile Include="Tokens\Client\PunishToken.cs" />
<Compile Include="Tokens\Client\ClientClanToken.cs" />
<Compile Include="Tokens\Client\ClientToken.cs" />
<Compile Include="Tokens\Client\CustomBuildToken.cs" />
<Compile Include="Tokens\Client\DonorToken.cs" />
<Compile Include="Tokens\Client\FishToken.cs" />
<Compile Include="Tokens\Client\LoginRequestToken.cs" />
<Compile Include="Tokens\Client\PetChangeToken.cs" />
<Compile Include="Tokens\Client\PetToken.cs" />
<Compile Include="Tokens\Client\GemRewardToken.cs" />
<Compile Include="Tokens\Client\SlotToken.cs" />
<Compile Include="Tokens\Client\RemovePunishmentToken.cs" />
<Compile Include="Tokens\Client\UpdateTaskToken.cs" />
<Compile Include="Tokens\UnknownPurchaseToken.cs" />
<Compile Include="Tokens\PurchaseToken.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectView>ShowAllFiles</ProjectView>
</PropertyGroup>
</Project>

View File

@ -0,0 +1,15 @@
namespace LOC.Core
{
using System;
public class LogEntry
{
public int LogEntryId { get; set; }
public DateTime Date { get; set; }
public string Category { get; set; }
public string Message { get; set; }
}
}

View File

@ -0,0 +1,68 @@
namespace LOC.Core.Model.Account
{
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Sales;
using Server.GameServer;
using Server.GameServer.CaptureThePig.Stats;
using Server.GameServer.Dominate.Stats;
using Server.PvpServer;
using Server.PvpServer.Clan;
public class Account
{
public int AccountId { get; set; }
[StringLength(40)]
public string Name { get; set; }
[StringLength(100)]
public string Uuid { get; set; }
public Rank Rank { get; set; }
public bool RankPerm { get; set; }
public DateTime RankExpire { get; set; }
public int LoginCount { get; set; }
public long LastLogin { get; set; }
public long TotalPlayingTime { get; set; }
public List<Punishment> Punishments { get; set; }
public bool FilterChat { get; set; }
public int Gems { get; set; }
public int Coins { get; set; }
public bool Donated { get; set; }
public DateTime LastVote { get; set; }
public int VoteModifier { get; set; }
public int EconomyBalance { get; set; }
public List<string> IgnoredPlayers { get; set; }
public virtual Clan Clan { get; set; }
public virtual ClanRole ClanRole { get; set; }
public virtual List<OwnedPet> Pets { get; set; }
public int PetNameTagCount { get; set; }
public virtual List<FishCatch> FishCatches { get; set; }
public virtual List<Transaction> Transactions { get; set; }
public virtual List<GameTransaction> PvpTransactions { get; set; }
public virtual List<CustomBuild> CustomBuilds { get; set; }
public virtual List<LoginAddress> IpAddresses { get; set; }
public virtual List<MacAddress> MacAddresses { get; set; }
public virtual List<Login> Logins { get; set; }
public List<DominatePlayerStats> DominateStats { get; set; }
public List<CaptureThePigPlayerStats> CaptureThePigStats { get; set; }
public List<AccountTransaction> AccountTransactions { get; set; }
}
}

View File

@ -0,0 +1,17 @@
namespace LOC.Core.Model.Account
{
public class Login
{
public int LoginId { get; set; }
public long Time { get; set; }
public LoginAddress IpAddress { get; set; }
public MacAddress MacAddress { get; set; }
public Account Account { get; set; }
public int ServerId { get; set; }
}
}

View File

@ -0,0 +1,12 @@
namespace LOC.Core.Model.Account
{
using Newtonsoft.Json;
public class LoginAddress
{
[JsonIgnore]
public int LoginAddressId { get; set; }
public string Address { get; set; }
}
}

View File

@ -0,0 +1,15 @@
namespace LOC.Core.Model.Account
{
using System.Collections.Generic;
using Newtonsoft.Json;
public class MacAddress
{
[JsonIgnore]
public int MacAddressId { get; set; }
public string Address { get; set; }
public virtual List<Account> Accounts { get; set; }
}
}

View File

@ -0,0 +1,11 @@
namespace LOC.Core.Model.Account
{
public class OwnedPet
{
public int OwnedPetId { get; set; }
public string PetName { get; set; }
public string PetType { get; set; }
}
}

View File

@ -0,0 +1,35 @@
namespace LOC.Core.Model.Account
{
using System;
public class Punishment
{
public int PunishmentId { get; set; }
public int UserId { get; set; }
public String Admin { get; set; }
public bool Active { get; set; }
public string Category { get; set; }
public string Reason { get; set; }
public long Time { get; set; }
public int Severity { get; set; }
public double Duration { get; set; }
public string Sentence { get; set; }
public bool Removed { get; set; }
public string RemoveAdmin { get; set; }
public string RemoveReason { get; set; }
public long RemoveTime { get; set; }
}
}

View File

@ -0,0 +1,9 @@
namespace LOC.Core.Model.Account
{
public class Rank
{
public int RankId { get; set; }
public string Name { get; set; }
}
}

View File

@ -0,0 +1,17 @@
namespace LOC.Core.Model.Account
{
public class RemovedPunishment
{
public int RemovedPunishmentId { get; set; }
public int PunishmentId { get; set; }
public int AdminId { get; set; }
public string PunishmentType { get; set; }
public string Reason { get; set; }
public long DateTime { get; set; }
}
}

View File

@ -0,0 +1,9 @@
namespace LOC.Core.Model.PvpServer
{
public class Economy
{
public string ClientName { get; set; }
public int Balance { get; set; }
}
}

View File

@ -0,0 +1,17 @@
namespace LOC.Core.Model.Sales
{
public class AccountTransaction
{
public int AccountTransactionId { get; set; }
public Account.Account Account { get; set; }
public long Date { get; set; }
public string SalesPackageName { get; set; }
public int Gems { get; set; }
public int Coins { get; set; }
}
}

View File

@ -0,0 +1,15 @@
namespace LOC.Core.Model.Sales
{
public class CoinTransaction
{
public int CoinTransactionId { get; set; }
public Account.Account Account { get; set; }
public long Date { get; set; }
public string Source { get; set; }
public int Amount { get; set; }
}
}

View File

@ -0,0 +1,13 @@
namespace LOC.Core.Model.Sales
{
public class GameSalesPackage
{
public int GameSalesPackageId { get; set; }
public int Gems { get; set; }
public int Economy { get; set; }
public bool Free { get; set; }
}
}

View File

@ -0,0 +1,15 @@
namespace LOC.Core.Model.Sales
{
public class GameTransaction
{
public int GameTransactionId { get; set; }
public Account.Account Account { get; set; }
public int GameSalesPackageId { get; set; }
public int Gems { get; set; }
public int Economy { get; set; }
}
}

View File

@ -0,0 +1,15 @@
namespace LOC.Core.Model.Sales
{
public class GemTransaction
{
public int GemTransactionId { get; set; }
public Account.Account Account { get; set; }
public long? Date { get; set; }
public string Source { get; set; }
public int Amount { get; set; }
}
}

View File

@ -0,0 +1,29 @@
namespace LOC.Core.Model.Sales
{
using Account;
public class SalesPackage
{
public int SalesPackageId { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public bool Test { get; set; }
public double Price { get; set; }
public int Gems { get; set; }
public Rank Rank { get; set; }
public bool RankPerm { get; set; }
public long Length { get; set; }
public string Image { get; set; }
public string PaypalButtonId { get; set; }
}
}

View File

@ -0,0 +1,19 @@
namespace LOC.Core.Model.Sales
{
using System;
public class Transaction
{
public int TransactionId { get; set; }
public Account.Account Account { get; set; }
public SalesPackage SalesPackage { get; set; }
public decimal Fee { get; set; }
public decimal Profit { get; set; }
public DateTime Time { get; set; }
}
}

View File

@ -0,0 +1,9 @@
namespace LOC.Core.Model.Server
{
public class FilteredWord
{
public int FilteredWordId { get; set; }
public string Name { get; set; }
}
}

View File

@ -0,0 +1,11 @@
namespace LOC.Core.Model.Server.GameServer.CaptureThePig.Stats
{
using System.Collections.Generic;
public class CaptureThePigGameStatsToken
{
public long Length { get; set; }
public List<CaptureThePigPlayerStatsToken> PlayerStats { get; set; }
}
}

View File

@ -0,0 +1,25 @@
namespace LOC.Core.Model.Server.GameServer.CaptureThePig.Stats
{
public class CaptureThePigPlayerStats
{
public int CaptureThePigPlayerStatsId { get; set; }
public int AccountId { get; set; }
public string Type { get; set; }
public long Start { get; set; }
public int Wins { get; set; }
public int Losses { get; set; }
public int Kills { get; set; }
public int Deaths { get; set; }
public int Assists { get; set; }
public int Captures { get; set; }
}
}

View File

@ -0,0 +1,13 @@
namespace LOC.Core.Model.Server.GameServer.CaptureThePig.Stats
{
public class CaptureThePigPlayerStatsToken
{
public string Name { get; set; }
public bool Won { get; set; }
public long TimePlayed { get; set; }
public CaptureThePigPlayerStats PlayerStats { get; set; }
}
}

View File

@ -0,0 +1,12 @@
namespace LOC.Core.Model.GameServer.Stats
{
using System.Collections.Generic;
using Model.Server.GameServer.Dominate.Stats;
public class DominateGameStatsToken
{
public List<DominatePlayerStatsToken> PlayerStats { get; set; }
public long Duration { get; set; }
}
}

View File

@ -0,0 +1,23 @@
namespace LOC.Core.Model.Server.GameServer.Dominate.Stats
{
public class DominatePlayerStats
{
public int DominatePlayerStatsId { get; set; }
public string Type { get; set; }
public long Start { get; set; }
public int Points { get; set; }
public int Kills { get; set; }
public int Deaths { get; set; }
public int Assists { get; set; }
public int Wins { get; set; }
public int Losses { get; set; }
}
}

View File

@ -0,0 +1,13 @@
namespace LOC.Core.Model.Server.GameServer.Dominate.Stats
{
public class DominatePlayerStatsToken
{
public string Name { get; set; }
public bool Won { get; set; }
public long TimePlayed { get; set; }
public DominatePlayerStats PlayerStats { get; set; }
}
}

View File

@ -0,0 +1,17 @@
namespace LOC.Core.Model.Server.GameServer.MineKart
{
using Sales;
public class KartArmor
{
public int KartArmorId { get; set; }
public string Material { get; set; }
public string Name { get; set; }
public string Data { get; set; }
public GameSalesPackage SalesPackage { get; set; }
}
}

View File

@ -0,0 +1,17 @@
namespace LOC.Core.Model.Server.GameServer.MineKart
{
using Sales;
public class MineKart
{
public int MineKartId { get; set; }
public string Name { get; set; }
public string Material { get; set; }
public string Data { get; set; }
public GameSalesPackage SalesPackage { get; set; }
}
}

View File

@ -0,0 +1,15 @@
namespace LOC.Core.Model.Server.GameServer.MineKart
{
public class MineKartStats
{
public int MineKartStatsId { get; set; }
public int MineKartId { get; set; }
public string TrackName { get; set; }
public long Time { get; set; }
public short Place { get; set; }
}
}

View File

@ -0,0 +1,15 @@
namespace LOC.Core.Model.Server
{
using Sales;
public class Pet
{
public int PetId { get; set; }
public string Name { get; set; }
public string PetType { get; set; }
public GameSalesPackage SalesPackage { get; set; }
}
}

View File

@ -0,0 +1,15 @@
namespace LOC.Core.Model.Server
{
using Sales;
public class PetExtra
{
public int PetExtraId { get; set; }
public string Name { get; set; }
public string Material { get; set; }
public GameSalesPackage SalesPackage { get; set; }
}
}

View File

@ -0,0 +1,15 @@
namespace LOC.Core.Model.Server.PvpServer
{
using Sales;
public class BenefitItem
{
public int BenefitItemId { get; set; }
public string Name { get; set; }
public string Material { get; set; }
public GameSalesPackage SalesPackage { get; set; }
}
}

View File

@ -0,0 +1,11 @@
namespace LOC.Core.Model.Server.PvpServer.Clan
{
public class Alliance
{
public int AllianceId { get; set; }
public Clan Clan { get; set; }
public bool Trusted { get; set; }
}
}

View File

@ -0,0 +1,26 @@
namespace LOC.Core.Model.Server.PvpServer.Clan
{
using Account;
using System.Collections.Generic;
public class Clan
{
public int ClanId { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public int Power { get; set; }
public string Home { get; set; }
public bool Admin { get; set; }
public long DateCreated { get; set; }
public long LastTimeOnline { get; set; }
public string Generator { get; set; }
public int GeneratorStock { get; set; }
public long GeneratorTime { get; set; }
public List<Alliance> Alliances { get; set; }
public List<War> Wars { get; set; }
public List<Territory> Territories { get; set; }
public List<Account> Members { get; set; }
}
}

View File

@ -0,0 +1,8 @@
namespace LOC.Core.Model.Server.PvpServer.Clan
{
public class ClanRole
{
public int ClanRoleId { get; set; }
public string Name { get; set; }
}
}

View File

@ -0,0 +1,15 @@
namespace LOC.Core.Model.Server.PvpServer.Clan
{
public class Territory
{
public int TerritoryId { get; set; }
public virtual Clan Clan { get; set; }
public string ServerName { get; set; }
public string Chunk { get; set; }
public bool Safe { get; set; }
}
}

View File

@ -0,0 +1,15 @@
namespace LOC.Core.Model.Server.PvpServer.Clan
{
public class War
{
public int WarId { get; set; }
public Clan Clan { get; set; }
public int Dominance { get; set; }
public bool Ended { get; set; }
public long Cooldown { get; set; }
}
}

View File

@ -0,0 +1,75 @@
namespace LOC.Core.Model.Server.PvpServer
{
public class CustomBuild
{
public int CustomBuildId { get; set; }
public Account.Account Account { get; set; }
public string Name { get; set; }
public bool Active { get; set; }
public int CustomBuildNumber { get; set; }
public string PvpClass { get; set; }
public string SwordSkill { get; set; }
public int SwordSkillLevel { get; set; }
public string AxeSkill { get; set; }
public int AxeSkillLevel { get; set; }
public string BowSkill { get; set; }
public int BowSkillLevel { get; set; }
public string ClassPassiveASkill { get; set; }
public int ClassPassiveASkillLevel { get; set; }
public string ClassPassiveBSkill { get; set; }
public int ClassPassiveBSkillLevel { get; set; }
public string GlobalPassiveSkill { get; set; }
public int GlobalPassiveSkillLevel { get; set; }
public int SkillTokens { get; set; }
public int ItemTokens { get; set; }
public string Slot1Name { get; set; }
public string Slot1Material { get; set; }
public int Slot1Amount { get; set; }
public string Slot2Name { get; set; }
public string Slot2Material { get; set; }
public int Slot2Amount { get; set; }
public string Slot3Name { get; set; }
public string Slot3Material { get; set; }
public int Slot3Amount { get; set; }
public string Slot4Name { get; set; }
public string Slot4Material { get; set; }
public int Slot4Amount { get; set; }
public string Slot5Name { get; set; }
public string Slot5Material { get; set; }
public int Slot5Amount { get; set; }
public string Slot6Name { get; set; }
public string Slot6Material { get; set; }
public int Slot6Amount { get; set; }
public string Slot7Name { get; set; }
public string Slot7Material { get; set; }
public int Slot7Amount { get; set; }
public string Slot8Name { get; set; }
public string Slot8Material { get; set; }
public int Slot8Amount { get; set; }
public string Slot9Name { get; set; }
public string Slot9Material { get; set; }
public int Slot9Amount { get; set; }
}
}

View File

@ -0,0 +1,25 @@
namespace LOC.Core.Model.Server.PvpServer
{
public class FieldBlock
{
public int FieldBlockId { get; set; }
public string Server { get; set; }
public string Location { get; set; }
public int BlockId { get; set; }
public byte BlockData { get; set; }
public int EmptyId { get; set; }
public byte EmptyData { get; set; }
public int StockMax { get; set; }
public double StockRegenTime { get; set; }
public string Loot { get; set; }
}
}

View File

@ -0,0 +1,23 @@
namespace LOC.Core.Model.Server.PvpServer
{
public class FieldMonster
{
public int FieldMonsterId { get; set; }
public string Server { get; set; }
public string Name { get; set; }
public string Type { get; set; }
public int MobMax { get; set; }
public double MobRate { get; set; }
public string Centre { get; set; }
public int Radius { get; set; }
public int Height { get; set; }
}
}

View File

@ -0,0 +1,11 @@
namespace LOC.Core.Model.Server.PvpServer
{
public class FieldOre
{
public int FieldOreId { get; set; }
public string Server { get; set; }
public string Location { get; set; }
}
}

View File

@ -0,0 +1,15 @@
namespace LOC.Core.Model.Server.PvpServer
{
public class FishCatch
{
public int FishCatchId { get; set; }
public string Owner { get; set; }
public decimal Size { get; set; }
public string Name { get; set; }
public virtual Account.Account Catcher { get; set; }
}
}

View File

@ -0,0 +1,15 @@
namespace LOC.Core.Model.PvpServer
{
using Sales;
public class Item
{
public int ItemId { get; set; }
public string Name { get; set; }
public string Material { get; set; }
public GameSalesPackage SalesPackage { get; set; }
}
}

View File

@ -0,0 +1,13 @@
namespace LOC.Core.Model.PvpServer
{
using Sales;
public class PvpClass
{
public int PvpClassId { get; set; }
public string Name { get; set; }
public GameSalesPackage SalesPackage { get; set; }
}
}

View File

@ -0,0 +1,17 @@
namespace LOC.Core.Model.PvpServer
{
using System.Collections.Generic;
using Sales;
using Server.PvpServer;
public class Skill
{
public int SkillId { get; set; }
public string Name { get; set; }
public int Level { get; set; }
public GameSalesPackage SalesPackage { get; set; }
}
}

View File

@ -0,0 +1,13 @@
namespace LOC.Core.Model.PvpServer
{
using Sales;
public class Weapon
{
public int WeaponId { get; set; }
public string Name { get; set; }
public GameSalesPackage SalesPackage { get; set; }
}
}

View File

@ -0,0 +1,17 @@
namespace LOC.Core.Model.GameServer
{
using System.Collections.Generic;
public class Server
{
public int ServerId { get; set; }
public string Name { get; set; }
public string ConnectionAddress { get; set; }
public int PlayerLimit { get; set; }
public List<ServerHistory> History { get; set; }
}
}

View File

@ -0,0 +1,19 @@
namespace LOC.Core.Model.GameServer
{
using Core.GameServer;
public class ServerHistory
{
public int ServerHistoryId { get; set; }
public int ServerId { get; set; }
public ServerStatus Status { get; set; }
public long Time { get; set; }
public double TicksPerSecond { get; set; }
public long MemoryUsage { get; set; }
}
}

View File

@ -0,0 +1,9 @@
namespace LOC.Core.GameServer
{
public class ServerStatus
{
public int ServerStatusId { get; set; }
public string Name { get; set; }
}
}

View File

@ -0,0 +1,15 @@
namespace LOC.Core.Model.GameServer
{
using System.Collections.Generic;
using Tokens.Client;
public class ServerUpdate
{
public ServerUpdate()
{
ClientTokens = new List<ClientToken>();
}
public List<ClientToken> ClientTokens { get; set; }
}
}

View File

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("LOC.Core.Data")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Windows User")]
[assembly: AssemblyProduct("LOC.Core.Data")]
[assembly: AssemblyCopyright("Copyright © Windows User 2012")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("784dcbf3-4395-418c-9987-d2905e0f3fdf")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -0,0 +1,10 @@
namespace LOC.Core
{
public enum PunishmentType
{
Mute,
Kick,
Ban,
DisabledQueue
}
}

View File

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace LOC.Core
{
public class SearchConf
{
public int IdIndex { get; set; }
public int Count { get; set; }
}
}

View File

@ -0,0 +1,14 @@
namespace LOC.Core
{
using System;
public static class TimeUtil
{
public static double GetCurrentMilliseconds()
{
var staticDate = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
var timeSpan = DateTime.UtcNow - staticDate;
return timeSpan.TotalMilliseconds;
}
}
}

View File

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace LOC.Core.Tokens
{
public class AccountBatchToken
{
public int Start { get; set; }
public int End { get; set; }
}
}

View File

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace LOC.Core.Tokens
{
public class AccountNameToken
{
public string Name { get; set; }
public string UUID { get; set; }
}
}

View File

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace LOC.Core.Tokens
{
public class AccountTask
{
public int Id { get; set; }
public string Task { get; set; }
public string UUID { get; set; }
}
}

View File

@ -0,0 +1,24 @@
namespace LOC.Core.Tokens.Clan
{
using Model.Server.PvpServer.Clan;
public class AllianceToken
{
public AllianceToken()
{
}
public AllianceToken(Alliance alliance)
{
ClanId = alliance.Clan.ClanId;
ClanName = alliance.Clan.Name;
Trusted = alliance.Trusted;
}
public int ClanId { get; set; }
public string ClanName { get; set; }
public bool Trusted { get; set; }
}
}

View File

@ -0,0 +1,20 @@
namespace LOC.Core.Tokens.Clan
{
public class ClanGeneratorToken
{
public ClanGeneratorToken() { }
public ClanGeneratorToken(string name, string generator, int generatorStock, long generatorTime)
{
Name = name;
Location = generator;
Stock = generatorStock;
Time = generatorTime;
}
public string Name { get; set; }
public string Location { get; set; }
public int Stock { get; set; }
public long Time { get; set; }
}
}

View File

@ -0,0 +1,26 @@
namespace LOC.Core.Tokens.Clan
{
using Model.Account;
using Model.Server.PvpServer.Clan;
public class ClanMemberToken
{
public ClanMemberToken()
{
}
public ClanMemberToken(Account account)
{
AccountId = account.AccountId;
Name = account.Name;
ClanRole = account.ClanRole;
}
public int AccountId { get; set; }
public string Name { get; set; }
public ClanRole ClanRole { get; set; }
}
}

View File

@ -0,0 +1,27 @@
namespace LOC.Core.Tokens.Clan
{
using Model.Server.PvpServer.Clan;
public class ClanTerritoryToken
{
public ClanTerritoryToken()
{
}
public ClanTerritoryToken(Territory territory)
{
ClanId = territory.Clan.ClanId;
ClanName = territory.Clan.Name;
ServerName = territory.ServerName;
Chunk = territory.Chunk;
Safe = territory.Safe;
}
public int ClanId { get; set; }
public string ClanName { get; set; }
public string ServerName { get; set; }
public string Chunk { get; set; }
public bool Safe { get; set; }
}
}

View File

@ -0,0 +1,66 @@
namespace LOC.Core.Tokens.Clan
{
using System.Collections.Generic;
using Model.Server.PvpServer.Clan;
public class ClanToken
{
public ClanToken()
{
}
public ClanToken(Clan clan)
{
ClanId = clan.ClanId;
Name = clan.Name;
Description = clan.Description;
Power = clan.Power;
Home = clan.Home;
Admin = clan.Admin;
DateCreated = clan.DateCreated;
LastTimeOnline = clan.LastTimeOnline;
Generator = new ClanGeneratorToken(Name, clan.Generator, clan.GeneratorStock, clan.GeneratorTime);
Members = new List<ClanMemberToken>();
foreach (var member in clan.Members)
{
Members.Add(new ClanMemberToken(member));
}
Alliances = new List<AllianceToken>();
foreach (var alliance in clan.Alliances)
{
Alliances.Add(new AllianceToken(alliance));
}
Wars = new List<WarToken>();
foreach (var war in clan.Wars)
{
Wars.Add(new WarToken(war));
}
Territories = new List<ClanTerritoryToken>();
foreach (var territory in clan.Territories)
{
Territories.Add(new ClanTerritoryToken(territory));
}
}
public int ClanId { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public int Power { get; set; }
public string Home { get; set; }
public bool Admin { get; set; }
public long DateCreated { get; set; }
public long LastTimeOnline { get; set; }
public ClanGeneratorToken Generator { get; set; }
public List<ClanMemberToken> Members { get; set; }
public List<ClanTerritoryToken> Territories { get; set; }
public List<AllianceToken> Alliances;
public List<WarToken> Wars;
}
}

View File

@ -0,0 +1,9 @@
namespace LOC.Core.Tokens.Clan
{
public class ClanWarRechargeToken
{
public int ClanId { get; set; }
public string ClanName { get; set; }
public long Recharge { get; set; }
}
}

View File

@ -0,0 +1,28 @@
namespace LOC.Core.Tokens.Clan
{
using Model.Server.PvpServer.Clan;
public class WarToken
{
public WarToken()
{
}
public WarToken(War war)
{
ClanId = war.Clan.ClanId;
ClanName = war.Clan.Name;
Dominance = war.Dominance;
Ended = war.Ended;
Cooldown = war.Cooldown;
}
public int ClanId { get; set; }
public string ClanName { get; set; }
public int Dominance { get; set; }
public bool Ended { get; set; }
public long Cooldown { get; set; }
}
}

View File

@ -0,0 +1,37 @@
using System.Collections.Generic;
using LOC.Core.Model.Account;
namespace LOC.Core.Tokens.Client
{
using System.Collections.ObjectModel;
public class AccountToken
{
public AccountToken()
{
}
public AccountToken(Account account)
{
LastLogin = account.LastLogin;
IpAddresses = new Collection<string>();
MacAddresses = new Collection<string>();
IpAliases = new Collection<string>();
MacAliases = new Collection<string>();
account.IpAddresses = new List<LoginAddress>();
account.MacAddresses = new List<MacAddress>();
}
public long TotalPlayingTime { get; set; }
public long LastLogin { get; set; }
public int LoginCount { get; set; }
public Collection<string> IpAddresses { get; set; }
public Collection<string> MacAddresses { get; set; }
public Collection<string> IpAliases { get; set; }
public Collection<string> MacAliases { get; set; }
}
}

View File

@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace LOC.Core.Tokens.Client
{
public class AccountTransactionToken
{
public long Date { get; set; }
public string SalesPackageName { get; set; }
public int Gems { get; set; }
public int Coins { get; set; }
public AccountTransactionToken(Model.Sales.AccountTransaction transaction)
{
SalesPackageName = transaction.SalesPackageName;
Date = transaction.Date;
Gems = transaction.Gems;
Coins = transaction.Coins;
}
}
}

View File

@ -0,0 +1,8 @@
namespace LOC.Core.Tokens.Client
{
public class ClientClanToken
{
public string Name { get; set; }
public string Role { get; set; }
}
}

View File

@ -0,0 +1,10 @@
using System.Collections.Generic;
namespace LOC.Core.Tokens.Client
{
public class ClientIgnoreToken
{
public string Name { get; set; }
public string IgnoredPlayer { get; set; }
}
}

View File

@ -0,0 +1,136 @@
namespace LOC.Core.Tokens.Client
{
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;
Uuid = account.Uuid;
Rank = account.Rank.Name;
RankPerm = account.RankPerm;
RankExpire = account.RankExpire.ToShortDateString();
Time = (long)TimeUtil.GetCurrentMilliseconds();
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,
Coins = account.Coins,
Donated = account.Donated,
SalesPackages = new List<int>(),
UnknownSalesPackages = new List<string>(),
Transactions = new List<AccountTransactionToken>(),
CoinRewards = new List<CoinTransactionToken>(),
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)
account.AccountTransactions = new List<AccountTransaction>();
foreach (var transaction in account.AccountTransactions)
{
DonorToken.UnknownSalesPackages.Add(transaction.SalesPackageName);
DonorToken.Transactions.Add(new AccountTransactionToken(transaction));
}
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; }
public string Uuid { get; set; }
public string Rank { get; set; }
public bool RankPerm { get; set; }
public string RankExpire { get; set; }
public long Time { get; set; }
public int EconomyBalance { get; set; }
public List<Punishment> Punishments { get; set; }
public List<FishToken> FishTokens;
public List<string> IgnoredPlayers { get; set; }
public AccountToken AccountToken;
public DonorToken DonorToken;
public ClientClanToken ClanToken;
}
}

View File

@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace LOC.Core.Tokens.Client
{
public class CoinTransactionToken
{
public long Date { get; set; }
public int Amount { get; set; }
public string Source { get; set; }
public CoinTransactionToken(Model.Sales.CoinTransaction transaction)
{
Amount = transaction.Amount;
Date = transaction.Date;
Source = transaction.Source;
}
}
}

View File

@ -0,0 +1,165 @@
namespace LOC.Core.Tokens.Client
{
using System.Collections.Generic;
using Model.Server.PvpServer;
public class CustomBuildToken
{
public CustomBuildToken() { }
public CustomBuildToken(CustomBuild customBuild)
{
CustomBuildId = customBuild.CustomBuildId;
Name = customBuild.Name;
Active = customBuild.Active;
CustomBuildNumber = customBuild.CustomBuildNumber;
PvpClass = customBuild.PvpClass;
SwordSkill = customBuild.SwordSkill;
SwordSkillLevel = customBuild.SwordSkillLevel;
AxeSkill = customBuild.AxeSkill;
AxeSkillLevel = customBuild.AxeSkillLevel;
BowSkill = customBuild.BowSkill;
BowSkillLevel = customBuild.BowSkillLevel;
ClassPassiveASkill = customBuild.ClassPassiveASkill;
ClassPassiveASkillLevel = customBuild.ClassPassiveASkillLevel;
ClassPassiveBSkill = customBuild.ClassPassiveBSkill;
ClassPassiveBSkillLevel = customBuild.ClassPassiveBSkillLevel;
GlobalPassiveSkill = customBuild.GlobalPassiveSkill;
GlobalPassiveSkillLevel = customBuild.GlobalPassiveSkillLevel;
SkillTokens = customBuild.SkillTokens;
ItemTokens = customBuild.ItemTokens;
Slots = new List<SlotToken>();
Slots.Add(new SlotToken { Material = customBuild.Slot1Material, Name = customBuild.Slot1Name, Amount = customBuild.Slot1Amount });
Slots.Add(new SlotToken { Material = customBuild.Slot2Material, Name = customBuild.Slot2Name, Amount = customBuild.Slot2Amount });
Slots.Add(new SlotToken { Material = customBuild.Slot3Material, Name = customBuild.Slot3Name, Amount = customBuild.Slot3Amount });
Slots.Add(new SlotToken { Material = customBuild.Slot4Material, Name = customBuild.Slot4Name, Amount = customBuild.Slot4Amount });
Slots.Add(new SlotToken { Material = customBuild.Slot5Material, Name = customBuild.Slot5Name, Amount = customBuild.Slot5Amount });
Slots.Add(new SlotToken { Material = customBuild.Slot6Material, Name = customBuild.Slot6Name, Amount = customBuild.Slot6Amount });
Slots.Add(new SlotToken { Material = customBuild.Slot7Material, Name = customBuild.Slot7Name, Amount = customBuild.Slot7Amount });
Slots.Add(new SlotToken { Material = customBuild.Slot8Material, Name = customBuild.Slot8Name, Amount = customBuild.Slot8Amount });
Slots.Add(new SlotToken { Material = customBuild.Slot9Material, Name = customBuild.Slot9Name, Amount = customBuild.Slot9Amount });
}
public int CustomBuildId { get; set; }
public string PlayerName { get; set; }
public string Name { get; set; }
public bool Active { get; set; }
public int CustomBuildNumber { get; set; }
public string PvpClass { get; set; }
public string SwordSkill { get; set; }
public int SwordSkillLevel { get; set; }
public string AxeSkill { get; set; }
public int AxeSkillLevel { get; set; }
public string BowSkill { get; set; }
public int BowSkillLevel { get; set; }
public string ClassPassiveASkill { get; set; }
public int ClassPassiveASkillLevel { get; set; }
public string ClassPassiveBSkill { get; set; }
public int ClassPassiveBSkillLevel { get; set; }
public string GlobalPassiveSkill { get; set; }
public int GlobalPassiveSkillLevel { get; set; }
public List<SlotToken> Slots { get; set; }
public int SkillTokens { get; set; }
public int ItemTokens { get; set; }
public CustomBuild GetCustomBuild()
{
var customBuild = new CustomBuild();
UpdateCustomBuild(customBuild);
return customBuild;
}
public void UpdateCustomBuild(CustomBuild customBuild)
{
customBuild.Name = Name;
customBuild.Active = Active;
customBuild.CustomBuildNumber = CustomBuildNumber;
customBuild.PvpClass = PvpClass;
customBuild.SwordSkill = SwordSkill;
customBuild.SwordSkillLevel = SwordSkillLevel;
customBuild.AxeSkill = AxeSkill;
customBuild.AxeSkillLevel = AxeSkillLevel;
customBuild.BowSkill = BowSkill;
customBuild.BowSkillLevel = BowSkillLevel;
customBuild.ClassPassiveASkill = ClassPassiveASkill;
customBuild.ClassPassiveASkillLevel = ClassPassiveASkillLevel;
customBuild.ClassPassiveBSkill = ClassPassiveBSkill;
customBuild.ClassPassiveBSkillLevel = ClassPassiveBSkillLevel;
customBuild.GlobalPassiveSkill = GlobalPassiveSkill;
customBuild.GlobalPassiveSkillLevel = GlobalPassiveSkillLevel;
customBuild.ItemTokens = ItemTokens;
customBuild.SkillTokens = SkillTokens;
if (Slots != null && Slots.Count > 0)
{
var slots = Slots.ToArray();
customBuild.Slot1Name = slots[0].Name;
customBuild.Slot1Material = slots[0].Material;
customBuild.Slot1Amount = slots[0].Amount;
customBuild.Slot2Name = slots[1].Name;
customBuild.Slot2Material = slots[1].Material;
customBuild.Slot2Amount = slots[1].Amount;
customBuild.Slot3Name = slots[2].Name;
customBuild.Slot3Material = slots[2].Material;
customBuild.Slot3Amount = slots[2].Amount;
customBuild.Slot4Name = slots[3].Name;
customBuild.Slot4Material = slots[3].Material;
customBuild.Slot4Amount = slots[3].Amount;
customBuild.Slot5Name = slots[4].Name;
customBuild.Slot5Material = slots[4].Material;
customBuild.Slot5Amount = slots[4].Amount;
customBuild.Slot6Name = slots[5].Name;
customBuild.Slot6Material = slots[5].Material;
customBuild.Slot6Amount = slots[5].Amount;
customBuild.Slot7Name = slots[6].Name;
customBuild.Slot7Material = slots[6].Material;
customBuild.Slot7Amount = slots[6].Amount;
customBuild.Slot8Name = slots[7].Name;
customBuild.Slot8Material = slots[7].Material;
customBuild.Slot8Amount = slots[7].Amount;
customBuild.Slot9Name = slots[8].Name;
customBuild.Slot9Material = slots[8].Material;
customBuild.Slot9Amount = slots[8].Amount;
}
}
}
}

View File

@ -0,0 +1,11 @@
namespace LOC.Core.Tokens.Client
{
public class DamageToken
{
public string Player { get; set; }
public string Source { get; set; }
public double Damage { get; set; }
}
}

View File

@ -0,0 +1,11 @@
namespace LOC.Core.Tokens.Client
{
using System.Collections.Generic;
public class DeathStatToken
{
public PlayerSetupToken Killer { get; set; }
public PlayerSetupToken Victim { get; set; }
public List<PlayerSetupToken> Assistants { get; set; }
}
}

View File

@ -0,0 +1,8 @@
namespace LOC.Core.Tokens.Client
{
public class DonationBenefitToken
{
public string AccountName { get; set; }
public int BenefitSalesPackageId { get; set; }
}
}

View File

@ -0,0 +1,19 @@
namespace LOC.Core.Tokens.Client
{
using System.Collections.Generic;
using LOC.Core.Model.Sales;
public class DonorToken
{
public int Gems { get; set; }
public int Coins { get; set; }
public bool Donated { get; set; }
public List<int> SalesPackages { get; set; }
public List<string> UnknownSalesPackages { get; set; }
public List<AccountTransactionToken> Transactions { get; set; }
public List<CoinTransactionToken> CoinRewards { get; set; }
public List<CustomBuildToken> CustomBuilds { get; set; }
public List<PetToken> Pets { get; set; }
public int PetNameTagCount { get; set; }
}
}

View File

@ -0,0 +1,22 @@
namespace LOC.Core.Tokens.Client
{
using Model.Server.PvpServer;
public class FishToken
{
public FishToken() { }
public FishToken(FishCatch fishCatch)
{
Size = fishCatch.Size;
Name = fishCatch.Name;
Catcher = fishCatch.Catcher.Name;
}
public decimal Size { get; set; }
public string Name { get; set; }
public string Catcher { get; set; }
}
}

View File

@ -0,0 +1,15 @@
namespace LOC.Core.Tokens.Client
{
public class GemRewardToken
{
public int OriginalBalance;
public string Name { get; set; }
public string Source { get; set; }
public int Amount { get; set; }
public int Retries { get; set; }
}
}

Some files were not shown because too many files have changed in this diff Show More