public override async void Encode()
        {
            try
            {            //var pl = Client.GetLevel().GetPlayerAvatar();
                Alliance an = await ObjectManager.GetAlliance(Client.GetLevel().GetPlayerAvatar().GetAllianceId());

                List <byte> data = new List <byte>();
                data.AddInt32(4);                         // 4 = Preperation Day; 5 = Battle Day; 6 = End of War
                data.AddInt32(3600);                      // Time left
                data.AddInt64(an.GetAllianceId());        // Alliance ID
                data.AddString(an.GetAllianceName());     // Alliance Name
                data.AddInt32(an.GetAllianceBadgeData()); // Alliance Badge Data
                data.AddInt32(an.GetAllianceLevel());     // Alliance Level
                data.AddInt32(10);                        // War Members

                int count = 0;
                foreach (AllianceMemberEntry a in an.GetAllianceMembers())
                {
                    Level l = await ResourcesManager.GetPlayer(a.GetAvatarId());

                    ClientAvatar pl = l.GetPlayerAvatar();

                    data.AddInt64(pl.GetAllianceId());    // Alliance ID
                    data.AddInt64(pl.GetId());            // Player ID
                    data.AddInt64(pl.GetCurrentHomeId()); // Current Home ID
                    data.AddString(pl.GetAvatarName());   // Player 1 Name // or pl.GetAvatarName()
                    data.AddInt32(0);                     //StarGivenUp
                    data.AddInt32(0);                     //Damage
                    data.AddInt32(0);                     //Unknown 1
                    data.AddInt32(0);                     //AttackUsed
                    data.AddInt32(0);                     //TotalDefence
                    data.AddInt32(3);                     //Gold Gain
                    data.AddInt32(3);                     //Elixir Gain
                    data.AddInt32(3);                     //DElixir Gain
                    data.AddInt32(101000);                //Gold Available
                    data.AddInt32(101000);                //Elixir Available
                    data.AddInt32(550);                   //DElixir Available
                    data.AddInt32(0);                     //OffencesWeight
                    data.AddInt32(0);                     //DefencesWeight
                    data.AddInt32(0);                     //Unknown2
                    data.AddInt32(pl.GetTownHallLevel()); //TownHall Level
                    data.AddInt32(count + 1);             // Map Position

                    count++;
                    if (count == 10)
                    {
                        break;
                    }
                }

                //data.AddRange("00-00-04-22-00-00-06-A7-00-00-00-03-00-00-00-0A-00-00-00-00-02-00-00-00-57-00-2D-86-65-01-00-00-00-00-21-8E-C7-D0-00-00-00-00-00-00-00-00-05-00-00-00-23-00-00-00-07-64-72-61-67-67-64-63-00-00-00-14-00-00-00-01-00-00-00-0E-00-7A-B1-BE-00-00-00-01-00-3D-09-08-00-00-00-03-00-00-00-2B-00-1C-06-38-00-00-00-34-00-5D-D2-41-00-00-00-34-00-5D-D2-41-00-00-00-05-5A-6F-75-6D-69-00-00-00-02-00-00-00-40-00-00-00-97-00-00-00-01-00-00-00-01-00-00-FD-E8-00-00-FD-E8-00-00-01-22-00-00-FA-00-00-00-FA-00-00-00-01-18-00-00-02-66-00-00-02-05-00-00-00-03-00-00-00-08-00-00-00-01-02-00-00-00-57-00-2D-86-65-01-00-00-00-00-21-8E-B2-2B-01-00-00-00-00-07-51-AA-F8-00-00-00-00-00-00-00-03-00-00-00-19-00-00-00-0D-6E-20-69-6D-70-6F-72-74-65-20-67-64-63-00-00-00-19-00-00-00-01-00-00-00-00-00-7E-1C-30-00-00-00-02-00-3D-09-08-00-00-00-04-00-3D-09-05-00-00-00-06-00-00-00-2B-00-1C-06-38-00-00-00-40-00-5F-97-0D-00-00-00-40-00-5F-97-0D-00-00-00-06-64-72-69-76-65-72-00-00-00-02-00-00-00-34-00-00-00-65-00-00-00-02-00-00-00-03-00-01-A1-30-00-01-A1-30-00-00-01-BC-00-00-FA-00-00-00-FA-00-00-00-01-18-00-00-02-6A-00-00-01-FA-00-00-00-03-00-00-00-08-00-00-00-02-02-00-00-00-57-00-2D-86-65-01-00-00-00-00-21-8E-B2-28-01-00-00-00-00-07-53-BC-55-00-00-00-00-00-00-00-04-00-00-00-1E-00-00-00-00-00-00-00-1E-00-00-00-01-00-00-00-00-00-7E-1C-30-00-00-00-01-00-3D-09-11-00-00-00-02-00-00-00-2B-00-1C-06-38-00-00-00-0F-00-79-FE-3C-00-00-00-0F-00-79-FE-3C-00-00-00-08-6D-61-68-64-69-20-4D-52-00-00-00-02-00-00-00-35-00-00-00-66-00-00-00-00-00-00-00-02-00-00-00-00-00-00-00-00-00-00-00-00-00-00-EA-60-00-00-EA-60-00-00-00-FA-00-00-01-DE-00-00-01-B6-00-00-00-03-00-00-00-08-00-00-00-03-02-00-00-00-57-00-2D-86-65-01-00-00-00-00-21-8E-B2-19-01-00-00-00-00-07-52-17-46-00-00-00-00-00-00-00-03-00-00-00-19-00-00-00-00-00-00-00-19-00-00-00-01-00-00-00-00-00-7E-1C-30-00-00-00-02-00-3D-09-08-00-00-00-04-00-3D-09-05-00-00-00-06-00-00-00-2B-00-1C-06-38-00-00-00-0E-00-7A-B1-BE-00-00-00-0E-00-7A-B1-BE-00-00-00-08-64-69-6D-C3-A9-32-37-30-00-00-00-03-00-00-00-64-00-00-00-7E-00-00-00-01-00-00-00-01-00-00-AB-E0-00-00-AB-E0-00-00-00-8C-00-00-CB-20-00-00-CB-20-00-00-00-B4-00-00-01-34-00-00-01-34-00-00-00-03-00-00-00-07-00-00-00-04-02-00-00-00-57-00-2D-86-65-01-00-00-00-00-21-8E-B2-23-01-00-00-00-00-07-54-85-62-00-00-00-00-00-00-00-03-00-00-00-19-00-00-00-08-64-72-61-67-20-62-61-6C-00-00-00-19-00-00-00-01-00-00-00-00-00-7E-1C-30-00-00-00-02-00-3D-09-08-00-00-00-04-00-3D-09-05-00-00-00-06-00-00-00-2B-00-1C-06-38-00-00-00-0C-00-30-4C-9C-00-00-00-0C-00-30-4C-9B-00-00-00-04-4B-6F-67-61-00-00-00-03-00-00-00-64-00-00-00-8F-00-00-00-00-00-00-00-01-00-00-00-00-00-00-00-00-00-00-00-00-00-00-94-70-00-00-94-70-00-00-00-64-00-00-00-B0-00-00-00-CE-00-00-00-03-00-00-00-06-00-00-00-05-02-00-00-00-57-00-2D-86-65-01-00-00-00-00-21-8E-B2-1E-01-00-00-00-00-07-54-B7-B2-00-00-00-00-00-00-00-02-00-00-00-14-00-00-00-26-73-6F-72-63-69-65-72-20-65-74-20-61-72-20-68-65-72-20-33-20-6D-69-6E-20-6D-65-72-63-69-20-6C-65-73-20-67-61-72-73-00-00-00-14-00-00-00-01-00-00-00-00-00-7E-1C-30-00-00-00-01-00-3D-09-08-00-00-00-04-00-00-00-2B-00-1C-06-38-00-00-00-13-00-F5-83-60-00-00-00-13-00-F5-83-60-00-00-00-06-79-61-6E-6E-6F-75-00-00-00-03-00-00-00-64-00-00-00-88-00-00-00-02-00-00-00-03-00-01-30-B0-00-01-30-B0-00-00-00-C8-00-00-88-B8-00-00-88-B8-00-00-00-46-00-00-00-8B-00-00-00-B5-00-00-00-03-00-00-00-06-00-00-00-06-02-00-00-00-57-00-2D-86-65-01-00-00-00-00-21-8E-B2-14-01-00-00-00-00-07-54-D6-23-00-00-00-00-00-00-00-02-00-00-00-14-00-00-00-07-62-61-6C-6C-6F-6E-20-00-00-00-14-00-00-00-01-00-00-00-00-00-7E-1C-30-00-00-00-01-00-3D-09-08-00-00-00-04-00-00-00-2B-00-1C-06-38-00-00-00-35-00-FE-56-BE-00-00-00-35-00-FE-56-BE-00-00-00-07-62-61-73-74-69-65-6E-00-00-00-02-00-00-00-59-00-00-00-B3-00-00-00-02-00-00-00-04-00-00-54-60-00-00-54-60-00-00-00-00-00-00-84-D0-00-00-84-D0-00-00-00-3C-00-00-00-62-00-00-00-AB-00-00-00-03-00-00-00-06-00-00-00-07-02-00-00-00-57-00-2D-86-65-01-00-00-00-00-21-8E-B2-1D-01-00-00-00-00-07-54-D4-C5-00-00-00-00-00-00-00-02-00-00-00-14-00-00-00-00-00-00-00-14-00-00-00-01-00-00-00-00-00-7E-1C-30-00-00-00-01-00-3D-09-08-00-00-00-04-00-00-00-2B-00-1C-06-38-00-00-00-0E-01-04-64-66-00-00-00-0E-01-04-64-66-00-00-00-06-4E-61-68-69-64-61-00-00-00-03-00-00-00-64-00-00-00-64-00-00-00-00-00-00-00-01-00-00-00-00-00-00-00-00-00-00-00-00-00-00-42-68-00-00-42-68-00-00-00-00-00-00-00-1E-00-00-00-3A-00-00-00-03-00-00-00-04-00-00-00-08-02-00-00-00-57-00-2D-86-65-01-00-00-00-00-21-8E-B2-1C-01-00-00-00-00-07-4F-C9-DE-00-00-00-00-00-00-00-01-00-00-00-0F-00-00-00-00-00-00-00-0F-00-00-00-01-00-00-00-00-00-7E-1C-30-00-00-00-03-00-3D-09-05-00-00-00-06-00-3D-09-05-00-00-00-06-00-3D-09-05-00-00-00-06-00-00-00-2B-00-1C-06-38-00-00-00-55-00-DE-48-32-00-00-00-55-00-DE-48-32-00-00-00-09-6B-61-6D-65-6C-64-69-6E-65-00-00-00-03-00-00-00-64-00-00-00-41-00-00-00-00-00-00-00-02-00-00-00-00-00-00-00-00-00-00-00-00-00-00-3E-80-00-00-3E-80-00-00-00-00-00-00-00-1D-00-00-00-33-00-00-00-03-00-00-00-04-00-00-00-09-02-00-00-00-57-00-2D-86-65-01-00-00-00-00-21-8E-B2-1B-01-00-00-00-00-07-52-94-B1-00-00-00-00-00-00-00-01-00-00-00-0F-00-00-00-00-00-00-00-0F-00-00-00-01-00-00-00-00-00-7E-1C-30-00-00-00-03-00-3D-09-05-00-00-00-06-00-3D-09-05-00-00-00-06-00-3D-09-05-00-00-00-06-01-00-00-00-32-00-00-00-05-00-00-00-05-00-00-00-05-00-00-00-05-00-00-00-05-00-00-00-04-00-00-00-04-00-00-00-04-00-00-00-04-00-00-00-04-00-00-00-04-00-00-00-04-00-00-00-04-00-00-00-04-00-00-00-04-00-00-00-03-00-00-00-03-00-00-00-03-00-00-00-03-00-00-00-03-00-00-00-03-00-00-00-03-00-00-00-03-00-00-00-03-00-00-00-03-00-00-00-02-00-00-00-02-00-00-00-02-00-00-00-02-00-00-00-02-00-00-00-02-00-00-00-02-00-00-00-02-00-00-00-02-00-00-00-02-00-00-00-02-00-00-00-02-00-00-00-02-00-00-00-02-00-00-00-02-00-00-00-02-00-00-00-02-00-00-00-02-00-00-00-02-00-00-00-02-00-00-00-02-00-00-00-02-00-00-00-02-00-00-00-02-00-00-00-02-00-00-00-0A-00-00-00-19-00-00-00-32-00-00-00-28-00-00-00-3C-01-00-00-00-19-00-10-65-87-00-00-00-12-C5-9E-45-4B-C4-B0-4C-53-C4-B0-4E-C4-B0-5A-20-59-41-41-62-00-19-52-00-00-00-06-00-00-00-0A-00-00-00-19-00-10-65-87-00-00-00-25-00-2F-B5-0B-00-00-00-25-00-2F-B5-0B-00-00-00-0B-4D-5F-61-5F-4E-5F-59-5F-61-5F-4B-00-00-00-02-00-00-00-32-00-00-00-5E-00-00-00-02-00-00-00-01-00-01-90-00-00-01-90-00-00-00-01-C0-00-01-38-80-00-01-38-80-00-00-01-A4-00-00-03-42-00-00-03-B1-00-00-00-03-00-00-00-09-00-00-00-00-02-00-00-00-57-00-2D-86-65-01-00-00-00-00-21-8E-B2-2C-01-00-00-00-00-07-4F-E9-69-00-00-00-00-00-00-00-04-00-00-00-1E-00-00-00-00-00-00-00-1E-00-00-00-00-00-00-00-19-00-10-65-87-00-00-00-28-00-1E-A1-C0-00-00-00-28-00-1E-A1-C0-00-00-00-0A-C3-96-7A-63-61-6E-37-30-39-31-00-00-00-01-00-00-00-3E-00-00-00-7D-00-00-00-02-00-00-00-01-00-01-83-80-00-01-83-80-00-00-01-A8-00-01-34-98-00-01-34-98-00-00-01-9A-00-00-02-C1-00-00-03-89-00-00-00-03-00-00-00-09-00-00-00-01-02-00-00-00-57-00-2D-86-65-01-00-00-00-00-21-8E-B2-2D-01-00-00-00-00-07-50-1E-D4-00-00-00-00-00-00-00-04-00-00-00-1E-00-00-00-00-00-00-00-1A-00-00-00-00-00-00-00-19-00-10-65-87-00-00-00-3D-00-00-9A-9A-00-00-00-3D-00-00-9A-9A-00-00-00-0C-54-45-52-4D-C4-B0-4E-41-54-C3-96-52-00-00-00-01-00-00-00-39-00-00-00-77-00-00-00-01-00-00-00-01-00-00-00-00-00-00-00-00-00-00-00-00-00-01-01-D0-00-01-01-D0-00-00-01-2C-00-00-02-80-00-00-02-20-00-00-00-03-00-00-00-08-00-00-00-02-02-00-00-00-57-00-2D-86-65-01-00-00-00-00-21-8E-B2-36-01-00-00-00-00-07-50-10-E8-00-00-00-00-00-00-00-04-00-00-00-1E-00-00-00-00-00-00-00-1A-00-00-00-00-00-00-00-19-00-10-65-87-00-00-00-01-00-39-28-18-00-00-00-01-00-39-28-18-00-00-00-08-4D-55-48-49-54-54-49-4E-00-00-00-02-00-00-00-41-00-00-00-97-00-00-00-02-00-00-00-01-00-01-8C-E0-00-01-8C-E0-00-00-01-8A-00-00-FD-E8-00-00-FD-E8-00-00-01-22-00-00-02-66-00-00-02-16-00-00-00-03-00-00-00-08-00-00-00-03-02-00-00-00-57-00-2D-86-65-01-00-00-00-00-21-8E-B2-22-01-00-00-00-00-07-52-E5-DF-00-00-00-00-00-00-00-04-00-00-00-1E-00-00-00-00-00-00-00-1C-00-00-00-00-00-00-00-19-00-10-65-87-00-00-00-2F-00-24-94-DF-00-00-00-2F-00-24-94-DF-00-00-00-06-6B-61-79-61-70-61-00-00-00-03-00-00-00-64-00-00-00-84-00-00-00-02-00-00-00-01-00-00-E4-20-00-00-E4-20-00-00-00-88-00-00-C7-38-00-00-C7-38-00-00-00-B4-00-00-01-2F-00-00-01-33-00-00-00-03-00-00-00-07-00-00-00-04-02-00-00-00-57-00-2D-86-65-01-00-00-00-00-21-8E-B2-34-01-00-00-00-00-07-54-81-29-00-00-00-00-00-00-00-03-00-00-00-19-00-00-00-00-00-00-00-16-00-00-00-00-00-00-00-19-00-10-65-87-00-00-00-16-00-8D-78-64-00-00-00-16-00-8D-78-64-00-00-00-09-44-61-6E-71-65-52-6F-75-53-00-00-00-03-00-00-00-64-00-00-00-76-00-00-00-02-00-00-00-01-00-00-D7-A0-00-00-D7-A0-00-00-00-68-00-00-AB-E0-00-00-AB-E0-00-00-00-8C-00-00-00-E2-00-00-00-F9-00-00-00-03-00-00-00-07-00-00-00-05-02-00-00-00-57-00-2D-86-65-01-00-00-00-00-21-8E-B2-25-01-00-00-00-00-07-54-1E-56-00-00-00-00-00-00-00-02-00-00-00-14-00-00-00-00-00-00-00-14-00-00-00-00-00-00-00-19-00-10-65-87-00-00-00-4F-00-A8-25-CE-00-00-00-4F-00-A8-25-CE-00-00-00-06-45-4E-49-53-36-31-00-00-00-02-00-00-00-35-00-00-00-87-00-00-00-02-00-00-00-01-00-00-79-E0-00-00-79-E0-00-00-00-30-00-00-A7-F8-00-00-A7-F8-00-00-00-8C-00-00-00-C8-00-00-00-F1-00-00-00-03-00-00-00-07-00-00-00-06-02-00-00-00-57-00-2D-86-65-01-00-00-00-00-21-8E-B2-1A-01-00-00-00-00-07-50-2E-DD-00-00-00-00-00-00-00-03-00-00-00-19-00-00-00-00-00-00-00-19-00-00-00-00-00-00-00-19-00-10-65-87-00-00-00-11-00-A0-BC-DF-00-00-00-11-00-A0-BC-DF-00-00-00-05-56-61-68-69-74-00-00-00-03-00-00-00-64-00-00-00-AF-00-00-00-02-00-00-00-02-00-00-A6-04-00-00-A6-04-00-00-00-3C-00-00-88-B8-00-00-88-B8-00-00-00-3C-00-00-00-93-00-00-00-B1-00-00-00-03-00-00-00-06-00-00-00-07-02-00-00-00-57-00-2D-86-65-01-00-00-00-00-21-8E-B2-21-01-00-00-00-00-07-53-C7-48-00-00-00-00-00-00-00-02-00-00-00-14-00-00-00-00-00-00-00-14-00-00-00-00-00-00-00-19-00-10-65-87-00-00-00-0F-00-F4-54-9A-00-00-00-0F-00-F4-54-9A-00-00-00-04-5A-65-75-73-00-00-00-01-00-00-00-56-00-00-00-B3-00-00-00-02-00-00-00-01-00-00-00-00-00-00-00-00-00-00-00-00-00-00-69-78-00-00-69-78-00-00-00-00-00-00-00-4D-00-00-00-71-00-00-00-03-00-00-00-05-00-00-00-08-02-00-00-00-57-00-2D-86-65-01-00-00-00-00-21-8E-B2-2A-01-00-00-00-00-07-51-17-5B-00-00-00-00-00-00-00-02-00-00-00-14-00-00-00-00-00-00-00-14-00-00-00-00-00-00-00-19-00-10-65-87-00-00-00-03-00-E4-7C-1C-00-00-00-03-00-E4-7C-1C-00-00-00-0A-6B-65-72-69-6D-20-62-61-62-61-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-01-00-00-00-00-00-00-3E-80-00-00-3E-80-00-00-00-00-00-00-2E-E0-00-00-2E-E0-00-00-00-00-00-00-00-13-00-00-00-23-00-00-00-03-00-00-00-03-00-00-00-09-02-00-00-00-57-00-2D-86-65-01-00-00-00-00-21-8E-B2-33-00-00-00-00-00-00-00-00-01-00-00-00-0F-00-00-00-00-00-00-00-0F-00-00-00-00-01-00-00-00-32-00-00-00-05-00-00-00-05-00-00-00-05-00-00-00-05-00-00-00-05-00-00-00-04-00-00-00-04-00-00-00-04-00-00-00-04-00-00-00-04-00-00-00-04-00-00-00-04-00-00-00-04-00-00-00-04-00-00-00-04-00-00-00-03-00-00-00-03-00-00-00-03-00-00-00-03-00-00-00-03-00-00-00-03-00-00-00-03-00-00-00-03-00-00-00-03-00-00-00-03-00-00-00-02-00-00-00-02-00-00-00-02-00-00-00-02-00-00-00-02-00-00-00-02-00-00-00-02-00-00-00-02-00-00-00-02-00-00-00-02-00-00-00-02-00-00-00-02-00-00-00-02-00-00-00-02-00-00-00-02-00-00-00-02-00-00-00-02-00-00-00-02-00-00-00-02-00-00-00-02-00-00-00-02-00-00-00-02-00-00-00-02-00-00-00-02-00-00-00-02-00-00-00-0A-00-00-00-19-00-00-00-32-00-00-00-28-00-00-00-3C-01-00-00-00-57-00-2D-86-65-00-00-00-1C-00-00-00-01-00-00-00-00-07-54-D6-23-00-00-1A-01-00-00-00-19-00-10-65-87-00-00-00-2F-00-24-94-DF-00-00-00-2B-00-1C-06-38-00-00-00-13-00-F5-83-60-00-00-00-06-6B-61-79-61-70-61-00-00-00-06-79-61-6E-6E-6F-75-00-00-00-03-00-00-00-01-00-00-00-64-00-00-00-88-00-00-00-08-00-00-01-4C-00-00-00-06-01-00-00-00-2F-00-00-00-00-80-CD-90-A3-00-04-F4-57-00-00-00-01-00-00-00-00-07-54-D4-C5-00-00-1A-6C-00-00-00-19-00-10-65-87-00-00-00-16-00-8D-78-64-00-00-00-2B-00-1C-06-38-00-00-00-35-00-FE-56-BE-00-00-00-09-44-61-6E-71-65-52-6F-75-53-00-00-00-07-62-61-73-74-69-65-6E-00-00-00-02-00-00-00-00-00-00-00-59-00-00-00-B3-00-00-00-08-00-00-01-4C-00-00-00-06-01-00-00-00-16-00-00-00-00-A2-4E-64-65-00-02-F2-E2-00-00-00-01-00-00-00-00-07-54-B7-B2-00-00-23-04-00-00-00-19-00-10-65-87-00-00-00-2F-00-24-94-DF-00-00-00-2B-00-1C-06-38-00-00-00-0C-00-30-4C-9C-00-00-00-06-6B-61-79-61-70-61-00-00-00-04-4B-6F-67-61-00-00-00-03-00-00-00-03-00-00-00-64-00-00-00-8F-00-00-00-08-00-00-01-4C-00-00-00-06-01-00-00-00-2F-00-00-00-00-80-CC-94-F8-00-04-F4-AC-00-00-00-01-00-00-00-00-07-54-85-62-00-00-30-BE-00-00-00-19-00-10-65-87-00-00-00-01-00-39-28-18-00-00-00-2B-00-1C-06-38-00-00-00-0E-00-7A-B1-BE-00-00-00-08-4D-55-48-49-54-54-49-4E-00-00-00-08-64-69-6D-C3-A9-32-37-30-00-00-00-03-00-00-00-03-00-00-00-64-00-00-00-7E-00-00-00-08-00-00-01-4C-00-00-00-06-01-00-00-00-01-00-00-00-00-D8-A0-31-7B-00-04-E7-05-00-00-00-01-00-00-00-00-07-54-81-29-00-00-31-D3-00-00-00-2B-00-1C-06-38-00-00-00-40-00-5F-97-0D-00-00-00-19-00-10-65-87-00-00-00-2F-00-24-94-DF-00-00-00-06-64-72-69-76-65-72-00-00-00-06-6B-61-79-61-70-61-00-00-00-03-00-00-00-03-00-00-00-64-00-00-00-84-00-00-00-08-00-00-01-4C-00-00-00-06-01-00-00-00-40-00-00-00-00-61-81-29-8F-00-05-97-AE-00-00-00-01-00-00-00-00-07-54-64-74-00-00-38-F2-00-00-00-19-00-10-65-87-00-00-00-4F-00-A8-25-CE-00-00-00-2B-00-1C-06-38-00-00-00-35-00-FE-56-BE-00-00-00-06-45-4E-49-53-36-31-00-00-00-07-62-61-73-74-69-65-6E-00-00-00-01-00-00-00-00-00-00-00-46-00-00-00-B3-00-00-00-08-00-00-01-4C-00-00-00-06-01-00-00-00-4F-00-00-00-00-2F-81-00-E5-00-02-A5-49-00-00-00-01-00-00-00-00-07-54-1E-56-00-00-48-D2-00-00-00-2B-00-1C-06-38-00-00-00-0E-00-7A-B1-BE-00-00-00-19-00-10-65-87-00-00-00-16-00-8D-78-64-00-00-00-08-64-69-6D-C3-A9-32-37-30-00-00-00-09-44-61-6E-71-65-52-6F-75-53-00-00-00-03-00-00-00-03-00-00-00-64-00-00-00-76-00-00-00-08-00-00-01-4C-00-00-00-06-01-00-00-00-0E-00-00-00-00-B0-1C-43-61-00-06-37-40-00-00-00-01-00-00-00-00-07-53-C7-AD-00-00-59-6C-00-00-00-19-00-10-65-87-00-00-00-16-00-8D-78-64-00-00-00-2B-00-1C-06-38-00-00-00-13-00-F5-83-60-00-00-00-09-44-61-6E-71-65-52-6F-75-53-00-00-00-06-79-61-6E-6E-6F-75-00-00-00-02-00-00-00-02-00-00-00-55-00-00-00-6B-00-00-00-08-00-00-01-4C-00-00-00-06-01-00-00-00-16-00-00-00-00-A2-45-FE-F2-00-02-F2-E2-00-00-00-01-00-00-00-00-07-53-C7-48-00-00-59-7D-00-00-00-2B-00-1C-06-38-00-00-00-13-00-F5-83-60-00-00-00-19-00-10-65-87-00-00-00-11-00-A0-BC-DF-00-00-00-06-79-61-6E-6E-6F-75-00-00-00-05-56-61-68-69-74-00-00-00-03-00-00-00-03-00-00-00-64-00-00-00-AF-00-00-00-08-00-00-01-4C-00-00-00-06-01-00-00-00-13-00-00-00-00-A4-34-4F-4C-00-03-A0-84-00-00-00-01-00-00-00-00-07-53-BC-55-00-00-5B-72-00-00-00-19-00-10-65-87-00-00-00-28-00-1E-A1-C0-00-00-00-2B-00-1C-06-38-00-00-00-40-00-5F-97-0D-00-00-00-0A-C3-96-7A-63-61-6E-37-30-39-31-00-00-00-06-64-72-69-76-65-72-00-00-00-02-00-00-00-01-00-00-00-34-00-00-00-65-00-00-00-08-00-00-01-4C-00-00-00-06-01-00-00-00-28-00-00-00-00-96-A6-3F-E0-00-08-1F-1A-00-00-00-01-00-00-00-00-07-53-56-F7-00-00-6C-94-00-00-00-19-00-10-65-87-00-00-00-25-00-2F-B5-0B-00-00-00-2B-00-1C-06-38-00-00-00-40-00-5F-97-0D-00-00-00-0B-4D-5F-61-5F-4E-5F-59-5F-61-5F-4B-00-00-00-06-64-72-69-76-65-72-00-00-00-01-00-00-00-01-00-00-00-48-00-00-00-B3-00-00-00-08-00-00-01-4C-00-00-00-06-01-00-00-00-25-00-00-00-00-96-B1-D6-69-00-06-0F-A4-00-00-00-01-00-00-00-00-07-53-29-23-00-00-73-FF-00-00-00-19-00-10-65-87-00-00-00-0F-00-F4-54-9A-00-00-00-2B-00-1C-06-38-00-00-00-35-00-FE-56-BE-00-00-00-04-5A-65-75-73-00-00-00-07-62-61-73-74-69-65-6E-00-00-00-00-00-00-00-00-00-00-00-23-00-00-00-AC-00-00-00-08-00-00-01-4C-00-00-00-06-01-00-00-00-0F-00-00-00-00-B0-AD-E6-28-00-01-18-3C-00-00-00-01-00-00-00-00-07-53-22-D3-00-00-74-FF-00-00-00-19-00-10-65-87-00-00-00-0F-00-F4-54-9A-00-00-00-2B-00-1C-06-38-00-00-00-13-00-F5-83-60-00-00-00-04-5A-65-75-73-00-00-00-06-79-61-6E-6E-6F-75-00-00-00-00-00-00-00-00-00-00-00-25-00-00-00-99-00-00-00-08-00-00-01-4C-00-00-00-06-01-00-00-00-0F-00-00-00-00-B0-AD-B7-C3-00-01-18-3C-00-00-00-01-00-00-00-00-07-52-E5-DF-00-00-7E-E7-00-00-00-2B-00-1C-06-38-00-00-00-34-00-5D-D2-41-00-00-00-19-00-10-65-87-00-00-00-01-00-39-28-18-00-00-00-05-5A-6F-75-6D-69-00-00-00-08-4D-55-48-49-54-54-49-4E-00-00-00-02-00-00-00-02-00-00-00-41-00-00-00-97-00-00-00-08-00-00-01-4C-00-00-00-06-01-00-00-00-34-00-00-00-00-76-87-10-87-00-05-92-7C-00-00-00-01-00-00-00-00-07-52-94-B1-00-00-8D-42-00-00-00-19-00-10-65-87-00-00-00-4F-00-A8-25-CE-00-00-00-2B-00-1C-06-38-00-00-00-55-00-DE-48-32-00-00-00-06-45-4E-49-53-36-31-00-00-00-09-6B-61-6D-65-6C-64-69-6E-65-00-00-00-03-00-00-00-01-00-00-00-64-00-00-00-41-00-00-00-08-00-00-01-4C-00-00-00-06-01-00-00-00-4F-00-00-00-00-2F-74-5A-11-00-00-F8-D4-00-00-00-01-00-00-00-00-07-52-78-80-00-00-92-AB-00-00-00-19-00-10-65-87-00-00-00-3D-00-00-9A-9A-00-00-00-2B-00-1C-06-38-00-00-00-40-00-5F-97-0D-00-00-00-0C-54-45-52-4D-C4-B0-4E-41-54-C3-96-52-00-00-00-06-64-72-69-76-65-72-00-00-00-00-00-00-00-00-00-00-00-23-00-00-00-53-00-00-00-08-00-00-01-4C-00-00-00-06-01-00-00-00-3D-00-00-00-00-6B-33-88-9D-00-04-CD-AB-00-00-00-01-00-00-00-00-07-52-31-8B-00-00-A1-4D-00-00-00-2B-00-1C-06-38-00-00-00-35-00-FE-56-BE-00-00-00-19-00-10-65-87-00-00-00-11-00-A0-BC-DF-00-00-00-07-62-61-73-74-69-65-6E-00-00-00-05-56-61-68-69-74-00-00-00-00-00-00-00-00-00-00-00-21-00-00-00-41-00-00-00-08-00-00-01-4C-00-00-00-06-01-00-00-00-35-00-00-00-00-76-83-0E-4E-00-01-7A-20-00-00-00-01-00-00-00-00-07-52-17-46-00-00-A7-38-00-00-00-19-00-10-65-87-00-00-00-28-00-1E-A1-C0-00-00-00-2B-00-1C-06-38-00-00-00-0F-00-79-FE-3C-00-00-00-0A-C3-96-7A-63-61-6E-37-30-39-31-00-00-00-08-6D-61-68-64-69-20-4D-52-00-00-00-02-00-00-00-01-00-00-00-35-00-00-00-66-00-00-00-08-00-00-01-4C-00-00-00-06-01-00-00-00-28-00-00-00-00-96-99-53-BD-00-09-21-EE-00-00-00-01-00-00-00-00-07-51-AA-F8-00-00-C3-2B-00-00-00-19-00-10-65-87-00-00-00-25-00-2F-B5-0B-00-00-00-2B-00-1C-06-38-00-00-00-34-00-5D-D2-41-00-00-00-0B-4D-5F-61-5F-4E-5F-59-5F-61-5F-4B-00-00-00-05-5A-6F-75-6D-69-00-00-00-02-00-00-00-02-00-00-00-40-00-00-00-97-00-00-00-08-00-00-01-4C-00-00-00-06-01-00-00-00-25-00-00-00-00-96-A3-E9-6C-00-07-EA-18-00-00-00-01-00-00-00-00-07-51-17-5B-00-00-EE-23-00-00-00-2B-00-1C-06-38-00-00-00-35-00-FE-56-BE-00-00-00-19-00-10-65-87-00-00-00-0F-00-F4-54-9A-00-00-00-07-62-61-73-74-69-65-6E-00-00-00-04-5A-65-75-73-00-00-00-01-00-00-00-01-00-00-00-56-00-00-00-B3-00-00-00-08-00-00-01-4C-00-00-00-06-01-00-00-00-35-00-00-00-00-76-78-EE-65-00-01-7F-FC-00-00-00-01-00-00-00-00-07-50-2E-DD-00-01-2F-F7-00-00-00-2B-00-1C-06-38-00-00-00-13-00-F5-83-60-00-00-00-19-00-10-65-87-00-00-00-4F-00-A8-25-CE-00-00-00-06-79-61-6E-6E-6F-75-00-00-00-06-45-4E-49-53-36-31-00-00-00-02-00-00-00-02-00-00-00-35-00-00-00-87-00-00-00-08-00-00-01-4C-00-00-00-06-01-00-00-00-13-00-00-00-00-A4-15-1E-DF-00-03-9E-F4-00-00-00-01-00-00-00-00-07-50-1E-D4-00-01-35-0E-00-00-00-2B-00-1C-06-38-00-00-00-00-00-7E-1C-30-00-00-00-19-00-10-65-87-00-00-00-28-00-1E-A1-C0-00-00-00-09-76-72-36-6C-65-76-72-61-69-00-00-00-0A-C3-96-7A-63-61-6E-37-30-39-31-00-00-00-01-00-00-00-01-00-00-00-3E-00-00-00-7D-00-00-00-08-00-00-01-4C-00-00-00-06-01-00-00-00-00-00-00-00-00-DB-CE-2A-5E-00-06-5A-E0-00-00-00-01-00-00-00-00-07-50-10-E8-00-01-39-7C-00-00-00-2B-00-1C-06-38-00-00-00-40-00-5F-97-0D-00-00-00-19-00-10-65-87-00-00-00-3D-00-00-9A-9A-00-00-00-06-64-72-69-76-65-72-00-00-00-0C-54-45-52-4D-C4-B0-4E-41-54-C3-96-52-00-00-00-01-00-00-00-01-00-00-00-39-00-00-00-77-00-00-00-08-00-00-01-4C-00-00-00-06-01-00-00-00-40-00-00-00-00-61-5D-9F-85-00-05-8E-FD-00-00-00-01-00-00-00-00-07-4F-F8-93-00-01-41-BD-00-00-00-19-00-10-65-87-00-00-00-03-00-E4-7C-1C-00-00-00-2B-00-1C-06-38-00-00-00-55-00-DE-48-32-00-00-00-0A-6B-65-72-69-6D-20-62-61-62-61-00-00-00-09-6B-61-6D-65-6C-64-69-6E-65-00-00-00-02-00-00-00-02-00-00-00-55-00-00-00-65-00-00-00-08-00-00-01-4C-00-00-00-06-01-00-00-00-03-00-00-00-00-D7-23-05-36-00-00-2D-14-00-00-00-01-00-00-00-00-07-4F-F5-E2-00-01-42-AF-00-00-00-19-00-10-65-87-00-00-00-11-00-A0-BC-DF-00-00-00-2B-00-1C-06-38-00-00-00-35-00-FE-56-BE-00-00-00-05-56-61-68-69-74-00-00-00-07-62-61-73-74-69-65-6E-00-00-00-02-00-00-00-02-00-00-00-4B-00-00-00-99-00-00-00-08-00-00-01-4C-00-00-00-06-01-00-00-00-11-00-00-00-00-AB-47-44-62-00-03-70-DC-00-00-00-01-00-00-00-00-07-4F-E9-69-00-01-46-EA-00-00-00-2B-00-1C-06-38-00-00-00-00-00-7E-1C-30-00-00-00-19-00-10-65-87-00-00-00-25-00-2F-B5-0B-00-00-00-09-76-72-36-6C-65-76-72-61-69-00-00-00-0B-4D-5F-61-5F-4E-5F-59-5F-61-5F-4B-00-00-00-02-00-00-00-02-00-00-00-32-00-00-00-5E-00-00-00-08-00-00-01-4C-00-00-00-06-01-00-00-00-00-00-00-00-00-DB-CB-D5-4A-00-06-B2-D8-00-00-00-01-00-00-00-00-07-4F-DC-A5-00-01-4B-19-00-00-00-19-00-10-65-87-00-00-00-01-00-39-28-18-00-00-00-2B-00-1C-06-38-00-00-00-0F-00-79-FE-3C-00-00-00-08-4D-55-48-49-54-54-49-4E-00-00-00-08-6D-61-68-64-69-20-4D-52-00-00-00-01-00-00-00-01-00-00-00-47-00-00-00-8E-00-00-00-08-00-00-01-4C-00-00-00-06-01-00-00-00-01-00-00-00-00-D8-73-F5-4C-00-05-54-F1-00-00-00-01-00-00-00-00-07-4F-C9-DE-00-01-50-FB-00-00-00-19-00-10-65-87-00-00-00-11-00-A0-BC-DF-00-00-00-2B-00-1C-06-38-00-00-00-0E-01-04-64-66-00-00-00-05-56-61-68-69-74-00-00-00-06-4E-61-68-69-64-61-00-00-00-03-00-00-00-03-00-00-00-64-00-00-00-64-00-00-00-08-00-00-01-4C-00-00-00-06-01-00-00-00-11-00-00-00-00-AB-45-9E-F3-00-01-4D-98".Replace("-", "").ToBytes());

                // TODO: Fix

                Encrypt(data.ToArray());
            } catch (Exception) { }
        }
Пример #2
0
 public void SetAlliance(Alliance alliance)
 {
     if (alliance != null)
     {
         m_vHasAlliance  = true;
         m_vAllianceId   = alliance.GetAllianceId();
         m_vAllianceName = alliance.GetAllianceName();
         m_vAllianceIcon = alliance.GetAllianceBadgeData();
     }
 }
        public override async void Encode()
        {
            try
            {
                List <byte> packet = new List <byte>();
                List <byte> data   = new List <byte>();
                var         i      = 0;

                foreach (var player in ResourcesManager.GetInMemoryLevels().OrderByDescending(t => t.GetPlayerAvatar().GetScore()))
                {
                    /*if (player.GetPlayerAvatar().GetAvatarLevel() >= 70)
                     * {*/
                    ClientAvatar pl = player.GetPlayerAvatar();
                    long         id = pl.GetAllianceId();
                    if (i >= 100)
                    {
                        break;
                    }
                    data.AddInt64(pl.GetId());
                    data.AddString(pl.GetAvatarName());
                    data.AddInt32(i + 1);
                    data.AddInt32(pl.GetScore());
                    data.AddInt32(i + 1);
                    data.AddInt32(pl.GetAvatarLevel());
                    data.AddInt32(100);
                    data.AddInt32(1);
                    data.AddInt32(100);
                    data.AddInt32(1);
                    data.AddInt32(pl.GetLeagueId());
                    data.AddString(pl.GetUserRegion().ToUpper());
                    data.AddInt64(pl.GetAllianceId());
                    data.AddInt32(1);
                    data.AddInt32(1);
                    if (pl.GetAllianceId() > 0)
                    {
                        data.Add(1);     // 1 = Have an alliance | 0 = No alliance
                        data.AddInt64(pl.GetAllianceId());
                        Alliance _Alliance = await ObjectManager.GetAlliance(id);

                        data.AddString(_Alliance.GetAllianceName());
                        data.AddInt32(_Alliance.GetAllianceBadgeData());
                    }
                    else
                    {
                        data.Add(0);
                    }
                    i++;
                    //}
                }

                packet.AddInt32(i);
                packet.AddRange(data.ToArray());
                Encrypt(packet.ToArray());
            } catch (Exception) { }
        }
Пример #4
0
        public override async void Encode()
        {
            try
            {
                List <byte> data    = new List <byte>();
                List <byte> packet1 = new List <byte>();

                int i = 1;
                foreach (Level player in ResourcesManager.GetOnlinePlayers().Where(t => t.GetPlayerAvatar().GetLeagueId() == Player.GetPlayerAvatar().GetLeagueId()).OrderByDescending(t => t.GetPlayerAvatar().GetScore()))
                {
                    if (i >= 0)
                    {
                        break;
                    }

                    ClientAvatar pl = player.GetPlayerAvatar();
                    if (pl.GetAvatarName() != null)
                    {
                        packet1.AddInt64(pl.GetId());
                        packet1.AddString(pl.GetAvatarName());
                        packet1.AddInt32(i);
                        packet1.AddInt32(pl.GetScore());
                        packet1.AddInt32(i);
                        packet1.AddInt32(pl.GetAvatarLevel());
                        packet1.AddInt32(200);
                        packet1.AddInt32(i);
                        packet1.AddInt32(100);
                        packet1.AddInt32(1);
                        packet1.AddInt64(pl.GetAllianceId());
                        packet1.AddInt32(1);
                        packet1.AddInt32(1);
                        if (pl.GetAllianceId() > 0)
                        {
                            packet1.Add(1);
                            packet1.AddInt64(pl.GetAllianceId());
                            Alliance _Alliance = await ObjectManager.GetAlliance(pl.GetAllianceId());

                            packet1.AddString(_Alliance.GetAllianceName());
                            packet1.AddInt32(_Alliance.GetAllianceBadgeData());
                            packet1.AddInt64(i);
                        }
                        else
                        {
                            packet1.Add(0);
                        }
                        i++;
                    }
                }
                data.AddInt32(9000); //Season End
                data.AddInt32(i - 1);
                data.AddRange(packet1);
                Encrypt(data.ToArray());
            } catch (Exception) { }
        }
Пример #5
0
        public override byte[] Encode()
        {
            m_vPlayer.Tick();
            List <byte> data = new List <byte>();

            data.AddInt64(m_vAlliance.GetAllianceId());
            data.AddInt32(m_vAlliance.GetAllianceBadgeData());
            data.AddInt32(m_vAlliance.GetAllianceLevel());
            data.AddInt32(0); //Tick
            return(data.ToArray());
        }
        public override async void Encode()
        {
            try
            {
                List <byte> data    = new List <byte>();
                List <byte> packet1 = new List <byte>();

                int i = 1;
                foreach (var player in ResourcesManager.GetOnlinePlayers())
                {
                    ClientAvatar pl = player.GetPlayerAvatar();
                    packet1.AddInt64(pl.GetId());
                    packet1.AddString(pl.GetAvatarName());
                    packet1.AddInt32(i);
                    packet1.AddInt32(pl.GetScore());
                    packet1.AddInt32(i);
                    packet1.AddInt32(pl.GetAvatarLevel());
                    packet1.AddInt32(100);
                    packet1.AddInt32(1);
                    packet1.AddInt32(100);
                    packet1.AddInt32(1);
                    packet1.AddInt32(pl.GetLeagueId());
                    packet1.AddString("EN");
                    packet1.AddInt64(pl.GetId());
                    packet1.AddInt32(1);
                    packet1.AddInt32(1);
                    if (pl.GetAllianceId() > 0)
                    {
                        packet1.Add(1); // 1 = Have an alliance | 0 = No alliance
                        packet1.AddInt64(pl.GetAllianceId());
                        Alliance _Alliance = await ObjectManager.GetAlliance(pl.GetAllianceId());

                        packet1.AddString(_Alliance.GetAllianceName());
                        packet1.AddInt32(_Alliance.GetAllianceBadgeData());
                    }
                    else
                    {
                        packet1.Add(0);
                    }
                    if (i >= 101)
                    {
                        break;
                    }
                    i++;
                }
                data.AddInt32(i - 1);
                data.AddRange(packet1);
                data.AddInt32(DateTime.Now.Month - 1);
                data.AddInt32(DateTime.Now.Year);
                Encrypt(data.ToArray());
            } catch (Exception) { }
        }
        public void SetAlliance(Alliance alliance)
        {
            if (alliance == null || alliance.GetAllianceId() <= 0L)
            {
                // Just in case.
                m_vHasAlliance = false;
                return;
            }

            m_vHasAlliance  = true;
            m_vAllianceId   = alliance.GetAllianceId();
            m_vAllianceName = alliance.GetAllianceName();
            m_vAllianceIcon = alliance.GetAllianceBadgeData();
        }
        public override void Execute(Level level)
        {
            SendAllianceMailCommand allianceMailCommand = this;

            try
            {
                ClientAvatar avatar     = level.GetPlayerAvatar();
                long         allianceId = avatar.GetAllianceId();
                if (allianceId > 0L)
                {
                    Alliance alliance = ObjectManager.GetAlliance(allianceId);
                    if (alliance != null)
                    {
                        AllianceMailStreamEntry allianceMailStreamEntry1 = new AllianceMailStreamEntry();
                        allianceMailStreamEntry1.SetId((int)DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1)).TotalSeconds);
                        allianceMailStreamEntry1.SetAvatar(avatar);
                        allianceMailStreamEntry1.SetIsNew((byte)2);
                        allianceMailStreamEntry1.SetSenderId(avatar.GetId());
                        allianceMailStreamEntry1.SetAllianceId(allianceId);
                        allianceMailStreamEntry1.SetAllianceBadgeData(alliance.GetAllianceBadgeData());
                        allianceMailStreamEntry1.SetAllianceName(alliance.GetAllianceName());
                        allianceMailStreamEntry1.SetMessage(m_vMailContent);
                        foreach (Level onlinePlayer in ResourcesManager.GetOnlinePlayers())
                        {
                            if (onlinePlayer.GetPlayerAvatar().GetAllianceId() == allianceId)
                            {
                                AvatarStreamEntryMessage Message = new AvatarStreamEntryMessage(onlinePlayer.GetClient());
                                AllianceMailStreamEntry  allianceMailStreamEntry2 = allianceMailStreamEntry1;
                                Message.SetAvatarStreamEntry((UCS.Logic.AvatarStreamEntry.AvatarStreamEntry)allianceMailStreamEntry2);
                                Message.Send();
                            }
                        }
                    }
                }
                avatar = (ClientAvatar)null;
            }
            catch (Exception ex)
            {
            }
        }
        public override void Encode()
        {
            var data = new List <byte>();

            data.AddInt32(1);

            data.AddInt64(m_vHomeAlliance.GetAllianceId());        // 1 Alliance ID
            data.AddString(m_vHomeAlliance.GetAllianceName());     // 1 Alliance Name
            data.AddInt32(m_vHomeAlliance.GetAllianceBadgeData()); // 1 Alliance Badge
            data.AddInt32(m_vHomeAlliance.GetAllianceLevel());     // 1 Alliance Level

            data.AddInt64(9999);                                   // 2 Alliance ID
            data.AddString("Goblinland");                          // 2 Alliance Name
            data.AddInt32(0);                                      // 2 Alliance Badge
            data.AddInt32(1);                                      // 2 Alliance Level

            data.AddInt32(9999);                                   // 1 Stars
            data.AddInt32(0);                                      // 2 Stars

            data.AddInt32(0);                                      // 1 Village Destroyed
            data.AddInt32(100);                                    // 2 Village Destroyed

            data.AddInt32(0);                                      // 1 Unknown
            data.AddInt32(0);                                      // 2 Unknown

            data.AddInt32(100);                                    // Attack Used
            data.AddInt32(4000);                                   // XP Earned

            data.AddInt64(515631654);                              // War ID
            data.AddInt64(40);                                     // Members Count

            data.AddInt32(1);                                      // War Won Count

            data.Add((byte)99);
            data.AddInt32((int)TimeSpan.FromDays(1).TotalSeconds);
            data.AddInt64((int)(TimeSpan.FromDays(1).TotalSeconds - TimeSpan.FromDays(0.5).TotalSeconds));

            Encrypt(data.ToArray());
        }
        public override async void Encode()
        {
            try
            {
                List <byte> data    = new List <byte>();
                List <byte> packet1 = new List <byte>();
                int         i       = 0;

                foreach (var player in ResourcesManager.GetInMemoryLevels().OrderByDescending(t => t.GetPlayerAvatar().GetScore()))
                {
                    if (player.GetPlayerAvatar().GetAvatarLevel() >= 70)
                    {
                        var pl = player.GetPlayerAvatar();
                        if (i >= 100)
                        {
                            break;
                        }
                        packet1.AddInt64(pl.GetId());
                        packet1.AddString(pl.GetAvatarName());
                        packet1.AddInt32(i + 1);
                        packet1.AddInt32(pl.GetScore());
                        packet1.AddInt32(i + 1);
                        packet1.AddInt32(pl.GetAvatarLevel());
                        packet1.AddInt32(100);
                        packet1.AddInt32(i);
                        packet1.AddInt32(100);
                        packet1.AddInt32(1);
                        packet1.AddInt32(pl.GetLeagueId());
                        packet1.AddString(pl.GetUserRegion().ToUpper());
                        packet1.AddInt64(pl.GetId());
                        packet1.AddInt32(1);
                        packet1.AddInt32(1);
                        if (pl.GetAllianceId() > 0)
                        {
                            packet1.Add(1); // 1 = Have an alliance | 0 = No alliance
                            packet1.AddInt64(pl.GetAllianceId());
                            Alliance _Alliance = await ObjectManager.GetAlliance(pl.GetAllianceId());

                            packet1.AddString(_Alliance.GetAllianceName());
                            packet1.AddInt32(_Alliance.GetAllianceBadgeData());
                        }
                        else
                        {
                            packet1.Add(0);
                        }
                        i++;
                    }
                }

                data.AddInt32(i);
                data.AddRange(packet1);
                data.AddInt32(i);
                data.AddRange(packet1);

                data.AddInt32((int)TimeSpan.FromDays(7).TotalSeconds);
                data.AddInt32(DateTime.Now.Year);
                data.AddInt32(DateTime.Now.Month);
                data.AddInt32(DateTime.Now.Year);
                data.AddInt32(DateTime.Now.Month - 1);
                Encrypt(data.ToArray());
            } catch (Exception) { }
        }
Пример #11
0
        //00 00 02 24 20 41 6A 6B 00 00 00 01 00 00 02 1F
        //00 00 00 17 00 9E 81 01
        //01
        //00 00 00 33
        //44 C3 A9 73 6F 6C C3 A9 2C 20 6E 6F 75 73 20 61 76 6F 6E 73 20 64 C3 A9 63 69 64 C3 A9 20 64 65 20 74 27 65 78 63 6C 75 72 65 20 64 75 20 63 6C 61 6E 2E
        //00 00 01 E6

        public override void Execute(Level level)
        {
            Level targetAccount = ResourcesManager.GetPlayer(m_vAvatarId, true);

            if (targetAccount != null)
            {
                var targetAvatar        = targetAccount.GetPlayerAvatar();
                var targetAllianceId    = targetAvatar.GetAllianceId();
                var requesterAvatar     = level.GetPlayerAvatar();
                var requesterAllianceId = requesterAvatar.GetAllianceId();
                if (requesterAllianceId > 0 && targetAllianceId == requesterAllianceId)
                {
                    Alliance alliance        = ObjectManager.GetAlliance(requesterAllianceId);
                    var      requesterMember = alliance.GetAllianceMember(requesterAvatar.GetId());
                    var      targetMember    = alliance.GetAllianceMember(m_vAvatarId);
                    if (targetMember.HasLowerRoleThan(requesterMember.GetRole()))
                    {
                        targetAvatar.SetAllianceId(0);
                        alliance.RemoveMember(m_vAvatarId);
                        //Now sending messages
                        if (ResourcesManager.IsPlayerOnline(targetAccount))
                        {
                            var leaveAllianceCommand = new LeaveAllianceCommand();
                            leaveAllianceCommand.SetAlliance(alliance);
                            leaveAllianceCommand.SetReason(2);//kick
                            var availableServerCommandMessage = new AvailableServerCommandMessage(targetAccount.GetClient());
                            availableServerCommandMessage.SetCommandId(2);
                            availableServerCommandMessage.SetCommand(leaveAllianceCommand);
                            PacketManager.ProcessOutgoingPacket(availableServerCommandMessage);

                            AllianceKickOutStreamEntry kickOutStreamEntry = new AllianceKickOutStreamEntry();
                            kickOutStreamEntry.SetId((int)DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1)).TotalSeconds);
                            kickOutStreamEntry.SetAvatar(requesterAvatar);
                            kickOutStreamEntry.SetIsNew(0);
                            kickOutStreamEntry.SetAllianceId(alliance.GetAllianceId());
                            kickOutStreamEntry.SetAllianceBadgeData(alliance.GetAllianceBadgeData());
                            kickOutStreamEntry.SetAllianceName(alliance.GetAllianceName());
                            kickOutStreamEntry.SetMessage(m_vMessage);
                            var p = new AvatarStreamEntryMessage(targetAccount.GetClient());
                            p.SetAvatarStreamEntry(kickOutStreamEntry);
                            PacketManager.ProcessOutgoingPacket(p);
                        }

                        AllianceEventStreamEntry eventStreamEntry = new AllianceEventStreamEntry();
                        eventStreamEntry.SetId((int)DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1)).TotalSeconds);
                        eventStreamEntry.SetAvatar(targetAvatar);
                        eventStreamEntry.SetEventType(1);
                        eventStreamEntry.SetAvatarId(requesterAvatar.GetId());
                        eventStreamEntry.SetAvatarName(requesterAvatar.GetAvatarName());

                        alliance.AddChatMessage(eventStreamEntry);

                        foreach (var onlinePlayer in ResourcesManager.GetOnlinePlayers())
                        {
                            if (onlinePlayer.GetPlayerAvatar().GetAllianceId() == requesterAllianceId)
                            {
                                var p = new AllianceStreamEntryMessage(onlinePlayer.GetClient());
                                p.SetStreamEntry(eventStreamEntry);
                                PacketManager.ProcessOutgoingPacket(p);
                            }
                        }
                    }
                }
            }
        }