Skip to content

Commit 3433ef6

Browse files
committed
v3.3.3.3
1 parent 832a0c2 commit 3433ef6

File tree

26 files changed

+447
-638
lines changed

26 files changed

+447
-638
lines changed

.gitignore

Lines changed: 334 additions & 575 deletions
Large diffs are not rendered by default.

GFFClient/GFFClient.csproj

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,14 @@
7373
<Reference Include="protobuf-net, Version=2.3.15.0, Culture=neutral, PublicKeyToken=257b51d87d2e4d67, processorArchitecture=MSIL">
7474
<HintPath>..\packages\protobuf-net.2.3.15\lib\net40\protobuf-net.dll</HintPath>
7575
</Reference>
76-
<Reference Include="SAEA.Common, Version=3.2.1.1, Culture=neutral, PublicKeyToken=01a82380791791ab, processorArchitecture=MSIL">
77-
<HintPath>..\packages\SAEA.Common.3.2.1.1\lib\netstandard2.0\SAEA.Common.dll</HintPath>
76+
<Reference Include="SAEA.Common, Version=3.3.3.3, Culture=neutral, PublicKeyToken=01a82380791791ab, processorArchitecture=MSIL">
77+
<HintPath>..\packages\SAEA.Common.3.3.3.3\lib\netstandard2.0\SAEA.Common.dll</HintPath>
7878
</Reference>
79-
<Reference Include="SAEA.MessageSocket, Version=3.2.1.1, Culture=neutral, PublicKeyToken=01a82380791791ab, processorArchitecture=MSIL">
80-
<HintPath>..\packages\SAEA.MessageSocket.3.2.1.1\lib\netstandard2.0\SAEA.MessageSocket.dll</HintPath>
79+
<Reference Include="SAEA.MessageSocket, Version=3.3.3.3, Culture=neutral, PublicKeyToken=01a82380791791ab, processorArchitecture=MSIL">
80+
<HintPath>..\packages\SAEA.MessageSocket.3.3.3.3\lib\netstandard2.0\SAEA.MessageSocket.dll</HintPath>
8181
</Reference>
82-
<Reference Include="SAEA.Sockets, Version=3.2.1.1, Culture=neutral, PublicKeyToken=01a82380791791ab, processorArchitecture=MSIL">
83-
<HintPath>..\packages\SAEA.Sockets.3.2.1.1\lib\netstandard2.0\SAEA.Sockets.dll</HintPath>
82+
<Reference Include="SAEA.Sockets, Version=3.3.3.3, Culture=neutral, PublicKeyToken=01a82380791791ab, processorArchitecture=MSIL">
83+
<HintPath>..\packages\SAEA.Sockets.3.3.3.3\lib\netstandard2.0\SAEA.Sockets.dll</HintPath>
8484
</Reference>
8585
<Reference Include="System" />
8686
<Reference Include="System.Buffers, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
@@ -129,7 +129,7 @@
129129
</Compile>
130130
<Compile Include="Program.cs" />
131131
<Compile Include="Properties\AssemblyInfo.cs" />
132-
<Compile Include="PushHelper.cs" />
132+
<Compile Include="MessageHelper.cs" />
133133
<EmbeddedResource Include="InitForm.resx">
134134
<DependentUpon>InitForm.cs</DependentUpon>
135135
</EmbeddedResource>

GFFClient/MainForm.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public partial class MainForm : CCSkinMain
4141
{
4242
private Image fileImage = Resources.file;
4343

44-
public static PushHelper PushHelper = new PushHelper();
44+
public static MessageHelper PushHelper = new MessageHelper();
4545

4646
#region 无参构造
4747

@@ -128,7 +128,7 @@ private void btnSend_Click(object sender, EventArgs e)
128128
c.Font = content.Font;
129129
c.Color = content.Color;
130130
string msg = SerializeHelper.Serialize(c);
131-
ThreadPool.QueueUserWorkItem(s => SendMsgToServer(msg));
131+
ThreadPool.QueueUserWorkItem(s => SendMsgToServer(msg));
132132
}
133133

134134
#endregion
@@ -393,8 +393,9 @@ private void OnReceivedMsg(string msg)
393393
}
394394
AppendChatBoxContent(userName, null, content, Color.Blue, false);
395395
}
396-
catch
396+
catch (Exception ex)
397397
{
398+
MessageBox.Show("发送图片失败:" + ex.Message);
398399
}
399400
}
400401

GFFClient/PushHelper.cs renamed to GFFClient/MessageHelper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
namespace GFFClient
2828
{
29-
public class PushHelper
29+
public class MessageHelper
3030
{
3131
public delegate void OnErrorHander(Exception ex, string msg);
3232

@@ -40,7 +40,7 @@ public class PushHelper
4040

4141
ClientConfig clientConfig;
4242

43-
public PushHelper()
43+
public MessageHelper()
4444
{
4545
clientConfig = ClientConfig.Instance();
4646
}

GFFClient/app.config

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
3-
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/></startup></configuration>
3+
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" /></startup>
4+
<runtime>
5+
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
6+
<dependentAssembly>
7+
<assemblyIdentity name="SAEA.Sockets" publicKeyToken="01a82380791791ab" culture="neutral" />
8+
<bindingRedirect oldVersion="0.0.0.0-3.3.3.3" newVersion="3.3.3.3" />
9+
</dependentAssembly>
10+
<dependentAssembly>
11+
<assemblyIdentity name="SAEA.Common" publicKeyToken="01a82380791791ab" culture="neutral" />
12+
<bindingRedirect oldVersion="0.0.0.0-3.3.3.3" newVersion="3.3.3.3" />
13+
</dependentAssembly>
14+
</assemblyBinding>
15+
</runtime>
16+
</configuration>

GFFClient/packages.config

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
<package id="Microsoft.Tpl.Dataflow" version="4.5.24" targetFramework="net462" />
44
<package id="Newtonsoft.Json" version="11.0.2" targetFramework="net462" />
55
<package id="protobuf-net" version="2.3.15" targetFramework="net462" />
6-
<package id="SAEA.Common" version="3.2.1.1" targetFramework="net462" />
7-
<package id="SAEA.MessageSocket" version="3.2.1.1" targetFramework="net462" />
8-
<package id="SAEA.Sockets" version="3.2.1.1" targetFramework="net462" />
6+
<package id="SAEA.Common" version="3.3.3.3" targetFramework="net462" />
7+
<package id="SAEA.MessageSocket" version="3.3.3.3" targetFramework="net462" />
8+
<package id="SAEA.Sockets" version="3.3.3.3" targetFramework="net462" />
99
<package id="System.Buffers" version="4.4.0" targetFramework="net462" />
1010
<package id="System.Memory" version="4.5.1" targetFramework="net462" />
1111
<package id="System.Numerics.Vectors" version="4.4.0" targetFramework="net462" />

GFFServer/App.config

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,23 @@
1111
</dependentAssembly>
1212
<dependentAssembly>
1313
<assemblyIdentity name="SAEA.Sockets" publicKeyToken="01a82380791791ab" culture="neutral" />
14-
<bindingRedirect oldVersion="0.0.0.0-3.2.1.1" newVersion="3.2.1.1" />
14+
<bindingRedirect oldVersion="0.0.0.0-3.3.3.3" newVersion="3.3.3.3" />
1515
</dependentAssembly>
1616
<dependentAssembly>
1717
<assemblyIdentity name="SAEA.Common" publicKeyToken="01a82380791791ab" culture="neutral" />
18-
<bindingRedirect oldVersion="0.0.0.0-3.2.1.1" newVersion="3.2.1.1" />
18+
<bindingRedirect oldVersion="0.0.0.0-3.3.3.3" newVersion="3.3.3.3" />
19+
</dependentAssembly>
20+
<dependentAssembly>
21+
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
22+
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
23+
</dependentAssembly>
24+
<dependentAssembly>
25+
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
26+
<bindingRedirect oldVersion="0.0.0.0-4.1.4.0" newVersion="4.1.4.0" />
27+
</dependentAssembly>
28+
<dependentAssembly>
29+
<assemblyIdentity name="protobuf-net" publicKeyToken="257b51d87d2e4d67" culture="neutral" />
30+
<bindingRedirect oldVersion="0.0.0.0-2.4.0.0" newVersion="2.4.0.0" />
1931
</dependentAssembly>
2032
</assemblyBinding>
2133
</runtime>

GFFServer/Controllers/FileController.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using SAEA.Http.Model;
2-
using SAEA.MVC;
1+
using SAEA.MVC;
32
using System.IO;
43

54
namespace GFFServer.Controllers
@@ -9,6 +8,11 @@ namespace GFFServer.Controllers
98
/// </summary>
109
public class FileController : Controller
1110
{
11+
public ActionResult Test()
12+
{
13+
return Content("GFF File Server");
14+
}
15+
1216
[HttpPost]
1317
public ActionResult Upload()
1418
{

GFFServer/GFFServer.csproj

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -43,39 +43,39 @@
4343
<Reference Include="Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
4444
<HintPath>..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
4545
</Reference>
46-
<Reference Include="protobuf-net, Version=2.3.15.0, Culture=neutral, PublicKeyToken=257b51d87d2e4d67, processorArchitecture=MSIL">
47-
<HintPath>..\packages\protobuf-net.2.3.15\lib\net40\protobuf-net.dll</HintPath>
46+
<Reference Include="protobuf-net, Version=2.4.0.0, Culture=neutral, PublicKeyToken=257b51d87d2e4d67, processorArchitecture=MSIL">
47+
<HintPath>..\packages\protobuf-net.2.4.0\lib\net40\protobuf-net.dll</HintPath>
4848
</Reference>
49-
<Reference Include="SAEA.Common, Version=3.2.1.1, Culture=neutral, PublicKeyToken=01a82380791791ab, processorArchitecture=MSIL">
50-
<HintPath>..\packages\SAEA.Common.3.2.1.1\lib\netstandard2.0\SAEA.Common.dll</HintPath>
49+
<Reference Include="SAEA.Common, Version=3.3.3.3, Culture=neutral, PublicKeyToken=01a82380791791ab, processorArchitecture=MSIL">
50+
<HintPath>..\packages\SAEA.Common.3.3.3.3\lib\netstandard2.0\SAEA.Common.dll</HintPath>
5151
</Reference>
52-
<Reference Include="SAEA.Http, Version=3.2.1.1, Culture=neutral, PublicKeyToken=01a82380791791ab, processorArchitecture=MSIL">
53-
<HintPath>..\packages\SAEA.Http.3.2.1.1\lib\netstandard2.0\SAEA.Http.dll</HintPath>
52+
<Reference Include="SAEA.Http, Version=3.3.3.3, Culture=neutral, PublicKeyToken=01a82380791791ab, processorArchitecture=MSIL">
53+
<HintPath>..\packages\SAEA.Http.3.3.3.3\lib\netstandard2.0\SAEA.Http.dll</HintPath>
5454
</Reference>
55-
<Reference Include="SAEA.MessageSocket, Version=3.2.1.1, Culture=neutral, PublicKeyToken=01a82380791791ab, processorArchitecture=MSIL">
56-
<HintPath>..\packages\SAEA.MessageSocket.3.2.1.1\lib\netstandard2.0\SAEA.MessageSocket.dll</HintPath>
55+
<Reference Include="SAEA.MessageSocket, Version=3.3.3.3, Culture=neutral, PublicKeyToken=01a82380791791ab, processorArchitecture=MSIL">
56+
<HintPath>..\packages\SAEA.MessageSocket.3.3.3.3\lib\netstandard2.0\SAEA.MessageSocket.dll</HintPath>
5757
</Reference>
58-
<Reference Include="SAEA.MVC, Version=3.2.1.1, Culture=neutral, PublicKeyToken=01a82380791791ab, processorArchitecture=MSIL">
59-
<HintPath>..\packages\SAEA.MVC.3.2.1.1\lib\netstandard2.0\SAEA.MVC.dll</HintPath>
58+
<Reference Include="SAEA.MVC, Version=3.3.3.3, Culture=neutral, PublicKeyToken=01a82380791791ab, processorArchitecture=MSIL">
59+
<HintPath>..\packages\SAEA.MVC.3.3.3.3\lib\netstandard2.0\SAEA.MVC.dll</HintPath>
6060
</Reference>
61-
<Reference Include="SAEA.Sockets, Version=3.2.1.1, Culture=neutral, PublicKeyToken=01a82380791791ab, processorArchitecture=MSIL">
62-
<HintPath>..\packages\SAEA.Sockets.3.2.1.1\lib\netstandard2.0\SAEA.Sockets.dll</HintPath>
61+
<Reference Include="SAEA.Sockets, Version=3.3.3.3, Culture=neutral, PublicKeyToken=01a82380791791ab, processorArchitecture=MSIL">
62+
<HintPath>..\packages\SAEA.Sockets.3.3.3.3\lib\netstandard2.0\SAEA.Sockets.dll</HintPath>
6363
</Reference>
6464
<Reference Include="System" />
65-
<Reference Include="System.Buffers, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
66-
<HintPath>..\packages\System.Buffers.4.4.0\lib\netstandard2.0\System.Buffers.dll</HintPath>
65+
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
66+
<HintPath>..\packages\System.Buffers.4.5.0\lib\netstandard2.0\System.Buffers.dll</HintPath>
6767
</Reference>
6868
<Reference Include="System.Configuration" />
6969
<Reference Include="System.Core" />
7070
<Reference Include="System.Memory, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
7171
<HintPath>..\packages\System.Memory.4.5.1\lib\netstandard2.0\System.Memory.dll</HintPath>
7272
</Reference>
7373
<Reference Include="System.Numerics" />
74-
<Reference Include="System.Numerics.Vectors, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
75-
<HintPath>..\packages\System.Numerics.Vectors.4.4.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
74+
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
75+
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
7676
</Reference>
77-
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
78-
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.5.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
77+
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
78+
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
7979
</Reference>
8080
<Reference Include="System.Runtime.Serialization" />
8181
<Reference Include="System.ServiceModel" />

GFFServer/Program.cs

Lines changed: 35 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,42 +17,62 @@
1717
* 创建说明:
1818
*****************************************************************************************************/
1919

20-
using System;
2120
using GFF.Component.Config;
2221
using GFF.Helper;
23-
using GFF.Model.Entity;
2422
using SAEA.MessageSocket;
2523
using SAEA.MVC;
2624
using SAEA.Sockets.Interface;
25+
using System;
2726

2827
namespace GFFServer
2928
{
3029
internal class Program
3130
{
32-
private static MessageServer server;
31+
private static MessageServer messageServer;
3332

3433
private static SAEAMvcApplication mvcApplication;
3534

3635
private static void Main(string[] args)
3736
{
38-
ConsoleHelper.WriteLine("正在初始化服务器...", ConsoleColor.Green);
39-
server = new MessageServer();
40-
server.OnAccepted += Server_OnAccepted;
41-
server.OnError += Server_OnError;
42-
server.OnDisconnected += Server_OnDisconnected;
43-
mvcApplication = new SAEAMvcApplication(port: ServerConfig.Instance().FilePort);
44-
ConsoleHelper.WriteLine("服务器初始化完毕...", ConsoleColor.Green);
45-
ConsoleHelper.WriteLine("正在启动服务器...", ConsoleColor.Green);
46-
server.Start();
37+
Console.Title = "GFFServer";
38+
39+
40+
ConsoleHelper.WriteLine("正在初始化消息服务器...", ConsoleColor.Green);
41+
messageServer = new MessageServer();
42+
messageServer.OnAccepted += Server_OnAccepted;
43+
messageServer.OnError += Server_OnError;
44+
messageServer.OnDisconnected += Server_OnDisconnected;
45+
ConsoleHelper.WriteLine("消息服务器初始化完毕...", ConsoleColor.Green);
46+
47+
48+
49+
ConsoleHelper.WriteLine("正在初始化文件服务器...", ConsoleColor.DarkYellow);
50+
var filePort = ServerConfig.Instance().FilePort;
51+
mvcApplication = new SAEAMvcApplication(port: filePort);
52+
mvcApplication.SetDefault("File", "Test");
53+
ConsoleHelper.WriteLine("文件服务器初始化完毕,http://127.0.0.1:" + filePort + "/...", ConsoleColor.DarkYellow);
54+
55+
56+
57+
ConsoleHelper.WriteLine("正在启动消息服务器...", ConsoleColor.Green);
58+
messageServer.Start();
59+
ConsoleHelper.WriteLine("消息服务器启动完毕...", ConsoleColor.Green);
60+
61+
62+
63+
ConsoleHelper.WriteLine("正在启动文件服务器...", ConsoleColor.DarkYellow);
4764
mvcApplication.Start();
48-
ConsoleHelper.WriteLine("服务器启动完毕...", ConsoleColor.Green);
65+
ConsoleHelper.WriteLine("文件服务器启动完毕...", ConsoleColor.DarkYellow);
66+
67+
68+
4969
ConsoleHelper.WriteLine("点击回车,结束服务");
5070
Console.ReadLine();
5171
}
5272

5373
private static void Server_OnDisconnected(string ID, Exception ex)
5474
{
55-
ConsoleHelper.WriteInfo(string.Format("客户端{0}已断开连接,当前连接数共记:{1}", ID, server.ClientCounts - 1));
75+
ConsoleHelper.WriteInfo(string.Format("客户端{0}已断开连接,当前连接数共记:{1}", ID, messageServer.ClientCounts));
5676
}
5777

5878
private static void Server_OnError(string ID, Exception ex)
@@ -62,7 +82,7 @@ private static void Server_OnError(string ID, Exception ex)
6282

6383
private static void Server_OnAccepted(IUserToken userToken)
6484
{
65-
ConsoleHelper.WriteInfo(string.Format("客户端{0}已连接,当前连接数共记:{1}", userToken.ID, server.ClientCounts));
85+
ConsoleHelper.WriteInfo(string.Format("客户端{0}已连接,当前连接数共记:{1}", userToken.ID, messageServer.ClientCounts));
6686
}
6787
}
6888
}

0 commit comments

Comments
 (0)