[Release/Bugfix] New login packet by Entwell

08/08/2018 19:27 Tbp123#1
Basically, Entwell (or Gameforge, idk) has changed their login packet parts and your login server will crash if you log in with the lastest NosTale client to your server.

Fix:

Go -> OpenNos.GameObject.Packets.ClientPackets.LoginPack et.cs LINE 28

Replace this:
Code:
        [PacketIndex(4)]
        public string ClientData { get; set; }
For this:
Code:
        [PacketIndex(4)]
        public string ClientDataOld { get; set; }

        [PacketIndex(5)]
        public string ClientData { get; set; }
Then, go OpenNos.Handler.LoginPacketHandler.cs LINE 149 (I'm not sure about the code line)

And replace this:
Code:
                                string[] clientData = loginPacket.ClientData.Split('.');
For this:
Code:
                                string[] clientData = loginPacket.ClientData.Split('.');

                                    if(clientData.Length < 2)
                                    {
                                        clientData = loginPacket.ClientDataOld.Split('.');
                                    }
Done, it's fixed.
08/08/2018 20:19 darkriderse83#2
what is the file to change?
08/08/2018 20:27 MarsBounty#3
Quote:
Originally Posted by Tbp123 View Post
Go -> OpenNos.GameObject.Packets.ClientPackets.LoginPack et.cs LINE 28


Then, go OpenNos.Handler.LoginPacketHandler.cs LINE 149 (I'm not sure about the code line)

Done, it's fixed.
i think there
08/08/2018 22:03 GGGGame#4
In reality it is less complicated, but ok °-°
08/10/2018 02:12 Tbp123#5
Quote:
Originally Posted by GGGGame View Post
In reality it is less complicated, but ok °-°
Well, you could just change the packet index of the ClientData var, but what if someone with the old client tries to log in
08/10/2018 02:21 Itachi-Senpai#6
Great job :3
08/11/2018 00:31 0Lucifer0#7
this is not a really good way to fix the login packet.
This is a better way: [Only registered and activated users can see links. Click Here To Register...]
08/11/2018 12:10 Tbp123#8
Quote:
Originally Posted by 0Lucifer0 View Post
this is not a really good way to fix the login packet.
This is a better way: [Only registered and activated users can see links. Click Here To Register...]
I didn't know what was the "NONE" ^^
08/11/2018 12:16 0Lucifer0#9
None just mean not any / again a new way to null value on packet... seems entwell doesn’t care about doing the same thing 10 different way
08/11/2018 12:36 Tbp123#10
Quote:
Originally Posted by 0Lucifer0 View Post
None just mean not any / again a new way to null value on packet... seems entwell doesn’t care about doing the same thing 10 different way
about none

i meant the variable was filled with what, if its not none, what would it be, so i didnt know what it was so i just made it a string

and yeh, but why does entwell do this, im wondering
08/11/2018 12:45 0Lucifer0#11
It’s a guid
08/12/2018 00:39 erixor#12
If you want to add a GUID to the loginpacket, you have to replace the Convert.ChangeType in the packetfactory with a TypeDescriptor.GetConverter, for example:

before:
return Convert.ChangeType(currentValue, packetPropertyType.GenericTypeArguments[0]);

after:
return TypeDescriptor.GetConverter(packetPropertyType.Gen ericTypeArguments[0]).ConvertFromInvariantString(currentValue);
03/14/2021 19:21 m.one#13
This fix doesn't work anymore?
I just get another error after this fix..

03/14/2021 19:42 erixor#14
Quote:
Originally Posted by m.one View Post
This fix doesn't work anymore?
I just get another error after this fix..

No, this fix doesn't work anymore, this post is from 2018. That was before Entwell/Gameforge started implementing internationalization in their client. The NsTesT packet has changed a lot since then. You can probably find it somewhere on this forum by taking a look, since people are constantly asking for a fix