コード例 #1
0
 public GroundItem(Spawninfo si)
 {
     X    = si.X;
     Y    = si.Y;
     Z    = si.Z;
     Name = si.Name;
 }
コード例 #2
0
ファイル: EQCommunications.cs プロジェクト: eqdialup/MySEQ
        private void ProcessPacket(Spawninfo si)
        {
            // SPAWN  // si.flags == 0
            // Target // si.flags == 1
            //  MAP   // si.flags == 4
            // GROUND // si.flags == 5
            //ProcInfo// si.flags == 6
            //World//    si.flags == 8
            // PLAYER // si.flags == 253

            switch (si.flags)
            {
            case PacketType.Zone:

                f1.ProcessMap(si);

                break;

            case PacketType.Player:

                eq.ProcessGamer(si, f1);

                break;

            case PacketType.GroundItem:

                eq.ProcessGroundItems(si);

                break;

            case PacketType.Target:

                eq.ProcessTarget(si);

                break;

            case PacketType.World:

                eq.ProcessWorld(si);

                break;

            case PacketType.Spawn:

                eq.ProcessSpawns(si, update_hidden);

                break;

            case PacketType.GetProcessInfo:

                ProcessProcessInfo(si);
                break;

            default:

                LogLib.WriteLine("Unknown Packet Type: " + si.flags.ToString(), LogLevel.Warning);

                break;
            }
        }
コード例 #3
0
ファイル: SPAWNINFO.cs プロジェクト: eqdialup/MySEQ
 public bool IsSpawnLDON(Spawninfo si)
 {
     if (si.Class == 62)
     {
         si.isLDONObject = true;
         return(true);
     }
     return(false);
 }
コード例 #4
0
ファイル: EQCommunications.cs プロジェクト: eqdialup/MySEQ
        private void ProcessPacket(byte[] packet, int bytes)
        {
            var offset = 0;

            const int SIZE_OF_PACKET = 100; //104 on new server

            try
            {
                if (bytes > 0)
                {
                    // we have received some bytes, check if this is the beginning of a new packet or a chunk of an existing one.

                    offset = CheckStart(packet);

                    eq.BeginProcessPacket(); //clears spawn&ground arrays

                    for (; offset + SIZE_OF_PACKET <= bytes; offset += SIZE_OF_PACKET)
                    {
                        Spawninfo si = new Spawninfo();

                        if (offset < 0)
                        {
                            // copy the missing chunk of the incomplete packet to the incomplete packet buffer
                            try
                            {
                                PacketCopy(packet, SIZE_OF_PACKET);
                            }
                            catch (Exception ex) { LogLib.WriteLine("Error: ProcessPacket: Copy Incomplete packet buffer: ", ex); }
                            incompleteCount = 0;
                            if (incompletebuffer.Length == 0)
                            {
                                numPackets = 0;
                                break;
                            }
                            si.Frombytes(incompletebuffer, 0);
                        }
                        else
                        {
                            si.Frombytes(packet, offset);
                        }

                        numProcessed++;
                        ProcessPacket(si);
                    }

                    eq.ProcessSpawnList(f1.SpawnList);
                    eq.ProcessGroundItemList(f1.GroundItemList);
                }
            }
            catch (Exception ex) { LogLib.WriteLine("Error: ProcessPacket: ", ex); }

            ProcessedPackets(packet, bytes, offset);
        }
コード例 #5
0
ファイル: SPAWNINFO.cs プロジェクト: eqdialup/MySEQ
        public bool IsSpawnController(Spawninfo si)
        {
            if ((si.Race == 127) && si.Name.IndexOf("_") == 0) // Invisible Man Race
            {
                si.isEventController = true;

                if (!Settings.Default.ShowInvis)
                {
                    si.hidden = true;
                }
                return(true);
            }
            return(false);
        }
コード例 #6
0
ファイル: EQCommunications.cs プロジェクト: eqdialup/MySEQ
        private void ProcessProcessInfo(Spawninfo si)
        {
            ProcessInfo ProcInfo = new ProcessInfo(si.SpawnID, si.Name);

            if (si.SpawnID == 0)
            {
                ProcInfo.SCharName = "";
                CurrentProcess     = ProcInfo;
            }
            else
            {
                processcount++;

                while (ColProcesses.Count > 0 && ColProcesses.Count >= processcount)
                {
                    ColProcesses.Remove(ColProcesses[ColProcesses.Count - 1]);
                }

                ColProcesses.Add(ProcInfo);

                f1.ShowCharsInList(si, ProcInfo);
            }
        }
コード例 #7
0
ファイル: SPAWNINFO.cs プロジェクト: eqdialup/MySEQ
 public float SpawnDistance(Spawninfo si, Spawninfo gamerInfo)
 => (float)Math.Sqrt(((si.X - gamerInfo.X) * (si.X - gamerInfo.X)) + ((si.Y - gamerInfo.Y) * (si.Y - gamerInfo.Y)) + ((si.Z - gamerInfo.Z) * (si.Z - gamerInfo.Z)));
コード例 #8
0
ファイル: SpawnColors.cs プロジェクト: eqdialup/MySEQ
        public void FillConColors(Spawninfo GamerInfo)
        {
            int level = GamerInfo.Level;

            if (Settings.Default.LevelOverride != -1)
            {
                level = Settings.Default.LevelOverride;
            }

            GreenRange = -1 * level;

            GreyRange = -1 * level;

            // Variation on level depending on EQ version (SOD, SOF, LIVE)
            VersionColorVariation(level);

            int c;

            // Set the Grey Cons
            for (c = 0; c < GreyRange + level; c++)
            {
                ConColors[c] = new SolidBrush(Color.Gray);
            }

            // Set the Green Cons
            for (; c < GreenRange + level; c++)
            {
                ConColors[c] = new SolidBrush(Color.Lime);
            }

            // Set the Light Blue Cons
            for (; c < CyanRange + level; c++)
            {
                ConColors[c] = new SolidBrush(Color.Aqua);
            }

            // Set the Dark Blue Cons
            for (; c < level; c++)
            {
                ConColors[c] = new SolidBrush(Color.Blue);
            }

            // Set the Same Level Con
            ConColors[c++] = new SolidBrush(Color.White);

            // Yellow Cons
            for (; c < level + YellowRange + 1; c++)
            {
                ConColors[c] = new SolidBrush(Color.Yellow);
            }

            // 4 levels of bright red
            ConColors[c++] = new SolidBrush(Color.Red);
            ConColors[c++] = new SolidBrush(Color.Red);
            ConColors[c++] = new SolidBrush(Color.Red);
            ConColors[c++] = new SolidBrush(Color.Red);

            // Set the remaining levels to dark red
            for (; c < 200; c++)
            {
                ConColors[c] = new SolidBrush(Color.Maroon);
            }
        }