You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

150 lines
3.4 KiB

/*
Sog 游戏基础库
2016 by zouwei
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Runtime;
using System.Runtime.Serialization;
using System.Net;
namespace Sog.ClusterCfg
{
/*
{ "name":"Account", "appid": 10 },
*/
public class AppConfig
{
public string name { get; set; }
//servertype,apptype
public int apptype { get; set; }
// 启动顺序,停止的时候反过来
public int sequence { get; set; }
//自定义stop的超时时间,缺省10秒
public int stoptimeout { get; set; }
public string script { get; set; }
}
public class ChannelConfig
{
//app name
public string app1 { get; set; }
public string app2 { get; set; }
public int type { get; set; }
}
public class GroupProcConfig
{
//appname
public string app { get; set; }
//instanceid
public int instid { get; set; }
//cluster监听端口
public int clusterport { get; set; }
//配置文件名字
public string cfg { get; set; }
//yinlf 2018.3.15
//添加可自己设置的配置
public string param { get; set; }
}
public class GroupDeplayConfig
{
//组名
public string groupname { get; set; }
public GroupProcConfig[] procs { get; set; }
}
public class HostConfig
{
public string idc { get; set; }
//机器的hostname(请尽量填写实际的hostname,根据ip匹配在linux下比较麻烦,还要配置/etc/hosts)
public string hostname { get; set; }
public int worldid { get; set; }
//外网ip
public string externalip {get; set;}
//内网ip
public string innerip { get; set; }
//配置路径
public string cfgpath { get; set; }
//自定义参数
public string param { get; set; }
public HostGroupConfig[] groups { get; set; }
public int listenanyip { get; set; }
}
public class HostGroupConfig
{
//组名
public string groupname { get; set; }
}
public class BusinessConfig
{
//一个独立的业务
public string businessname { get; set; }
/// <summary>
/// 工作路径
/// </summary>
public string workpath { get; set; }
/// <summary>
/// 机器部署配置
/// </summary>
public HostConfig[] hosts { get; set; }
/// <summary>
/// 自定义参数配置
/// </summary>
public string param { get; set; }
}
public class ClusterConfig
{
/// <summary>
/// cluster层服务器配置
/// </summary>
public AppConfig[] cluster_layer_apps { get; set; }
/// <summary>
/// world层服务器配置
/// </summary>
public AppConfig[] world_layer_apps { get; set; }
/// <summary>
/// 服务器之间通信管道配置
/// </summary>
public ChannelConfig[] channels { get; set; }
/// <summary>
/// 进程部署组的配置
/// </summary>
public GroupDeplayConfig[] groupdeploy { get; set; }
/// <summary>
/// 业务配置,最好只有一个,多个导致配置文件太大
/// </summary>
public BusinessConfig[] bussiness { get; set; }
}
}