new packets

Diskussion und Informationen über UO:KR
Antworten
Nachricht
Autor
Benutzeravatar
Torfo
Moderator (Sphere)
Beiträge: 828
Registriert: 13 Jan 2004 12:00
Kontaktdaten:

new packets

#1 Beitrag von Torfo » 02 Jul 2007 20:32

========================
0xBF sub 0x14 (server -> client)
KR Context Menu Display
========================

byte[2] unk1 (always 0x0002)
byte[4] char serial
byte[1] entry count
- foreach entry
byte[4] cliloc id (LocalizedStrings.uop)
byte[2] entry id
byte[2] flags
Maybe there is an additional optional byte[2] with the color

EDIT: All the other known new packets you can find here: http://www.uodev.de/viewtopic.php?t=4902

Again: It's not my work. I'm just posting...
Bild

TheUndisputed

#2 Beitrag von TheUndisputed » 16 Jul 2009 23:48

Color is flag for KR.(0x04)

Code: Alles auswählen

	public enum CMEFlags
	{
		None = 0x00,
		Disabled = 0x01,
		KRBlue = 0x04,
		Colored = 0x20
	}

	public sealed class DisplayContextMenu : Packet
	{
		public DisplayContextMenu( ContextMenu menu ) : base( 0xBF )
		{
			bool isKRClient = menu.From.NetState.IsKRClient;

			ContextMenuEntry[] entries = menu.Entries;

			int length = (byte)entries.Length;

			//KR Start
			this.EnsureCapacity(isKRClient ? (12 + (length * 10)) : (12 + (length * 8)));

			m_Stream.Write((short)0x14);

			m_Stream.Write(isKRClient ? (short)0x02 : (short)0x01);
			//KR end
			IEntity target = menu.Target as IEntity;

			m_Stream.Write( (int) ( target == null ? Serial.MinusOne : target.Serial ) );

			m_Stream.Write( (byte) length );

			Point3D p;

			if ( target is Mobile )
				p = target.Location;
			else if ( target is Item )
				p = ((Item)target).GetWorldLocation();
			else
				p = Point3D.Zero;

			for ( int i = 0; i <length> 3000000)
                        			m_Stream.Write((uint)e.Number);
					else
                        			m_Stream.Write((uint)(3000000 + e.Number));

                    			m_Stream.Write((short)i);
                		}
                		else
                		{
					m_Stream.Write( (short) i );
					m_Stream.Write( (ushort) e.Number );
                		}
                		//08NOV2007 UOKR *** END   ***                

				int range = e.Range;

				if ( range == -1 )
					range = 18;

				CMEFlags flags = (e.Enabled && menu.From.InRange( p, range )) ? CMEFlags.None : CMEFlags.Disabled;

				int color = e.Color & 0xFFFF;

				if ( color != 0xFFFF )
				{
					if(isKRClient)
						flags |= CMEFlags.KRBlue;
					else
						flags |= CMEFlags.Colored;
				}

				flags |= e.Flags;

				m_Stream.Write( (short) flags );

				if ( (flags & CMEFlags.Colored) != 0 && !isKRClient)
					m_Stream.Write( (short) color );
			}
		}
	}

Antworten