提交 326b715a 编写于 作者: Richard__Hu's avatar Richard__Hu

服务器新增推送网络,移除开发中心功能。

上级 c5ba15a9
......@@ -10,6 +10,19 @@ namespace CommonLibrary.DataBaseSupport
/// </summary>
public class SqlServerSupport
{
#region Constructor
/// <summary>
/// 实例化一个默认的构造函数
/// </summary>
public SqlServerSupport( )
{
}
#endregion
/// <summary>
/// 数据库的连接字符串,该信息应来源于服务器保存的连接字符串
/// </summary>
......
......@@ -40,11 +40,12 @@ namespace CommonLibrary
* 时间:2017年10月1日 16:00:13 版本号:1.5.0
* 时间:2017年10月6日 19:23:09 版本号:1.6.0
* 时间:2017年10月21日 11:55:41 版本号:1.7.0
* 时间:2018年5月8日 11:09:16 版本号:1.8.0
*
**************************************************************************/
SoftBasic.FrameworkVersion = new SystemVersion("1.7.14");
SoftBasic.FrameworkVersion = new SystemVersion("1.8.0");
}
......@@ -53,6 +54,7 @@ namespace CommonLibrary
/************************************************************************************************
*
* 注意:您在准备二次开发时,应该重新生成一个自己的GUID码
* Note: When you are preparing for secondary development, you should regenerate your own GUID code
*
************************************************************************************************/
......@@ -77,27 +79,36 @@ namespace CommonLibrary
/// 主网络端口,此处随机定义了一个数据
/// </summary>
public static int Port_Main_Net { get; } = 17652;
/// <summary>
/// 同步网络访问的端口,此处随机定义了一个数据
/// </summary>
public static int Port_Second_Net { get; } = 14568;
/// <summary>
/// 用于软件系统更新的端口,此处随机定义了一个数据
/// </summary>
public static int Port_Update_Net { get; } = 17538;
/// <summary>
/// 共享文件的端口号
/// </summary>
public static int Port_Ultimate_File_Server { get; } = 34261;
/// <summary>
/// 用于UDP传输的端口号
/// </summary>
public static int Port_Udp_Server { get; } = 32566;
/// <summary>
/// 用于服务器版本更新的端口
/// </summary>
public static int Port_Advanced_File_Server { get; } = 24672;
/// <summary>
/// 用于实时数据推送的消息网络
/// </summary>
public static int Port_Push_Server { get; } = 14574;
/// <summary>
......
......@@ -82,11 +82,6 @@
<materialDesign:PackIcon Kind="Rotate3d" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="开发中心" x:Name="MenuItem开发中心" Click="MenuItem开发中心_Click">
<MenuItem.Icon>
<materialDesign:PackIcon Kind="Security" />
</MenuItem.Icon>
</MenuItem>
</MenuItem>
<MenuItem Header="_设置">
<MenuItem.Icon>
......
......@@ -141,7 +141,6 @@ namespace 软件系统客户端Wpf
{
MenuItem日志查看.IsEnabled = false;
MenuItem远程更新.IsEnabled = false;
MenuItem开发中心.IsEnabled = false;
MenuItem系统配置.IsEnabled = false;
}
......@@ -271,32 +270,7 @@ namespace 软件系统客户端Wpf
fiaa.ShowDialog();
}
}
private void MenuItem开发中心_Click(object sender, RoutedEventArgs e)
{
using (FormSuper fs = new FormSuper(() =>
{
OperateResult<byte[]> result = UserClient.Net_simplify_client.ReadFromServer(CommonHeadCode.SimplifyHeadCode.性能计数, new byte[0]);
//解析
if (result.IsSuccess)
{
int[] data = new int[result.Content.Length / 4];
for (int i = 0; i < data.Length; i++)
{
data[i] = BitConverter.ToInt32(result.Content, i * 4);
}
return data;
}
else
{
return null;
}
}))
{
fs.ShowDialog();
}
}
private void MenuItem密码更改_Click(object sender, RoutedEventArgs e)
{
......
......@@ -305,33 +305,7 @@ namespace 软件系统客户端模版
fiaa.ShowDialog();
}
}
private void 开发中心ToolStripMenuItem_Click(object sender, EventArgs e)
{
using (FormSuper fs = new FormSuper(() =>
{
OperateResult<byte[]> result = UserClient.Net_simplify_client.ReadFromServer(CommonHeadCode.SimplifyHeadCode.性能计数, new byte[0]);
//解析
if (result.IsSuccess)
{
int[] data = new int[result.Content.Length / 4];
for (int i = 0; i < data.Length; i++)
{
data[i] = BitConverter.ToInt32(result.Content, i * 4);
}
return data;
}
else
{
return null;
}
}))
{
fs.ShowDialog();
}
}
private void 我的信息ToolStripMenuItem_Click(object sender, EventArgs e)
......
......@@ -61,8 +61,8 @@
this.label5 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.label_GC_Memery = new System.Windows.Forms.Label();
this.label_Pm_Memery = new System.Windows.Forms.Label();
this.label_Count_Simplify = new System.Windows.Forms.Label();
this.label_Count_Push = new System.Windows.Forms.Label();
this.statusStrip1.SuspendLayout();
this.menuStrip1.SuspendLayout();
this.SuspendLayout();
......@@ -313,30 +313,30 @@
this.label7.TabIndex = 15;
this.label7.Text = "Push:";
//
// label_GC_Memery
//
this.label_GC_Memery.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.label_GC_Memery.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.label_GC_Memery.Cursor = System.Windows.Forms.Cursors.Hand;
this.label_GC_Memery.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label_GC_Memery.Location = new System.Drawing.Point(648, 37);
this.label_GC_Memery.Name = "label_GC_Memery";
this.label_GC_Memery.Size = new System.Drawing.Size(108, 24);
this.label_GC_Memery.TabIndex = 16;
this.label_GC_Memery.Text = "0";
this.label_GC_Memery.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// label_Pm_Memery
//
this.label_Pm_Memery.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.label_Pm_Memery.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.label_Pm_Memery.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label_Pm_Memery.Location = new System.Drawing.Point(648, 67);
this.label_Pm_Memery.Name = "label_Pm_Memery";
this.label_Pm_Memery.Size = new System.Drawing.Size(108, 24);
this.label_Pm_Memery.TabIndex = 17;
this.label_Pm_Memery.Text = "0";
this.label_Pm_Memery.TextAlign = System.Drawing.ContentAlignment.TopRight;
// label_Count_Simplify
//
this.label_Count_Simplify.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.label_Count_Simplify.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.label_Count_Simplify.Cursor = System.Windows.Forms.Cursors.Hand;
this.label_Count_Simplify.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label_Count_Simplify.Location = new System.Drawing.Point(648, 37);
this.label_Count_Simplify.Name = "label_Count_Simplify";
this.label_Count_Simplify.Size = new System.Drawing.Size(108, 24);
this.label_Count_Simplify.TabIndex = 16;
this.label_Count_Simplify.Text = "0";
this.label_Count_Simplify.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// label_Count_Push
//
this.label_Count_Push.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.label_Count_Push.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.label_Count_Push.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label_Count_Push.Location = new System.Drawing.Point(648, 67);
this.label_Count_Push.Name = "label_Count_Push";
this.label_Count_Push.Size = new System.Drawing.Size(108, 24);
this.label_Count_Push.TabIndex = 17;
this.label_Count_Push.Text = "0";
this.label_Count_Push.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// FormServerWindow
//
......@@ -344,8 +344,8 @@
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.AliceBlue;
this.ClientSize = new System.Drawing.Size(764, 481);
this.Controls.Add(this.label_Pm_Memery);
this.Controls.Add(this.label_GC_Memery);
this.Controls.Add(this.label_Count_Push);
this.Controls.Add(this.label_Count_Simplify);
this.Controls.Add(this.label7);
this.Controls.Add(this.label6);
this.Controls.Add(this.label5);
......@@ -404,8 +404,8 @@
private System.Windows.Forms.ToolStripMenuItem 日志查看ToolStripMenuItem;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label_GC_Memery;
private System.Windows.Forms.Label label_Pm_Memery;
private System.Windows.Forms.Label label_Count_Simplify;
private System.Windows.Forms.Label label_Count_Push;
}
}
......@@ -229,6 +229,7 @@ namespace 软件系统服务端模版
Ultimate_File_Initiaization(); // 共享文件引擎初始化
Net_File_Portrait_Initialization(); // 头像文件管理服务
Net_Udp_Server_Initialization(); // UDP引擎服务初始化
Net_Push_Server_Initialization( ); // 推送网络引擎初始化
启动服务器ToolStripMenuItem.Text = "已启动";
启动服务器ToolStripMenuItem.BackColor = Color.LimeGreen;
IsSystemStart = true;
......@@ -1075,6 +1076,28 @@ namespace 软件系统服务端模版
#endregion
#region Push Net [ 推送网络 ]
private NetPushServer pushServer;
private void Net_Push_Server_Initialization( )
{
try
{
pushServer = new NetPushServer( );
pushServer.Token = UserSystem.KeyToken;
pushServer.LogNet = RuntimeLogHelper;
pushServer.ServerStart( UserSystem.Port_Push_Server );
}
catch(Exception ex)
{
SoftBasic.ShowExceptionMessage( ex );
}
}
#endregion
#region Time Tick Thread
/*********************************************************************************************
......@@ -1092,7 +1115,7 @@ namespace 软件系统服务端模版
{
toolStripStatusLabel_time.Alignment = ToolStripItemAlignment.Right;
statusStrip1.LayoutStyle = ToolStripLayoutStyle.StackWithOverflow;
toolStripStatusLabel_time.ForeColor = Color.Purple;//紫色
toolStripStatusLabel_time.ForeColor = Color.Purple; // 紫色
Thread thread = new Thread(new ThreadStart(ThreadTimeTick));
......@@ -1106,12 +1129,14 @@ namespace 软件系统服务端模版
{
toolStripStatusLabel_time.Text = DateTime.Now.ToString( );
RenderOnlineAccount( );
if (net_simplify_server != null) label_Count_Simplify.Text = net_simplify_server.ClientCount.ToString( );
if (pushServer != null) label_Count_Push.Text = pushServer.OnlineCount.ToString( );
}
public void ThreadTimeTick()
{
Thread.Sleep(300);//加一个微小的延时
Thread.Sleep(300); // 加一个微小的延时
int second = DateTime.Now.Second - 1;
int minute = -1;
int hour = -1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册