mirror of
https://github.com/project-redbud/FunGame-Server.git
synced 2025-12-05 00:06:03 +00:00
添加BaseServerModel,修改ThreadManager
This commit is contained in:
parent
eaa1b7d228
commit
163ad53e48
@ -1,6 +0,0 @@
|
|||||||
namespace FunGame.Server.Controller
|
|
||||||
{
|
|
||||||
internal class ServerController
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -2,20 +2,21 @@
|
|||||||
using Milimoe.FunGame.Core.Entity;
|
using Milimoe.FunGame.Core.Entity;
|
||||||
using Milimoe.FunGame.Core.Library.Common.Network;
|
using Milimoe.FunGame.Core.Library.Common.Network;
|
||||||
using Milimoe.FunGame.Core.Library.Constant;
|
using Milimoe.FunGame.Core.Library.Constant;
|
||||||
|
using Milimoe.FunGame.Core.Library.Server;
|
||||||
using Milimoe.FunGame.Server.Others;
|
using Milimoe.FunGame.Server.Others;
|
||||||
using Milimoe.FunGame.Server.Utility;
|
using Milimoe.FunGame.Server.Utility;
|
||||||
|
|
||||||
namespace Milimoe.FunGame.Server.Model
|
namespace Milimoe.FunGame.Server.Model
|
||||||
{
|
{
|
||||||
public class ServerModel
|
public class ServerModel : BaseModel
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Public
|
* Public
|
||||||
*/
|
*/
|
||||||
public bool Running = false;
|
public new bool Running = false;
|
||||||
public ClientSocket? Socket = null;
|
public new ClientSocket? Socket = null;
|
||||||
public Task? Task = null;
|
public new Task? Task = null;
|
||||||
public string ClientName = "";
|
public new string ClientName = "";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Private
|
* Private
|
||||||
@ -32,7 +33,7 @@ namespace Milimoe.FunGame.Server.Model
|
|||||||
Running = running;
|
Running = running;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Read(ClientSocket socket)
|
public override bool Read(ClientSocket socket)
|
||||||
{
|
{
|
||||||
// 接收客户端消息
|
// 接收客户端消息
|
||||||
try
|
try
|
||||||
@ -140,7 +141,7 @@ namespace Milimoe.FunGame.Server.Model
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Send(ClientSocket socket, SocketMessageType type, params object[] objs)
|
public override bool Send(ClientSocket socket, SocketMessageType type, params object[] objs)
|
||||||
{
|
{
|
||||||
// 发送消息给客户端
|
// 发送消息给客户端
|
||||||
try
|
try
|
||||||
@ -165,7 +166,7 @@ namespace Milimoe.FunGame.Server.Model
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Start()
|
public override void Start()
|
||||||
{
|
{
|
||||||
Task StreamReader = Task.Factory.StartNew(() =>
|
Task StreamReader = Task.Factory.StartNew(() =>
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
using Milimoe.FunGame.Core.Library.Constant;
|
using System.Collections;
|
||||||
using Milimoe.FunGame.Server.Model;
|
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Concurrent;
|
using System.Collections.Concurrent;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using Milimoe.FunGame.Core.Library.Constant;
|
||||||
|
using Milimoe.FunGame.Server.Model;
|
||||||
|
|
||||||
namespace Milimoe.FunGame.Server.Others
|
namespace Milimoe.FunGame.Server.Others
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
using Milimoe.FunGame.Core.Api.Utility;
|
using System.Collections;
|
||||||
|
using MySql.Data.MySqlClient;
|
||||||
|
using Milimoe.FunGame.Core.Api.Utility;
|
||||||
using Milimoe.FunGame.Core.Entity;
|
using Milimoe.FunGame.Core.Entity;
|
||||||
using Milimoe.FunGame.Server.Others;
|
using Milimoe.FunGame.Server.Others;
|
||||||
using MySql.Data.MySqlClient;
|
|
||||||
using System.Collections;
|
|
||||||
|
|
||||||
namespace Milimoe.FunGame.Server.Utility
|
namespace Milimoe.FunGame.Server.Utility
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user