NazoX Publicado 1 de Junio del 2021 Reportar Compartir Publicado 1 de Junio del 2021 Como algunos tienen problema con la versión publicada, pondré aquí en que parte va cada línea, ya que en el otro solo te pone "añade" y listo. Requisitos: -Ultima versión de Great Offline Shop -Comprobar que te funcionase la Offline shop, pues hay veces que directamente ni se prueba y de por si no funciona -Si no te funciona con esta guía es porque no es la misma versión o necesitas adaptarla de otra forma. 1- Vamos al source game en nuestro servidor, y abrimos el archivo input.h y buscamos: Quote protected: CPacketInfoGG m_packetInfoGG; }; ahora, antes de eso añadimos: Quote void SendOfflineShopMessage(LPDESC d, const char * c_pData); tendría que quedarte algo así: 2-Ahora nos vamos al archivo input2_p2p.cpp y a los includes añadimos: Quote #include "buffer_manager.h" 2,1-Ahora buscamos: Quote int CInputP2P::Analyze(LPDESC d, BYTE bHeader, const char * c_pData) { if (test_server) sys_log(0, "CInputP2P::Anlayze[Header %d]", bHeader); int iExtraLen = 0; switch (bHeader) { case HEADER_GG_SETUP: Setup(d, c_pData); break; Antes de esta función añadimos: Quote void CInputP2P::SendOfflineShopMessage(LPDESC d, const char * c_pData) { TPacketGGOfflineShopMessage * p = (TPacketGGOfflineShopMessage *)c_pData; LPCHARACTER ch = CHARACTER_MANAGER::instance().FindByPID(p->dwTargetPID); if (ch) { LPDESC pkVictimDesc = ch->GetDesc(); if (pkVictimDesc) { char msg[CHAT_MAX_LEN + 1]; snprintf(msg, sizeof(msg), LC_TEXT("Your item %s sold, buyer is: %s."), p->szItemName, p->szName); TPacketGCWhisper pack; int len = MIN(CHAT_MAX_LEN, strlen(msg) + 1); pack.bHeader = HEADER_GC_WHISPER; pack.wSize = sizeof(TPacketGCWhisper)+len; pack.bType = WHISPER_TYPE_SYSTEM; strlcpy(pack.szNameFrom, "[Offline Shop]", sizeof(pack.szNameFrom)); TEMP_BUFFER buf; buf.write(&pack, sizeof(TPacketGCWhisper)); buf.write(msg, len); pkVictimDesc->Packet(buf.read_peek(), buf.size()); } } } y así se tendría que ver: Ahora volvemos a buscar: Quote int CInputP2P::Analyze(LPDESC d, BYTE bHeader, const char * c_pData) y al final del todo antes de : Quote return (iExtraLen); añadimos: Quote case HEADER_GG_OFFLINE_SHOP_SEND_MESSAGE: SendOfflineShopMessage(d, c_pData); break; tiene que quedar así: 3-Ahora abrimos nuestro packet.h y buscamos lo siguiente: Quote HEADER_GG_CHECK_AWAKENESS y debajo añadimos: Quote HEADER_GG_OFFLINE_SHOP_SEND_MESSAGE = 53, *nota* Es recomendable verificar que no se está utilizando el packet 53 para evitar problemas de paquetes, Ahora vamos al final del todo, y antes de : Quote #pragma pack() #endif agregamos: Quote typedef struct SPacketGGOfflineShopMessage { BYTE bHeader; DWORD dwTargetPID; char szName[CHARACTER_NAME_MAX_LEN + 1]; char szItemName[ITEM_NAME_MAX_LEN + 1]; } TPacketGGOfflineShopMessage; 5-Nos dirigimos a packet_info.cpp y buscamos: Quote Set(HEADER_GG_CHECK_AWAKENESS, sizeof(TPacketGGCheckAwakeness), "CheckAwakeness", false); y debajo añadimos: Quote Set(HEADER_GG_OFFLINE_SHOP_SEND_MESSAGE, sizeof(TPacketGGOfflineShopMessage), "OfflineShopUpdateMessage", false); 6.Ahora abrimos shop.cpp y añadimos en los includes: Quote #include "p2p.h" 6-Ahora buscamos: Quote #ifdef FULL_YANG snprintf(buf, sizeof(buf), "%s %u(%s) %lld %u", pkNewItem->GetName(), mpid, m_pkPC->GetName(), dwPrice, pkNewItem->GetCount()); LogManager::instance().ItemLog(ch, pkNewItem, szBuy.c_str(), buf); snprintf(buf, sizeof(buf), "%s %u(%s) %lld %u", pkNewItem->GetName(), ch->GetPlayerID(), ch->GetName(), dwPrice, pkNewItem->GetCount()); LogManager::instance().ItemLog(m_pkPC, pkNewItem, szSell.c_str(), buf); #else snprintf(buf, sizeof(buf), "%s %u(%s) %u %u", pkNewItem->GetName(), mpid, m_pkPC->GetName(), dwPrice, pkNewItem->GetCount()); LogManager::instance().ItemLog(ch, pkNewItem, szBuy.c_str(), buf); snprintf(buf, sizeof(buf), "%s %u(%s) %u %u", pkNewItem->GetName(), ch->GetPlayerID(), ch->GetName(), dwPrice, pkNewItem->GetCount()); LogManager::instance().ItemLog(m_pkPC, pkNewItem, szSell.c_str(), buf); #endif *Nota* si no lo encuentras, o tienes varios (solo deberías tener este), se añade en la función: Quote #ifdef OFFLINE_SHOP #include "char.h" int CShop::Buy(LPCHARACTER ch, BYTE pos) bien, debajo del ifdef FULL_YANG añadimos: Quote LPCHARACTER BuyPMCh = CHARACTER_MANAGER::instance().FindByPID(m_pkPC->GetPrivShopOwner()); if (BuyPMCh) { char msg[CHAT_MAX_LEN + 1]; snprintf(msg, sizeof(msg), LC_TEXT("Your item %s x%u sold, buyer is: %s."), pkNewItem->GetName(), pkNewItem->GetCount(), ch->GetName()); LPDESC pkVictimDesc = BuyPMCh->GetDesc(); if (pkVictimDesc) { TPacketGCWhisper pack; int len = MIN(CHAT_MAX_LEN, strlen(msg) + 1); pack.bHeader = HEADER_GC_WHISPER; pack.wSize = sizeof(TPacketGCWhisper)+len; pack.bType = WHISPER_TYPE_SYSTEM; strlcpy(pack.szNameFrom, "[Offline Shop]", sizeof(pack.szNameFrom)); TEMP_BUFFER buf; buf.write(&pack, sizeof(TPacketGCWhisper)); buf.write(msg, len); pkVictimDesc->Packet(buf.read_peek(), buf.size()); } } else { TPacketGGOfflineShopMessage p; p.bHeader = HEADER_GG_OFFLINE_SHOP_SEND_MESSAGE; p.dwTargetPID = m_pkPC->GetPlayerID(); strlcpy(p.szItemName, pkNewItem->GetName(), sizeof(p.szItemName)); strlcpy(p.szName, ch->GetName(), sizeof(p.szName)); P2P_MANAGER::instance().Send(&p, sizeof(TPacketGGOfflineShopMessage)); } y este será el resultado: Debes iniciar sesión para ver el contenido del enlace en esta publicación. Emre Yavuz, [email protected], clocki y 10 mas reacciono a esto 11 2 Citar Enlace para comentar Compartir en otros sitios Mas opciones de compartir...
Emre Yavuz Publicado 1 de Junio del 2021 Reportar Compartir Publicado 1 de Junio del 2021 ÇOK TEŞEKKÜR EDERİM DOSTUM! Edit: It worked now! Thank you so much. Citar Enlace para comentar Compartir en otros sitios Mas opciones de compartir...
NazoX Publicado 1 de Junio del 2021 Author Reportar Compartir Publicado 1 de Junio del 2021 hace 1 hora, Emre Yavuz dijo: ÇOK TEŞEKKÜR EDERİM DOSTUM! Edit: It worked now! Thank you so much. Rica ederim iyi kullanımlar :). Citar Enlace para comentar Compartir en otros sitios Mas opciones de compartir...
♥ TesT ♥ Publicado 1 de Junio del 2021 Reportar Compartir Publicado 1 de Junio del 2021 estaria bueno si tuebises la shop q dejes el link jaja gracias Citar Enlace para comentar Compartir en otros sitios Mas opciones de compartir...
NazoX Publicado 1 de Junio del 2021 Author Reportar Compartir Publicado 1 de Junio del 2021 hace 1 hora, ♥ TesT ♥ dijo: estaria bueno si tuebises la shop q dejes el link jaja gracias La versión que tengo yo es un poco diferente a la que hay pública, pero puedes usar esta que también es funcional Debes iniciar sesión para ver el contenido del enlace en esta publicación. giajans, SuperGamix, Kenshi Torres y 3 mas reacciono a esto 5 1 Citar Enlace para comentar Compartir en otros sitios Mas opciones de compartir...
Mensajes recomendados
Unirse a la conversación
Puedes publicar ahora y registrarte más tarde. Si tienes una cuenta, regístrate para publicar con su cuenta.