コード例 #1
0
ファイル: Handlers.cs プロジェクト: herculesjr/razor
        private static void RunUOProtocolExtention(PacketReader p, PacketHandlerEventArgs args)
        {
            args.Block = true;

            switch (p.ReadByte())
            {
                case 1: // Custom Party information
                {
                    Serial serial;

                    PacketHandlers.SpecialPartyReceived++;

                    while ((serial = p.ReadUInt32()) > 0)
                    {
                        Mobile mobile = World.FindMobile(serial);

                        short x = p.ReadInt16();
                        short y = p.ReadInt16();
                        byte map = p.ReadByte();

                        if (mobile == null)
                        {
                            World.AddMobile( mobile = new Mobile(serial) );
                            mobile.Visible = false;
                        }

                        if ( mobile.Name == null || mobile.Name.Length <= 0 )
                            mobile.Name = "(Not Seen)";

                        if ( !m_Party.Contains( serial ) )
                            m_Party.Add( serial );

                        if ( map == World.Player.Map )
                            mobile.Position = new Point3D(x, y, mobile.Position.Z);
                        else
                            mobile.Position = Point3D.Zero;
                    }

                    if (Engine.MainWindow.MapWindow != null)
                        Engine.MainWindow.MapWindow.UpdateMap();

                    break;
                }
                case 0xFE: // Begin Handshake/Features Negotiation
                {
                    ulong features = p.ReadRawUInt64();

                    if ( ClientCommunication.HandleNegotiate( features ) != 0 )
                    {
                        ClientCommunication.SendToServer( new RazorNegotiateResponse() );
                        Engine.MainWindow.UpdateControlLocks();
                    }
                    break;
                }
            }
        }