Page 1 of 1

Bug 25: Crafting class is Unknown in /who

Posted: Sun Nov 16, 2014 3:19 pm
by BugTracker
Bug ID       : 25 - Crafting class is Unknown in /who 
Bug Date     : 2014/10/23 06:25:01
Assigned To  : John Adams
Priority     : Medium

Category     : VGClient
Sub-Category : Gameplay: Crafting
Severity     : Minor (e.g. Cosmetic)
Reproducible : Every time
Details:
In /who, players crafting class is Unknown -- add the proper values to the database (?) or defaults so the generic class shows up properly.
Originated From World: New Telon (1)
Chunk                : Tursh Village (144)
Location             : 56493 -32334 34580

Re: Bug 25: Crafting class is Unknown in /who

Posted: Sun Nov 16, 2014 3:27 pm
by Volt
John you just posted about this in the 0.2 priorities thread. But trying out this new nifty function to make a forum post instead.

Actually John it is you who need to change in the db schema. New characters shall have a crafting class of 255 (and not 1050 like it is now).
Btw, new characters shall not be assigned to Artificers, but to 255 = none or unknown.

Re: Bug 25: Crafting class is Unknown in /who

Posted: Sun Nov 16, 2014 3:41 pm
by John Adams
Dev Notes:
[quote]Entered on Nov 14, 2014 10:11 by Volt
Crafting class is not yet implemented, i.e. I can not fix this until we start implement the crafting system.

Entered on Nov 14, 2014 16:11 by Volt
I take that back. I found a screenshot proving that if a character does not have a crafting class, it shall not be shown at all in the /who result. I will fix this.

Entered on Nov 15, 2014 04:11 by Volt
Analyzed and the conclusion is that players crafting class showing as Unknown in /who is a symptom. The root cause is that there is now a db column 'characters'.'crafting_class' and this gets the value 1050 (decimal) at or around character creation. This is not good. The value must be 255 (decimal) / 0xff (hex). I can not see even how this happens. Re-assigning to John to determine who to fix this.[/quote]
To reply, In the `characters` table, the default value was set to '1050' so this is why everyone received Unknown for crafting classes. Are you saying these below values are incorrect? I cannot for the life of me remember where I got these values, but I certainly would not have made them up myself so they came from somewhere.
1000 => "Blacksmith"
1002 => "Artificer"
1004 => "Outfitter"
1050 => "Crafter"
Where did you come up with 255 (0xff)? And what then are the valid crafting classes? I will adjust my portal code.

Re: Bug 25: Crafting class is Unknown in /who

Posted: Thu Nov 20, 2014 5:58 pm
by Ratief
0=>blacksmith
1=>alchemist (though I can't get the client to accept the attributes, I Really wanted to be able to add this class someday)
2=>artificer
3=>gemworker (not all attributes even exist)
4=>outfitter
255=>crafter
the rest seem to map to 'Unknown'

and yes I have this working on my server (and i''m defaulting everyone to smiths for now)

BTW, the crafting class should be 1 byte (uint8_t) or tinyint in SQL. The code currently has it as uint32_t.

Re: Bug 25: Crafting class is Unknown in /who

Posted: Sat Nov 22, 2014 8:35 am
by Volt
[quote="John Adams"]To reply, In the `characters` table, the default value was set to '1050' so this is why everyone received Unknown for crafting classes. Are you saying these below values are incorrect? I cannot for the life of me remember where I got these values, but I certainly would not have made them up myself so they came from somewhere.
1000 => "Blacksmith"
1002 => "Artificer"
1004 => "Outfitter"
1050 => "Crafter"
Where did you come up with 255 (0xff)? And what then are the valid crafting classes? I will adjust my portal code.[/quote]
I just spent some time diving through logs, and while it makes all the sense that you didn't make up those values I still have no clue where you got them from. I would think there is something clever to this, but I also can't figure what.

I got 0xff from logs (OP_WhoList.crafting_class and OP_ServerCharacterUpdate.crafting_class_2).

What I found in the logs is pretty much what Ratief already wrote, but since I did the work I will expand it a bit here:

From player perspective your character can have any of 10 crafting "classes" (this is not exactly class thus the quotation marks but I didn't find a better term):
  • Not a crafter (this is what the characters are born into)[/*:m:1ue6bc7d]
  • crafting_class Blacksmith without any specialization[/*:m:1ue6bc7d]
  • crafting_class Blacksmith with specialization Armorsmith[/*:m:1ue6bc7d]
  • crafting_class Blacksmith with specialization Weaponsmith[/*:m:1ue6bc7d]
  • crafting_class Artificer without any specialization[/*:m:1ue6bc7d]
  • crafting_class Artificer with specialization Mineralogist[/*:m:1ue6bc7d]
  • crafting_class Artificer with specialization Woodworker[/*:m:1ue6bc7d]
  • crafting_class Outfitter without any specialization[/*:m:1ue6bc7d]
  • crafting_class Outfitter with specialization Leatherworker[/*:m:1ue6bc7d]
  • crafting_class Outfitter with specialization Tailor[/*:m:1ue6bc7d][/list:u]
    What we are talking about in this thread is primarily sending info about the crafting class and we don't need to care about the specialization, but I thought I'd mention it because we will eventually need to store info about that as well in the db.

    Both OP_WhoList.crafting_class and OP_ServerCharacterUpdate.crafting_class_2 use this coding:
    0x00 Blacksmith
    0x02 Artificer
    0x04 Outfitter
    0xff Not a crafter (note the small but yet big difference from Crafter)
    So it would make all the sense to use this same coding in the db and for the WorldCharacter attribute.
    The WhoList use uint32 for the value while OP_ServerCharacterUpdate use uint8, but the db representation won't matter for this.

    Xinux: The OP_ServerCharacterUpdate.crafting_class seems to always be 8, while OP_ServerCharacterUpdate.crafting_class_2 is holding the actual crafting_class. Can we please rename them (to unknownX and crafting_class)? (I will send Xinux a PM to direct him here since this is kind of hidden to him.)

Re: Bug 25: Crafting class is Unknown in /who

Posted: Sat Nov 22, 2014 8:45 am
by John Adams
Volt, thank you for the write up. I wish I remembered where 1002, 1004, 1006 and 1050 came from I feel embarassed that I do not heh. But the default crafting_class ID in `characters` is now 255, and the field has been turned into an unsigned tinyint(3) in the latest vgo_world.sql. I think this will solve that problem.