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.
199 lines
5.9 KiB
199 lines
5.9 KiB
/*
|
|
Sog 游戏基础库
|
|
2016 by zouwei
|
|
*/
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
using Sog;
|
|
|
|
using ProtoCSStruct;
|
|
|
|
namespace Game
|
|
{
|
|
public class ClientHotPatchFile
|
|
{
|
|
public long LoadTimeSecond;
|
|
public string FileContent;//不压缩
|
|
public byte[] ZipFileContent;//压缩
|
|
public string Md5; //不压缩文件内容的MD5
|
|
}
|
|
|
|
public class InviteeSuccessSendMailInfo
|
|
{
|
|
public long InviteeUid;
|
|
public string deviceID;//设备id
|
|
public string ip;//ip地址
|
|
public long SendTime;//时间限制
|
|
}
|
|
|
|
public class FetterLinkHeroID
|
|
{
|
|
//key 为有关联的其他英雄ID
|
|
public List<int> m_fetterHeroId = new List<int>();
|
|
}
|
|
|
|
public class SurveyInfo
|
|
{
|
|
public string url;
|
|
public int passMainlandId;
|
|
public long startTime;
|
|
public long endTime;
|
|
// 开服几天后
|
|
public int afterRealmOpen;
|
|
public int duration;
|
|
public int includeRealmGroup;
|
|
public int excludeRealmGroup;
|
|
}
|
|
|
|
public class OneUpPoolInfo
|
|
{
|
|
public int Id;
|
|
public int Index;
|
|
public long BeginTime;
|
|
public long EndTime;
|
|
public int ShopGroup;
|
|
}
|
|
|
|
public class ServerUpPoolInfo
|
|
{
|
|
//<up池id,信息>
|
|
public Dictionary<int,OneUpPoolInfo> UpPoolList = new Dictionary<int, OneUpPoolInfo>();
|
|
}
|
|
|
|
public class RealmServerInfo
|
|
{
|
|
public int realmId;
|
|
public int openTime;
|
|
public int logicWorldId;
|
|
public int bigRealmId;
|
|
public GameRankInfo rankInfo; //排行榜数据
|
|
public ServerUpPoolInfo upPoolInfos; //up池数据
|
|
|
|
}
|
|
|
|
public class DispatchTaskWeight
|
|
{
|
|
public int type;
|
|
public int weight;
|
|
|
|
public void Clear()
|
|
{
|
|
type = 0;
|
|
weight = 0;
|
|
}
|
|
}
|
|
|
|
public class ActivityData
|
|
{
|
|
public int actIdD;
|
|
public int state;//活动状态0 未开始 1已开始 2玩法结束 3活动结束
|
|
public void Clear()
|
|
{
|
|
actIdD = 0;
|
|
state = 0;
|
|
}
|
|
public ActivityData(int _actIdD, int _state)
|
|
{
|
|
actIdD = _actIdD;
|
|
state = _state;
|
|
}
|
|
}
|
|
|
|
|
|
public class GameServerData : IServerDataObj
|
|
{
|
|
public ServerApp m_app;
|
|
|
|
public Dictionary<int, IPacketHandler> m_packetHandlerTable;
|
|
|
|
public StructPacketSender m_packetSender;
|
|
|
|
// 当前world的合法realm列表, 即可以登录的realm, SSGameReportRealmlistRes 回包更新
|
|
public List<RealmBriefInfo> m_configRealm = new List<RealmBriefInfo>();
|
|
public List<int> m_configLogicWorldIds = new List<int>();
|
|
public Dictionary<int, RealmBriefInfo> m_configRealmTempForRecv = new Dictionary<int, RealmBriefInfo>();
|
|
public string recvConfigRealmListMd5;
|
|
// 一个cluster下所有的realm简要信息, 包含其他world的, SSRealmBriefRes 回包更新
|
|
// 这个只是用来在游戏内部切换服务器,查看服务器列表功能,其他时候请不要用
|
|
public Dictionary<int, RealmBriefInfo> m_allRealm = new Dictionary<int, RealmBriefInfo>();
|
|
public string recvRealmListMd5;
|
|
|
|
// 任务版本号
|
|
public int m_svrTaskVersion;
|
|
// 随机挑战任务(现在暂时没有这种任务)
|
|
//public List<TaskDesc> m_randomTasks;
|
|
//public long m_lastResetRandomTaskTime;
|
|
//public long m_lastSendRandomTaskReqTime;
|
|
|
|
public GameServerGlobalData m_GameServerGlobalData;// 本地文件保存
|
|
|
|
public Dictionary<string, ClientHotPatchFile> m_clientHotPatchFileDict = new Dictionary<string, ClientHotPatchFile>();
|
|
|
|
//存放内测热更版本文件
|
|
public Dictionary<string, ClientHotPatchFile> m_clientHotPatchFileDubugDict = new Dictionary<string, ClientHotPatchFile>();
|
|
|
|
public Dictionary<long, List<InviteeSuccessSendMailInfo>> m_inviteeSuccessDict = new Dictionary<long, List<InviteeSuccessSendMailInfo>>();
|
|
|
|
public long ReOnlineAtZero; //0点自动reonline一下在线玩家,这个是为了统计工具尽量不出错
|
|
|
|
//缓存英雄羁绊信息(kye:英雄ID,HeroFetterInfo 和英雄有羁绊的其他英雄)
|
|
public Dictionary<int, FetterLinkHeroID> m_heroFetterInfo = new Dictionary<int, FetterLinkHeroID>();
|
|
|
|
//服务器信息(排行榜,up池)
|
|
public Dictionary<int, RealmServerInfo> m_realmIdServerInfoMap = new Dictionary<int, RealmServerInfo>();
|
|
|
|
// 区服商品库存信息
|
|
public Dictionary<int, RealmItemStockInfo> m_realmItemStock = new Dictionary<int, RealmItemStockInfo>();
|
|
|
|
public ServerUniqueIDMgr m_uniqueIdMgr;
|
|
|
|
//脏词数据
|
|
public DirtyString m_dirtyStringData = new DirtyString();
|
|
|
|
|
|
|
|
// 调查问卷地址
|
|
public List<SurveyInfo> surveyInfo = new List<SurveyInfo>();
|
|
|
|
// 在线人数
|
|
// realmId -> online num
|
|
public Dictionary<int, int> realmOnline = new Dictionary<int, int>();
|
|
|
|
|
|
public List<DispatchTaskWeight> m_dispatchTaskWeight = new List<DispatchTaskWeight>();
|
|
|
|
|
|
//记录已经发送过邮件的realmID
|
|
public List<long> alreadySendTowerMailRealmIDList = new List<long>();
|
|
|
|
|
|
public PresetData presetdata = new PresetData();
|
|
|
|
|
|
public GameServerData(ServerApp app)
|
|
{
|
|
m_app = app;
|
|
|
|
m_packetHandlerTable = new Dictionary<int, IPacketHandler>();
|
|
m_packetSender = new StructPacketSender();
|
|
m_packetSender.Init(app.ServerID, app.GetCluster());
|
|
|
|
m_uniqueIdMgr = new ServerUniqueIDMgr(app.ServerID);
|
|
|
|
//m_randomTasks = new List<TaskDesc>();
|
|
}
|
|
|
|
public override int GetDataType()
|
|
{
|
|
return GameDataObjType.GameServerData;
|
|
}
|
|
|
|
|
|
public List<PlayerOnGame> needAutoTreasuer = new List<PlayerOnGame>();
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|