String Exporter
#15


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 ?



Messages In This Thread
[No subject] - by nicolasg - 03-27-2022, 01:01 AM
[No subject] - by Tommy - 03-27-2022, 01:12 AM
[No subject] - by nicolasg - 03-27-2022, 01:27 AM
[No subject] - by dethunter12 - 03-27-2022, 10:09 PM
[No subject] - by kravens - 03-28-2022, 03:02 PM
[No subject] - by nicolasg - 03-29-2022, 02:50 AM
[No subject] - by Scura - 04-06-2022, 09:15 AM
[No subject] - by nicolasg - 04-06-2022, 03:10 PM
[No subject] - by Scura - 04-23-2022, 06:24 PM
[No subject] - by nicolasg - 04-23-2022, 06:48 PM
[No subject] - by Veni - 04-23-2022, 07:50 PM
[No subject] - by nicolasg - 04-23-2022, 09:30 PM
[No subject] - by Scura - 04-24-2022, 04:00 PM
[No subject] - by nicolasg - 04-24-2022, 05:07 PM
[No subject] - by Scura - 04-24-2022, 06:24 PM
[No subject] - by kravens - 04-26-2022, 01:12 AM
[No subject] - by Sutz - 12-19-2023, 09:31 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)