EC Support 2.2

Adds EC Support to your server

  1. zerodowned

    zerodowned Administrator Moderator JustUO Developer Gold Star Member Et Cetera, Et Cetera

    Interesting. I'll take a look when I can. Might not be until late tonight or tomorrow morning.
    I'll also try to get the textentry gumps for inputting Rune names and PlayerVendor prices. That's how OSI does it.
    I don't know how to call the actual gump that's part of the EC client but I think one with "old" gumps should work as a patch.
     
    • Like Like x 1
  2. HawkEye

    HawkEye Super Contributor

    I have ec working three times more then this package contains.
     
  3. TheDoc

    TheDoc Distinguished Member

    So why not share it instead of talking shit?
     
    • Like Like x 1
  4. zerodowned

    zerodowned Administrator Moderator JustUO Developer Gold Star Member Et Cetera, Et Cetera

    i don't know that he was being negative, just informative
     
  5. zerodowned

    zerodowned Administrator Moderator JustUO Developer Gold Star Member Et Cetera, Et Cetera

    okay, so this time I had the time to download a fresh copy of the repo to make sure it works.

    Note: I haven't tried the files in Scripts\Custom Systems\Encryption since the EC client is able to create an account and character without them

    ps -
    are just console writelines, it's okay to ignore that

    but
    is an error with the script that would stop the mobile from dropping two things

    change
    Code:
    public override void OnDeath(Container c)
            {
                base.OnDeath(c);
    
                if (Utility.RandomDouble() < 0.05)
                {
                    switch (Utility.Random(3))
                    {
                        case 0:
                            c.DropItem(new ToxicVenomSac());
                            break;
                        case 1:
                            c.DropItem(new SlithTongue());
                            break;
                        case 2:
                            c.DropItem(new SlithEye());
                            break;
    
                            if (Utility.RandomDouble() < 0.25)
                            {
                                switch (Utility.Random(2))
                                {
                                    case 0:
                                        c.DropItem(new AncientPotteryFragments());
                                        break;
                                    case 1:
                                        c.DropItem(new TatteredAncientScroll());
                                        break;
                                }
                            }
                    }
                }
            }
    to
    Code:
    public override void OnDeath(Container c)
            {
                base.OnDeath(c);
    
                if (Utility.RandomDouble() < 0.05)
                {
                    switch (Utility.Random(3))
                    {
                        case 0:
                            c.DropItem(new ToxicVenomSac());
                            break;
                        case 1:
                            c.DropItem(new SlithTongue());
                            break;
                        case 2:
                            c.DropItem(new SlithEye());
                            break;
                    }
                }
               
                if (Utility.RandomDouble() < 0.25)
                {
                    switch (Utility.Random(2))
                    {
                        case 0: c.DropItem(new AncientPotteryFragments());
                            break;
                        case 1: c.DropItem(new TatteredAncientScroll());
                            break;
                    }
                }
            }
     

    Attached Files:

    • Like Like x 1
  6. Jack Handy

    Jack Handy Distinguished Member

    that fixed it, fresh github master + ec support 2.6 files + edit to ToxicSlith compiles / runs, also allowed me to connect and create character with EC. Thanks
    One question about your post though,

    "Note: I haven't tried the files in Scripts\Custom Systems\Encryption"

    Do you mean those files are superfluous currently?
     
    Last edited: Oct 13, 2015
  7. zerodowned

    zerodowned Administrator Moderator JustUO Developer Gold Star Member Et Cetera, Et Cetera

    That's correct. I don't know why they're there or what exactly they do.
    There doesn't seem to be any need for them in any of the other EC files, and IMO they seem a little sketchy. ( and I only say that because they both involve Encryption, that hasn't shown as being necessary, and oddly name files "TwoFish" )
     
    • Agree Agree x 1
  8. dmurphy

    dmurphy Distinguished Member

    I haven't looked at the files in question but twofish is a block cipher. https://en.wikipedia.org/wiki/Twofish
     
    • Informative Informative x 2
  9. HawkEye

    HawkEye Super Contributor

    I am going to share for all those people like to run there mouth. I posted that to let you all know I been getting the package together with JustUO repo. so please take you silly comments and shove them in the trash can.. You will see a new ec package uploaded soon,
     
    • Like Like x 1
  10. TheDoc

    TheDoc Distinguished Member

    Maybe I misunderstood you. For the record, I haven't "ran my mouth" in a long time and that's not what was intended. I do get a little angry when someone has put a lot of effort into something and someone else
    talks shit about it. If you didn't mean to come across that way, my sincere apologies. Otherwise the comment stands.
     
  11. zerodowned

    zerodowned Administrator Moderator JustUO Developer Gold Star Member Et Cetera, Et Cetera

    I did a little testing and found out how to set names of runes and prices on player vendors for EC clients.
    I know nothing when it comes to packets so i can't get the real gump, but I did figure out how to open the gump on double-click if on ec ( and checked to make sure it works normally on classic )

    so i'll post that as a temporary patch when i can
     
  12. HawkEye

    HawkEye Super Contributor

    Code:
    using System;
    using Server.Prompts;
    using Server.Gumps;
    
    namespace Server.Network
    {
        public static class PromptExtensions
        {
            public static void SendTo( this Prompt prompt, Mobile m )
            {
                if (m.Client != null && m.Client.Version.IsKRClient)
                {
                    m.Send( new PromptGumpStub( prompt, m ).GetPacket() );
                }
                else
                {
                    if ( prompt.MessageCliloc != 1042971 || prompt.MessageArgs != String.Empty )
                        m.SendLocalizedMessage( prompt.MessageCliloc, prompt.MessageArgs, prompt.MessageHue );
    
                    m.Send( new UnicodePrompt( prompt, m ) );
                }
            }
        }
    
        public class PromptGumpStub : Gump
        {
            public override int TypeID { get { return 0x2AE; } }
    
            public PromptGumpStub( Prompt prompt, Mobile to )
                : base( 0, 0 )
            {
                Serial senderSerial = prompt.Sender != null ? prompt.Sender.Serial : to.Serial;
    
                Serial = senderSerial;
    
                Intern( "TEXTENTRY" );
                Intern( senderSerial.Value.ToString() );
                Intern( to.Serial.Value.ToString() );
                Intern( prompt.TypeId.ToString() );
                Intern( prompt.MessageCliloc.ToString() ); // TODO: Is there a way to include args here?
                Intern( "1" ); // 0 = Ascii response, 1 = Unicode Response
    
                AddBackground( 50, 50, 540, 350, 0xA28 );
    
                AddPage( 0 );
    
                AddHtmlLocalized( 264, 80, 200, 24, 1062524, false, false );
                AddHtmlLocalized( 120, 108, 420, 48, 1062638, false, false );
                AddBackground( 100, 148, 440, 200, 0xDAC );
                AddTextEntryIntern( 120, 168, 400, 200, 0x0, 44, 0 );
                AddButton( 175, 355, 0x81A, 0x81B, 1, GumpButtonType.Reply, 0 );
                AddButton( 405, 355, 0x819, 0x818, 0, GumpButtonType.Reply, 0 );
            }
    
            public Packet GetPacket()
            {
                return Compile();
            }
        }
    }
    Code:
    using System;
    using Server;
    using Server.Gumps;
    
    namespace Server.Prompts
    {
        public abstract class Prompt
        {
            private IEntity m_Sender;
            private String m_MessageArgs;
    
            public IEntity Sender
            {
                get { return m_Sender; }
            }
    
            public String MessageArgs
            {
                get { return m_MessageArgs; }
            }
    
            public virtual int MessageCliloc
            {
                get { return 1042971; } // ~1_NOTHING~
            }
    
            public virtual int MessageHue
            {
                get { return 0; }
            }
    
            public virtual int TypeId
            {
                get { return GetType().FullName.GetHashCode(); }
            }
    
            public Prompt()
                : this( null )
            {
            }
    
            public Prompt( IEntity sender )
                : this( sender, String.Empty )
            {
            }
    
            public Prompt( IEntity sender, String args )
            {
                m_Sender = sender;
                m_MessageArgs = args;
            }
    
            public virtual void OnCancel( Mobile from )
            {
            }
    
            public virtual void OnResponse( Mobile from, string text )
            {
            }
        }
    }
    Code:
            public void AsciiPromptResponse( NetState state, PacketReader pvSrc )
            {
                Mobile from = state.Mobile;
                Prompt p = from.Prompt;
    
                int senderSerial = pvSrc.ReadInt32();
                int promptId = pvSrc.ReadInt32();
                int type = pvSrc.ReadInt32();
                string text = pvSrc.ReadStringSafe();
    
                if ( text.Length > 128 )
                    return;
    
                if ( p != null && p.Sender.Serial == senderSerial && p.TypeId == promptId )
                {
                    from.Prompt = null;
    
                    try
                    {
                        if ( type == 0 )
                            p.OnCancel( from );
                        else
                            p.OnResponse( from, text );
                    }
                    catch ( Exception e )
                    {
                        //Logger.Error( "Exception disarmed in AsciiPrompt response {0}, type {1}: {2}", state.Mobile, type, e );
                    }
                }
            }
    
            public void UnicodePromptResponse( NetState state, PacketReader pvSrc )
            {
                Mobile from = state.Mobile;
                Prompt p = from.Prompt;
    
                int senderSerial = pvSrc.ReadInt32();
                int promptId = pvSrc.ReadInt32();
                int type = pvSrc.ReadInt32();
                /*string lang = */
                pvSrc.ReadString( 4 );
                string text = pvSrc.ReadUnicodeStringLESafe();
    
                if ( text.Length > 128 )
                    return;
    
                int promptSerial = ( p != null && p.Sender != null ) ? p.Sender.Serial.Value : from.Serial.Value;
    
                if ( p != null && promptSerial == senderSerial && p.TypeId == promptId )
                {
                    from.Prompt = null;
    
                    try
                    {
                        if ( type == 0 )
                            p.OnCancel( from );
                        else
                            p.OnResponse( from, text );
                    }
                    catch ( Exception e )
                    {
                        //Logger.Error( "Exception disarmed in UnicodePrompt response {0}, type {1}: {2}", state.Mobile, type, e );
                    }
                }
            }
     
  13. HawkEye

    HawkEye Super Contributor

    Code:
        public sealed class UnicodePrompt : Packet
        {
            public UnicodePrompt( Prompt prompt, Mobile to )
                : base( 0xC2 )
            {
                this.EnsureCapacity( 21 );
    
                Serial senderSerial = prompt.Sender != null ? prompt.Sender.Serial : to.Serial;
    
                m_Stream.Write( (int) senderSerial );
                m_Stream.Write( (int) prompt.TypeId ); //0x2C
                m_Stream.Write( (int) 0 ); // type
                m_Stream.Write( (int) 0 ); // language
                m_Stream.Write( (short) 0 ); // text
            }
        }
     
  14. HawkEye

    HawkEye Super Contributor

    Only problem I'm having to get this to work right is only having server know its a Enhanced client but if I do normal client it sends gump to normal 2d client and ec.

    There is a lot more code needs added to get this to work. but I hope this a start for any one that can solve problem I ran into how to make server know different between clients. if you go ingame you will see on who list that the client version the player logs in is the ec version but says time of legends. as for 2d is shows the 2d version numbers if he logs into 2d. so if any one any one can figure this part out we can get it working correctly. again I'm working on getting a ec JustUO package together using there repo that's up now so everything works. just give me time its a huge package and its a lot of work.
     
  15. zerodowned

    zerodowned Administrator Moderator JustUO Developer Gold Star Member Et Cetera, Et Cetera

    Code:
    Netstate ns = from.Netstate
    
    if ( ns.IsKRClient ) 
    I'd have to double check the code I did this morning but I'm pretty sure that's it.
    Checks if the player is using EC ( "KRClient" ) or not
     
  16. HawkEye

    HawkEye Super Contributor

    Well what I got as well but for some dang reason that check is not working at all if I remove that iskrclient check I can see the gump pop up in the ec client its confusing lol.
     
  17. zerodowned

    zerodowned Administrator Moderator JustUO Developer Gold Star Member Et Cetera, Et Cetera

    hmm, well I'd have to see the method you're trying to add the check to.
    I got to head back to work. hopefully will have time to get back on when I get home
     
  18. HawkEye

    HawkEye Super Contributor

  19. HawkEye

    HawkEye Super Contributor

    Well I got it all to working I figured out what I did wrong when moving stuff around I put the client iskr in wrong mobile status in the packets so now renaming vendors runebooks and every thing is working 100% soon as I get all the code done I will upload full package with details. I hope this can be looked over and then uploaded to JustUO As this will be my biggest Improvement :) if u find any bugs or you know of a better fix I'm up for it. I'm just happy to let every one get ec working on there shards.
     
    • Like Like x 3
  20. zerodowned

    zerodowned Administrator Moderator JustUO Developer Gold Star Member Et Cetera, Et Cetera

    found an issue with the Toolbar edit, it fixes it for EC but makes it almost useless for Classic clients.

    Here's a fix for that:

    find the file: Scripts\Services\Toolbar\Gumps\Toolbar.cs

    change: public ToolbarGump(ToolbarInfo info)
    to: public ToolbarGump(ToolbarInfo info, Mobile m)

    then in that same file
    change line 75: AddButton(x + 1, y, 2445, 2445, temp + 10, GumpButtonType.Reply, 0);

    to:
    Code:
    NetState ns = m.NetState;
    if( ns.IsKRClient ) {
                        AddButton(x + 1, y, 2435, 2436, temp + 10, GumpButtonType.Reply, 0);
                    }
                    else {
                        AddButton(x + 1, y, 2445, 2445, temp + 10, GumpButtonType.Reply, 0);
                    }
    go to the file Toolbar\Core\ToolbarCore.cs
    change line 63: m.SendGump(new ToolbarGump(module.ToolbarInfo));
    to: m.SendGump(new ToolbarGump(module.ToolbarInfo, m));

    go to file Toolbar\Gumps\ToolbarEdit.cs
    change line: m.SendGump(new ToolbarGump(module.ToolbarInfo));
    to: m.SendGump(new ToolbarGump(module.ToolbarInfo, m));

    and now it should act normally in both EC and classic client[/QUOTE]
     
    • Like Like x 1
  21. HawkEye

    HawkEye Super Contributor

    Nice catch okay. What I did was made a check in rename print to check for major version number like major >= 67 so any ec client 67or greater will always work for new name prompts. So now 2d and ec both work correctly. Also have the fix for renaming pets in ec.
     
  22. HawkEye

    HawkEye Super Contributor

    Major progress. Will release tonight
     
    • Like Like x 1
  23. zerodowned

    zerodowned Administrator Moderator JustUO Developer Gold Star Member Et Cetera, Et Cetera

    looking forward to it
     
  24. HawkEye

    HawkEye Super Contributor

    This package I have will contain renaming fix for ec. Runebook working in ec . Character sheet for ec working. Containers. Working 100% vendor pricing. All ec Gump system so u can make gumps work with ec. Effects quest waypoint system . And many more
     
    • Like Like x 1
  25. zerodowned

    zerodowned Administrator Moderator JustUO Developer Gold Star Member Et Cetera, Et Cetera

    one question I had is do AlphaRegions work in EC ?
    someone on servuo mentioned to me an issue with the staff runebook in EC, I'm assuming the staffrunebook that's part of the toolbar.
    not sure if they meant it's not working at all or just that they're not able to see alpharegions.
     

Share This Page