private void UpdateRKNLocation() { if (DateTime.Now.Ticks > (LastRKNUpdate + RKNUpdateDelay)) { PlayerInfo[] Characters = API.State.PlayerInfo.Values.ToArray(); List <RKNMapService.Character> RKNCharList = new List <RKNMapService.Character>(); foreach (PlayerInfo PlayerInfo in Characters) { RKNMapService.Character Character = new RKNMapService.Character(); if (PlayerInfo.IsHooked) { Character.NickName = PlayerInfo.Name; Character.X = PlayerInfo.Position.X; Character.Y = PlayerInfo.Position.Z; Character.Zone = Convert.ToInt32(PlayerInfo.Zone.ID); RKNCharList.Add(Character); } } if (RKNCharList.Count > 0) { try { Service.UpdateCharacterLocation(RKNCharList.ToArray()); } catch (Exception e) { eventLog.WriteEntry("Error: " + e.Message, EventLogEntryType.Error); } } LastRKNUpdate = DateTime.Now.Ticks; } }
/// <remarks/> public void UpdateCharacterLocationAsync(Character[] Characters) { this.UpdateCharacterLocationAsync(Characters, null); }
public bool UpdateCharacterLocation(Character[] Characters) { object[] results = this.Invoke("UpdateCharacterLocation", new object[] { Characters}); return ((bool)(results[0])); }
/// <remarks/> public void UpdateCharacterLocationAsync(Character[] Characters, object userState) { if ((this.UpdateCharacterLocationOperationCompleted == null)) { this.UpdateCharacterLocationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUpdateCharacterLocationOperationCompleted); } this.InvokeAsync("UpdateCharacterLocation", new object[] { Characters}, this.UpdateCharacterLocationOperationCompleted, userState); }
private void UpdateRKNLocation() { if (DateTime.Now.Ticks > (LastRKNUpdate + RKNUpdateDelay)) { PlayerInfo[] Characters = API.State.PlayerInfo.Values.ToArray(); List<RKNMapService.Character> RKNCharList = new List<RKNMapService.Character>(); foreach (PlayerInfo PlayerInfo in Characters) { RKNMapService.Character Character = new RKNMapService.Character(); if (PlayerInfo.IsHooked) { Character.NickName = PlayerInfo.Name; Character.X = PlayerInfo.Position.X; Character.Y = PlayerInfo.Position.Z; Character.Zone = Convert.ToInt32(PlayerInfo.Zone.ID); RKNCharList.Add(Character); } } if (RKNCharList.Count > 0) { try { Service.UpdateCharacterLocation(RKNCharList.ToArray()); } catch (Exception e) { eventLog.WriteEntry("Error: " + e.Message, EventLogEntryType.Error); } } LastRKNUpdate = DateTime.Now.Ticks; } }