Files
hjha-server/GlobalSever/Module/GameInfo.cs
xiaoou e9616125ce 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
2026-07-07 12:02:15 +08:00

115 lines
2.7 KiB
C#

/*
* 由SharpDevelop创建。
* 用户: Administrator
* 日期: 2018-12-22
* 时间: 16:21
*
* 要改变这种模板请点击 工具|选项|代码编写|编辑标准头文件
*/
using System;
using System.Text;
using Server.Config;
namespace Server.Data{
/// <summary>
/// 游戏信息
/// </summary>
public class GameInfo{
/// <summary>
/// gameid 服务器ServerId
/// </summary>
public int gameId;
/// <summary>
/// 是否开启朋友模式
/// </summary>
public int openFriend;
/// <summary>
/// 是否开启金币模式
/// </summary>
public int openGlod;
/// <summary>
/// 模块的id
/// </summary>
public int moduleId;
/// <summary>
/// 构造方法
/// </summary>
public GameInfo(){}
public GameInfo(GameConfig gameConfig)
{
this.gameId = gameConfig.GameId;
this.openFriend = gameConfig.OpenFriend;
this.openGlod = gameConfig.OpenGold;
this.moduleId = ServerConfigManager.Instance.NodeId;
}
/// <summary>
/// 构造器
/// </summary>
/// <param name="gameid">游戏服务器id</param>
/// <param name="openFriend">是否开启朋友模式</param>
/// <param name="openGlod">是否开启金币模式</param>
/// <param name="moudleId">模块id</param>
public GameInfo(int gameid,int openFriend,int openGlod,int moudleId){
this.gameId = gameid;
this.openFriend = openFriend;
this.openGlod = openGlod;
this.moduleId = moudleId;
}
/// <summary>
/// 游戏信息
/// </summary>
/// <returns></returns>
public GameInfo Clone(){
return this.MemberwiseClone() as GameInfo;
}
/// <summary>
///
/// </summary>
/// <param name="obj"></param>
/// <returns></returns>
public override bool Equals(object obj)
{
GameInfo other = obj as GameInfo;
if (other == null)
return false;
return this.gameId == other.gameId && this.moduleId == other.moduleId;
}
/// <summary>
///
/// </summary>
/// <returns></returns>
public override int GetHashCode()
{
return base.GetHashCode();
}
/// <summary>
///
/// </summary>
/// <returns></returns>
public override string ToString()
{
StringBuilder sbr = new StringBuilder();
sbr.Append(Environment.NewLine);
sbr.Append("gameid:" + gameId);
sbr.Append(Environment.NewLine);
sbr.Append("openFriend:" + openFriend);
sbr.Append(Environment.NewLine);
sbr.Append("openGlod:" + openGlod);
sbr.Append(Environment.NewLine);
sbr.Append("moduleId:" + moduleId);
return sbr.ToString();
}
}
}