Index: packet_system.cpp =================================================================== --- packet_system.cpp (revision 2015) +++ packet_system.cpp (working copy) @@ -124,11 +124,11 @@ uint8 PacketSize[512]; void (*PacketParser[512])(map_session_data_t*, CCharEntity*, int8*); -/************************************************************************ -* * -* Отображения содержимого входящего пакета в консоли * -* * -************************************************************************/ +/************************************************* *********************** +** +* Display the contents of the incoming packet to the console * +** +************************************************** **********************/ void PrintPacket(int8* data) { @@ -154,7 +154,7 @@ /************************************************************************ * * -* Неизвестный пакет * +* Unknown packet * * * ************************************************************************/ @@ -166,7 +166,7 @@ /************************************************************************ * * -* Нереализованный пакет * +* Missed the package * * * ************************************************************************/ @@ -178,11 +178,11 @@ /************************************************************************ * * -* Вход в зону * +* Log into the zone * +** +* Update sessionkey and client port at each transition between zones * +* We need to keep the correct key when moving from server to server * * * -* Обновляем sessionkey и порт клиента при каждом переходе между зонами * -* Мы должны оставлять правильный ключ при переходе с сервера на сервер * -* * ************************************************************************/ void SmallPacket0x00A(map_session_data_t* session, CCharEntity* PChar, int8* data) @@ -269,8 +269,8 @@ /************************************************************************ * * -* Пакет-запрос информации о персонаже. Приходит только во время * -* перехода между зонами / входа в игру (что почти одно и то же) * +* Package request for information about a character. Comes just in time * +* Transition between zones / enter the game (which is almost the same) * * * ************************************************************************/ @@ -298,10 +298,10 @@ /************************************************************************ * * -* Персонаж покидает зону каким-либо из возможных способов. В случае * -* выхода из игры, текущая зона находится в переменной zone, во всех * -* остальных случаех в prevzone. Делаем соответствующую проверку для * -* правильного удаления персонажа их списка зоны. * +* Characters move outside any way possible. In the case of * +* Out of the game, the current zone is in your zone, in all * +* Rest in such as eh prevzone. Making the appropriate test for * +* Proper disposal of the character of the list area. * * * ************************************************************************/ @@ -361,17 +361,17 @@ } if (PChar->PLinkshell != NULL) { - // удаляем персонажа из linkshell + // Remove the character from the linkshell PChar->PLinkshell->DelMember(PChar); } CTaskMgr::getInstance()->AddTask(new CTaskMgr::CTask("close_session", gettick()+2500, session, CTaskMgr::TASK_ONCE, map_close_session)); } - else // проверка именно при покидании зоны, чтобы не делать двойную проверку при входе в игру + else // check it when leaving the area to do a double check at the entrance to the game { charutils::CheckEquipLogic(PChar, SCRIPT_CHANGEZONE, PChar->getZone()); } - // персонаж может отвалиться во время перехода между зонами, - // map_cleanup вызовет этот метод и zone персонажа будет NULL + //Character can fall off during the transition between zones + //Map_cleanup calls this method and the zone will be NULL character if (PChar->loc.zone != NULL) { PChar->loc.zone->DecreaseZoneCounter(PChar); @@ -383,7 +383,7 @@ /************************************************************************ * * -* Запрос на список квестов и миссий, предметов и ключевых предметов * +* Request a list of quests and missions, items and key items * * * ************************************************************************/ @@ -405,9 +405,9 @@ /************************************************************************ * * -* Первый пакет после входа в игру / перехода между зонами, является * -* подтверждением завершения перехода персонажа. * -* Привязываем экипированные предметы * +* The first packet after entering the game / transition between zones is * +* Confirmation of completion of the transition of the character. * +* Bind the items equipped, * * * * ************************************************************************/ @@ -429,10 +429,10 @@ /************************************************************************ * * -* Перемещение персонажа (обновление позиции в зоне) * -* Обновление цели, выбранной персонажем, для правильного отображения * -* поворота головы. Из-за блуждания монстров необходимо проверять их * -* видимость постоянно, так же как и видимость питомцев * +* Move your character (updated position in the area) * +* Update, in choosing a character to display correctly * +* Head turn. Because of the wandering monsters need to check them * +* Visibility constantly, as well as the appearance of pets * * * ************************************************************************/ @@ -480,7 +480,7 @@ /************************************************************************ * * -* Клиент запрашивает информацию об NPC, для отображения их в событиях * +* The client requests information about NPC, to display them in events * * * ************************************************************************/ @@ -506,7 +506,7 @@ /************************************************************************ * * -* Kлиент сообщает серверу об ошибочном типе npc * +* Clients tells the server to the wrong type of npc * * * ************************************************************************/ @@ -522,8 +522,8 @@ /************************************************************************ * * -* Различные действия персонажа в игре: рыбалка, команды боя, общение * -* с npc и подобные * +* Many of the actions of the character in the game fishing, team battle, communication * +* With the npc and such * * * ************************************************************************/ @@ -638,7 +638,18 @@ PChar->pushPacket(new CServerIPPacket(PChar,2)); } break; case 0x0C: break; // assist case 0x0D: // raise menu { if(RBUFB(data,(0x0C)) == 0) //ACCEPTED RAISE @@ -649,12 +660,12 @@ PChar->m_hasRaise = 0; } break; - case 0x0E: // рыбалка + case 0x0E: // fishing { fishingutils::StartFishing(PChar); } break; - case 0x0F: // смена цели во время боя + case 0x0F: // change targets in combat { PChar->PBattleAI->SetCurrentAction(ACTION_CHANGE_TARGET, TargID); PChar->PBattleAI->CheckCurrentAction(gettick()); @@ -693,7 +704,7 @@ break; case 0x13: // tractor menu { - // по любому, это работает неправильно. проблемный код в комментарии + // To anyone, it is not working properly. problem code in a comment //PChar->PBattleAI->SetCurrentAction(ACTION_RAISE_MENU_SELECTION); //PChar->PBattleAI->CheckCurrentAction(gettick()); @@ -713,7 +724,7 @@ */ } break; - case 0x14: // окончание обновления данных персонажа + case 0x14: // end of the updating of the character { if (PChar->getZone() == 0) { @@ -746,7 +757,7 @@ /************************************************************************ * * -* Генерация World Pass * +* Generation of World Pass * * * ************************************************************************/ @@ -760,9 +771,9 @@ /************************************************************************ * * -* Назначение пакета неизвестно, но начинает появляться при * -* использовании способностей, если у персонажа есть питомец. Возможно * -* клиент требует недостающие пакеты. * +* Purpose of the package is unknown, but is beginning to appear at * +* Use of the ability, if a character has a pet. Possible * +* Client requires the missing packages. * * * ************************************************************************/ @@ -774,7 +785,7 @@ /************************************************************************ * * -* Удаление предметов из хранилищ * +* Remove items from the store * * * ************************************************************************/ @@ -791,7 +802,7 @@ if (charutils::UpdateItem(PChar, LOC_INVENTORY, slotID, -quantity) != 0) { - // TODO: сломать linkshell, если раковина была выброшена + // TODO: break linkshell, if the sink has been thrown PChar->pushPacket(new CMessageStandardPacket(NULL, ItemID, quantity, 180)); PChar->pushPacket(new CInventoryFinishPacket()); @@ -804,7 +815,7 @@ /************************************************************************ * * -* Перемещение предметов между хранилищами * +* Move objects between repositories * * * ************************************************************************/ @@ -852,18 +863,18 @@ uint32 NewQuantity = PItem->getQuantity() - quantity; - if(NewQuantity != 0) // делим пачку + if(NewQuantity != 0) // divide the pack { if (charutils::AddItem(PChar, ToLocationID, PItem->getID(), quantity) != ERROR_SLOTID) { charutils::UpdateItem(PChar, FromLocationID, FromSlotID, -(int32)quantity); } } - else // переносим всю пачку, или пытаемся объединить одинаковые предметы + else // transfer the entire stack, or trying to combine the same subjects { if (ToSlotID < 82) // 80 + 1 { - // объединение еще не реализовано + // Union is not yet implemented ShowDebug("SmallPacket0x29: Trying to unite items\n", FromLocationID, FromSlotID); return; } @@ -881,20 +892,20 @@ { PChar->getStorage(FromLocationID)->InsertItem(NULL, FromSlotID); - PChar->pushPacket(new CInventoryItemPacket(NULL, FromLocationID, FromSlotID)); // убираем предмет из FormLocationID - PChar->pushPacket(new CInventoryItemPacket(PItem, ToLocationID, NewSlotID)); // добавляем предмет в ToLocationID + PChar->pushPacket(new CInventoryItemPacket(NULL, FromLocationID, FromSlotID)); // remove item from FormLocationID + PChar->pushPacket(new CInventoryItemPacket(PItem, ToLocationID, NewSlotID)); // add item to ToLocationID } - else // в случае ошибки отменяем перемещение предмета + else // if an error canceling moving object { - PChar->getStorage(ToLocationID)->InsertItem(NULL, NewSlotID); // убираем предмет - PChar->getStorage(FromLocationID)->InsertItem(PItem, FromSlotID); // возвращаем предмет (для обновления Location и Slot предмета) + PChar->getStorage(ToLocationID)->InsertItem(NULL, NewSlotID); // remove item + PChar->getStorage(FromLocationID)->InsertItem(PItem, FromSlotID); // return the item (to update the Location and Slot item) } } else { - // клиент не позволяет перемещать предмет в полный контейнер. - // если мы видим это сообщение, значит данные клиента и сервера различаются - // Client thinks that ToLocationID is NOT full, so lets send those packets again and tell them it is! + // The client can not move the object in a full container. + // If we see this message, it means the data server and client are different + // Client thinks that ToLocationID is NOT full, so lets send those packets again and tell them it is! uint8 size = PChar->getStorage(ToLocationID)->GetSize(); for(uint8 slotID = 0; slotID <= size; ++slotID) { @@ -916,7 +927,7 @@ /************************************************************************ * * -* Запрос начала обмена между персонажами (trade) * +* Request early exchange between the characters (trade) * * * ************************************************************************/ @@ -1580,7 +1591,7 @@ /************************************************************************ * * -* Все действия с Auction House * +* All the action from the Auction House * * * ************************************************************************/ void SmallPacket0x04E(map_session_data_t* session, CCharEntity* PChar, int8* data) @@ -1594,15 +1605,15 @@ ShowDebug(CL_CYAN"AH Action (%02hx)\n" CL_RESET, RBUFB(data,(0x04))); - // 0x04 - продажа предмета - // 0x05 - похоже, что в ответ на этот пакет мы можем открыть список продаж или предложить персонажу подождать немного - // 0x0A - получение списка продаваемых персонажем предметов - // 0x0B - подтверждение покупки - // 0x0E - покупка предмета - // 0x0С - отмена продажи - // 0x0D - обновление списка продаваемых персонажем предметов + //0x04 - Sale of + //0x05 - it seems that the answer to this package, we can open a list of sales or offer to wait a little character + //0x0A - get a list of items sold by character + //0x0B - proof of purchase + //0x0E - Item Purchase + //0x0C - cancellation of sale + //0x0D - updating the list of items sold by character - switch(action) + switch(action) { case 0x04: { @@ -1776,11 +1787,16 @@ case 0x0C: //removing item from ah { - /* + //GG START + // I only uncommented the code. + + ShowDebug(CL_YELLOW"AH Action Debug: 0x0C received.\n" CL_RESET); + //check user has invent space if (PChar->getStorage(LOC_INVENTORY)->GetFreeSlotsCount() == 0) { - PChar->pushPacket(new CAuctionHousePacket(action, 0xE5, 0, 0)); //invent full, unable to remove msg + ShowDebug(CL_YELLOW"AH Action Debug: Cannot cancel. Character has 0 space left.\n" CL_RESET); + PChar->pushPacket(new CAuctionHousePacket(action, 0xE5, 0, 0)); //invent full, unable to remove msg } else { @@ -1802,8 +1818,15 @@ //add the item back to the users invent CItem* PDelItem = itemutils::GetItemPointer(delitemid); if(PDelItem != NULL){ - uint8 SlotID = charutils::AddItem(PChar, LOC_INVENTORY, delitemid, - (delitemstack == 0 ? PDelItem->getStackSize() : 1)); + ShowDebug(CL_YELLOW"AH Action Debug: About to give item %u with stack value of %u\n" CL_RESET, delitemid, delitemstack); + if (delitemstack == 0){ + ShowDebug(CL_YELLOW"AH Action Debug: Did not detect a stack, giving 1.\n" CL_RESET); + delitemstack = 1; + }else{ + delitemstack = PDelItem->getStackSize(); + ShowDebug(CL_YELLOW"AH Action Debug: Stack of items detected ! Giving %u.\n" CL_RESET, delitemstack); + } + uint8 SlotID = charutils::AddItem(PChar, LOC_INVENTORY, delitemid, delitemstack); if (SlotID != ERROR_SLOTID) { @@ -1821,7 +1844,9 @@ } //let client know something went wrong PChar->pushPacket(new CAuctionHousePacket(action, 0xE5, 0, 0)); //invent full, unable to remove msg - }*/ + } + //End of the normally commented code. + //GG END } break; case 0x0D: