Originally Posted by
nhjelle
I'm really glad to see that preschool is offering programming classes these days. It's a good idea to start the next generation off with a valuable curriculum.
However, please do not try to explain client-server session exchanges simply on the basis of variable assignment/population. It would be an absolutely horrid practice to send a "string", as you called it, of every drop available to the client. It would be even worse to determine item drops when spawning monsters. Talk about wasted bandwidth... If they did this, it would be a strenuous data transfer operation for monsters that might not even be killed.
Instead, think about this. Client sends request to server when the player enters new game world. Server runs algorithm to create an array of monsters. The types are determined by a look-up table for that specific world ID. Server sends an array to client containing monster ID, levelarea ID, and point object (X, Y, Z coordinates).
The client creates a monster at the location for each index of the array.
When a monster is killed, the client sends a request to the server mentioning a unique identifier. Server responds with an array of items that drop.
There is a multitude of possibilities for how the server determines item drops. From what we've seen with leaked drop tables, chances are it's probably fairly simple.
The server first determines item quality based on the odds for each quality. There are 6 options when it comes to armor: weak (gray), normal, superior, magic, rare, and legendary.
Next, the server determines what type of item it is based on the available types for the quality (there are no weak follower tokens for example). There aren't that many options here either.
For most items it'll simply be a generic item and this step can be skipped. If it's a legendary, there's a small table of legendaries for the item slot. We've already seen the rates for this part...
Finally, the server determines stats of the item. This process is similar to the above.
The server sends the client an item object. For example, it could contain [4,34,18,520,53,544].
This could mean it is a magic item which is a scoundrel token. It has 520 dexterity and 544 vitality. The item name might be determined by the client based on stats, or another value might be attached such as 8D,3C. This could be a prefix ID and a suffix ID in hex.
The client uses this item object to generate an in-game item.
In addition to all of what I've explained, it's possible that drops are pre-determined on the server to add some slack. These would be SPECIFIC to each character. If you're playing on your Barbarian, the server might have already determined what the next magic, rare, and legendary item will be. Next time you kill something, the client sends a request to the server. The server rolls to determine item quality based on that monster's drops (unique elites drop 1 rare). If it is a unique, the server simply sends the cached rare drop to the client. It's still completely randomized, it was simply determined before you killed the monster, but this is entirely server-side... When you log off, the cached items are likely garbage collected.
Can you exploit a system like this? Sure, but you'll have to find your way into one of Blizzard's server farms and somehow gain access to a machine.
Will it help to log off and reset item cache? No. The server doesn't determine if a legendary will drop until the monster dies, but it might determine what that legendary will be IF one does drop, and there's no way to know which legendary this will be.