Просмотр исходного кода

抽出了Boss命令模块, 使用了命令模式实现Boss命令

tanghai 13 лет назад
Родитель
Сommit
e79d21615c
32 измененных файлов с 558 добавлено и 257 удалено
  1. 11 27
      CSharp/App/BossBase/BossBase.csproj
  2. 1 1
      CSharp/App/BossBase/CommonDefines.cs
  3. 1 1
      CSharp/App/BossBase/IMessageChannel.cs
  4. 2 3
      CSharp/App/BossBase/LoginOKEvent.cs
  5. 1 1
      CSharp/App/BossBase/Messages.cs
  6. 0 0
      CSharp/App/BossBase/Packages.config
  7. 36 36
      CSharp/App/BossBase/Properties/AssemblyInfo.cs
  8. 4 2
      CSharp/App/BossClient/BossClient.csproj
  9. 1 0
      CSharp/App/BossClient/ENetChannel.cs
  10. 1 0
      CSharp/App/BossClient/GateSession.cs
  11. 1 0
      CSharp/App/BossClient/RealmSession.cs
  12. 0 1
      CSharp/App/BossClient/SRP6Client.cs
  13. 1 4
      CSharp/App/BossClient/TcpChannel.cs
  14. 60 0
      CSharp/App/BossCommand/ABossCommand.cs
  15. 14 0
      CSharp/App/BossCommand/App.config
  16. 45 0
      CSharp/App/BossCommand/BCAllowBuy.cs
  17. 47 0
      CSharp/App/BossCommand/BCFindPlayer.cs
  18. 56 0
      CSharp/App/BossCommand/BCForbiddenBuy.cs
  19. 19 0
      CSharp/App/BossCommand/BCReloadWorld.cs
  20. 21 0
      CSharp/App/BossCommand/BCServerInfo.cs
  21. 84 0
      CSharp/App/BossCommand/BossCommand.csproj
  22. 4 0
      CSharp/App/BossCommand/Packages.config
  23. 36 0
      CSharp/App/BossCommand/Properties/AssemblyInfo.cs
  24. 4 4
      CSharp/App/Modules/Login/Login.csproj
  25. 1 1
      CSharp/App/Modules/Login/LoginViewModel.cs
  26. 0 2
      CSharp/App/Modules/Robot/Packages.config
  27. 8 44
      CSharp/App/Modules/Robot/Robot.csproj
  28. 1 1
      CSharp/App/Modules/Robot/RobotView.xaml
  29. 2 2
      CSharp/App/Modules/Robot/RobotView.xaml.cs
  30. 80 125
      CSharp/App/Modules/Robot/RobotViewModel.cs
  31. 0 1
      CSharp/App/Modules/Robot/ServerViewModel.cs
  32. 16 1
      CSharp/CSharp.sln

+ 11 - 27
CSharp/App/Events/Events.csproj → CSharp/App/BossBase/BossBase.csproj

@@ -7,8 +7,8 @@
     <ProjectGuid>{999910D3-4E7D-45B1-BD2C-47289CD4D1AB}</ProjectGuid>
     <OutputType>Library</OutputType>
     <AppDesignerFolder>Properties</AppDesignerFolder>
-    <RootNamespace>Events</RootNamespace>
-    <AssemblyName>Events</AssemblyName>
+    <RootNamespace>BossBase</RootNamespace>
+    <AssemblyName>BossBase</AssemblyName>
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>
     <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
@@ -32,44 +32,28 @@
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="Microsoft.Expression.Interactions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\Prism.4.1.0.0\lib\NET40\Microsoft.Expression.Interactions.dll</HintPath>
-    </Reference>
     <Reference Include="Microsoft.Practices.Prism, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
       <HintPath>..\..\packages\Prism.4.1.0.0\lib\NET40\Microsoft.Practices.Prism.dll</HintPath>
     </Reference>
-    <Reference Include="Microsoft.Practices.Prism.Interactivity, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\Prism.4.1.0.0\lib\NET40\Microsoft.Practices.Prism.Interactivity.dll</HintPath>
-    </Reference>
-    <Reference Include="Microsoft.Practices.Prism.MefExtensions, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\Prism.MEFExtensions.4.1.0.0\lib\NET40\Microsoft.Practices.Prism.MefExtensions.dll</HintPath>
-    </Reference>
-    <Reference Include="Microsoft.Practices.ServiceLocation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\CommonServiceLocator.1.0\lib\NET35\Microsoft.Practices.ServiceLocation.dll</HintPath>
-    </Reference>
     <Reference Include="System" />
     <Reference Include="System.Core" />
-    <Reference Include="System.Windows.Interactivity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\Prism.4.1.0.0\lib\NET40\System.Windows.Interactivity.dll</HintPath>
-    </Reference>
-    <Reference Include="System.Xml.Linq" />
-    <Reference Include="System.Data.DataSetExtensions" />
-    <Reference Include="Microsoft.CSharp" />
-    <Reference Include="System.Data" />
-    <Reference Include="System.Xml" />
+    <Reference Include="System.Runtime.Serialization" />
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="CommonDefines.cs" />
+    <Compile Include="IMessageChannel.cs" />
     <Compile Include="LoginOKEvent.cs" />
+    <Compile Include="Messages.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
   </ItemGroup>
   <ItemGroup>
-    <ProjectReference Include="..\BossClient\BossClient.csproj">
-      <Project>{8650195a-7904-4ebc-9d81-b392a7e9b9b3}</Project>
-      <Name>BossClient</Name>
-    </ProjectReference>
+    <None Include="Packages.config" />
   </ItemGroup>
   <ItemGroup>
-    <None Include="Packages.config" />
+    <ProjectReference Include="..\DataCenter\DataCenter.csproj">
+      <Project>{A829A025-5E90-4085-8DD4-E3B8C1282635}</Project>
+      <Name>DataCenter</Name>
+    </ProjectReference>
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <Import Project="$(SolutionDir)\.nuget\nuget.targets" />

+ 1 - 1
CSharp/App/Modules/Robot/CommonDefines.cs → CSharp/App/BossBase/CommonDefines.cs

@@ -1,5 +1,5 @@
 
-namespace Modules.Robot
+namespace BossBase
 {
 	public static class BuffId
 	{

+ 1 - 1
CSharp/App/BossClient/IMessageChannel.cs → CSharp/App/BossBase/IMessageChannel.cs

@@ -1,7 +1,7 @@
 using System;
 using System.Threading.Tasks;
 
-namespace BossClient
+namespace BossBase
 {
 	public interface IMessageChannel : IDisposable
 	{

+ 2 - 3
CSharp/App/Events/LoginOKEvent.cs → CSharp/App/BossBase/LoginOKEvent.cs

@@ -1,7 +1,6 @@
-using BossClient;
-using Microsoft.Practices.Prism.Events;
+using Microsoft.Practices.Prism.Events;
 
-namespace Events
+namespace BossBase
 {
 	public class LoginOKEvent : CompositePresentationEvent<IMessageChannel>
 	{

+ 1 - 1
CSharp/App/BossClient/Messages.cs → CSharp/App/BossBase/Messages.cs

@@ -1,7 +1,7 @@
 using System.Collections.Generic;
 using System.Runtime.Serialization;
 
-namespace BossClient
+namespace BossBase
 {
 	public static class MessageOpcode
 	{

+ 0 - 0
CSharp/App/Events/Packages.config → CSharp/App/BossBase/Packages.config


+ 36 - 36
CSharp/App/Events/Properties/AssemblyInfo.cs → CSharp/App/BossBase/Properties/AssemblyInfo.cs

@@ -1,36 +1,36 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// 有关程序集的常规信息通过以下
-// 特性集控制。更改这些特性值可修改
-// 与程序集关联的信息。
-[assembly: AssemblyTitle("Events")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("Events")]
-[assembly: AssemblyCopyright("Copyright ©  2013")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// 将 ComVisible 设置为 false 使此程序集中的类型
-// 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
-// 则将该类型上的 ComVisible 特性设置为 true。
-[assembly: ComVisible(false)]
-
-// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
-[assembly: Guid("288940c7-28fd-45cd-a5f7-87eaeef4740d")]
-
-// 程序集的版本信息由下面四个值组成:
-//
-//      主版本
-//      次版本 
-//      生成号
-//      修订号
-//
-// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
-// 方法是按如下所示使用“*”:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// 有关程序集的常规信息通过以下
+// 特性集控制。更改这些特性值可修改
+// 与程序集关联的信息。
+[assembly: AssemblyTitle("Events")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Events")]
+[assembly: AssemblyCopyright("Copyright ©  2013")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// 将 ComVisible 设置为 false 使此程序集中的类型
+// 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
+// 则将该类型上的 ComVisible 特性设置为 true。
+[assembly: ComVisible(false)]
+
+// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
+[assembly: Guid("288940c7-28fd-45cd-a5f7-87eaeef4740d")]
+
+// 程序集的版本信息由下面四个值组成:
+//
+//      主版本
+//      次版本 
+//      生成号
+//      修订号
+//
+// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
+// 方法是按如下所示使用“*”:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 4 - 2
CSharp/App/BossClient/BossClient.csproj

@@ -44,8 +44,6 @@
   <ItemGroup>
     <Compile Include="ENetChannel.cs" />
     <Compile Include="GateSession.cs" />
-    <Compile Include="IMessageChannel.cs" />
-    <Compile Include="Messages.cs" />
     <Compile Include="BossClient.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="BossException.cs" />
@@ -66,6 +64,10 @@
       <Project>{72e16572-fc1f-4a9e-bc96-035417239298}</Project>
       <Name>Log</Name>
     </ProjectReference>
+    <ProjectReference Include="..\BossBase\BossBase.csproj">
+      <Project>{999910d3-4e7d-45b1-bd2c-47289cd4d1ab}</Project>
+      <Name>BossBase</Name>
+    </ProjectReference>
   </ItemGroup>
   <ItemGroup>
     <None Include="Packages.config" />

+ 1 - 0
CSharp/App/BossClient/ENetChannel.cs

@@ -1,5 +1,6 @@
 using System;
 using System.Threading.Tasks;
+using BossBase;
 using ENet;
 using Helper;
 using Ionic.Zlib;

+ 1 - 0
CSharp/App/BossClient/GateSession.cs

@@ -1,5 +1,6 @@
 using System;
 using System.Threading.Tasks;
+using BossBase;
 using Helper;
 using Log;
 

+ 1 - 0
CSharp/App/BossClient/RealmSession.cs

@@ -1,6 +1,7 @@
 using System;
 using System.Security.Cryptography;
 using System.Threading.Tasks;
+using BossBase;
 using Helper;
 using Log;
 

+ 0 - 1
CSharp/App/BossClient/SRP6Client.cs

@@ -3,7 +3,6 @@ using System.Linq;
 using System.Numerics;
 using System.Security.Cryptography;
 using Helper;
-using Log;
 
 namespace BossClient
 {

+ 1 - 4
CSharp/App/BossClient/TcpChannel.cs

@@ -1,12 +1,9 @@
 using System;
-using System.Collections.Generic;
-using System.Linq;
 using System.Net.Sockets;
-using System.Text;
 using System.Threading.Tasks;
+using BossBase;
 using Helper;
 using Log;
-using BossClient;
 
 namespace BossClient
 {

+ 60 - 0
CSharp/App/BossCommand/ABossCommand.cs

@@ -0,0 +1,60 @@
+using System;
+using System.Threading.Tasks;
+using BossBase;
+using DataCenter;
+using Helper;
+using Log;
+
+namespace BossCommand
+{
+	public abstract class ABossCommand
+	{
+		protected IMessageChannel IMessageChannel { get; set; }
+		protected DataCenterEntities Entities { get; set; }
+
+
+		protected void SendMessage(CMSG_Boss_Gm cmsgBossGm)
+		{
+			this.IMessageChannel.SendMessage(MessageOpcode.CMSG_BOSS_GM, cmsgBossGm);
+		}
+
+		protected async Task<T> RecvMessage<T>()
+		{
+			var result = await this.IMessageChannel.RecvMessage();
+			ushort opcode = result.Item1;
+			byte[] content = result.Item2;
+
+			try
+			{
+				var message = ProtobufHelper.FromBytes<T>(content);
+				return message;
+			}
+			catch (Exception)
+			{
+				Logger.Trace("parse message fail, opcode: {0}", opcode);
+				throw;
+			}
+		}
+
+		protected ABossCommand(IMessageChannel iMessageChannel, DataCenterEntities entities)
+		{
+			this.IMessageChannel = iMessageChannel;
+			this.Entities = entities;
+		}
+
+		public virtual Task<object> DoAsync()
+		{
+			throw new NotImplementedException();
+		}
+
+		public virtual object Do()
+		{
+			throw new NotImplementedException();
+		}
+
+		public void Undo()
+		{
+			throw new NotImplementedException();
+		}
+	}
+}

+ 14 - 0
CSharp/App/BossCommand/App.config

@@ -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=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
+  </configSections>
+  <entityFramework>
+    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
+      <parameters>
+        <parameter value="v11.0" />
+      </parameters>
+    </defaultConnectionFactory>
+  </entityFramework>
+</configuration>

+ 45 - 0
CSharp/App/BossCommand/BCAllowBuy.cs

@@ -0,0 +1,45 @@
+using System.Linq;
+using System.Threading.Tasks;
+using BossBase;
+using DataCenter;
+
+namespace BossCommand
+{
+	public class BCAllowBuy: ABossCommand
+	{
+		public BCAllowBuy(IMessageChannel iMessageChannel, DataCenterEntities entities): 
+			base(iMessageChannel, entities)
+		{
+		}
+
+		public string Guid { get; set; }
+
+		public override async Task<object> DoAsync()
+		{
+			this.SendMessage(new CMSG_Boss_Gm
+			{
+				Message = string.Format("forbidden_buy_item {0} 0", this.Guid)
+			});
+			var smsgBossCommandResponse = await RecvMessage<SMSG_Boss_Command_Response>();
+			if (smsgBossCommandResponse.ErrorCode == ErrorCode.RESPONSE_SUCCESS)
+			{
+				return ErrorCode.RESPONSE_SUCCESS;
+			}
+			if (smsgBossCommandResponse.ErrorCode == ErrorCode.BOSS_PLAYER_NOT_FOUND)
+			{
+				decimal character_guid = decimal.Parse(this.Guid);
+				var removeBuffs = Entities.t_city_buff.Where(
+					c => c.buff_id == BuffId.BUFF_FORBIDDEN_PLAYER_BUY_ITEM &&
+						c.character_guid == character_guid);
+				foreach (var removeBuff in removeBuffs)
+				{
+					Entities.t_city_buff.Remove(removeBuff);
+				}
+				Entities.SaveChanges();
+
+				return ErrorCode.RESPONSE_SUCCESS;
+			}
+			return smsgBossCommandResponse.ErrorCode;
+		}
+	}
+}

+ 47 - 0
CSharp/App/BossCommand/BCFindPlayer.cs

@@ -0,0 +1,47 @@
+using System;
+using System.Linq;
+using BossBase;
+using DataCenter;
+
+namespace BossCommand
+{
+	public class BCFindPlayer: ABossCommand
+	{
+		public BCFindPlayer(IMessageChannel iMessageChannel, DataCenterEntities entities): 
+			base(iMessageChannel, entities)
+		{
+		}
+
+		public int FindTypeIndex { get; set; }
+
+		public string FindType { get; set; }
+
+		public override object Do()
+		{
+			t_character result = null;
+			switch (this.FindTypeIndex)
+			{
+				case 0:
+				{
+					result = Entities.t_character.FirstOrDefault(
+						c => c.account == this.FindType);
+					break;
+				}
+				case 1:
+				{
+					result = Entities.t_character.FirstOrDefault(
+						c => c.character_name == this.FindType);
+					break;
+				}
+				case 2:
+				{
+					var findGuid = Decimal.Parse(this.FindType);
+					result = Entities.t_character.FirstOrDefault(
+						c => c.character_guid == findGuid);
+					break;
+				}
+			}
+			return result;
+		}
+	}
+}

+ 56 - 0
CSharp/App/BossCommand/BCForbiddenBuy.cs

@@ -0,0 +1,56 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using BossBase;
+using DataCenter;
+using Helper;
+
+namespace BossCommand
+{
+	public class BCForbiddenBuy: ABossCommand
+	{
+		public BCForbiddenBuy(IMessageChannel iMessageChannel, DataCenterEntities entities): 
+			base(iMessageChannel, entities)
+		{
+		}
+
+		public string Guid { get; set; }
+		public override async Task<object> DoAsync()
+		{
+			this.SendMessage(new CMSG_Boss_Gm { Message = string.Format("forbidden_buy_item {0} {1}", this.Guid, 365 * 24 * 3600) });
+
+			var smsgBossCommandResponse = await this.RecvMessage<SMSG_Boss_Command_Response>();
+			if (smsgBossCommandResponse.ErrorCode == ErrorCode.RESPONSE_SUCCESS)
+			{
+				return ErrorCode.RESPONSE_SUCCESS;
+			}
+			if (smsgBossCommandResponse.ErrorCode == ErrorCode.BOSS_PLAYER_NOT_FOUND)
+			{
+				decimal character_guid = decimal.Parse(this.Guid);
+				var removeBuffs = Entities.t_city_buff.Where(
+					c => c.buff_id == BuffId.BUFF_FORBIDDEN_PLAYER_BUY_ITEM &&
+						c.character_guid == character_guid);
+				foreach (var removeBuff in removeBuffs)
+				{
+					Entities.t_city_buff.Remove(removeBuff);
+				}
+				var newBuff = new t_city_buff
+				{
+					buff_guid = RandomHelper.RandUInt64(),
+					buff_id = BuffId.BUFF_FORBIDDEN_PLAYER_BUY_ITEM,
+					buff_time = 0,
+					buff_values = "{}".ToByteArray(),
+					character_guid = decimal.Parse(this.Guid),
+					create_time = DateTime.Now,
+					modify_time = DateTime.Now,
+					stack = 1
+				};
+				Entities.t_city_buff.Add(newBuff);
+				Entities.SaveChanges();
+				return ErrorCode.RESPONSE_SUCCESS;
+			}
+			return smsgBossCommandResponse.ErrorCode;
+		}
+	}
+}

+ 19 - 0
CSharp/App/BossCommand/BCReloadWorld.cs

@@ -0,0 +1,19 @@
+using BossBase;
+using DataCenter;
+
+namespace BossCommand
+{
+	public class BCReloadWorld: ABossCommand
+	{
+		public BCReloadWorld(IMessageChannel iMessageChannel, DataCenterEntities entities): 
+			base(iMessageChannel, entities)
+		{
+		}
+
+		public override object Do()
+		{
+			this.SendMessage(new CMSG_Boss_Gm { Message = "reload" });
+			return null;
+		}
+	}
+}

+ 21 - 0
CSharp/App/BossCommand/BCServerInfo.cs

@@ -0,0 +1,21 @@
+using System.Threading.Tasks;
+using BossBase;
+using DataCenter;
+
+namespace BossCommand
+{
+	public class BCServerInfo: ABossCommand
+	{
+		public BCServerInfo(IMessageChannel iMessageChannel, DataCenterEntities entities): 
+			base(iMessageChannel, entities)
+		{
+		}
+
+		public override async Task<object> DoAsync()
+		{
+			this.SendMessage(new CMSG_Boss_Gm { Message = "servers"});
+			var smsgBossServersInfo = await this.RecvMessage<SMSG_Boss_ServersInfo>();
+			return smsgBossServersInfo;
+		}
+	}
+}

+ 84 - 0
CSharp/App/BossCommand/BossCommand.csproj

@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{6C16281F-5550-4024-9504-295C63889E4F}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>BossCommand</RootNamespace>
+    <AssemblyName>BossCommand</AssemblyName>
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+  </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">
+      <HintPath>..\..\packages\EntityFramework.5.0.0\lib\net45\EntityFramework.dll</HintPath>
+    </Reference>
+    <Reference Include="Microsoft.Practices.Prism, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
+    <Reference Include="Microsoft.Practices.Prism.MefExtensions, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
+    <Reference Include="System" />
+    <Reference Include="System.ComponentModel.Composition" />
+    <Reference Include="System.Core" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="ABossCommand.cs" />
+    <Compile Include="BCAllowBuy.cs" />
+    <Compile Include="BCFindPlayer.cs" />
+    <Compile Include="BCServerInfo.cs" />
+    <Compile Include="BCReloadWorld.cs" />
+    <Compile Include="BCForbiddenBuy.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\Platform\Helper\Helper.csproj">
+      <Project>{24233CD5-A5DF-484B-A482-B79CB7A0D9CB}</Project>
+      <Name>Helper</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\Platform\Log\Log.csproj">
+      <Project>{72E16572-FC1F-4A9E-BC96-035417239298}</Project>
+      <Name>Log</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\BossBase\BossBase.csproj">
+      <Project>{999910D3-4E7D-45B1-BD2C-47289CD4D1AB}</Project>
+      <Name>BossBase</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\DataCenter\DataCenter.csproj">
+      <Project>{A829A025-5E90-4085-8DD4-E3B8C1282635}</Project>
+      <Name>DataCenter</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="App.config" />
+    <None Include="Packages.config" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <Import Project="$(SolutionDir)\.nuget\nuget.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>

+ 4 - 0
CSharp/App/BossCommand/Packages.config

@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+  <package id="EntityFramework" version="5.0.0" targetFramework="net45" />
+</packages>

+ 36 - 0
CSharp/App/BossCommand/Properties/AssemblyInfo.cs

@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// 有关程序集的常规信息通过以下
+// 特性集控制。更改这些特性值可修改
+// 与程序集关联的信息。
+[assembly: AssemblyTitle("BossCommand")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("BossCommand")]
+[assembly: AssemblyCopyright("Copyright ©  2013")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// 将 ComVisible 设置为 false 使此程序集中的类型
+// 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
+// 则将该类型上的 ComVisible 特性设置为 true。
+[assembly: ComVisible(false)]
+
+// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
+[assembly: Guid("5a08753f-2724-4f97-a254-9d64f6faff13")]
+
+// 程序集的版本信息由下面四个值组成:
+//
+//      主版本
+//      次版本 
+//      生成号
+//      修订号
+//
+// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
+// 方法是按如下所示使用“*”:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 4 - 4
CSharp/App/Modules/Login/Login.csproj

@@ -83,14 +83,14 @@
     <None Include="Packages.config" />
   </ItemGroup>
   <ItemGroup>
+    <ProjectReference Include="..\..\BossBase\BossBase.csproj">
+      <Project>{999910D3-4E7D-45B1-BD2C-47289CD4D1AB}</Project>
+      <Name>BossBase</Name>
+    </ProjectReference>
     <ProjectReference Include="..\..\BossClient\BossClient.csproj">
       <Project>{8650195A-7904-4EBC-9D81-B392A7E9B9B3}</Project>
       <Name>BossClient</Name>
     </ProjectReference>
-    <ProjectReference Include="..\..\Events\Events.csproj">
-      <Project>{999910d3-4e7d-45b1-bd2c-47289cd4d1ab}</Project>
-      <Name>Events</Name>
-    </ProjectReference>
     <ProjectReference Include="..\..\Infrastructure\Infrastructure.csproj">
       <Project>{48a2e149-0dac-41b4-bb54-dfbccd6d42b3}</Project>
       <Name>Infrastructure</Name>

+ 1 - 1
CSharp/App/Modules/Login/LoginViewModel.cs

@@ -4,7 +4,7 @@ using System.Configuration;
 using System.Threading.Tasks;
 using System.Windows;
 using System.Windows.Threading;
-using Events;
+using BossBase;
 using Microsoft.Practices.Prism.Events;
 using Microsoft.Practices.Prism.ViewModel;
 

+ 0 - 2
CSharp/App/Modules/Robot/Packages.config

@@ -3,8 +3,6 @@
   <package id="CommonServiceLocator" version="1.0" targetFramework="net45" />
   <package id="EntityFramework" version="5.0.0" targetFramework="net45" />
   <package id="Extended.Wpf.Toolkit" version="1.9.0" targetFramework="net45" />
-  <package id="MySql.Data" version="6.6.4" targetFramework="net45" />
-  <package id="MySQL.Data.Entities" version="6.5.4.0" targetFramework="net45" />
   <package id="Prism" version="4.1.0.0" targetFramework="net45" />
   <package id="Prism.MEFExtensions" version="4.1.0.0" targetFramework="net45" />
 </packages>

+ 8 - 44
CSharp/App/Modules/Robot/Robot.csproj

@@ -32,7 +32,6 @@
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="Accessibility" />
     <Reference Include="EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
       <SpecificVersion>False</SpecificVersion>
       <HintPath>..\..\..\packages\EntityFramework.5.0.0\lib\net45\EntityFramework.dll</HintPath>
@@ -43,46 +42,19 @@
     <Reference Include="Microsoft.Practices.Prism.MefExtensions">
       <HintPath>..\..\..\packages\Prism.MEFExtensions.4.1.0.0\lib\NET40\Microsoft.Practices.Prism.MefExtensions.dll</HintPath>
     </Reference>
-    <Reference Include="MySql.Data, Version=6.6.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\..\..\packages\MySql.Data.6.6.4\lib\net40\MySql.Data.dll</HintPath>
-    </Reference>
-    <Reference Include="MySql.Data.Entity, Version=6.5.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\..\..\packages\MySQL.Data.Entities.6.5.4.0\lib\net40\MySql.Data.Entity.dll</HintPath>
-    </Reference>
     <Reference Include="PresentationCore" />
     <Reference Include="PresentationFramework" />
-    <Reference Include="PresentationUI, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
-    <Reference Include="ReachFramework" />
     <Reference Include="System" />
     <Reference Include="System.ComponentModel.Composition" />
     <Reference Include="System.ComponentModel.DataAnnotations" />
-    <Reference Include="System.Configuration" />
     <Reference Include="System.Core" />
-    <Reference Include="System.Data" />
     <Reference Include="System.Data.Entity" />
-    <Reference Include="System.Deployment" />
-    <Reference Include="System.Printing" />
     <Reference Include="System.Runtime.Serialization" />
-    <Reference Include="System.Security" />
     <Reference Include="System.Xaml" />
     <Reference Include="System.Xml" />
-    <Reference Include="System.Xml.Linq" />
-    <Reference Include="UIAutomationProvider" />
-    <Reference Include="UIAutomationTypes" />
     <Reference Include="WindowsBase" />
-    <Reference Include="Xceed.Wpf.DataGrid, Version=1.9.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\..\..\packages\Extended.Wpf.Toolkit.1.9.0\lib\net40\Xceed.Wpf.DataGrid.dll</HintPath>
-    </Reference>
-    <Reference Include="Xceed.Wpf.Toolkit, Version=1.9.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\..\..\packages\Extended.Wpf.Toolkit.1.9.0\lib\net40\Xceed.Wpf.Toolkit.dll</HintPath>
-    </Reference>
   </ItemGroup>
   <ItemGroup>
-    <Compile Include="CommonDefines.cs" />
     <Compile Include="Robot.cs" />
     <Compile Include="RobotModule.cs" />
     <Compile Include="RobotViewModel.cs" />
@@ -98,30 +70,22 @@
     </Page>
   </ItemGroup>
   <ItemGroup>
-    <ProjectReference Include="..\..\..\Platform\ENet\ENet.csproj">
-      <Project>{d0b4cfac-a368-4742-9863-68776cfa9938}</Project>
-      <Name>ENet</Name>
-    </ProjectReference>
-    <ProjectReference Include="..\..\..\Platform\Helper\Helper.csproj">
-      <Project>{24233CD5-A5DF-484B-A482-B79CB7A0D9CB}</Project>
-      <Name>Helper</Name>
-    </ProjectReference>
-    <ProjectReference Include="..\..\..\Platform\Log\Log.csproj">
-      <Project>{72e16572-fc1f-4a9e-bc96-035417239298}</Project>
-      <Name>Log</Name>
+    <ProjectReference Include="..\..\BossBase\BossBase.csproj">
+      <Project>{999910d3-4e7d-45b1-bd2c-47289cd4d1ab}</Project>
+      <Name>BossBase</Name>
     </ProjectReference>
     <ProjectReference Include="..\..\BossClient\BossClient.csproj">
-      <Project>{8650195a-7904-4ebc-9d81-b392a7e9b9b3}</Project>
+      <Project>{8650195A-7904-4EBC-9D81-B392A7E9B9B3}</Project>
       <Name>BossClient</Name>
     </ProjectReference>
+    <ProjectReference Include="..\..\BossCommand\BossCommand.csproj">
+      <Project>{6c16281f-5550-4024-9504-295c63889e4f}</Project>
+      <Name>BossCommand</Name>
+    </ProjectReference>
     <ProjectReference Include="..\..\DataCenter\DataCenter.csproj">
       <Project>{a829a025-5e90-4085-8dd4-e3b8c1282635}</Project>
       <Name>DataCenter</Name>
     </ProjectReference>
-    <ProjectReference Include="..\..\Events\Events.csproj">
-      <Project>{999910d3-4e7d-45b1-bd2c-47289cd4d1ab}</Project>
-      <Name>Events</Name>
-    </ProjectReference>
     <ProjectReference Include="..\..\Infrastructure\Infrastructure.csproj">
       <Project>{48a2e149-0dac-41b4-bb54-dfbccd6d42b3}</Project>
       <Name>Infrastructure</Name>

+ 1 - 1
CSharp/App/Modules/Robot/RobotView.xaml

@@ -34,7 +34,7 @@
 								<ComboBoxItem Content="GUID"/>
 							</ComboBox>
 							<TextBox Width="166" Text="{Binding FindType}" Canvas.Left="88" Canvas.Top="23" Height="25"/>
-							<Button Name="btnFind" Content="查询" Click="btnFind_Click" RenderTransformOrigin="9.161,1.435" Canvas.Left="261" Canvas.Top="23" Height="25"></Button>
+							<Button Name="btnFindPlayer" Content="查询" Click="btnFindPlayer_Click" RenderTransformOrigin="9.161,1.435" Canvas.Left="261" Canvas.Top="23" Height="25"></Button>
 							<Label Content="帐 号:" Grid.Row="1" Grid.Column="0" HorizontalAlignment="Center" Canvas.Left="32" Canvas.Top="52" />
 							<TextBox Text="{Binding Account}"  Grid.Row="1" Grid.Column="1" IsReadOnly="True" Height="25" Canvas.Left="88" Canvas.Top="53" Width="204"/>
 							<Label Content="名 字:" Grid.Row="2" Grid.Column="0" HorizontalAlignment="Center" Canvas.Left="32" Canvas.Top="83" />

+ 2 - 2
CSharp/App/Modules/Robot/RobotView.xaml.cs

@@ -33,9 +33,9 @@ namespace Modules.Robot
 			this.ViewModel.Reload();
 		}
 
-		private void btnFind_Click(object sender, RoutedEventArgs e)
+		private void btnFindPlayer_Click(object sender, RoutedEventArgs e)
 		{
-			this.ViewModel.Find();
+			this.ViewModel.FindPlayer();
 		}
 
 		private void menuLogin_Click(object sender, RoutedEventArgs e)

+ 80 - 125
CSharp/App/Modules/Robot/RobotViewModel.cs

@@ -3,14 +3,12 @@ using System.Collections.Generic;
 using System.Collections.ObjectModel;
 using System.ComponentModel.Composition;
 using System.Globalization;
-using System.Linq;
 using System.Threading.Tasks;
 using System.Windows;
 using BossClient;
+using BossCommand;
 using DataCenter;
-using Events;
-using Helper;
-using Log;
+using BossBase;
 using Microsoft.Practices.Prism.Events;
 using Microsoft.Practices.Prism.ViewModel;
 
@@ -19,7 +17,7 @@ namespace Modules.Robot
 	[Export(contractType: typeof (RobotViewModel)),
 		PartCreationPolicy(creationPolicy: CreationPolicy.Shared)]
 	internal sealed class RobotViewModel: NotificationObject, IDisposable
-	{
+	{
 		private string errorInfo = "";
 		private int findTypeIndex;
 		private string account = "";
@@ -30,11 +28,35 @@ namespace Modules.Robot
 		private Visibility dockPanelVisiable = Visibility.Hidden;
 		private readonly BossClient.BossClient bossClient = new BossClient.BossClient();
 		private readonly ObservableCollection<ServerViewModel> serverInfos = 
-			new ObservableCollection<ServerViewModel>();
-
-		private readonly DataCenterEntities entities = new DataCenterEntities();
+			new ObservableCollection<ServerViewModel>();
 
-		public IMessageChannel IMessageChannel { get; set; }
+		private DataCenterEntities entities = new DataCenterEntities();
+
+		private IMessageChannel iMessageChannel;
+
+		public DataCenterEntities Entities
+		{
+			get
+			{
+				return this.entities;
+			}
+			set
+			{
+				this.entities = value;
+			}
+		}
+
+		public IMessageChannel IMessageChannel
+		{
+			get
+			{
+				return this.iMessageChannel;
+			}
+			set
+			{
+				this.iMessageChannel = value;
+			}
+		}
 
 		public int FindTypeIndex
 		{
@@ -209,38 +231,17 @@ namespace Modules.Robot
 			this.IMessageChannel = messageChannel;
 		}
 
-		public void SendCommand(string command)
-		{
-			var cmsgBossGm = new CMSG_Boss_Gm
-			{
-				Message = command
-			};
-
-			this.IMessageChannel.SendMessage(MessageOpcode.CMSG_BOSS_GM, cmsgBossGm);
-		}
-
-		public async Task<T> RecvMessage<T>()
+		public async void Servers()
 		{
-			var result = await this.IMessageChannel.RecvMessage();
-			ushort opcode = result.Item1;
-			byte[] content = result.Item2;
+			ABossCommand bossCommand = new BCServerInfo(this.IMessageChannel, this.Entities);
+			var result = await bossCommand.DoAsync();
 
-			try
+			var smsgBossServersInfo = result as SMSG_Boss_ServersInfo;
+			if (smsgBossServersInfo == null)
 			{
-				var message = ProtobufHelper.FromBytes<T>(content);
-				return message;
-			}
-			catch (Exception)
-			{
-				Logger.Trace("parse message fail, opcode: {0}", opcode);
-				throw;
+				this.ErrorInfo = "查询服务器失败!";
+				return;
 			}
-		}
-
-		public async void Servers()
-		{
-			this.SendCommand("servers");
-			var smsgBossServersInfo = await this.RecvMessage<SMSG_Boss_ServersInfo>();
 
 			this.ServerInfos.Clear();
 			foreach (var nm in smsgBossServersInfo.Name)
@@ -252,41 +253,25 @@ namespace Modules.Robot
 
 		public void Reload()
 		{
-			this.SendCommand("reload");
+			ABossCommand bossCommand = new BCReloadWorld(this.IMessageChannel, this.Entities);
+			bossCommand.Do();
 		}
 
-		public void Find()
+		public void FindPlayer()
 		{
-			t_character result = null;
-			switch (this.FindTypeIndex)
+			ABossCommand bossCommand = new BCFindPlayer(this.IMessageChannel, this.Entities)
 			{
-				case 0:
-				{
-					result = entities.t_character.FirstOrDefault(
-						c => c.account == this.FindType);
-					break;
-				}
-				case 1:
-				{
-					result = entities.t_character.FirstOrDefault(
-						c => c.character_name == this.FindType);
-					break;
-				}
-				case 2:
-				{
-					var findGuid = Decimal.Parse(this.FindType);
-					result = entities.t_character.FirstOrDefault(
-						c => c.character_guid == findGuid);
-					break;
-				}
-			}
-			
+				FindTypeIndex = this.FindTypeIndex, 
+				FindType = this.FindType
+			};
+			var result = bossCommand.Do() as t_character;
+
 			if (result == null)
 			{
-				this.ErrorInfo = "没有找到该玩家!";
+				this.ErrorInfo = "查询失败";
 				return;
 			}
-			
+
 			this.Account = result.account;
 			this.Name = result.character_name;
 			this.Guid = result.character_guid.ToString(CultureInfo.InvariantCulture);
@@ -301,73 +286,43 @@ namespace Modules.Robot
 				this.ErrorInfo = "请先指定玩家";
 				return;
 			}
-			this.SendCommand(string.Format("forbidden_buy_item {0} {1}", guid, 365 * 24 * 3600));
-			var smsgBossCommandResponse = await RecvMessage<SMSG_Boss_Command_Response>();
-			if (smsgBossCommandResponse.ErrorCode == ErrorCode.RESPONSE_SUCCESS)
+
+			ABossCommand bossCommand = new BCForbiddenBuy(this.IMessageChannel, this.Entities)
 			{
+				Guid = this.Guid
+			};
+			var result = await bossCommand.DoAsync();
+
+			var errorCode = (int)result;
+
+			if (errorCode == ErrorCode.RESPONSE_SUCCESS)
+			{
 				this.ErrorInfo = "禁止交易成功";
 				return;
+			}
+			this.ErrorInfo = string.Format("禁止交易失败, error code: {0}", errorCode);
+		}
+
+		public async void AllowBuy()
+		{
+			if (this.Guid == "")
+			{
+				this.ErrorInfo = "请先指定玩家";
+				return;
 			}
-			if (smsgBossCommandResponse.ErrorCode == ErrorCode.BOSS_PLAYER_NOT_FOUND)
-			{
-				decimal character_guid = decimal.Parse(this.Guid);
-				var removeBuffs = entities.t_city_buff.Where(
-					c => c.buff_id == BuffId.BUFF_FORBIDDEN_PLAYER_BUY_ITEM && 
-						c.character_guid == character_guid);
-				foreach (var removeBuff in removeBuffs)
-				{
-					entities.t_city_buff.Remove(removeBuff);
-				}
-				var newBuff = new t_city_buff
-				{
-					buff_guid = RandomHelper.RandUInt64(),
-					buff_id = BuffId.BUFF_FORBIDDEN_PLAYER_BUY_ITEM,
-					buff_time = 0,
-					buff_values = "{}".ToByteArray(),
-					character_guid = decimal.Parse(this.Guid),
-					create_time = DateTime.Now,
-					modify_time = DateTime.Now,
-					stack = 1
-				};
-				entities.t_city_buff.Add(newBuff);
-				entities.SaveChanges();
-
-				this.ErrorInfo = "禁止交易成功";
-				return;
+			ABossCommand bossCommand = new BCAllowBuy(this.IMessageChannel, this.Entities)
+			{
+				Guid = this.Guid
+			};
+			var result = await bossCommand.DoAsync();
+			var errorCode = (int) result;
+			if (errorCode == ErrorCode.RESPONSE_SUCCESS)
+			{
+				this.ErrorInfo = "允许交易成功";
+				return;
 			}
-			this.ErrorInfo = smsgBossCommandResponse.ErrorCode.ToString();
-		}
 
-		public async void AllowBuy()
-		{
-			if (this.Guid == "")
-			{
-				this.ErrorInfo = "请先指定玩家";
-				return;
-			}
-			this.SendCommand(string.Format("forbidden_buy_item {0} 0", guid));
-			var smsgBossCommandResponse = await RecvMessage<SMSG_Boss_Command_Response>();
-			if (smsgBossCommandResponse.ErrorCode == ErrorCode.RESPONSE_SUCCESS)
-			{
-				this.ErrorInfo = "允许交易成功";
-				return;
-			}
-			if (smsgBossCommandResponse.ErrorCode == ErrorCode.BOSS_PLAYER_NOT_FOUND)
-			{
-				decimal character_guid = decimal.Parse(this.Guid);
-				var removeBuffs = entities.t_city_buff.Where(
-					c => c.buff_id == BuffId.BUFF_FORBIDDEN_PLAYER_BUY_ITEM &&
-						c.character_guid == character_guid);
-				foreach (var removeBuff in removeBuffs)
-				{
-					entities.t_city_buff.Remove(removeBuff);
-				}
-				entities.SaveChanges();
-
-				this.ErrorInfo = "允许交易成功";
-				return;
-			}
-			this.ErrorInfo = smsgBossCommandResponse.ErrorCode.ToString();
+			this.ErrorInfo = errorCode.ToString();
 		}
 	}
 }

+ 0 - 1
CSharp/App/Modules/Robot/ServerViewModel.cs

@@ -1,7 +1,6 @@
 using System;
 using System.Collections.Generic;
 using System.Collections.ObjectModel;
-using System.Linq;
 using System.Runtime.Serialization;
 using System.Text;
 using System.Threading.Tasks;

+ 16 - 1
CSharp/CSharp.sln

@@ -52,7 +52,9 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataCenter", "App\DataCente
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Login", "App\Modules\Login\Login.csproj", "{5AA48F9A-455D-4CD8-A605-A3AC38283E60}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Events", "App\Events\Events.csproj", "{999910D3-4E7D-45B1-BD2C-47289CD4D1AB}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BossBase", "App\BossBase\BossBase.csproj", "{999910D3-4E7D-45B1-BD2C-47289CD4D1AB}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BossCommand", "App\BossCommand\BossCommand.csproj", "{6C16281F-5550-4024-9504-295C63889E4F}"
 EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -274,6 +276,18 @@ Global
 		{999910D3-4E7D-45B1-BD2C-47289CD4D1AB}.Release|Mixed Platforms.Build.0 = Release|Any CPU
 		{999910D3-4E7D-45B1-BD2C-47289CD4D1AB}.Release|Win32.ActiveCfg = Release|Any CPU
 		{999910D3-4E7D-45B1-BD2C-47289CD4D1AB}.Release|x86.ActiveCfg = Release|Any CPU
+		{6C16281F-5550-4024-9504-295C63889E4F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{6C16281F-5550-4024-9504-295C63889E4F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{6C16281F-5550-4024-9504-295C63889E4F}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+		{6C16281F-5550-4024-9504-295C63889E4F}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+		{6C16281F-5550-4024-9504-295C63889E4F}.Debug|Win32.ActiveCfg = Debug|Any CPU
+		{6C16281F-5550-4024-9504-295C63889E4F}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{6C16281F-5550-4024-9504-295C63889E4F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{6C16281F-5550-4024-9504-295C63889E4F}.Release|Any CPU.Build.0 = Release|Any CPU
+		{6C16281F-5550-4024-9504-295C63889E4F}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+		{6C16281F-5550-4024-9504-295C63889E4F}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+		{6C16281F-5550-4024-9504-295C63889E4F}.Release|Win32.ActiveCfg = Release|Any CPU
+		{6C16281F-5550-4024-9504-295C63889E4F}.Release|x86.ActiveCfg = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
@@ -285,6 +299,7 @@ Global
 		{8650195A-7904-4EBC-9D81-B392A7E9B9B3} = {6E9D97F0-4243-452E-B832-1A855B8118EB}
 		{A829A025-5E90-4085-8DD4-E3B8C1282635} = {6E9D97F0-4243-452E-B832-1A855B8118EB}
 		{999910D3-4E7D-45B1-BD2C-47289CD4D1AB} = {6E9D97F0-4243-452E-B832-1A855B8118EB}
+		{6C16281F-5550-4024-9504-295C63889E4F} = {6E9D97F0-4243-452E-B832-1A855B8118EB}
 		{3A98B35C-DEA8-489C-9203-263FFB6B065D} = {ADBF5F67-B480-4A93-9D50-C81856FC61A9}
 		{72E16572-FC1F-4A9E-BC96-035417239298} = {ADBF5F67-B480-4A93-9D50-C81856FC61A9}
 		{24233CD5-A5DF-484B-A482-B79CB7A0D9CB} = {ADBF5F67-B480-4A93-9D50-C81856FC61A9}