Пример #1
0
            public void AddZone(ZoneInfo zone)
            {
                zones.Add(zone.uuid, zone);
                //---------------------------------------------------------------------------------------------
                Dictionary <string, ZoneInfo> map = null;

                if (!zonesMap.TryGetValue(zone.serverGroupID, out map))
                {
                    map = new Dictionary <string, ZoneInfo>();
                    zonesMap.Add(zone.serverGroupID, map);
                }

                map.Add(zone.uuid, zone);
                //---------------------------------------------------------------------------------------------

                if (RPGServerTemplateManager.Instance.IsPublicMap(zone.map_data))
                {
                    Dictionary <int, List <ZoneInfo> > lineMap = null;
                    List <ZoneInfo> lt = null;
                    if (!zonesLineMap.TryGetValue(zone.serverGroupID, out lineMap))
                    {
                        lineMap = new Dictionary <int, List <ZoneInfo> >();
                        zonesLineMap.Add(zone.serverGroupID, lineMap);
                    }

                    if (!lineMap.TryGetValue(zone.map_data.id, out lt))
                    {
                        lt = new List <ZoneInfo>();
                        lineMap.Add(zone.map_data.id, lt);
                    }

                    int line = AddLine(zone, lt);
                    zone.lineIndex = line;
                }
                //---------------------------------------------------------------------------------------------
                if (zone.guildUUID != null)
                {
                    AddGuildZone(zone.guildUUID, zone);
                }

                if (!string.IsNullOrEmpty(zone.roomKey))
                {
                    roomZones.Add(zone.roomKey, zone);
                }
            }