| | |
| | | int nowSendCnt = 0;
|
| | | //敌对福地和周围福地已经发过包的玩家ID
|
| | | List<uint> sendPlayerIDList = new List<uint>();
|
| | | //自己福地发过包的索引位置
|
| | | List<int> sendIndexList = new List<int>();
|
| | |
|
| | | for (int i = 0; i < sandCntMax; i++)
|
| | | {
|
| | |
| | | return isHas;
|
| | | int index = mineItemsList[k];
|
| | | var mineItem = mineAreaInfo.MineItems[index];
|
| | | if (sendIndexList.Contains(index))
|
| | | continue;
|
| | | if (!MineAreaItemConfig.Has(mineItem.MineID))
|
| | | continue;
|
| | | MineAreaItemConfig config = MineAreaItemConfig.Get(mineItem.MineID);
|
| | |
| | | //不是指定的矿物
|
| | | if (itemId != config.ItemID || config.ItemLV < itemLv)
|
| | | continue;
|
| | | blessedLandModel.SendCB030Pack(myPlayerId, (byte)index, (byte)1, 0);
|
| | | isHas = true;
|
| | | nowSendCnt += 1;
|
| | | sendIndexList.Add(index);
|
| | | blessedLandModel.SendCB030Pack(myPlayerId, (byte)index, (byte)1, 0);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | continue;
|
| | | if (sendPlayerIDList.Contains(playerId))
|
| | | continue;
|
| | | //是否采集了这个人的其他资源
|
| | | bool isSnatchItem = blessedLandModel.IsSnatchItem(playerId);
|
| | | if (isSnatchItem)
|
| | | continue;
|
| | |
|
| | | var mineItems = mineAreaInfo.MineItems;
|
| | | var mineItemsList = mineItems.Keys.ToList();
|
| | |
| | | {
|
| | | int index = mineItemsList[l];
|
| | | var mineItem = mineItems[index];
|
| | | if (sendPlayerIDList.Contains(playerId))
|
| | | continue;
|
| | | if (!MineAreaItemConfig.Has(mineItem.MineID))
|
| | | continue;
|
| | | MineAreaItemConfig config = MineAreaItemConfig.Get(mineItem.MineID);
|
| | |
| | | //当前资源正在被自己或别人采集
|
| | | if (mineItem.RobWorkerCount > 0)
|
| | | continue;
|
| | | //是否采集了这个人的其他资源
|
| | | bool isSnatchItem = blessedLandModel.IsSnatchItem(playerId);
|
| | | if (isSnatchItem)
|
| | | break;
|
| | | blessedLandModel.SendCB030Pack(playerId, (byte)index, (byte)1, 0);
|
| | | isHas = true;
|
| | | nowSendCnt += 1;
|
| | | if (!sendPlayerIDList.Contains(playerId))
|
| | | sendPlayerIDList.Add(playerId);
|
| | | sendPlayerIDList.Add(playerId);
|
| | | blessedLandModel.SendCB030Pack(playerId, (byte)index, (byte)1, 0);
|
| | | break;
|
| | | }
|
| | | }
|
| | |
| | | continue;
|
| | | if (sendPlayerIDList.Contains(playerId))
|
| | | continue;
|
| | | //是否采集了这个人的其他资源
|
| | | bool isSnatchItem = blessedLandModel.IsSnatchItem(playerId);
|
| | | if (isSnatchItem)
|
| | | continue;
|
| | | var mineItems = mineAreaInfo.MineItems;
|
| | | var mineItemsList = mineItems.Keys.ToList();
|
| | | mineItemsList.Sort((int a, int b) => SortByItemLV(playerId, a, b));
|
| | |
| | | {
|
| | | int index = mineItemsList[l];
|
| | | var mineItem = mineItems[index];
|
| | | if (sendPlayerIDList.Contains(playerId))
|
| | | continue;
|
| | | if (!MineAreaItemConfig.Has(mineItem.MineID))
|
| | | continue;
|
| | | MineAreaItemConfig config = MineAreaItemConfig.Get(mineItem.MineID);
|
| | |
| | | //当前资源正在被自己或别人采集
|
| | | if (mineItem.RobWorkerCount > 0)
|
| | | continue;
|
| | | //是否采集了这个人的其他资源
|
| | | bool isSnatchItem = blessedLandModel.IsSnatchItem(playerId);
|
| | | if (isSnatchItem)
|
| | | break;
|
| | | blessedLandModel.SendCB030Pack(playerId, (byte)index, (byte)1, 0);
|
| | | isHas = true;
|
| | | nowSendCnt += 1;
|
| | | if (!sendPlayerIDList.Contains(playerId))
|
| | | sendPlayerIDList.Add(playerId);
|
| | | sendPlayerIDList.Add(playerId);
|
| | | blessedLandModel.SendCB030Pack(playerId, (byte)index, (byte)1, 0);
|
| | | break;
|
| | | }
|
| | | }
|