Esempio n. 1
0
        public int ApplyHoldLode(int serverId, ref MsgSceneLodeList msg)
        {
            var mgr = GetLodeManager(serverId);

            if (mgr == null)
            {
                return((int)ErrorCodes.Unknow);
            }
            mgr.ApplyHoldLode(ref msg);
            return((int)ErrorCodes.OK);
        }
Esempio n. 2
0
        public int ApplyHoldLode(LodeManager _this, ref MsgSceneLodeList msg)
        {
            System.DateTime startTime = DataTimeExtension.EpochStart; // 当地时区
            List <int>      keys      = new List <int>(_this.mDbData.SceneLodeList.Keys);

            for (int i = 0; i < keys.Count; i++)
            {
                //foreach (var tmp in _this.mDbData.SceneLodeList)
                var          tmp       = _this.mDbData.SceneLodeList[keys[i]];
                MsgSceneLode sceneLode = new MsgSceneLode();
                sceneLode.SceneId  = tmp.SceneId;
                sceneLode.TeamId   = tmp.TeamId;
                sceneLode.TeamName = tmp.TeamName;
                sceneLode.FlagId   = tmp.FlagId;
                DateTime rstTime = new DateTime(1970, 1, 1, 0, 0, 0).AddSeconds(tmp.ResetTime);
                if (rstTime < DateTime.Now)
                {
                    tmp.ResetTime     += 60 * 60 * 24;
                    sceneLode.TeamId   = 0;
                    sceneLode.TeamName = "";
                }

                foreach (var v in tmp.LodeList)
                {
                    msgLode l = new msgLode();
                    l.Id = v.Value.Id;
                    if (null == v.Value)
                    {
                        DateTime dt = startTime.AddSeconds(v.Value.UpdateTime);
                        if (dt < DateTime.Now && l.Times <= 0)
                        {
                            var tb = Table.GetLode(l.Id);
                            if (tb != null)
                            {
                                v.Value.Times      = tb.CanCollectNum;
                                v.Value.UpdateTime = 0;
                            }
                        }
                    }
                    l.Times      = v.Value.Times;
                    l.UpdateTime = v.Value.UpdateTime;
                    sceneLode.LodeList.Add(v.Key, l);
                }
                msg.LodeList.Add(sceneLode);
            }
            return((int)ErrorCodes.OK);
        }
Esempio n. 3
0
 public int ApplyHoldLode(ref MsgSceneLodeList msg)
 {
     return(mImpl.ApplyHoldLode(this, ref msg));
 }
Esempio n. 4
0
 public static int ApplyHoldLode(int serverId, ref MsgSceneLodeList msg)
 {
     return(mImpl.ApplyHoldLode(serverId, ref msg));
 }