Ejemplo n.º 1
0
        public void OnUpdatePointReq(UpdatePointReq packet, string ipPort)
        {
            Sql.Instance.UpdatePoint(packet.PointId, packet.Lat, packet.Lng);

            _server.SendToEveryoneExcept(new PointUpdatedAck()
            {
                PointId = packet.PointId,
                Lat     = packet.Lat,
                Lng     = packet.Lng,
                ZoneId  = packet.ZoneId
            }, ipPort);
        }
Ejemplo n.º 2
0
        public void OnUpdatePointReq(UpdatePointReq packet, User user)
        {
            Sql.Instance.UpdatePoint(packet.PointId, packet.Lat, packet.Lng);

            lock (Server.Dto.Zones)
            {
                var zone     = Server.Dto.Zones.First(z => z.Id == packet.ZoneId.ToString());
                var geometry = zone.Geometry.First(g => g.Id == packet.PointId);
                geometry.Lat = packet.Lat;
                geometry.Lng = packet.Lng;
            }

            _server.SendToEveryoneExcept(new PointUpdatedAck()
            {
                PointId = packet.PointId,
                Lat     = packet.Lat,
                Lng     = packet.Lng,
                ZoneId  = packet.ZoneId
            }, user.IpPort);
        }