feat: initial commit - HJHA game server full source
6 major server modules (PdkFriendServer/GlobalSever/ServerCore/GameModule/GameNetModule) + game logic (GameFix/GameDAL/ServerData) + network layer (NetWorkMessage) + data layer (ObjectModel) + utilities (MrWu/Core/Config/CloudAPI/dll) + adapters (zyxAdapter/base) .NET 8.0 C# solution, 16 projects, 958 source files
This commit is contained in:
65
GlobalSever/GlobalManager/ServerUtilFactory.cs
Normal file
65
GlobalSever/GlobalManager/ServerUtilFactory.cs
Normal file
@ -0,0 +1,65 @@
|
||||
using System;
|
||||
using Server.MQ;
|
||||
using Server.Module;
|
||||
using Server.Data;
|
||||
using Server.Pack;
|
||||
using Server.Data.Module;
|
||||
using GameData;
|
||||
using System.Xml;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server
|
||||
{
|
||||
/// <summary>
|
||||
/// 服务单元工厂
|
||||
/// </summary>
|
||||
public abstract class ServerUtilFactory
|
||||
{
|
||||
private IGlobalFactory GlobalMQFactory;
|
||||
|
||||
/// <summary>
|
||||
/// 创建消息管理
|
||||
/// </summary>
|
||||
public virtual IGlobalFactory CreateGlobalMQFactory() {
|
||||
if (GlobalMQFactory == null)
|
||||
GlobalMQFactory = new GlobalMQ.Factory();
|
||||
return GlobalMQFactory;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public abstract GlobalManager GetGlobalManager();
|
||||
|
||||
/// <summary>
|
||||
/// 创建一些信息使用
|
||||
/// </summary>
|
||||
/// <param name="ObjectName"></param>
|
||||
/// <returns></returns>
|
||||
public abstract Object Produce(string ObjectName);
|
||||
|
||||
/// <summary>
|
||||
/// 创建心跳包
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public virtual string CreateHeartPack(ModuleUtile util) {
|
||||
PackHead head = PackHead.Create();
|
||||
head.sendutil = util;
|
||||
head.packlx = ServerPackAgreement.nodeHeart;
|
||||
string result = JsonPack.GetJsonByPack(head, null);
|
||||
head.Dispose();
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 创建消息处理器
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public virtual GlobalManager.MessageProcessor CreateMessageProcessor() {
|
||||
return new GlobalManager.MessageProcessor();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user