EC Support 2.2

Adds EC Support to your server

  1. Fenris

    Fenris Super Contributor

    I found next bug today - player context buttons in action menu don't work when I put them in to toolbar (for example - open item insurance menu button , toggle item insurance button, open titles menu button etc). But "Item toogle insurance" option in Status Window/Show Character Menu works properly.
     
    Last edited: Nov 2, 2014
  2. Bambino

    Bambino Renowned Member Gold Star Member

    I really appreciate the work you have done here Dragon Slayer :Thumbsup: Very much appreciated! I feel like full EC client support could be a game changer for shard populations once all the kinks are worked out. I'll be testing this with the JustUO SVN and latest EC client.
     
    • Like Like x 1
  3. Dian

    Dian Administrator

    Absolutely :Thumbsup:
     
  4. Talshani

    Talshani Administrator Staff Member World Builder

    Yea then maybe we can try it out too.
    :Woot:
     
  5. Vorspire

    Vorspire Illustrious Member JustUO Developer

    Just gonna throw this out there since I don't think it's in the package yet:

    EC Packet 0xE8 - I have no idea what to do with it.

    Code:
    Register(0xE8, 13, true, KRUIHighlightRemove);
    
    Code:
            public static void KRUIHighlightRemove(NetState state, PacketReader pvSrc)
            {
                Serial serial = pvSrc.ReadInt32();
                short element = pvSrc.ReadInt16();
                Serial dest = pvSrc.ReadInt32();
                byte unk1 = pvSrc.ReadByte();
                byte unk2 = pvSrc.ReadByte();
            }
    
    ... And all of the packet's I've managed to reverse engineer to date (Server->Client), that don't appear to be in the package yet :)

    Code:
        public sealed class KRHealthbarPoison : Packet
        {
            public KRHealthbarPoison(Mobile m)
                : base(0x16)
            {
                EnsureCapacity(12);
    
                m_Stream.Write(m.Serial);
                m_Stream.Write((short)0x01);
    
                m_Stream.Write((short)0x01);
    
                Poison p = m.Poison;
    
                if (p != null)
                {
                    m_Stream.Write((byte)(p.RealLevel + 1));
                }
                else
                {
                    m_Stream.Write((byte)0x00);
                }
            }
        }
    
        public sealed class KRHealthbarYellow : Packet
        {
            public KRHealthbarYellow(Mobile m)
                : base(0x16)
            {
                EnsureCapacity(12);
    
                m_Stream.Write(m.Serial);
                m_Stream.Write((short)0x01);
    
                m_Stream.Write((short)0x02);
    
                if (m.Blessed || m.YellowHealthbar)
                {
                    m_Stream.Write((byte)0x01);
                }
                else
                {
                    m_Stream.Write((byte)0x00);
                }
            }
        }
    
        public sealed class KRPetWindow : Packet
        {
            public KRPetWindow(Mobile owner, params Mobile[] pets)
                : base(0x31)
            {
                EnsureCapacity(8 + (pets.Length * 5));
    
                m_Stream.Write(owner.Serial);
    
                m_Stream.Write((byte)pets.Length);
    
                foreach (Mobile pet in pets)
                {
                    m_Stream.Write(pet.Serial);
                    m_Stream.Write((byte)0x01);
                }
            }
        }
    
        public enum KRWaypointType
        {
            None = 0x0,
            Corpse = 0x01,
            Party = 0x02,
            Unknown = 0x03,
            Quest = 0x04,
            QuestDestination = 0x05,
            Resurrection = 0x06
        }
    
        public sealed class KRDisplayWaypoint : Packet
        {
            public KRDisplayWaypoint(Serial serial, Point3D loc, Map map, KRWaypointType type, string label)
                : base(0xE5)
            {
                bool ignore = false;
                int cliloc = 1062613;
    
                switch (type)
                {
                    case KRWaypointType.Corpse:
                        cliloc = 1046414;
                        break;
                    case KRWaypointType.Resurrection:
                    case KRWaypointType.QuestDestination:
                    case KRWaypointType.Quest:
                    case KRWaypointType.Party:
                    case KRWaypointType.None:
                        ignore = true;
                        break;
                }
    
                EnsureCapacity(25);
    
                m_Stream.Write(serial);
    
                m_Stream.Write((short)loc.X);
                m_Stream.Write((short)loc.Y);
                m_Stream.Write((sbyte)loc.Z);
    
                m_Stream.Write((byte)map.MapID);
    
                m_Stream.Write((short)type);
    
                m_Stream.Write(ignore);
    
                m_Stream.Write(cliloc);
                m_Stream.WriteLittleUniNull(label);
    
                m_Stream.Write((short)0); // terminate
            }
        }
    
        public sealed class KRHideWaypoint : Packet
        {
            public KRHideWaypoint(Serial serial)
                : base(0xE6, 5)
            {
                m_Stream.Write(serial);
            }
        }
    
        public sealed class KRUIHighlight : Packet
        {
            public KRUIHighlight(Mobile user, short element, Serial dest)
                : base(0xE7, 12)
            {
                m_Stream.Write(user.Serial);
                m_Stream.Write(element);
                m_Stream.Write(dest);
                m_Stream.Write((byte)0x01);
            }
        }
    
        public sealed class KRUIToggleHighlight : Packet
        {
            public static KRUIToggleHighlight Inventory(Mobile user, short element, int dest)
            {
                return new KRUIToggleHighlight(user, element, "ToggleInventory", dest);
            }
    
            public static KRUIToggleHighlight Paperdoll(Mobile user, short element, int dest)
            {
                return new KRUIToggleHighlight(user, element, "TogglePaperdoll", dest);
            }
    
            public static KRUIToggleHighlight Map(Mobile user, short element, int dest)
            {
                return new KRUIToggleHighlight(user, element, "ToggleMap", dest);
            }
    
            public KRUIToggleHighlight(Mobile user, short element, string desc, int dest)
                : base(0xE9, 75)
            {
                m_Stream.Write(element);
                m_Stream.Write(user.Serial);
    
                m_Stream.WriteAsciiFixed(desc, 64);
    
                m_Stream.Write(dest);
            }
        }
    
        public sealed class KRHotbar : Packet
        {
            public static readonly Packet Enable = SetStatic(new KRHotbar(true));
            public static readonly Packet Disable = SetStatic(new KRHotbar(false));
    
            public KRHotbar(bool enable)
                : base(0xEA, 3)
            {
                m_Stream.Write((short)(enable ? 0x01 : 0x00));
            }
        }
    
        public sealed class KRSlotCooldown : Packet
        {
            public KRSlotCooldown(Item item, int duration)
                : this(item.ItemID, duration)
            { }
    
            public KRSlotCooldown(int id, int duration)
                : base(0xBF)
            {
                m_Stream.Write((short)0x31);
                m_Stream.Write((short)0x01);
    
                m_Stream.Write(id);
                m_Stream.Write(duration);
            }
        }
    
        public sealed class KRStatLockInfo : Packet
        {
            public KRStatLockInfo(Mobile m)
                : base(0xBF)
            {
                EnsureCapacity(17);
    
                m_Stream.Write((short)0x19);
    
                m_Stream.Write((byte)0x05);
    
                m_Stream.Write(m.Serial);
                m_Stream.Write((byte)0);
    
                int lockBits = 0;
    
                lockBits |= (int)m.StrLock << 4;
                lockBits |= (int)m.DexLock << 2;
                lockBits |= (int)m.IntLock;
    
                m_Stream.Write((byte)lockBits);
    
                if (lockBits == 0xFF)
                {
                    m_Stream.Write((byte)m.GetPacketFlags());
                    m_Stream.Write((short)m.GetIdleAnimation()); //Animation
                    m_Stream.Write((short)5); //Frame Count
                }
                else
                {
                    m_Stream.Fill(5);
                }
            }
        }
    
    I feel like some of the edits made to the stock packets might cover a couple of these, but when I wrote support for my shards I basically rebuilt the packets as stand-alone instances and when it comes to sending them to the client, I use a similar method to the MobileIncoming.Create pattern.

    Anyway... hope these help :)

    P.S.
    The Town Crier, Boat Rename, etc, is supposed to be handled by text Prompts in 2D, but in EC I think you have to use some kind of input dialog, I am not sure if there is a new text Prompt packet or not for EC, or if the old one just needs tweaked.

    P.P.S
    The packet to allow renaming of pets is in the code above - not sure if you have it covered, but when you typically drag a pet's status bar out and you're able to rename it in 2D, it's not so simple in EC... hehe.

    P.P.P.S
    You can't fix the issues with gumps - a lot of VNc's gumps that use the old "hidden button with text overlay" hack, do actually break in EC and it's been that way for a while. Never being able to settle on a fix for it, I gave up trying.
    The EC renders gumps in the most odd way compared to 2D. For instance, instead of presenting the gump in layers as they are compiled sequentially by the server, the EC will break down the gump and prioritize entries. Backgrounds always get drawn to the back layer, while buttons and text are prioritized to the front; nothing short of a custom UI could fix it and even then, I don't think that would work :p
    The EC is truly a trash client, but some crazy people seem to like it :p
     
    Last edited: Nov 19, 2014
    • Like Like x 1
  6. Dian

    Dian Administrator

    Interesting stuff, thanks for the info Vorspire :)
     
  7. Dragon Slayer

    Dragon Slayer Grandmaster Member

    ill try to get it all added to the package thanks vorspire and if you can get text to town crier and msgs boards and books working that would be awesome I put a crack at it and failed

    I like it because its got some 3d effects if 2d client was able to zoom out and have la those effects would be awesome ;)
     
  8. Fenris

    Fenris Super Contributor

    Today I found a very problematic bug with brigand camp spawns on EC client (probably other camps too) . When I coming with my staff character on brigand camp location (Enhanced Client - spawn created via xml spawner) my EC client crash but on 2D I can playing on this location without problems. I also can play on this location via EC Client if spawner with brigand camp is disabled but when I enable it my EC client crash immidiately.
     
    Last edited: Dec 19, 2014
  9. Fenris

    Fenris Super Contributor

    Here is list of camps with Ehanced Client crash effect :
    - brigandcamp, elfbrigandcamp, humanbrigandcamp, lizardmencamp, orccamp, ratcamp

    Healercamp, magecamp and bankercamp works properly on EC.
     
  10. Fenris

    Fenris Super Contributor

    Also I see a small problem with lightlevel set on EC client. For example on 2d I can change playermobile lightlevel with effect visible for a players but on enhanced client if I set lightlevel value other than 0 - player always see like during day (only set 0 effect like night/evening/twilight).
    I ask this because I was able to reduce the max effect of brightening the night with a nightsight spell, potion and even elves race effect although the effects are visible only in the client 2d. In Enhanced Client players see as day (each lightlevel other than 0 = full daylight effect).
     
    Last edited: Dec 21, 2014
  11. Dragon Slayer

    Dragon Slayer Grandmaster Member

    If I am correct lightlevel for ec client pretty much light level they as there is no way to mod it like 2d because even when I play UP with ec client I cant change my light level
     
  12. Fenris

    Fenris Super Contributor

    As I see - the password change command (if enable) didnt work too. Same chat writing problem like set player vendor prices/boot rename/town criers message enter . Entered content (text) is interpreted as a dialogue on the chat and not the content of the new password. I think that its most problematic lack in EC support atm.

    Edit: Same problem with rune naming and vesper museum gift (when you type number of items gifted) :( Ehhh I havn't idea where is a problem with that. Mayby its really a packet problem?
     
    Last edited: Dec 26, 2014
  13. Tukaram

    Tukaram Super Contributor

    I just re-downloaded this to make sure I have the latest copy...

    Some stupid questions though... I have looked at most the files and have not made any modifications to the original files - or there are no original files (packet stuff, race definitions, containers etc.) Are these just drag & drop replacements? It reads that way - I just want to make sure I don't break the 2d while working on EC :) And the Custom Systems/Encryption folder I do not have in my original JustUO files - that would also be drag & drop?

    Although I have not made any mods to these original files I have done some comparisons in Beyond Compare... and man, are they some different files :)

    So, I want to give it a whirl I just don't want to break 2D to do it ha ha (I will copy all the original files for easy replacement if needed.)

    Also, would I use UOSALoader (or whatever it is called...)?

    ~Edit~
    So far it looks like toolbar.cs is the only file that needs to be changed. This all looks almost too easy.

    PS Wow! That is more errors than I have ever seen ha ha. I did not know you could run out of scrollbar - I cannot get to the top of the list to see the error count . All pertaining to containers. Backpack not found, wooden box not found etc... Must be something in the container.cs, I suppose. :)
     
    Last edited: Jan 21, 2015
  14. SamP

    SamP Distinguished Member

    I use this update as well for the EC and the 2d client works fine. I've never had any trouble/crashing while playing with the 2d client. Tukaram, which UOSA loader do you use? I found a few online, but my anti-virus program doesn't like them and deletes them every time.
     
  15. Tukaram

    Tukaram Super Contributor

    I have a loader - don't remember where I downloaded it. But right now I have to get past the thousands of errors ha ha
     
  16. Tukaram

    Tukaram Super Contributor

    I compared the 2 container.cs files. The original file has whole sections dealing with... containers. You know, backbacks, bags, boxes etc. The EC file does not. So I looked at them in WinMerge and it was just 2 completely different files... So I basically crammed them together into one. I mean I copied the whole old one into to the new one. I figured that is wrong - but it was a start.

    And it turned out better than I thought. Instead of so many errors the scroll bar won't show them all - I now have a very short list. It is all one section, from the new EC file. Here is the section of code and the errors. ...and as an added bonus I am including the original container.cs, the ec version, and free of charge - the crammed together version! (Edit it is line 648 in the crammed together file, but in the ec copy it starts at line 316)

    Code:
        public bool ConsumeTotalGrouped(Type type, int amount, bool recurse, OnItemConsumed callback, CheckItemGroup grouper)
         {
           if (grouper == null)
           {
             throw new ArgumentNullException();
           }
    
           Item[] typedItems = FindItemsByType(type, recurse);
    
           var groups = new List<List<Item>>();
           int idx = 0;
    
           while (idx < typedItems.Length)
           {
             Item a = typedItems[idx++];
             var group = new List<Item>();
    
             group.Add(a);
    
             while (idx < typedItems.Length)
             {
               Item b = typedItems[idx];
               int v = grouper(a, b);
    
               if (v == 0)
               {
                 group.Add(b);
               }
               else
               {
                 break;
               }
    
               ++idx;
             }
    
             groups.Add(group);
           }
    
    Errors
    Code:
    ----------------------------------------------------------------------------
    
    JustUO - [http://www.playuo.org] Version 1.0
    
    Core: .NET Framework Version 4.0.30319
    
    Core: Optimizing for 8 64-bit processors
    
    RandomImpl: CSPRandom (Software)
    
    Scripts: Compiling C# scripts...Failed with: 1 errors, 0 warnings
    
    Errors:
    
    + Items/Containers/Container.cs:
    
      CS1518: Line 641: Expected class, delegate, enum, interface, or struct
    
      CS1518: Line 645: Expected class, delegate, enum, interface, or struct
    
      CS0116: Line 648: A namespace cannot directly contain members such as fields
    
    or methods
    
      CS1001: Line 648: Identifier expected
    
      CS1518: Line 648: Expected class, delegate, enum, interface, or struct
    
      CS1518: Line 650: Expected class, delegate, enum, interface, or struct
    
      CS1003: Line 655: Syntax error, ']' expected
    
      CS1518: Line 656: Expected class, delegate, enum, interface, or struct
    
      CS1518: Line 662: Expected class, delegate, enum, interface, or struct
    
      CS1022: Line 675: Type or namespace definition, or end-of-file expected
    
      CS1527: Line 622: Elements defined in a namespace cannot be explicitly decla
    
    red as private, protected, or protected internal
    
    Scripts: One or more scripts failed to compile or no script files were found.
    
    - Press return to exit, or R to try again.
    
     

    Attached Files:

    Last edited: Jan 21, 2015
    • Funny Funny x 1
  17. Dian

    Dian Administrator

    Tukaram The reason the files you compared are so different: The EC Container file is actually the JustUO/Server/Items/Container.cs files NOT the Scripts Container File that you are comparing with.. two very different scripts.

    You want to compare that EC Container file with the JustUO/Server/Items/Container.cs file :)

    That should get you back on track
     
  18. Tukaram

    Tukaram Super Contributor

    I actually thought of that... but I do not have a JustUO/Server/ folder. So, should I make one? And is it ok to have 2 files with the same name?

    Do I delete the original? I first tried replacing the original and got pages of errors


    ~Edit~ Just added the server JustUO/Server/ folder, with container.cs. Tried to load it with both files and am back to pages and ages of errors ha ha... what a day :)
     
    Last edited: Jan 21, 2015
  19. Tukaram

    Tukaram Super Contributor

    I dumped it all... back to normal and it starts ok. :) Then, I made a 'JustUO/scripts/Server/' folder a 'JustUO/scripts/custom system/encryption' folder, and now only have 1 error. It deals with unsafe scripts. I looked online and people are saying to go to the project properties, click build, make sure and check 'use unsafe'... I go to the project button and have nothing but a grayed out 'refresh tools' option. Still googling...

    + Server/Item.cs:
    CS0227: Line 1054: Unsafe code may only appear if compiling with /unsafe
     
  20. m309

    m309 Moderator Moderator

    Tukaram, the "Server" folder is the folder (or Project if you're using Visual Studio) that contains what are commonly referred to as the "core" files. If you have the sourcecode for JustUO, then you definitely have that included in your package. Can you screenshot the root directory you have JustUO located at?

    Are you using Visual Studio? (If not, you should. Its free now.)
     
  21. Tukaram

    Tukaram Super Contributor

    Here is the directory list. The 'server' folder in the pic is the one I added with the EC files.

    Yes, I am using Visual Studio but never made a project. I just tried to make one now and did not see how to import all the files into it... Google is my friend.... sometimes... :)

    ~Edit~ also in the VNC, the folders backups, cache, and saves are the only directories with anything in them. The others are all empty... seemed odd (the compendium folder is also empty... whatever that is)
     

    Attached Files:

    Last edited: Jan 21, 2015
  22. Tukaram

    Tukaram Super Contributor

    Couple questions.

    If I need to make a project - what kind do I make? There is a long list... (so far I have tried 'console app' and 'empty project')

    And after I make it how do I get it to use the JustUO files?

    This pic is a fresh unzipped JustUO I keep as a backup. Never ran it... so most of the folders don't seem to be there - I use it as backup original scripts...
     

    Attached Files:

    Last edited: Jan 22, 2015
  23. m309

    m309 Moderator Moderator

    Ahhh. I think I might have a guess as to whats happening. Are you downloading the JustUO "release" versions? I bet they don't have the Server folder because it's precompiled for quick deployment.

    If you're wanting to make core modifications, you'll need the full package from the main repo: https://github.com/JustUO/JustUO.

    Also, you don't need to create a solution at all. Once you have Visual Studio installed (takes a good while depending on your rig), and you have the above package forked/cloned/downloaded, simply dbl click the JustUO.sln file in the root directory of the JustUO package. It may ask you what version of VS to open it with if you have more than one installed. This will open up the entire solution for you with some helpful presets. Then mod away.
     
  24. Tukaram

    Tukaram Super Contributor

    Hey... that is whole different package ha ha... now we may be getting somewhere. It may be dangerous... but we are going... :)
     
  25. Tukaram

    Tukaram Super Contributor

    Will this make a new shard? I can start over... just wondering...
     

Share This Page