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.
141 lines
4.1 KiB
141 lines
4.1 KiB
/*
|
|
Sog 游戏基础库
|
|
2016 by zouwei
|
|
*/
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
using ProtoCSStruct;
|
|
using Sog;
|
|
|
|
namespace World
|
|
{
|
|
public class GameSvrInfoWorld
|
|
{
|
|
public uint serverId;
|
|
public int onlinePlayer;
|
|
}
|
|
|
|
public class AlertData
|
|
{
|
|
//按天比较
|
|
public Dictionary<int, int> LastDayOnline = new Dictionary<int, int>();
|
|
public Dictionary<int, int> TodayOnline = new Dictionary<int, int>();
|
|
public long LastDayTimeSecond;
|
|
public int LastAlertIndex;
|
|
|
|
//按5分钟比较
|
|
public int OnlinePlayer;
|
|
public long LastCheckTimeSecond;
|
|
public long LastAlertTimeSecond;
|
|
}
|
|
|
|
public class SendMailWithRuleRecord
|
|
{
|
|
public DBMail Mail;
|
|
public int SendMailRuleType;
|
|
public long RuleParam1;
|
|
public long EndTime; //结束时间
|
|
public int VersionSeq; //版本号
|
|
}
|
|
|
|
public class PushReq
|
|
{
|
|
public List<long> UidList = new List<long>();
|
|
public string Content;
|
|
public string ParamKey;
|
|
public string ParamValue;
|
|
}
|
|
|
|
public class PushData
|
|
{
|
|
//push id
|
|
public Dictionary<long, string> m_pushIdCacheMap = new Dictionary<long, string>();
|
|
|
|
public int PushRequestSeq;
|
|
public Dictionary<int, PushReq> m_pushReqs = new Dictionary<int, PushReq>();
|
|
|
|
public long m_lastPushAllTime; //全局推送时间
|
|
public long m_lastPushCfgDescTime;//配置表PushCfgDesc的最后推送时间
|
|
|
|
public long m_lastVipCardPushTime; //vip10点未登录
|
|
}
|
|
|
|
public class RealmOnline
|
|
{
|
|
public int realmId;
|
|
public int onlineNum;
|
|
}
|
|
|
|
|
|
|
|
public class WorldServerData : IServerDataObj
|
|
{
|
|
public ServerApp m_app;
|
|
public StructPacketSender m_packetSender;
|
|
|
|
public List<GameSvrInfoWorld> m_gameSvrInfo;
|
|
|
|
// 当前world的合法realm列表, 即可以登录的realm
|
|
public List<RealmBriefInfo> m_configRealm = new List<RealmBriefInfo>();
|
|
public Dictionary<int, RealmBriefInfo> m_configRealmMap = new Dictionary<int, RealmBriefInfo>();
|
|
public Dictionary<int, RealmBriefInfo> m_configRealmTempForRecv = new Dictionary<int, RealmBriefInfo>();
|
|
public string recvRealmListMd5;
|
|
|
|
// 1个realm可能存在多个gamesvr上, 这里记录的是1个gamesvr上的realm online
|
|
public Dictionary<uint, List<RealmOnline>> realmOnlineGame = new Dictionary<uint, List<RealmOnline>>();
|
|
|
|
// 把所有gamesvr上同一个realm的在线人数累加起来就是realmOnlineAll, realmId -> onlineNum
|
|
public Dictionary<int, int> realmOnlineAll = new Dictionary<int, int>();
|
|
|
|
|
|
public AlertData m_alertData = new AlertData();
|
|
|
|
|
|
// 停服标识 0/1
|
|
public int m_serverStopFlag;
|
|
|
|
//发邮件列表,版本号控制
|
|
public int SendMailWithRuleVersionSeq = 0;
|
|
public List<SendMailWithRuleRecord> m_sendMailWithRuleList = new List<SendMailWithRuleRecord>();
|
|
public Dictionary<long, int> m_sendMailWithRulePlayerVersion = new Dictionary<long, int>();
|
|
|
|
public PushData m_pushData = new PushData();
|
|
|
|
public WorldSvrSaveFileData m_WorldServerGlobalData;// 本地文件保存
|
|
|
|
|
|
// 区服商品库存信息
|
|
public Dictionary<int, RealmItemStockInfo> m_realmItemStock = new Dictionary<int, RealmItemStockInfo>();
|
|
|
|
//adid和channel对应关系
|
|
public Dictionary<string, string> m_adidChannelMap = new Dictionary<string, string>();
|
|
|
|
|
|
// 前一天开始时间
|
|
public long lastDayStartTime;
|
|
|
|
|
|
//tick时间放这里,免的一hotfix就会全部重新数数上报在线,出bug
|
|
public long m_oneSecondMs;
|
|
public long m_5SecondMs;
|
|
public long m_oneMinute;
|
|
public long m_5Minute;
|
|
|
|
|
|
public WorldServerData(ServerApp app)
|
|
{
|
|
m_app = app;
|
|
m_packetSender = new StructPacketSender();
|
|
|
|
m_gameSvrInfo = new List<GameSvrInfoWorld>();
|
|
}
|
|
|
|
|
|
public override int GetDataType()
|
|
{
|
|
return WorldDataObjType.WorldServerData;
|
|
}
|
|
}
|
|
}
|
|
|