using System.Collections.Generic; using Sog; namespace HttpProxyPay { public class PayUrlConfig { public int payId; public string url; } public class HttpProxyPayServerData : IServerDataObj { public ServerApp m_app; public StructPacketSender m_packetSender; public int selfPayId; public PayUrlConfig[] payUrlCfg; // 华为app token public string huaweiAppAccessToken; //AdMob Key 广告观看完成密钥 public string adMobKey; public HttpProxyPayServerData(ServerApp app) { m_app = app; m_packetSender = new StructPacketSender(); //需要线程安全 m_packetSender.Init(app.ServerID, app.GetCluster()); } public void SetPayUrlConfig(List list) { if (list == null) { payUrlCfg = new PayUrlConfig[1]; return; } int maxId = 0; foreach (PayUrlConfig config in list) { if (config.payId > maxId) { maxId = config.payId; } } payUrlCfg = new PayUrlConfig[maxId + 1]; foreach (PayUrlConfig config in list) { // new新的, 避免影响hotfix payUrlCfg[config.payId] = new PayUrlConfig {payId = config.payId, url = config.url}; } } public override int GetDataType() { return HttpProxyPayDataObjType.HttpProxyPayServerData; } } }