Merge pull request #585 from noudess/master

Use languages when reading books that are in a language other than common.
This commit is contained in:
Uleat
2017-01-27 22:48:43 -05:00
committed by GitHub
9 changed files with 59 additions and 11 deletions
+1
View File
@@ -2495,6 +2495,7 @@ struct BookRequest_Struct {
uint8 window; // where to display the text (0xFF means new window)
uint8 type; //type: 0=scroll, 1=book, 2=item info.. prolly others.
uint32 invslot; // Only used in Sof and later clients;
int16 subslot; // The subslot inside of a bag if it is inside one.
char txtfile[20];
};
+1
View File
@@ -5154,6 +5154,7 @@ namespace RoF2
IN(type);
IN(invslot);
IN(subslot);
emu->window = (uint8)eq->window;
strn0cpy(emu->txtfile, eq->txtfile, sizeof(emu->txtfile));
+2 -1
View File
@@ -2826,7 +2826,8 @@ struct BookText_Struct {
struct BookRequest_Struct {
/*0000*/ uint32 window; // where to display the text (0xFFFFFFFF means new window).
/*0004*/ uint16 invslot; // Is the slot, but the RoF2 conversion causes it to fail. Turned to 0 since it isnt required anyway.
/*0008*/ uint32 unknown006; // Seen FFFFFFFF
/*0006*/ int16 subslot; // Inventory sub-slot (0-x)
/*0008*/ uint16 unknown006; // Seen FFFF
/*0010*/ uint16 unknown008; // seen 0000
/*0012*/ uint32 type; // 0 = Scroll, 1 = Book, 2 = Item Info. Possibly others
/*0016*/ uint32 unknown0012;
+3 -2
View File
@@ -1136,13 +1136,13 @@ const EQEmu::ItemData* SharedDatabase::IterateItems(uint32* id) {
return nullptr;
}
std::string SharedDatabase::GetBook(const char *txtfile)
std::string SharedDatabase::GetBook(const char *txtfile, int16 *language)
{
char txtfile2[20];
std::string txtout;
strcpy(txtfile2, txtfile);
std::string query = StringFormat("SELECT txtfile FROM books WHERE name = '%s'", txtfile2);
std::string query = StringFormat("SELECT txtfile, language FROM books WHERE name = '%s'", txtfile2);
auto results = QueryDatabase(query);
if (!results.Success()) {
txtout.assign(" ",1);
@@ -1157,6 +1157,7 @@ std::string SharedDatabase::GetBook(const char *txtfile)
auto row = results.begin();
txtout.assign(row[0],strlen(row[0]));
*language = static_cast<int16>(atoi(row[1]));
return txtout;
}
+1 -1
View File
@@ -94,7 +94,7 @@ class SharedDatabase : public Database
bool SetStartingItems(PlayerProfile_Struct* pp, EQEmu::InventoryProfile* inv, uint32 si_race, uint32 si_class, uint32 si_deity, uint32 si_current_zone, char* si_name, int admin);
std::string GetBook(const char *txtfile);
std::string GetBook(const char *txtfile, int16 *language);
/*
Item Methods
+1 -1
View File
@@ -30,7 +30,7 @@
Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt
*/
#define CURRENT_BINARY_DATABASE_VERSION 9101
#define CURRENT_BINARY_DATABASE_VERSION 9102
#ifdef BOTS
#define CURRENT_BINARY_BOTS_DATABASE_VERSION 9008
#else