Changeset 21
- Timestamp:
- 09/20/2009 08:50:14 PM (1 year ago)
- Files:
-
- trunk/sql/world_updates/2009_09_20_localizations.sql (added)
- trunk/src/hearthstone-world/ItemHandler.cpp (modified) (3 diffs)
- trunk/src/hearthstone-world/Makefile.am (modified) (1 diff)
- trunk/src/hearthstone-world/NPCHandler.cpp (modified) (3 diffs)
- trunk/src/hearthstone-world/QueryHandler.cpp (modified) (4 diffs)
- trunk/src/hearthstone-world/Quest.cpp (modified) (3 diffs)
- trunk/src/hearthstone-world/QuestMgr.cpp (modified) (8 diffs)
- trunk/src/hearthstone-world/StdAfx.h (modified) (1 diff)
- trunk/src/hearthstone-world/World.cpp (modified) (2 diffs)
- trunk/src/hearthstone-world/WorldSocket.cpp (modified) (1 diff)
- trunk/win/VC90/hearthstone-world.vcproj (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/hearthstone-world/ItemHandler.cpp
r19 r21 745 745 uint8 databuffer[50000]; 746 746 StackPacket data(SMSG_ITEM_QUERY_SINGLE_RESPONSE, databuffer, 50000); 747 748 LocalizedItem * li = (language>0) ? sLocalizationMgr.GetLocalizedItem(itemid, language) : NULL;749 747 750 748 data << itemProto->ItemId; … … 752 750 data << itemProto->SubClass; 753 751 data << itemProto->unknown_bc; 754 if(li) 755 data << li->Name; 756 else 757 data << itemProto->Name1; 752 data << itemProto->Name1; 758 753 759 754 data << uint8(0) << uint8(0) << uint8(0); // name 2,3,4 … … 812 807 } 813 808 data << itemProto->Bonding; 814 if(li) 815 data << li->Description; 816 else 817 data << itemProto->Description; 809 data << itemProto->Description; 818 810 819 811 data << itemProto->PageId; trunk/src/hearthstone-world/Makefile.am
r1 r21 94 94 LootMgr.cpp \ 95 95 LootMgr.h \ 96 LocalizationMgr.cpp \97 LocalizationMgr.h \98 96 LogonCommClient.cpp \ 99 97 LogonCommHandler.h \ trunk/src/hearthstone-world/NPCHandler.cpp
r19 r21 470 470 } 471 471 472 LocalizedQuest * lq = (language>0) ? sLocalizationMgr.GetLocalizedQuest((*it)->qst->id,language):NULL; 473 if(lq) 474 data << lq->Title; 475 else 476 data << (*it)->qst->title; 472 data << (*it)->qst->title; 477 473 } 478 474 } … … 598 594 599 595 pGossip = NpcTextStorage.LookupEntry(textID); 600 LocalizedNpcText * lnc = (language>0) ? sLocalizationMgr.GetLocalizedNpcText(textID,language) : NULL;601 596 602 597 data << textID; … … 607 602 { 608 603 data << pGossip->Texts[i].Prob; // prob 609 if(lnc) 610 { 611 data << lnc->Texts[i][0]; 612 data << lnc->Texts[i][1]; 613 } 614 else 615 { 616 data << pGossip->Texts[i].Text[0]; 617 data << pGossip->Texts[i].Text[1]; 618 } 604 data << pGossip->Texts[i].Text[0]; 605 data << pGossip->Texts[i].Text[1]; 619 606 620 607 data << pGossip->Texts[i].Lang; trunk/src/hearthstone-world/QueryHandler.cpp
r19 r21 94 94 return; 95 95 96 LocalizedCreatureName * lcn = (language>0) ? sLocalizationMgr.GetLocalizedCreatureName(entry, language) : NULL; 97 98 if(lcn == NULL) 99 { 100 OUT_DEBUG("WORLD: CMSG_CREATURE_QUERY '%s'", ci->Name); 101 data << (uint32)entry; 102 data << ci->Name; 103 data << uint8(0) << uint8(0) << uint8(0); 104 data << ci->SubName; 105 } 106 else 107 { 108 OUT_DEBUG("WORLD: CMSG_CREATURE_QUERY '%s' (localized to %s)", ci->Name, lcn->Name); 109 data << (uint32)entry; 110 data << lcn->Name; 111 data << uint8(0) << uint8(0) << uint8(0); 112 data << lcn->SubName; 113 } 96 OUT_DEBUG("WORLD: CMSG_CREATURE_QUERY '%s'", ci->Name); 97 data << (uint32)entry; 98 data << ci->Name; 99 data << uint8(0) << uint8(0) << uint8(0); 100 data << ci->SubName; 114 101 data << ci->info_str; //!!! this is a string in 2.3.0 Example: stormwind guard has : "Direction" 115 102 data << ci->Flags1; … … 162 149 return; 163 150 164 LocalizedGameObjectName * lgn = (language>0) ? sLocalizationMgr.GetLocalizedGameObjectName(entryID, language) : NULL;165 166 151 data << entryID; 167 152 data << goinfo->Type; 168 153 data << goinfo->DisplayID; 169 if(lgn) 170 data << lgn->Name; 171 else 172 data << goinfo->Name; 154 data << goinfo->Name; 173 155 174 156 data << uint8(0) << uint8(0) << uint8(0) << uint8(0) << uint8(0) << uint8(0); // new string in 1.12 … … 271 253 return; 272 254 273 LocalizedItemPage * lpi = (language>0) ? sLocalizationMgr.GetLocalizedItemPage(pageid,language):NULL;274 255 data.Clear(); 275 256 data << pageid; 276 if(lpi) 277 data.Write((uint8*)lpi->Text, strlen(lpi->Text) + 1); 278 else 279 data.Write((uint8*)page->text, strlen(page->text) + 1); 257 data.Write((uint8*)page->text, strlen(page->text) + 1); 280 258 281 259 data << page->next_page; … … 302 280 else 303 281 { 304 LocalizedItem * li = (language>0) ? sLocalizationMgr.GetLocalizedItem(itemid, language) : NULL; 305 if(li) 306 reply << li->Name; 307 else 308 reply << proto->Name1; 282 reply << proto->Name1; 309 283 } 310 284 SendPacket(&reply); trunk/src/hearthstone-world/Quest.cpp
r19 r21 29 29 30 30 WorldPacket *data = new WorldPacket(SMSG_QUEST_QUERY_RESPONSE, 2048); 31 LocalizedQuest * lci = (language>0) ? sLocalizationMgr.GetLocalizedQuest(qst->id, language) : NULL;32 31 33 32 *data << uint32(qst->id); // Quest ID … … 78 77 *data << qst->point_opt; // Unknown 79 78 80 if(lci) 81 { 82 *data << lci->Title; 83 *data << lci->Objectives; 84 *data << lci->Details; 85 *data << lci->EndText; 86 } 87 else 88 { 89 *data << qst->title; // Title / name of quest 90 *data << qst->objectives; // Objectives / description 91 *data << qst->details; // Details 92 *data << qst->endtext; // Subdescription 93 } 79 *data << qst->title; // Title / name of quest 80 *data << qst->objectives; // Objectives / description 81 *data << qst->details; // Details 82 *data << qst->endtext; // Subdescription 94 83 95 84 // (loop 4 times) … … 110 99 *data << uint32(0); // count 111 100 112 if(lci) 113 { 114 *data << lci->ObjectiveText[0]; 115 *data << lci->ObjectiveText[1]; 116 *data << lci->ObjectiveText[2]; 117 *data << lci->ObjectiveText[3]; 118 } 119 else 120 { 121 *data << qst->objectivetexts[0]; // Objective 1 - Used as text if mob not set 122 *data << qst->objectivetexts[1]; // Objective 2 - Used as text if mob not set 123 *data << qst->objectivetexts[2]; // Objective 3 - Used as text if mob not set 124 *data << qst->objectivetexts[3]; // Objective 4 - Used as text if mob not set 125 } 101 *data << qst->objectivetexts[0]; // Objective 1 - Used as text if mob not set 102 *data << qst->objectivetexts[1]; // Objective 2 - Used as text if mob not set 103 *data << qst->objectivetexts[2]; // Objective 3 - Used as text if mob not set 104 *data << qst->objectivetexts[3]; // Objective 4 - Used as text if mob not set 126 105 127 106 return data; trunk/src/hearthstone-world/QuestMgr.cpp
r19 r21 256 256 void QuestMgr::BuildOfferReward(WorldPacket *data, Quest* qst, Object* qst_giver, uint32 menutype, uint32 language, Player* plr) 257 257 { 258 LocalizedQuest * lq = (language>0) ? sLocalizationMgr.GetLocalizedQuest(qst->id,language):NULL;259 258 ItemPrototype * it; 260 259 data->SetOpcode(SMSG_QUESTGIVER_OFFER_REWARD); … … 262 261 *data << qst->id; 263 262 264 if(lq) 265 { 266 *data << lq->Title; 267 *data << lq->CompletionText; 268 } 269 else 270 { 271 *data << qst->title; 272 *data << qst->completiontext; 273 } 263 *data << qst->title; 264 *data << qst->completiontext; 274 265 275 266 //uint32 a = 0, b = 0, c = 1, d = 0, e = 1; … … 324 315 void QuestMgr::BuildQuestDetails(WorldPacket *data, Quest* qst, Object* qst_giver, uint32 menutype, uint32 language, Player* plr) 325 316 { 326 LocalizedQuest * lq = (language>0) ? sLocalizationMgr.GetLocalizedQuest(qst->id,language):NULL;327 317 std::map<uint32, uint8>::const_iterator itr; 328 318 … … 332 322 *data << uint64(0); // 3.0.2 unk 333 323 *data << qst->id; 334 if(lq) 335 { 336 *data << lq->Title; 337 *data << lq->Details; 338 *data << lq->Objectives; 339 } 340 else 341 { 342 *data << qst->title; 343 *data << qst->details; 344 *data << qst->objectives; 345 } 324 325 *data << qst->title; 326 *data << qst->details; 327 *data << qst->objectives; 346 328 347 329 *data << uint32(1); // Is Acceptable … … 403 385 void QuestMgr::BuildRequestItems(WorldPacket *data, Quest* qst, Object* qst_giver, uint32 status, uint32 language) 404 386 { 405 LocalizedQuest * lq = (language>0) ? sLocalizationMgr.GetLocalizedQuest(qst->id,language):NULL;406 387 ItemPrototype * it; 407 388 data->SetOpcode( SMSG_QUESTGIVER_REQUEST_ITEMS ); … … 410 391 *data << qst->id; 411 392 412 if(lq) 413 { 414 *data << lq->Title; 415 *data << ((lq->IncompleteText[0]) ? lq->IncompleteText : lq->Details); 416 } 417 else 418 { 419 *data << qst->title; 420 *data << (qst->incompletetext[0] ? qst->incompletetext : qst->details); 421 } 393 *data << qst->title; 394 *data << (qst->incompletetext[0] ? qst->incompletetext : qst->details); 422 395 423 396 *data << uint32(0); … … 538 511 { 539 512 tmp_map.insert(std::map<uint32,uint8>::value_type((*it)->qst->id, 1)); 540 LocalizedQuest * lq = (language>0) ? sLocalizationMgr.GetLocalizedQuest((*it)->qst->id,language):NULL;541 513 542 514 *data << (*it)->qst->id; … … 561 533 *data << status << uint32(0); 562 534 } 563 if(lq) 564 *data << lq->Title; 565 else 566 *data << (*it)->qst->title; 535 536 *data << (*it)->qst->title; 567 537 } 568 538 } trunk/src/hearthstone-world/StdAfx.h
r19 r21 162 162 #include "DayWatcherThread.h" 163 163 #include "VoiceChatHandler.h" 164 #include "LocalizationMgr.h"165 164 #include "AchievementInterface.h" 166 165 #include "ChainAggroEntity.h" trunk/src/hearthstone-world/World.cpp
r19 r21 104 104 World::~World() 105 105 { 106 Log.Notice("LocalizationMgr", "~LocalizationMgr()");107 sLocalizationMgr.Shutdown();108 109 106 Log.Notice("WorldLog", "~WorldLog()"); 110 107 delete WorldLog::getSingletonPtr(); … … 447 444 // wait for all loading to complete. 448 445 tl.wait(); 449 sLocalizationMgr.Reload(false);450 446 451 447 CommandTableStorage::getSingleton().Load(); trunk/src/hearthstone-world/WorldSocket.cpp
r1 r21 391 391 pSession->SetAccountFlags(AccountFlags); 392 392 pSession->m_lastPing = (uint32)UNIXTIME; 393 pSession->language = sLocalizationMgr.GetLanguageId(lang);393 //pSession->language = sLocalizationMgr.GetLanguageId(lang); 394 394 395 395 if(recvData.rpos() != recvData.wpos()) trunk/win/VC90/hearthstone-world.vcproj
r14 r21 1196 1196 > 1197 1197 <File 1198 RelativePath="..\..\src\hearthstone-world\LocalizationMgr.cpp"1199 >1200 </File>1201 <File1202 RelativePath="..\..\src\hearthstone-world\LocalizationMgr.h"1203 >1204 </File>1205 <File1206 1198 RelativePath="..\..\src\hearthstone-world\NameTables.h" 1207 1199 >