![]() |
|
String Exporter - Printable Version +- LCKB (https://lckb.dev/forum) +-- Forum: ** OLD LCKB DATABASE ** (https://lckb.dev/forum/forumdisplay.php?fid=109) +--- Forum: Release Zone (https://lckb.dev/forum/forumdisplay.php?fid=190) +---- Forum: Episode 4 Releases (https://lckb.dev/forum/forumdisplay.php?fid=156) +----- Forum: Tools (https://lckb.dev/forum/forumdisplay.php?fid=175) +----- Thread: String Exporter (/showthread.php?tid=4873) Pages:
1
2
|
- Veni - 04-23-2022 def_item.h in Client Source: struct stItem : public stTbl_base { int job; int stack; int fame; int level; __int64 flag; int wearing; int type; int subType; int needItemIndex[MAX_MAKE_ITEM_MATERIAL]; int needItemCount[MAX_MAKE_ITEM_MATERIAL]; int needSSkillIndex; int needSSkillCount; int needSSkillIndex2; int needSSkillCount2; int textureID; int textureRow; int textureCol; int num0; int num1; int num2; int num3; int price; int set0; int set1; int set2; int set3; int set4; char fileSMC[DEF_SMC_DEFAULT_LENGTH]; char efffectName[DEF_EFFECT_DEFAULT_LENGTH]; char attackEffectName[DEF_EFFECT_DEFAULT_LENGTH]; char damageEffectName[DEF_EFFECT_DEFAULT_LENGTH]; int JewelOptionType; int JewelOptionLevel; int rareOptionType[DEF_MAX_ORIGIN_OPTION]; int rareOptionLevel[DEF_MAX_ORIGIN_OPTION]; int syndicate_type; int syndicate_grade; int fortuneIndex; char castleWar; }; you'd probably have to check the length/max options on each to make it work without a problem. The client source itself has all the necessary things you need to figure it out. - nicolasg - 04-23-2022 I remember looking into the source code, but it wasn't clear to me what the problem was, I remember 2 issues, 1) I was wondering if it was a_durability or again a_index. 2) The most obvious problem I saw was that the file was not identical I'd have to do a little more research on this... edit: Now that I think about it more, maybe the problem is related to a_flag - Scura - 04-24-2022 That's my struct from my ItemAll never finished I see many differencies from your struct /index.php?/profile/14423-nicolasg/&do=hovercard" data-mentionid="14423" href="/index.php?/profile/14423-nicolasg/" rel="">@nicolasg... ? namespace ItemAll_Ep4.CS { public class Item { public int index; public int job; public int stack; public int fame; public int level; public double flag; public int wearing; public int type; public int subType; public int[] needItemIndex; public int[] needItemCount; public int needSSkillIndex; public int needSSkillCount; public int needSSkillIndex2; public int needSSkillCount2; public int textureID; public int textureRow; public int textureCol; public int num0; public int num1; public int num2; public int num3; public int price; public int set0; public int set1; public int set2; public int set3; public int set4; public string fileSMC; public string efffectName; public string attackEffectName; public string damageEffectName; public int JewelOptionType; public int JewelOptionLevel; public int[] rareOptionType; public int[] rareOptionLevel; public int syndicate_type; public int syndicate_grade; public int fortuneIndex; public string castleWar; } public class Stringhe : Item { public string name; public string descrition; } } - nicolasg - 04-24-2022 51 minutes ago, Scura said: That's my struct from my ItemAll never finished I see many differencies from your struct /index.php?/profile/14423-nicolasg/&do=hovercard" data-mentionid="14423" href="/index.php?/profile/14423-nicolasg/" rel="">@nicolasg... ? namespace ItemAll_Ep4.CS { public class Item { public int index; public int job; public int stack; public int fame; public int level; public double flag; public int wearing; public int type; public int subType; public int[] needItemIndex; public int[] needItemCount; public int needSSkillIndex; public int needSSkillCount; public int needSSkillIndex2; public int needSSkillCount2; public int textureID; public int textureRow; public int textureCol; public int num0; public int num1; public int num2; public int num3; public int price; public int set0; public int set1; public int set2; public int set3; public int set4; public string fileSMC; public string efffectName; public string attackEffectName; public string damageEffectName; public int JewelOptionType; public int JewelOptionLevel; public int[] rareOptionType; public int[] rareOptionLevel; public int syndicate_type; public int syndicate_grade; public int fortuneIndex; public string castleWar; } public class Stringhe : Item { public string name; public string descrition; } } I have 2 doubts... 1) The damona code changes the order, writes the value of a_castle_war first and then the fortuneIndex (I understand that this is a bug in your code). 2) I also see that it makes a strange loop, unnecessary in my understanding of c#, since it would be easier to take the value of a_index and write it directly, right? Attached reference code: int ordinal75 = mySqlDataReader1.GetOrdinal("a_castle_war"); string str6 = mySqlDataReader1.GetString(ordinal75); binaryWriter.Write(Convert.ToByte(str6)); string str7 = "SELECT * FROM t_fortune_data WHERE a_item_idx = " + s1 + " ORDER BY a_skill_index, a_skill_level"; MySqlConnection mySqlConnection2 = new MySqlConnection(connectionString); MySqlCommand command2 = mySqlConnection2.CreateCommand(); command2.CommandText = str7; mySqlConnection2.Open(); MySqlDataReader mySqlDataReader2 = command2.ExecuteReader(); while (mySqlDataReader2.Read()) { int ordinal76 = mySqlDataReader2.GetOrdinal("a_item_idx"); string s71 = mySqlDataReader2.GetString(ordinal76); binaryWriter.Write(int.Parse(s71)); } I also see that both in the game source code and in your code castleWar was define as char, when in the database it is tinyint and in the Damona code it is also treated as an int, I don't know if it is irrelevant or not... - Scura - 04-24-2022 1 hour ago, nicolasg said: I have 2 doubts... 1) The damona code changes the order, writes the value of a_castle_war first and then the fortuneIndex (I understand that this is a bug in your code). 2) I also see that it makes a strange loop, unnecessary in my understanding of c#, since it would be easier to take the value of a_index and write it directly, right? Attached reference code: int ordinal75 = mySqlDataReader1.GetOrdinal("a_castle_war"); string str6 = mySqlDataReader1.GetString(ordinal75); binaryWriter.Write(Convert.ToByte(str6)); string str7 = "SELECT * FROM t_fortune_data WHERE a_item_idx = " + s1 + " ORDER BY a_skill_index, a_skill_level"; MySqlConnection mySqlConnection2 = new MySqlConnection(connectionString); MySqlCommand command2 = mySqlConnection2.CreateCommand(); command2.CommandText = str7; mySqlConnection2.Open(); MySqlDataReader mySqlDataReader2 = command2.ExecuteReader(); while (mySqlDataReader2.Read()) { int ordinal76 = mySqlDataReader2.GetOrdinal("a_item_idx"); string s71 = mySqlDataReader2.GetString(ordinal76); binaryWriter.Write(int.Parse(s71)); } I also see that both in the game source code and in your code castleWar was define as char, when in the database it is tinyint and in the Damona code it is also treated as an int, I don't know if it is irrelevant or not... Quote 1) The damona code changes the order, writes the value of a_castle_war first and then the fortuneIndex (I understand that this is a bug in your code). This is the deserialize function to deserialize the .lod file. I can assure you it work in that order (check "def_item.h") Quote 2) I also see that it makes a strange loop, unnecessary in my understanding of c#, since it would be easier to take the value of a_index and write it directly, right? Attached reference code: Didn't get the point...? Quote I also see that both in the game source code and in your code castleWar was define as char, when in the database it is tinyint and in the Damona code it is also treated as an int, I don't know if it is irrelevant or not... It's an implicit cast! Check the struct into "def_item.h", /index.php?/profile/20534-veni/&do=hovercard" data-mentionid="20534" href="/index.php?/profile/20534-veni/" rel="">@Veni posted it, is coded as char not as int ? - kravens - 04-26-2022 very hard to find your error without enough information. but i saw a mistake Stream:write(IntToBytes(tonumber(Row.a_durability))); // this should be fortuneidx Stream:write(IntToBytes(tonumber(Row.a_castle_war))); also make sure castlewar is define as byte and itemflag as long and not double, they are different things. - Sutz - 12-19-2023 Mirror: 2 |