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
79 lines
2.2 KiB
C#
79 lines
2.2 KiB
C#
/********************************
|
|
*
|
|
* 作者:吴隆健
|
|
* 创建时间: 2019/7/8 13:26:08
|
|
*
|
|
********************************/
|
|
|
|
using System;
|
|
|
|
namespace GameData {
|
|
|
|
/// <summary>
|
|
/// 服务器节点
|
|
/// </summary>
|
|
//[ProtoBuf.ProtoContract]
|
|
#pragma warning disable CS0659 // 类型重写 Object.Equals(object o),但不重写 Object.GetHashCode()
|
|
public class ServerNode {
|
|
#pragma warning restore CS0659 // 类型重写 Object.Equals(object o),但不重写 Object.GetHashCode()
|
|
/// <summary>
|
|
/// 模块id 大系统的编号
|
|
/// </summary>
|
|
//[ProtoBuf.ProtoMember(1)]
|
|
public int id;
|
|
|
|
/// <summary>
|
|
/// 节点编号 集群中的编号
|
|
/// </summary>
|
|
//[ProtoBuf.ProtoMember(2)]
|
|
public int nodeNum;
|
|
|
|
/// <summary>
|
|
/// 是否暂停
|
|
/// </summary>
|
|
//[ProtoBuf.ProtoMember(3)]
|
|
public bool ispause = false;
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
public ServerNode() {
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="moduleId"></param>
|
|
/// <param name="nodeNum"></param>
|
|
public ServerNode(int moduleId, int nodeNum) {
|
|
this.id = moduleId;
|
|
this.nodeNum = nodeNum;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 比较数据是否相同
|
|
/// </summary>
|
|
/// <param name="obj"></param>
|
|
/// <returns></returns>
|
|
public override bool Equals(object obj) {
|
|
if (obj == null)
|
|
return false;
|
|
ServerNode node = obj as ServerNode;
|
|
if (node == null)
|
|
return false;
|
|
return node.id == this.id && node.nodeNum == this.nodeNum&&node.ispause ==this.ispause;
|
|
}
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public override string ToString() {
|
|
if (ispause)
|
|
return "id:" + id + ",nodeNum:" + nodeNum + ",暂停";
|
|
else
|
|
return "id:" + id + ",nodeNum:" + nodeNum;
|
|
}
|
|
}
|
|
} |