private void HanldeServerTargetCursorPacket(TargetCursorPacket packet) { targetFromServerReceivedEvent.Set(); lastCursorId = packet.CursorId; lastTargetCursorPacketTime = DateTime.UtcNow; eventSource.Publish(new ServerRequestedTargetEvent(packet.CursorId)); }
public static unsafe CursorHandle LoadCursor(CursorId id) { HCURSOR handle = Imports.LoadCursorW(ModuleInstance.Null, (char *)(uint)id); if (handle.IsInvalid) { Error.ThrowLastError(id.ToString()); } return(new CursorHandle(handle, ownsHandle: false)); }
public static unsafe CursorHandle LoadCursor(CursorId id) { HCURSOR handle = Imports.LoadCursorW(ModuleInstance.Null, (char *)(uint)id); if (handle.IsInvalid) { throw Error.GetExceptionForLastError(); } return(new CursorHandle(handle, ownsHandle: false)); }
public static CursorHandle LoadCursor(CursorId id) { CursorHandle handle = Imports.LoadCursorW(ModuleInstance.Null, (IntPtr)id); if (handle.IsInvalid) { throw Errors.GetIoExceptionForLastError(); } return(handle); }
public TargetCursorPacket(CursorTarget cursorTarget, CursorId cursorId, CursorType cursorType) { CursorTarget = cursorTarget; CursorId = cursorId; CursorType = cursorType; byte[] payload = new byte[19]; var writer = new ArrayPacketWriter(payload); writer.WriteByte((byte)PacketDefinitions.TargetCursor.Id); writer.WriteByte((byte)cursorTarget); writer.WriteUInt(cursorId.Value); writer.WriteByte((byte)cursorType); rawPacket = new Packet(PacketDefinitions.TargetCursor.Id, payload); }
public TargetLocationRequest(CursorId cursorId, Location3D location, ModelId tileType, CursorType cursorType) { var payload = new byte[19]; var writer = new ArrayPacketWriter(payload); writer.WriteByte((byte)PacketDefinitions.TargetCursor.Id); writer.WriteByte((byte)CursorTarget.Location); writer.WriteUInt(cursorId.Value); writer.WriteByte((byte)cursorType); writer.WriteInt(0); // clicked on item = 0 (using location click) writer.WriteUShort((ushort)location.X); writer.WriteUShort((ushort)location.Y); writer.WriteByte(0); // unknown writer.WriteSByte((sbyte)location.Z); writer.WriteModelId(tileType); RawPacket = new Packet(PacketDefinitions.TargetCursor.Id, payload); }
public override int GetHashCode() { int hash = 1; if (CursorId != 0) { hash ^= CursorId.GetHashCode(); } if (FetchRows != 0UL) { hash ^= FetchRows.GetHashCode(); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
public TargetLocationRequest(CursorId cursorId, ObjectId itemId, CursorType cursorType, Location3D location, ModelId itemType) { var payload = new byte[19]; var writer = new ArrayPacketWriter(payload); writer.WriteByte((byte)PacketDefinitions.TargetCursor.Id); writer.WriteByte((byte)CursorTarget.Object); writer.WriteUInt(cursorId.Value); writer.WriteByte((byte)cursorType); writer.WriteId(itemId); writer.WriteUShort((ushort)location.X); writer.WriteUShort((ushort)location.Y); writer.WriteByte(0); // unknown writer.WriteSByte((sbyte)location.Z); writer.WriteModelId(itemType); RawPacket = new Packet(PacketDefinitions.TargetCursor.Id, payload); }
public override void Deserialize(Packet rawPacket) { this.rawPacket = rawPacket; var reader = new ArrayPacketReader(rawPacket.Payload); reader.Skip(1); CursorTarget = (CursorTarget)reader.ReadByte(); CursorId = new CursorId(reader.ReadUInt()); CursorType = (CursorType)reader.ReadByte(); ClickedOnId = reader.ReadObjectId(); ushort xloc = reader.ReadUShort(); ushort yloc = reader.ReadUShort(); byte unknown = reader.ReadByte(); sbyte zloc = reader.ReadSByte(); Location = new Location3D(xloc, yloc, zloc); ClickedOnType = reader.ReadModelId(); }
public override void Visit(CursorId node) { this.action(node); }
public override void ExplicitVisit(CursorId fragment) { _fragments.Add(fragment); }
internal ServerRequestedTargetEvent(CursorId cursorId) { CursorId = cursorId; }
private static void SetMouseCursor(CursorId cursorId) { IMouseCursor cursor = new MouseCursorClass(); cursor.SetCursor((int) cursorId); }
public static CursorHandle SetCursor(CursorId id) => ResourceMethods.SetCursor(ResourceMethods.LoadCursor(id));