Ejemplo n.º 1
0
        public static void RemoveKnownSector(long planetId, long sectorId)
        {
            MyReplicationServer replicationServer = MyMultiplayer.GetReplicationServer();

            if (replicationServer != null)
            {
                HashSet <long> set;
                MyClientState  clientData = (MyClientState)replicationServer.GetClientData(new Endpoint(MyEventContext.Current.Sender, 0));
                if ((clientData != null) && clientData.KnownSectors.TryGetValue(planetId, out set))
                {
                    set.Remove(sectorId);
                    if (set.Count == 0)
                    {
                        clientData.KnownSectors.Remove(planetId);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public static void AddKnownSector(long planetId, long sectorId)
        {
            MyReplicationServer replicationServer = MyMultiplayer.GetReplicationServer();

            if (replicationServer != null)
            {
                MyClientState clientData = (MyClientState)replicationServer.GetClientData(new Endpoint(MyEventContext.Current.Sender, 0));
                if (clientData != null)
                {
                    HashSet <long> set;
                    if (!clientData.KnownSectors.TryGetValue(planetId, out set))
                    {
                        set = new HashSet <long>();
                        clientData.KnownSectors.Add(planetId, set);
                    }
                    set.Add(sectorId);
                }
            }
        }