EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Development (https://www.eqemulator.org/forums/forumdisplay.php?f=590)
-   -   Starting Work on SoF Opcodes/Structs (https://www.eqemulator.org/forums/showthread.php?t=26939)

trevius 01-05-2009 01:35 AM

I guess I am going to break down EQLive and see what each Opcode is so I can get an accurate order for what packets should be going when. Using SEQ, it shouldn't be too tough to get that all sorted out. Once I know the specific details, I am hoping to try them on SoF and see if it works.

Here is what I have so far:

Code:

[OPCode: 0x0100] [Raw] [Client->Server] [Size: 12] - Connect Request
[OPCode: 0x0200] [Raw] [Server->Client] [Size: 19] - Connect Accept Reply
[OPCode: 0x0700] [Raw] [Client->Server] [Size: 38] - Network Status Update
[OPCode: 0x0800] [Raw] [Server->Client] [Size: 38] - Network Status Update Reply?
[OPCode: 0x0300] [Raw] [Client->Server] [Size: 86] - Combined Packet

[OPCode: 0x3594] [Decoded] [Client->Server] [Size: 4] - Probably OP_AckPacket
[OPCode: 0x5a6b] [Decoded] [Client->Server] [Size: 68] - OP_ZoneEntry
[OPCode: 0x1500] [Raw] [Server->Client] [Size: 5] - Some Kind of Ack Packet
[OPCode: 0x0900] [Raw] [Server->Client] [Size: 406] - Stand-Alone Encoded and Compressed Packet
[OPCode: 0x1af0] [Decoded] [Server->Client] [Size: 12]
[OPCode: 0x3bef] [Decoded] [Server->Client] [Size: 0]
[OPCode: 0x322f] [Decoded] [Server->Client] [Size: 120] - OP_SendAATable

[OPCode: 0x1500] [Raw] [Client->Server] [Size: 5] - Some Kind of Ack Packet
[OPCode: 0x0d00] [Raw] [Server->Client] [Size: 507] - Fragmented Packet With Sequence
[OPCode: 0x6022] [Decoded] [Server->Client] [Size: 23488] - OP_PlayerProfile
[OPCode: 0x5a6b] [Decoded] [Server->Client] [Size: 334] - OP_ZoneEntry
[OPCode: 0x6015] [Decoded] [Server->Client] [Size: 8] - OP_TimeOfDay
[OPCode: 0x399b] [Decoded] [Server->Client] [Size: 48] - Maybe OP_TributeUpdate

[OPCode: 0x4036] [Decoded] [Client->Server] [Size: 4] - Maybe OP_TributeTimer
[OPCode: 0x3594] [Decoded] [Client->Server] [Size: 4] - Probably OP_AckPacket
[OPCode: 0x709d] [Decoded] [Server->Client] [Size: 205802] - Character Inventory
[OPCode: 0x5412] [Decoded] [Server->Client] [Size: 4] - Maybe OP_TaskDescription
[OPCode: 0x2641] [Decoded] [Server->Client] [Size: 12] - Maybe OP_TaskActivity or OP_Weather
[OPCode: 0x4292] [Decoded] [Server->Client] [Size: 4] - OP_DeleteSpawn
[OPCode: 0x6c26] [Decoded] [Server->Client] [Size: 4] - Maybe OP_CompletedTasks
[OPCode: 0x2c4c] [Decoded] [Server->Client] [Size: 24] - Maybe OP_Weather

[OPCode: 0x0924] [Decoded] [Client->Server] [Size: 1] - OP_ReqNewZone
[OPCode: 0x43ac] [Decoded] [Client->Server] [Size: 0] - Maybe OP_SendTributes
[OPCode: 0x466c] [Decoded] [Client->Server] [Size: 0] - Maybe OP_TributeInfo
[OPCode: 0x116d] [Decoded] [Server->Client] [Size: 20] - Maybe OP_SendGuildTributes
[OPCode: 0x5ca5] [Decoded] [Server->Client] [Size: 932] - OP_NewZone
[OPCode: 0x1b26] [Decoded] [Server->Client] [Size: 921] - Custom Titles

[OPCode: 0x7bbb] [Decoded] [Client->Server] [Size: 4] - OP_TargetMouse?
[OPCode: 0x3594] [Decoded] [Client->Server] [Size: 4] - Probably OP_AckPacket
[OPCode: 0x1436] [Decoded] [Client->Server] [Size: 0] - OP_ReqClientSpawn
[OPCode: 0x102f] [Decoded] [Server->Client] [Size: 184] - Spawn Doors
[OPCode: 0x5821] [Decoded] [Server->Client] [Size: 484] - Probably GroundSpawns or Zone Points
[OPCode: 0x69cd] [Decoded] [Server->Client] [Size: 0] - New OP_WorldObjectsSent (Replaced OP_SendExpZonein here)

[OPCode: 0x0baa] [Decoded] [Client->Server] [Size: 88] - NEW OP_BlockedSpells
[OPCode: 0x7b73] [Decoded] [Client->Server] [Size: 0] - OP_SendExpZonein
[OPCode: 0x10b7] [Decoded] [Server->Client] [Size: 8] - OP_SpawnAppearance
[OPCode: 0x3088] [Decoded] [Server->Client] [Size: 12] - OP_AAExpUpdate
[OPCode: 0x0e98] [Decoded] [Server->Client] [Size: 8] - OP_ExpUpdate
[OPCode: 0x50d0] [Decoded] [Server->Client] [Size: 12]
[OPCode: 0x7b73] [Decoded] [Server->Client] [Size: 0]

[OPCode: 0x7312] [Decoded] [Client->Server] [Size: 128]
[OPCode: 0x4e4e] [Decoded] [Server->Client] [Size: 4704] - List of Rewards available from /claim
[OPCode: 0x5448] [Decoded] [Server->Client] [Size: 12] - OP_SimpleMessage
[OPCode: 0x435b] [Decoded] [Server->Client] [Size: 4]
[OPCode: 0x0296] [Decoded] [Server->Client] [Size: 4]
[OPCode: 0x5a6b] [Decoded] [Server->Client] [Size: 326] - OP_ZoneEntry (this time from server to client)
[OPCode: 0x3164] [Decoded] [Server->Client] [Size: 5] - OP_RemoveSpawn
[OPCode: 0x5ebc] [Decoded] [Server->Client] [Size: 12]

[OPCode: 0x2d17] [Decoded] [Client->Server] [Size: 8]
[OPCode: 0x6759] [Decoded] [Client->Server] [Size: 0]
[OPCode: 0x7b6e] [Decoded] [Client->Server] [Size: 8]
[OPCode: 0x231f] [Decoded] [Client->Server] [Size: 19] - OP_WearChange
[OPCode: 0x4675] [Decoded] [Client->Server] [Size: 20] - OP_BazaarSearch
[OPCode: 0x19d2] [Decoded] [Client->Server] [Size: 0]
[OPCode: 0x4b49] [Decoded] [Client->Server] [Size: 4]
[OPCode: 0x7eac] [Decoded] [Client->Server] [Size: 12]
[OPCode: 0x365d] [Decoded] [Client->Server] [Size: 4]
[OPCode: 0x266e] [Decoded] [Client->Server] [Size: 4]
[OPCode: 0x7eeb] [Decoded] [Client->Server] [Size: 0]
[OPCode: 0x27bf] [Decoded] [Client->Server] [Size: 8]
[OPCode: 0x7e31] [Decoded] [Client->Server] [Size: 4]
[OPCode: 0x2d37] [Decoded] [Client->Server] [Size: 4]
[OPCode: 0x32c6] [Decoded] [Server->Client] [Size: 140] - Probably OP_GuildMemberList
[OPCode: 0xd677] [Decoded] [Server->Client] [Size: 648] - OP_GuildMOTD
[OPCode: 0x35d3] [Decoded] [Server->Client] [Size: 8]
[OPCode: 0x7b6e] [Decoded] [Server->Client] [Size: 8]

[OPCode: 0x7062] [Decoded] [Client->Server] [Size: 40] - OP_ClientUpdate
[OPCode: 0x7eeb] [Decoded] [Server->Client] [Size: 62] - Looks like the EQPlayers update
[OPCode: 0x538f] [Decoded] [Server->Client] [Size: 10] - Probably OP_HPUpdate
[OPCode: 0x4b61] [Decoded] [Server->Client] [Size: 10] - Maybe new Mana Update
[OPCode: 0x02d6] [Decoded] [Server->Client] [Size: 10] - Maybe new Endurance Update

I will edit this list as I can make more confirmations. It shouldn't take me long to figure out most of this list. I can tell for sure that some of the orders have changed, so I think if I can get that sorted out, it may work almost flawlessly for SoF.

trevius 01-05-2009 06:15 PM

I stumbled on a new struct last night. It doesn't really help this effort much, but it is probably worth noting for use later when we might be able to actually put it to use. There is a feature on Live that was in SoF as well, but not in Titanium. The new feature let's the client set certain spells to be blocked from hitting the client. This is for keeping buffs from overriding each other if you don't want them to.

The EQLive opcode for this is 0x0baa and I found the SoF opcode for it too. I built a struct for it with placeholders just to have something in place for it even though I don't know the values for it yet.

I also confirmed that EQLive now has 60 pages in the spell book as apposed to 50 in Titanium. This means that the MAX_PP_SPELLBOOK is now 480 in EQLive and probably in SoF as well. They had to add it when they upped player levels to 75, so I am sure it was in SoF, otherwise druids and maybe other classes could have overflowing spell books.

I am sure that most of my struct for SoF are correct or very close to it. I think I am just missing something minor that is keeping me from getting past this point I have been stuck at for the past couple of weeks. If I can just get pass that point, I feel that the rest will be much quicker and easier. My current guess is that I may not have all of the right opcodes being encoded on the way out that need to be for SoF. The client is expecting a 0 size opcode 0x1FA1, which is new since Titanium. Basically, it seems to be the same as SendExpZonein, accept instead of server sending that and getting it back from the client, it now sends this new opcode and waits for the SendExpZonein back from the client.

From looking at the EQLive logs, it looks like almost all packets are encoded now, at least while entering a zone. Maybe I have to set them all to be encoded for the client to get all of the info it needs for logging in. That is going to be a bit of a pain, because as far as I can tell, I have to create the handling stuff for each opcode that needs to be encoded. If there was a way for me to just set an opcode to be encoded in the Anniversary_ops.h and then only have to tell the Anniversary.cpp to use the structure for encoding, that would be pretty easy. But, it looks like I need to do something more like this for each one:

Code:

ENCODE(OP_ManaChange) {
        ENCODE_LENGTH_EXACT(ManaChange_Struct);
        SETUP_DIRECT_ENCODE(ManaChange_Struct, structs::ManaChange_Struct);
        OUT(new_mana);
        OUT(stamina);
        OUT(spell_id);
        FINISH_ENCODE();
}

I'm not exactly sure what the OUT stuff means, but I am guessing that all of the stuff set to go OUT is the stuff that gets encoded. If so, then I wonder what happens to stuff in the structure that isn't set to go OUT in the ENCODE. Does that stuff just get ignored?

greldor 01-07-2009 04:11 PM

Long time lurker, 1st time caller. . .


This work you've been doing is very exciting. With the last ever boxed edition of EQ1 possibly being SoF, this is a big step. I have been looking through the wikis and the forums, and trying to find some up to dat info on if there is anything someone with an active eqlive account can do to collect information for the Devs.

Let me know if there is something that can be done with no experience besides setting up a mini login server in the basement.

Thanks,

Greldor
The Grand Creation

unknownhost 01-07-2009 04:18 PM

my god man...
 
i didnt believe in intelligent machines until i read this thread.

Trevius isnt human i tell you! he is the real life Bender!!!!


you're awesome man, good things are comming peoples!


on a nearly equally pointless side note. every time i type/read Trevius' name i think of Golan Trevise from the Foundation series. :) any relation by chance?

Derision 01-07-2009 04:55 PM

Quote:

Originally Posted by trevius (Post 162440)
I'm not exactly sure what the OUT stuff means, but I am guessing that all of the stuff set to go OUT is the stuff that gets encoded. If so, then I wonder what happens to stuff in the structure that isn't set to go OUT in the ENCODE. Does that stuff just get ignored?

The ENCODE/DECODE is used when the struct is different between Client versions.

ENCODE 'encodes' packets on the way out, from the server to the client, and DECODE does the reverse.

The ENCODE is a translation from the struct in common/eq_packet_structs.h to the struct in the client specific struct in patches/<Client version>_structs.h.

To take your example for OP_ManaChange. The 'EMU' struct for this, in common/eq_packet_structs.h is:

Code:

struct ManaChange_Struct
{
        int32  new_mana;                  // New Mana AMount
        int32  stamina;
        int32  spell_id;
        int32  unknown12;
};

while the Anniversary struct is:

Code:

struct ManaChange_Struct
{
        int32  new_mana;                  // New Mana AMount
        int32  stamina;
        int32  spell_id;
        int32  unknown12;
        int32  unknown16;
};

As you can see, Anniversary has an extra field at the end of the struct.

Essentially, the ENCODE section in Anniversary.cpp is copying the fields from the Emulator version of the struct to the version that Anniversary edition needs. I think the outgoing packet is filled with zeroes before the ENCODE takes place, so unknown12 and unknown16 would be zero.

For each struct that has changed in SoF, you would need to map out the fields in the new structure and add it to Anniversary_structs.h, add the Opcode to Anniversary_ops.h and do an ENCODE in Anniversary.cpp.

You would also need to do the same for Client to Server opcodes where the struct has changed, but this time do a DECODE from the SoF client structure to the Emu struct.

trevius 01-07-2009 06:37 PM

@ greldor - Thanks. I wound up paying to get my old EQLive account active again. I am currently using ShowEQ to watch all opcodes from Client to Server on Live where I need to be looking. Right now, I am still working on just logging in. Once I can get past that point, I think it won't be too hard for me to break down each individual structure that has changed and get them updated as well as start filling in missing opcodes. I have switched directions for now and am going to see if I can get the emu working with EQLive. It should be much easier to get it working with Live, because I can see exactly what the client wants and is expecting from looking at the SEQ logs. Then, even if I don't know what a certain packet is, I should be able to just duplicate what I saw the Live server sending from the SEQ logs and trick the client to log all of the way in until I can fill in the missing information. There isn't really much other people can help with right now until I can get logged in all of the way. Once I do that, I will update the SVN so others can assist in filling in and updating opcodes and packet structures and making any other needed tweaks to finalize it. I am not planning to try to chase Live by making the emu work with it, I am only trying to get in on an EQLive version because it should be easier than SoF. Once I get in game with the EQLive version, I will try to work backwards and get SoF working with it. I think that will be much easier than trying to work from Titanium to SoF, since Live seems much closer to SoF than Titanium is.

@ unknownhost - No, no relation to the name. My avatar name is named after my nephew Trever, but with a fantasy twist to it :P I am definitely no machine, I am just persistent enough to keep going even when I am failing miserably. There are certainly a few people on this project who have much more experience than me and probably would have had this working by now already. Unfortunately, none of them have SoF, and more importantly, I don't think they have the time needed to do it. I am more than willing to do all of the grunt work in getting this stuff to work, but I admit it would be nice if one of the more experienced people were able to help figure out some of the more problematic issues (like currently being stuck at the first main loop). The big time involvement here is getting each of the needed opcodes and verifying they are accurate, and also getting each of the packet structures and verifying they are as accurate as possible. To the point I am currently failing at, I think I have all of the required opcodes and most of the packet structures should be good enough to be working for it. I haven't worked much past that point yet, because there isn't a point to until I get to the point where I need them. I didn't know anything about coding 8 months ago and have only learned by examples from reading the emulator source code and working on it. I have learned alot and learn new things every day, but I am sure the more experienced people would probably be able to help alot if they had the time. I will keep working away at it and will get it eventually, hopefully. All of the time I am working on this has really forced me to learn things I wouldn't have otherwise, so that is actually a good thing, but VERY time involved. It has officially been more than a month that I have been working on this so far, and I have worked on it for hours every single night. I made alot of progress in the first week or so, but since I got stuck on this main loop, I haven't been able to get past it. At this point, I still don't know what is causing it to hang up at that point. It could be anything from a wrong opcode, packet structure, something else missing, or whatever. Without logs directly from a packet collect (preferrably from SEQ) from when the SoF eqgame.exe was being used (patched Sep 7th 2007), it is hard to know exactly what might be missing. That is why I am hoping getting it working for EQLive will help me work back to getting SoF working.

@ Derision - Thanks for the info :) So, any opcode that isn't added to the patch_ops.h will use the eq_packet_structs.h for their structure? I have tried adding a few new opcodes to the anniversary_ops.h and it requires me to put structs into the eq_packet_structs.h for it to compile. If it is supposed to be using the anniversary_structs.h, then why does it require to have a struct in eq_packet_structs.h as well?

The main thing I am trying to figure out is how to know which packets are encoded/decoded. Is it only the ones that are put in the patch_ops.h and set to be encoded/decoded, or are all packets automatically encoded/decoded by default? The only raw packets I see from live are the acks and some of the sessions and network status stuff, everything else is encoded and some is also combined.

I am also trying to understand why anniversary.cpp seems to be telling the server how to handle the opcode packets, but we also have client_packet.cpp, which has handling instructions for each opcode as well. It seems that anything I add to anniversary_ops.h and anniversary.cpp also has to be added to client_packet.cpp. I am not really too clear on what is going on with that just yet. It seems like there is redundancy in some of this stuff and it makes it more complex for me, heh.

I verified most of the opcodes I need to get logged into the emu with an EQLive client last night. I just have to fill in a couple more and then adjust a couple of structures slightly and I should be able to at least get to the same point I am at trying to get in with SoF. I was able to get almost all of the player profile for EQLive mapped out just by looking at the SEQ hex output. I still have a bit more to do to finish that struct 100%, but it should be pretty accurate when I am done with it, at least for Live. But, Live and SoF have very similar structs. They are much closer than Titanium and SoF are.

Derision 01-07-2009 07:09 PM

Quote:

Originally Posted by trevius (Post 162571)
@ Derision - Thanks for the info :) So, any opcode that isn't added to the patch_ops.h will use the eq_packet_structs.h for their structure?

First thing to say is that what ShowEQ shows as a 'Decoded' packet has nothing to do with the with the EQEmu ENCODE/DECODE terminology.

You are correct, anything that isn't in <patch>_ops.h just gets passed straight through using the common/eq_packet_structs.h structure for that Opcode.

Quote:

I have tried adding a few new opcodes to the anniversary_ops.h and it requires me to put structs into the eq_packet_structs.h for it to compile. If it is supposed to be using the anniversary_structs.h, then why does it require to have a struct in eq_packet_structs.h as well?
By putting an Opcode in anniversary_ops.h, you are saying that this Opcode requires the struct to be translated from the version in common/eq_packet_structs.h to the version in Anniversary_structs.h, hence why you need a copy of the struct in both files. If the Opcode is a new Anniversary-Only opcode, you don't need to put it in Anniversary_ops.h, and if there is a struct associated with it, you can just put it in common/eq_packet_structs.h.

The only time you need to put something in Anniversary_ops.h is if the same opcode exists in 6.2/Titanium and/or Anniversary, but the structs are different. In that case you need to put the SoF struct in Anniversary_structs.h and code in Anniversary.cpp to encode the struct from the version in common/eq_packet_structs.h to the version in patches/Anniversary_structs.h to account for a different order of fields in the structure, or new fields, etc.

Quote:

The main thing I am trying to figure out is how to know which packets are encoded/decoded. Is it only the ones that are put in the patch_ops.h and set to be encoded/decoded, or are all packets automatically encoded/decoded by default?
The only packets that are encoded/decoded for a particular client version are those listed in patches/<patch>_ops.h . All other packets are passed along using the struct in common/eq_packet_structs.h. As I said, encoding/decoding is only required if the packet struct for a client version (SoF in this case) is different than that specified in common/eq_packet_structs.h

Quote:

The only raw packets I see from live are the acks and some of the sessions and network status stuff, everything else is encoded and some is also combined.
As above, when SEQ says it has 'decoded' a packet, this just means it recoginised the EQ Application Opcode and doesn't correspond to the encode/decode terminology used in EQEmu.

Quote:

I am also trying to understand why anniversary.cpp seems to be telling the server how to handle the opcode packets, but we also have client_packet.cpp, which has handling instructions for each opcode as well.
Anniversary.cpp isn't telling the server how to handle the packet. It is telling the server how to translate the struct associated with that Opcode from the version that particular version of the client is sending into the structure that is in common/eq_packet_structs.h. Once the struct the client has sent has been translated into the 'emu struct', the Opcode is then passed through to client_packet.cpp to handle.

trevius 01-07-2009 07:20 PM

Thank you VERY much, Derision! Understanding that better should help me quite a bit in getting more work done on this. It sounds like I will just have to look at the current examples of how the conversions from struct to struct depending on the patch version are being done. That sounds like it might be easier to do than I originally thought it was. I will check the files now that I have your explanation and hopefully I can make more sense of what is going on so I can get things adjusted properly where needed. When I got into working on this, I was under the assumption that it would just be finding opcodes for it and redoing structs where needed, but it seems there is a bit more to doing that than I originally thought.

All I know is that when I finally get past the point I have been stuck at for the past few weeks, I am probably going to yell loud enough to wake up my wife and daughter :P

trevius 01-07-2009 07:38 PM

After just looking at it quickly to see what is happening, it gave me a couple more questions;

It looks like unknowns are commented out in the Titanium.cpp ENCODEs, so I am wondering if the unknowns are somehow handled/converted automatically, or if they aren't needed at all. Doesn't it still need to know where to send unknowns out at to fill in the gaps?

The other question is about (OUT) vs eq-> usage. Some of the ENCODEs have (OUT) and then the struct field name. But, some of them have something like this "eq->deity = emu->deity;" instead. My guess is that they are both doing the same thing. If I am right, then "eq" is saying to get the eq_packet_structs.h structure and "emu" is saying to put that item from the structure into this position for this patch version. If I understand correctly, that is the same thing that (OUT) is doing. So maybe the eq = emu way is just the old way?

I have seen some warnings about eq and emu not being used when I am compiling. I am guessing that is because I was making blank structs, which also means blank encodes/decodes. And since they are blank, the eq and emu variables aren't being used, so it warns about it. Now that I think I understand it better, I don't think I should need those blank structs now to begin with. If I want to send a 0 size packet, I guess I can just make the new op and then have it get sent when needed directly from the client_packet.cpp. I don't think I would have to add anything anywhere else for them. I will mess with that more later tonight.

KLS 01-07-2009 08:29 PM

OUT(x) is the same thing as: eq->x = emu->x;

When you do your var allocation at the top it allocates both emu and eq; emu being the source struct from the emulator, eq being the dest struct that's going out on the wire.

That's for outgoing packets, as you imagine it's reversed for incoming. When you're decoding an inc packet IN(x) is the same thing as: emu->x = eq->x; and eq is the source from the wire and emu is the dest to the emulator.

greldor 01-08-2009 10:38 AM

this may help
 
As a side note, If anyone needs SoF to aid Trevius:

Newegg.com has Secrets of Faydwer for $19.99
with free shipping!



Greldor
The Grand Creation

trevius 01-09-2009 06:32 AM

Well, it looks like EQLive may no longer be an option at all for the emulator. Unless I am doing something wrong, I can't even get EQLive to connect to the eqemulator.net login server. I tried messing around with my host file (windows host file), but that didn't make any difference. I also tried adjusting my ini files in the EQ directory, but that didn't help either. I put in my username and password and hit connect, and it just hangs there indefinitely saying "Logging into the server. Please wait..." It never actually connects to the eqemu login server, and it never seems to time out either, it just stops doing anything else.

My guess is that they have some new opcode or structure or maybe encryption when logging into the LS, and it doesn't match what our LS uses. And, since we don't have access to the LS, it means we are basically out of luck other than developing a new login server (which has been discussed a little).

It isn't the worst thing in the world that the emu won't work with live anymore, but it does probably slow my progress down. Really, as long as I can get in game with SoF, that should be most of what I need to start working out the rest of the details. I mostly just need to get past the point I have been stuck at. The fact that EQEmu may not be able to work with EQLive is another reason why SoF is probably our best bet for a final version upgrade.

KLS 01-09-2009 08:21 AM

I connected to EMU login just 1 minute ago with a fully updated client so it must be: I am doing something wrong =p

EvoZak 01-09-2009 02:37 PM

Wow, how are you getting anything done with a fully patched client? Tomorrow's structs could be different from today's. Craziness.

secash 01-10-2009 03:54 AM

He probably means he was able to hit the login server, not actually functionally connect.

trevius 01-10-2009 05:03 AM

No, I wasn't even able to hit the Login Server. Thanks for confirming that it works, KLS! Now to figure out what I am doing wrong lol. I should know how to do this by now, LMAO!

Evozak, as long as I don't patch past the point my client is at now, I don't have to worry about the structs changing. I am not trying to get the emu to work with live and have us chase live as we did in the past at one time. I am just trying to get in game with Live for now so I can hopefully use some of that info to figure out what is stopping me from getting in with SoF. Since I have the exact breakdown of the structures (or at least I can see the actual packets from live with SEQ), I should be able to get everything I need set correctly to connect. I am hoping that if I can get in with a Live client, that I can use that info to help me figure out what is stopping me with SoF. If I have to, I should be able to force the exact packet structures from Live just to trick the client to logging all of the way in. Then, hopefully I can figure out the details later.

trevius 01-11-2009 05:48 AM

Well, I can't figure out why my live client won't connect to the emu LS... If I put the wrong info in the host file, it times out and says to check my network connection like normal. If I put the correct eqemu stuff in the host file and log in, it just hangs trying to connect. It is like it connects, but doesn't know what to do next. The only thing I can think of is that it is something to do with one of my INI files or maybe because I only own up to SoF. I tried messing around with my INI files as much as I could think of, but it didn't make any difference at all. So, maybe since I am using SoF, it has to do some extra check before going to the login server. I would guess it has to do the check to see if I want to purchase SoD or something, and since it is connecting to the emu LS, it fails that check and just hangs.

KLS, does your EQLive client have all expansions up to SoD? If so, maybe that is why you go right through, and I get stopped when it is trying to do that final check. I can't really think of what else it might be. All of my other client versions work fine to get to the LS, including my fresh SoF install from the DVDs. It was only after I patched to live that it stopped letting me connect to the LS.

Secrets 01-11-2009 08:11 AM

Quote:

Originally Posted by trevius (Post 162747)
Well, I can't figure out why my live client won't connect to the emu LS... If I put the wrong info in the host file, it times out and says to check my network connection like normal. If I put the correct eqemu stuff in the host file and log in, it just hangs trying to connect. It is like it connects, but doesn't know what to do next. The only thing I can think of is that it is something to do with one of my INI files or maybe because I only own up to SoF. I tried messing around with my INI files as much as I could think of, but it didn't make any difference at all. So, maybe since I am using SoF, it has to do some extra check before going to the login server. I would guess it has to do the check to see if I want to purchase SoD or something, and since it is connecting to the emu LS, it fails that check and just hangs.

KLS, does your EQLive client have all expansions up to SoD? If so, maybe that is why you go right through, and I get stopped when it is trying to do that final check. I can't really think of what else it might be. All of my other client versions work fine to get to the LS, including my fresh SoF install from the DVDs. It was only after I patched to live that it stopped letting me connect to the LS.

I just tried with a live client and could confirm the same symptoms as you. Bad info, times out and gives an error. EQLive, connects to server select. EQEmu? Hangs and never gives an error. Extremely odd.

trevius 01-11-2009 10:38 AM

Maybe KLS is running on a trial account client? I thought about using a trial account before I decided to pay to renew my old Live account. Unfortunately, the trial accounts are not the same as a fully updated live client. They have some limited files, and seem to only patch to a certain bare minimum point to be able to handle just the Tutorial zone. I never tested the trial version to see if it could connect to the emu LS, but I imagine it can. Even the UI on the trial version is a really old one (looks like Titanium UI). I tried using SEQ on the trial version and it didn't work at all. So, the trial definitely uses something other than EQLive. That is why I had to just pay to renew my old one instead.

Thanks for confirming that, Secrets. At least I know I am not crazy now lol. I have been wasting too many hours on trying to figure out why EQLive won't connect to the emu LS. Can anyone else confirm if it works for them or not? I would love to get it working to help me progress, but if it doesn't work, there is no use for me to waste anymore time on it!

klamath 01-11-2009 12:31 PM

If you just want live packets dumped out into your eqemu server its simple to connect. EQmain.dll is everquest loginserver. Swap the live one with your titanium file and your live patch will allow you to login to eqemu login server. Dunno how far you will get from there tho.

KLS 01-11-2009 04:23 PM

My EQLive folder is 5.63GB, eqgame.exe modified on jan 9th, eqmain.dll modified on jan 9th.

The acct I patched with has only a few expansions I think whatever titanium had with it. =p

Derision 01-11-2009 04:32 PM

To add another data point, I can't connect to the LS with the live client either. I ran the patcher today, but it looks like eqgame/eqmain haven't changed since December:

Code:

23/12/2008  10:06        1,015,808 eqmain.dll
23/12/2008  10:05        4,874,240 eqgame.exe

I bought the Anniversary digital download a year or two back, so that's all the expansions I have.

klamath 01-11-2009 04:44 PM

Titanium EQmain.dll is 2005 Live patch is 2008 thats why you are not connecting, So swap your live one with the titanium one then you will connect.

KLS 01-11-2009 07:42 PM

They did change the netcode for the live LS recently but it shouldn't of broken anything. They added the ability to force boot your account offline. The basic code is the same, or should be, very odd that it works for both live and emu for me.

Maybe there's something settings dependent, or as mentioned you can just use the older netcode with the titanium eqmain.

Edit: My patch brings me an eqgame and eqmain.dll that don't match those sizes. Puzzling.

trevius 01-11-2009 10:34 PM

KLS, do you currently own an active (paid) EQLive account? As I said earlier, you can patch only up to a certain point if you don't own a currently active EQLive account. You have to log in to patch all of the file, and the only 2 options are having a paid account, or one of the free trial accounts. If you tried with a trial account, then you aren't running the same version as EQLive.

I will see what happens if I try swapping out an older eqmain.dll with the EQLive one. I would think it would have some errors if I do, but no harm in trying.

KLS 01-11-2009 11:09 PM

I have a live eq and eq2 acct. I know right? I'm thinking maybe it didn't fully patch for some reason (I didn't actually try to log into live after patching). It changed my eqhosts.txt so I'm guessing it patched the right directory.

Well there were patch files waiting so I'm guessing that's what happened. =(

trevius 01-11-2009 11:16 PM

Ahh yeah, I think if you haven't patched before, it usually needs to exit and restart the patching again to get everything fully up-to-date. Thanks for the info though. At least I know I am not crazy now lol.

KLS 01-12-2009 05:55 AM

Well I wouldn't say we could come to that conclusion... =p

trevius 01-12-2009 09:00 AM

Well, it isn't much, but I did make a little progress on getting into SoF tonight. I found that I had the wrong opcode for zonespawns that I thought was correct, but wasn't.

Here is the new stuff in the SoF EQ Debug output:

Code:

[Mon Jan 12 06:06:09 2009]00129:Initializing character select UI.
[Mon Jan 12 06:06:09 2009]00130:Resetting game UI.
[Mon Jan 12 06:06:31 2009]00131:Zone Connect -- 0 -- Received MSG_ZONE_ADDRESS
[Mon Jan 12 06:06:31 2009]00132:Zone addr [192.168.1.102:19741] received...
[Mon Jan 12 06:06:31 2009]00133:ZONING
[Mon Jan 12 06:06:32 2009]00134:Networking: Connection Closed [0] with 0 pending bytes.
[Mon Jan 12 06:06:32 2009]00135:Networking: using port [3764].
[Mon Jan 12 06:06:32 2009]00136:Networking: Connection Established [1]
[Mon Jan 12 06:06:32 2009]00137:Connected to 192.168.1.102:19741...

[Mon Jan 12 06:06:32 2009]00138:Zone Connect -- 2 -- Sending MSG_EQ_ADDPLAYER
[Mon Jan 12 06:06:34 2009]00139:Zone Connect -- 3 -- Received MSG_SEND_PC
[Mon Jan 12 06:06:34 2009]00140:Zone Connect -- 4 -- Received MSG_EQ_ADDPLAYER
[Mon Jan 12 06:06:34 2009]00141:Received our Player from zone. MSG_EQ_NETPLAYERBUFF is next.
[Mon Jan 12 06:06:34 2009]00142:Player = Zshadow, zone = The Nexus
[Mon Jan 12 06:06:34 2009]00143:MSG_EQ_NETPLAYERBUFF received started.
[Mon Jan 12 06:06:34 2009]00144:MSG_EQ_NETPLAYERBUFF finished.

[Mon Jan 12 06:06:34 2009]00145:MSG_TIME_STAMP received.

[Mon Jan 12 06:06:34 2009]00146:MSG_TIME_STAMP received. (Items inc).

[Mon Jan 12 06:06:35 2009]00147:Received an item via EQI_STARTING_ITEM at loc 2083552304

Since I was looking into Item Serialization more again today after seeing a post from Derision in another thread, I started working on it a bit more again. I think I have the serialization stuff mostly worked out. If only I had a single log from someone logging in during SoF (preferable 9/7/07 to 11/13/07), I could get everything working pretty easily at this point I think.

The thing I can't figure out with item serialization is that it seems to be sending the wrong structure for OP_CharacterInventory. I don't even see a structure for it in the structs file. I assume it is all being handled in the anniversary.cpp encode stuff. In the log above, this is the only 1 of my characters that will even log 1 item before it crashes. The others all just fail before getting to the first one. So, I assume it is something about that particular item that is letting it get that far. I don't know what the number 2083552304 means, but that number is supposed to be the inventory slot the item is in according to normal log files. Here is an example from titanium:

Code:

2009-01-12 03:16:32        Zone Connect -- 0 -- Received MSG_ZONE_ADDRESS
2009-01-12 03:16:32        Zone addr [192.168.1.102:19741] received...
2009-01-12 03:16:32        ZONING
2009-01-12 03:16:32        Networking: Connection Closed [0] with 0 pending bytes.
2009-01-12 03:16:33        Networking: using port [3155].
2009-01-12 03:16:33        Networking: Connection Established [1]
2009-01-12 03:16:33        Connected to 192.168.1.102:19741...
2009-01-12 03:16:33       
2009-01-12 03:16:33        Zone Connect -- 2 -- Sending MSG_EQ_ADDPLAYER
2009-01-12 03:16:35        Zone Connect -- 3 -- Received MSG_SEND_PC
2009-01-12 03:16:35        Zone Connect -- 4 -- Received MSG_EQ_ADDPLAYER
2009-01-12 03:16:35        Received our EQPlayer from zone. MSG_EQ_NETPLAYERBUFF is next.
2009-01-12 03:16:35        Player = Trevazar, zone = Solusek Ro's Tower
2009-01-12 03:16:38        MSG_EQ_NETPLAYERBUFF received started.
2009-01-12 03:16:39        MSG_EQ_NETPLAYERBUFF finished.
2009-01-12 03:16:42        MSG_EQ_NETPLAYERBUFF received started.
2009-01-12 03:16:42        MSG_EQ_NETPLAYERBUFF finished.
2009-01-12 03:16:43        MSG_EQ_NETPLAYERBUFF received started.
2009-01-12 03:16:43        MSG_EQ_NETPLAYERBUFF finished.
2009-01-12 03:16:44        MSG_EQ_NETPLAYERBUFF received started.
2009-01-12 03:16:44        MSG_EQ_NETPLAYERBUFF finished.
2009-01-12 03:16:44        MSG_EQ_NETPLAYERBUFF received started.
2009-01-12 03:16:44        MSG_EQ_NETPLAYERBUFF finished.
2009-01-12 03:16:44        MSG_TIME_STAMP received.
2009-01-12 03:16:44       
2009-01-12 03:16:44        MSG_TIME_STAMP received. (Items inc).
2009-01-12 03:16:44       
2009-01-12 03:16:46        Received an item via EQI_STARTING_ITEM at loc 0
2009-01-12 03:16:46        Received an item via EQI_STARTING_ITEM at loc 1
2009-01-12 03:16:46        Received an item via EQI_STARTING_ITEM at loc 2
2009-01-12 03:16:46        Received an item via EQI_STARTING_ITEM at loc 3
2009-01-12 03:16:46        Received an item via EQI_STARTING_ITEM at loc 4
2009-01-12 03:16:46        Received an item via EQI_STARTING_ITEM at loc 5
2009-01-12 03:16:46        Received an item via EQI_STARTING_ITEM at loc 6
2009-01-12 03:16:46        Received an item via EQI_STARTING_ITEM at loc 7
2009-01-12 03:16:46        Received an item via EQI_STARTING_ITEM at loc 8
2009-01-12 03:16:46        Received an item via EQI_STARTING_ITEM at loc 9
2009-01-12 03:16:47        Received an item via EQI_STARTING_ITEM at loc 10
2009-01-12 03:16:47        Received an item via EQI_STARTING_ITEM at loc 11
2009-01-12 03:16:47        Received an item via EQI_STARTING_ITEM at loc 12
2009-01-12 03:16:47        Received an item via EQI_STARTING_ITEM at loc 13
2009-01-12 03:16:47        Received an item via EQI_STARTING_ITEM at loc 14
2009-01-12 03:16:47        Received an item via EQI_STARTING_ITEM at loc 15
2009-01-12 03:16:47        Received an item via EQI_STARTING_ITEM at loc 16
2009-01-12 03:16:47        Received an item via EQI_STARTING_ITEM at loc 17
2009-01-12 03:16:47        Received an item via EQI_STARTING_ITEM at loc 18
2009-01-12 03:16:47        Received an item via EQI_STARTING_ITEM at loc 19
2009-01-12 03:16:47        Received an item via EQI_STARTING_ITEM at loc 20
2009-01-12 03:16:47        Received an item via EQI_STARTING_ITEM at loc 21
2009-01-12 03:16:47        Received an item via EQI_STARTING_ITEM at loc 22
2009-01-12 03:16:47        Received an item via EQI_STARTING_ITEM at loc 23
2009-01-12 03:16:47        Received an item via EQI_STARTING_ITEM at loc 24
2009-01-12 03:16:47        Received an item via EQI_STARTING_ITEM at loc 25
2009-01-12 03:16:47        Received an item via EQI_STARTING_ITEM at loc 26
2009-01-12 03:16:48        Received an item via EQI_STARTING_ITEM at loc 27
2009-01-12 03:16:48        Received an item via EQI_STARTING_ITEM at loc 28
2009-01-12 03:16:48        Received an item via EQI_STARTING_ITEM at loc 29
2009-01-12 03:16:48        Received an item via EQI_STARTING_ITEM at loc 2000
2009-01-12 03:16:48        Received an item via EQI_STARTING_ITEM at loc 2001
2009-01-12 03:16:48        Received an item via EQI_STARTING_ITEM at loc 2002
2009-01-12 03:16:48        Received an item via EQI_STARTING_ITEM at loc 2003
2009-01-12 03:16:48        Received an item via EQI_STARTING_ITEM at loc 2004
2009-01-12 03:16:48        Received an item via EQI_STARTING_ITEM at loc 2005
2009-01-12 03:16:48        Received an item via EQI_STARTING_ITEM at loc 2006
2009-01-12 03:16:48        Received an item via EQI_STARTING_ITEM at loc 2007
2009-01-12 03:16:48        Received an item via EQI_STARTING_ITEM at loc 2008
2009-01-12 03:16:48        Received an item via EQI_STARTING_ITEM at loc 2010
2009-01-12 03:16:48        Received an item via EQI_STARTING_ITEM at loc 2011
2009-01-12 03:16:48        Received an item via EQI_STARTING_ITEM at loc 2012
2009-01-12 03:16:48        Received an item via EQI_STARTING_ITEM at loc 2014
2009-01-12 03:16:48        Received an item via EQI_STARTING_ITEM at loc 2015

2009-01-12 03:16:49        Item done, MSG_WEATHER_EVENT received.
2009-01-12 03:16:49       
2009-01-12 03:16:49        Initializing zone.
2009-01-12 03:16:49        Initializing world.


Derision 01-12-2009 09:27 AM

2083552304 is 7C307C30 in Hex. Ascii code 7C is the pipe symbol, |, and 30 is the number 0, so 7C307C30 is |0|0 which looks like serialised item data.

I should add that when I was working on the Bazaar, I was looking at some Live traces and *think* that I wasn't seeing item data being sent in a serialised format (didn't see any of those long strings of numbers separated by | symbols that are easy to spot in a packet trace). Maybe they stopped using that format for sending item data at some point.

trevius 01-12-2009 10:04 AM

If SEQ is showing the full packet, then you might be right. It seems more like they have each field broken down into int8,int16,int32,char,str, etc. Here is an example from SEQ from live:

Code:

30032 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  | ................
30048 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01  | ................
30064 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01  | ................
30080 | 00 00 00 00 00 00 00 25 53 4c 01 00 00 00 00 00  | .......%SL......
30096 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  | ................
30112 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 49  | ...............I
30128 | 6e 74 72 69 63 61 74 65 20 57 6f 6f 64 65 6e 20  | ntricate Wooden 
30144 | 46 69 67 75 72 69 6e 65 00 49 6d 62 75 65 64 20  | Figurine.Imbued 
30160 | 77 69 74 68 20 61 6e 20 61 64 76 65 6e 74 75 72  | with an adventur
30176 | 65 72 27 73 20 73 70 69 72 69 74 00 49 54 36 33  | er's spirit.IT63
30192 | 00 bb 88 00 00 01 01 00 00 00 01 00 00 00 00 00  | ................
30208 | 00 00 7f 03 00 00 01 00 00 00 00 00 00 0a 0a 0a  | ................
30224 | 0a 0a 00 0f 0f 00 0a 00 00 0a 5a 00 00 00 50 00  | ..........Z...P.
30240 | 00 00 00 00 00 00 14 00 00 00 00 00 00 00 00 00  | ................
30256 | 00 00 00 00 00 00 04 00 00 00 ff ff 00 00 00 00  | ................
30272 | 00 00 00 00 00 00 00 00 00 00 ff ff ff ff 00 00  | ................
30288 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00  | ................
30304 | 00 00 00 33 00 00 00 00 00 00 00 00 00 00 00 00  | ...3............
30320 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  | ................
30336 | 00 00 00 ff 0a 00 00 00 00 00 00 00 00 00 00 00  | ................
30352 | 00 00 00 80 3f 00 00 00 00 00 00 00 00 00 00 00  | ....?...........
30368 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  | ................
30384 | 00 00 00 00 00 00 00 00 00 b9 88 00 00 00 00 00  | ................
30400 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  | ................
30416 | 00 00 00 00 00 00 00 00 00 00 00 00 00 43 48 52  | .............CHR
30432 | 4d 50 6f 50 41 63 63 65 73 73 00 00 00 00 00 00  | MPoPAccess......
30448 | 00 00 00 07 00 00 00 01 00 00 00 00 00 01 00 00  | ................
30464 | 00 00 00 01 00 00 00 00 00 01 00 00 00 00 00 01  | ................
30480 | 00 00 00 00 00 00 00 00 00 00 00 00 00 46 00 00  | .............F..
30496 | 00 00 00 00 00 00 00 00 00 00 00 00 ff ff ff ff  | ................
30512 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  | ................
30528 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff  | ................
30544 | ff ff ff 00 00 00 00 00 00 00 00 00 00 00 01 00  | ................
30560 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  | ................
30576 | 00 00 00 00 00 00 00 00 ff ff ff ff 00 00 00 00  | ................
30592 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  | ................
30608 | 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff 00  | ................
30624 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  | ................
30640 | 00 00 00 00 00 00 00 00 00 00 ff ff ff ff ff ff  | ................
30656 | ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00  | ................
30672 | 00 00 00 00 00 00 00 00 00 00 00 00 00 ff ff ff  | ................
30688 | ff ff ff ff ff 00 00 00 00 00 00 00 00 00 00 00  | ................
30704 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  | ................
30720 | ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00  | ................
30736 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  | ................
30752 | 00 00 00 ff ff ff ff 00 00 00 00 00 00 00 00 00  | ................
30768 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  | ................
30784 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  | ................
30800 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  | ................
30816 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  | ................
30832 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  | ................
30848 | 00 00 00 00 00
01 00 00 00 00 00 00 00 d0 07 00  | ................
30864 | 00 00 00 00 00 01 00 00 00 00 00 00 00 4e 53 4c  | .............NSL
30880 | 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  | ................
30896 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  | ................
30912 | 00 00 00 00 01 54 72 61 64 65 72 27 73 20 53 61  | .....Trader's Sa
30928 | 74 63 68 65 6c 00 54 72 61 64 65 72 27 73 20 53  | tchel.Trader's S
30944 | 61 74 63 68 65 6c 00 49 54 36 33 00 eb 45 00 00  | atchel.IT63..E..

The section highlighted in green is what I believe to be a single complete item. I was able to break down some of the serialization of the item and it is pretty similar to the order I already have set for SoF. As far as I could tell, it matched perfectly, at least for EQLive.

I was thinking the same thing about the number being the serialization. I'm not sure where equip slot is sent, because I don't see it in the serialization.

Here is some of the serialization breakdown I was doing, which was some guesswork and some simple hex converting and comparing to the itemfields list as well as looking at the 13th floor info for this item:

Code:

1|0|0|0|1|0|21779237|0|0|0|0|0|0|0|0|0|<----Item Instance
Intricate Wooden Figurine|Imbued with an Adventurer's Spirit|IT63|1|1|0|0|0|1|0|0|0|0|0|0|0|127|3|0|0|1|0|0|0|0|0|0
|10|10|10|10|10|0|15|15|0|10|0|0|10|90|0|0|0|80|0x7|20|0x15|4|0|0|0|255|255|0x14
|255|255|255|255|0x16|1|0|0|0|0|51|0x31|128|63|0x36|185|136|0x34|CHRMPoPAccess|0x9|7|0|0|0|1

Item Instance Info:
Code:

01 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
01 00 00 00
00 00 00 00
25 53 4c 01
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00


Item Fields breakdown:
Code:

S(Name) 49 6e 74 72 69 63 61 74 65 20 57 6f 6f 64 65 6e 20 46 69 67 75 72 69 6e 65
00
S(Lore) 49 6d 62 75 65 64 20 77 69 74 68 20 61 6e 20 61 64 76 65 6e 74 75 72 65 72 27 73 20 73 70 69 72 69 74
00
S(IDFile) 49 54 36 33
00
I(ID) bb 88 00 00 - 35003
I(Weight) 01
I(NoRent) 01
I(NoDrop) 00
I(Size) 00
I(Slots) 00
I(Price) 01 00 00 00 00 00 00 00
I(Icon) 7f 03 00 00 - 895 (idol)
C("0")//UNK013 01
C("0")//UNK014 00
I(BenefitFlag) 00
I(Tradeskills) 00 00 00 00
I(CR) 0a - 10
I(DR) 0a - 10
I(PR) 0a - 10
I(MR) 0a - 10
I(FR) 0a - 10
I(SVCORR) 00
I(AStr) 0f - 15
I(ASta) 0f - 15
I(AAgi) 00
I(ADex) 0a - 10
I(ACha) 00
I(AInt) 00
I(AWis) 0a - 10
I(HP) 5a 00 00 00 - 90
I(Mana) 50 00 00 00 - 80
I(Endur) 00 00 00 00 - 0
I(AC) 14 00 00 00 - 20
? 00 00 00 00
? 00 00 00 00
? 00 00 00 00
I(Classes) 04 00 00 00 - 4 (paladin only)
I(Races) ff ff 00 00
I(Deity) 00 00 00 00
I(SkillModValue) 00 00 00 00
C("0")//UNK038 00 00 00 00
I(SkillModType) ff ff ff ff
I(BaneDmgRace) 00 00 00 00
I(BaneDmgBody) 00 00 00 00
I(BaneDmgRaceAmt) 00 00 00 00
I(BaneDmgAmt) 00 00 00 00
I(Magic) 01
I(CastTime_) 00 00 00 00
I(ReqLevel) 33 00 00 00 - 51
I(RecLevel) 00 00 00 00
I(RecSkill) 00 00 00 00
I(BardType) 00 00 00 00

So, it looks like strings are separated by 0s and the rest is just defined sizes.

Note: If you scroll up and down on the code box with the green hex code in it above, it looks kinda like the Matrix screen, LOL :D

Derision 01-12-2009 11:04 AM

My guess is that in those packets, the inventory slot is 8 bytes into the struct.

The first item:

Code:


01 00 00 00 00 00 00 00 00 00 00 00

Would be slot 0, charm slot.

Second item:

Code:

01 00 00 00 00 00 00 00 d0 07 00 00
The least significant byte is to the left, so this is 0x000007d0 which is 2000, which is the first bank slot. You'd have to know which slots those items were actually in on the character to confirm.

This ties in with the field order in the Serialized item data in Titanium. If you look in common/patches/Titanium.cpp at SerializeItem, the third field is the slot_id or merchant_slot.

trevius 01-13-2009 02:15 AM

Since strings seem to be separated by a single 0 bit, those should be easy to change over to the new format of removing the pipes | from the serialization. But, for chars and ints, I need to find a way that I can define a certain number of bits to use. It seems like most of them are set to work like int8, int16, int32 or so using 1, 2, 4 or so hex bits for each field. So, I need the serialization to be able to figure out how many bits to send for each field.

For example; If I want to send the Item ID, the example I gave in the last post would be to send "bb 88 00 00". That would be item ID 35003, but it is important to send the last to 0 bits there to make sure the item structure aligns properly. Maybe I could make an actual structure in the structs file to do it, but I don't really know how to pull database fields for structures.

From looking at the anniversary_itemfields.h "TRY NEW" section, it looks like they tried to assign lengths to each field. But I can't figure out how the serialization would work for that. Here is an excerpt from the file:

Code:

#ifdef NEW_TRY
/* 000 */        //I(ItemClass) Leave this one off on purpose
/* 001 */        S(Name)
/* 002 */        S(Lore)
/* 003 */        MISSINGCS("")        //LoreFile? missing from binary
/* 003 */        S(IDFile)
/* 004 */        I4(ID)
/* 005 */        I1(Weight)
/* 006 */        I1(NoRent)
/* 007 */        I2(NoDrop)
/* 008 */        I4(Size)
/* 009 */        I1(Slots)
/* 010 */        I4(Price)
/* 011 */        I4(Icon)
/* 013 */        C4(0)
/* 014 */        C1(0)
/* 014 */        I1(BenefitFlag)
/* 015 */        I1(Tradeskills)
/* 016 */        I1(CR)
/* 017 */        I1(DR)
/* 018 */        I1(PR)
/* 019 */        I1(MR)
/* 020 */        I1(FR)

I replaced that section on my test server a while back and had almost forgotten about it. I didn't understand what the numbers next to the defines were, but it makes sense now, lol. I guess the serialization was changed back when Anniversary actually came out or before it.

Any suggestions on how to change the SerializeItem below to work with the "TRY NEW" itemfields the way it needs to for clients later than Titanium? I don't think it would require much of a change, but I just don't know how to set it to know that "I4" means to use 4 bit even if only 1 of them gets filled with data.

Code:

char *SerializeItem(const ItemInst *inst, sint16 slot_id, uint32 *length, uint8 depth) {
        char *serialization = NULL;
        char *instance = NULL;
        const char *protection=(const char *)"\\\\\\\\\\";
        char *sub_items[10] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL };
        bool stackable=inst->IsStackable();
        uint32 merchant_slot=inst->GetMerchantSlot();
        sint16 charges=inst->GetCharges();
        const Item_Struct *item=inst->GetItem();
        int i;
        uint32 sub_length;

        //not sure how these truely shifted, as this dosent seem right.
        MakeAnyLenString(&instance,
                "%i|%i|%i|%i|%i|%i|%i|%i|%i|%i|%i|%i|%i|",
                stackable ? charges : 0,
                0,
                (merchant_slot==0) ? slot_id : merchant_slot,
                inst->GetPrice(),
                (merchant_slot==0) ? 1 : inst->GetMerchantCount(),
                0,
                merchant_slot + item->ID,        //instance ID, bullshit for now
                inst->IsInstNoDrop() ? 1 : 0,                //not sure where this field is
                (stackable ? ((inst->GetItem()->ItemType == ItemTypePotion) ? 1 : 0) : charges),
                0,
                0,
                0,
                0
        );

        for(i=0;i<10;i++) {
                ItemInst *sub=inst->GetItem(i);
                if (sub) {
                        sub_items[i]=SerializeItem(sub,0,&sub_length,depth+1);
                }
        }

       
        *length=MakeAnyLenString(&serialization,
                "%.*s%s"        // For leading quotes (and protection) if a subitem;
                "%s"                // Instance data
                "%.*s\""        // Quotes (and protection, if needed) around static data
                "%i"                // item->ItemClass so we can do |%s instead of %s|
#define I(field) "|%i"
#define C(field) "|%s"
#define S(field) "|%s"
#define F(field) "|%f"
#include "Anniversary_itemfields.h"
                "%.*s\""        // Quotes (and protection, if needed) around static data
                "|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s"        // Sub items
                "%.*s%s"        // For trailing quotes (and protection) if a subitem;
                ,depth ? depth-1 : 0,protection,(depth) ? "\"" : ""
                ,instance
                ,depth,protection
                ,item->ItemClass
#define I(field) ,item->field
#define C(field) ,field
#define S(field) ,item->field
#define F(field) ,item->field
#include "Anniversary_itemfields.h"
                ,depth,protection
                ,sub_items[0] ? sub_items[0] : ""
                ,sub_items[1] ? sub_items[1] : ""
                ,sub_items[2] ? sub_items[2] : ""
                ,sub_items[3] ? sub_items[3] : ""
                ,sub_items[4] ? sub_items[4] : ""
                ,sub_items[5] ? sub_items[5] : ""
                ,sub_items[6] ? sub_items[6] : ""
                ,sub_items[7] ? sub_items[7] : ""
                ,sub_items[8] ? sub_items[8] : ""
                ,sub_items[9] ? sub_items[9] : ""
                ,(depth) ? depth-1 : 0,protection,(depth) ? "\"" : ""
        );

        for(i=0;i<10;i++) {
                if (sub_items[i])
                        safe_delete_array(sub_items[i]);
        }

        safe_delete_array(instance);

printf("ITEM: \n%s\n", serialization);
       
        return serialization;
}

} //end namespace Anniversary


trevius 01-13-2009 09:21 AM

Well, I am trying to work out how to make the serialization match up with how it works now for Live (and apparently since Anniversary or so), but I can't seem to get it to send the integers followed by null (00 in hex) bits.

I copied the function (GetNextItemInstSerialNumber()) to make Item Instanced Serial Numbers similar to how live does it to use in the Item Instancing part of the Serialization. That part seems to be working properly and I will definitely keep that in the final Serialization code. It may not really be required, but it doesn't hurt to copy the way Live does it as close as possible.

I then tried making the changes noted in green below, to force it to send the integers as int32, hoping that it would send them each as 4 bits. It still seems to just be sending the integers, without the 00s after them as it needs to be doing.

Code:

sint32 NextItemInstSerialNumber = 1;
int32 MaxInstances = 2000000000;

static inline sint32 GetNextItemInstSerialNumber() {

        if(NextItemInstSerialNumber >= MaxInstances)
                NextItemInstSerialNumber = 1;
        else
                NextItemInstSerialNumber++;

        return NextItemInstSerialNumber;
}


char *SerializeItem(const ItemInst *inst, sint16 slot_id, uint32 *length, uint8 depth) {
        char *serialization = NULL;
        char *instance = NULL;
        const char *protection=(const char *)"\\\\\\\\\\";
        char *sub_items[10] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL };
        bool stackable=inst->IsStackable();
        uint32 merchant_slot=inst->GetMerchantSlot();
        sint16 charges=inst->GetCharges();
        const Item_Struct *item=inst->GetItem();
        int i;
        uint32 sub_length;
        uint32 stack = stackable ? charges : 1;
        uint32 zero = 0;
        uint32 price = inst->GetPrice();
        uint32 slot = (merchant_slot==0) ? slot_id : merchant_slot;
        uint32 merchcount = (merchant_slot==0) ? 1 : inst->GetMerchantCount();
        uint32 serialnumber = GetNextItemInstSerialNumber();
        uint32 instnodrop = inst->IsInstNoDrop() ? 1 : 0;
        uint32 typepotion = (stackable ? ((inst->GetItem()->ItemType == ItemTypePotion) ? 1 : 0) : charges);


  MakeAnyLenString(&instance,
      "%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i",
      stack,
      zero,
      price,
          slot,
      merchcount,
      zero,
      serialnumber,
      instnodrop,
      typepotion,
      zero,
      zero,
      zero,
      zero,
      zero,
      zero


  );

I also found the item_struct.h file which I hadn't seen before and it helped me understand how the serialization is working a little better. Basically, the item_struct is just handled in it's own separate file for some reason instead of being included in the eq_packet_structs.h file. So, if I understand correctly, it seems that the patch_itemfields.h files are just separate files to do basically the same thing as the encodes in the patch.cpp files.

I even noticed that the item_struct already has sizes defined for each field like int8, int32 etc just like normal structs. So, I think that I could just use that struct, and edit the field sizes where needed and add them to the anniversary_structs.h file and then do an encode of them like normal. But, I will still need to figure out how to make it send the structure as the size that it is supposed to be. The structure will vary in length slightly, because a couple fields are strings and don't have a set size limit on them. But, other than that, the rest should always be the same size.

trevius 01-21-2009 03:56 AM

O..M..G! I finally got in game! @#$@% WOOT!

Turns out the whole time, the thing that was stopping me was sending the incorrect structure for AA tables. I simply commented out the opcodes for AA stuff in the .conf file and got in game first try! Of course, nothing really works yet, but now that I am at this point, I think things will start progressing very quickly!!! As soon as I can iron a few things out, I will get this stuff on the SVN ASAP. I will try to add new files for it so I don't just overwrite the current anniversary files. I just need to figure out how to create new patch files and I will get them up. I will knock out a few more opcodes and clean up packet structures more too though, so it is less messy than what I currently have for it.

I am VERY excited!!! I have been stuck at the same point for over a month now! I will have more updates here shortly! Things are looking bright :D

Code:

[Wed Jan 21 02:14:36 2009]00420:DoMainLoop: just before first while(!EverQuest.ReceievedWorldObjects).
[Wed Jan 21 02:14:36 2009]00421:Zone Connect -- Received MSG_SND_WOBJECTS_RESPONSE
[Wed Jan 21 02:14:36 2009]00422:DoMainLoop: complete after first while(!EverQuest.ReceievedWorldObjects).
[Wed Jan 21 02:14:36 2009]00423:DoMainLoop: just before second while(!ReadyEnterWorld).
[Wed Jan 21 02:14:36 2009]00424:Zone Connect -- Sending out a MSG_READY_ENTER_WORLD.
[Wed Jan 21 02:14:36 2009]00425:Zone Connect -- Received MSG_READY_ENTER_WORLD
[Wed Jan 21 02:14:36 2009]00426:DoMainLoop: completed second while(!ReadyEnterWorld).
[Wed Jan 21 02:14:36 2009]00427:Setting up models.
[Wed Jan 21 02:14:36 2009]00428:Setting up character.
[Wed Jan 21 02:14:36 2009]00429:Activating music.
[Wed Jan 21 02:14:36 2009]00430:Initialization complete.
Entering main loop.
[Wed Jan 21 02:14:36 2009]00431:Item done, MSG_WEATHER_EVENT received.


Derision 01-21-2009 05:38 AM

Excellent work Trevius!

(I know you don't want your thread cluttered up, so feel free to delete this post :) ).

trevius 01-21-2009 06:02 AM

LOL, Thanks Derision! No worries about the clutter. After all of the hours it took to get past that part, I am glad to see a reply :)

I am still working on figuring out some of the unknown opcodes I am getting from the client atm. I may be able to have something up tomorrow night.

Secrets 01-21-2009 07:23 AM

Quote:

Originally Posted by trevius (Post 163189)
LOL, Thanks Derision! No worries about the clutter. After all of the hours it took to get past that part, I am glad to see a reply :)

I am still working on figuring out some of the unknown opcodes I am getting from the client atm. I may be able to have something up tomorrow night.

I forgot we had message boards. I admit it.

you are a god, keep it up. If I was any good with graphic design i'd photoshop your avatar onto Jesus.

k, maybe not THAT far.

but good job!

greldor 01-21-2009 11:16 AM

WAY TO GO!

Well done Trev, that is so exciting!

Sakrateri 01-21-2009 12:58 PM

All I can think of is this.....


"I think and think for months and years. Ninety-nine times, the conclusion is false. The hundredth time I am right. "
~ Albert Einstein



Way to go and a big round of applause 8-)


All times are GMT -4. The time now is 10:08 AM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.