Jump to content

xTryhard

Premium
  • Posts

    52
  • Joined

  • Last visited

  • Feedback

    0%

About xTryhard

Informations

  • Gender
    Male

Recent Profile Visitors

551 profile views

xTryhard's Achievements

Enthusiast

Enthusiast (6/16)

  • Collaborator
  • First Post
  • Very Important Person Rare
  • Dedicated
  • Reacting Well

Recent Badges

12

Reputation

  1. use a std::vector instead of a std::map you can resize the vector in the characters constructor if the Instance is a PlayerCharacter otherwise you keep the size from the vector at 0
  2. this error says something else CDropItemGroup* pkGroup; << Error CDropItemGroup* pkGroup = NULL; << OK CDropItemGroup* pkGroup = nullptr; << OK
  3. cooldowns should run on the server directly and not via database you can save the time in database and load it back when you relog but dont send everytime a query while the player is on the same core questflags are just integers in database but another question why do you want to use a cooldown for 1 second ?
  4. i dont know how to do this in Lua but in C++ it would look like this : char Query[512]; snprintf(Query, sizeof(Query), "SELECT * FROM player.horse WHERE PID = %d", GetPlayerID()); std::unique_ptr<SQLMsg> msg(DBManager::instance().DirectQuery(Query)); if (msg->Get()->uiNumRows == 0) { return; } else { MYSQL_ROW row = mysql_fetch_row(msg->Get()->pSQLResult); str_to_number(MyHorse.Level, row[1]); return; }
  5. char szQuery[50]; // << the length of your string snprintf(szQuery, sizeof(szQuery), "SELECT IP FROM player.player WHERE name = '%s'", arg1); std::unique_ptr<SQLMsg> msg(DBManager::instance().DirectQuery(szQuery)); MYSQL_RES* Result = msg->Get()->pSQLResult; MYSQL_ROW row = mysql_fetch_row(Result); std::string IP = row[0]; if you select a string you can just create one if you use an integer you have to use this function : str_to_number(IP, row[0]);
  6. your header and packet struct has to be 100% synced clientside and serverside make sure when you send a packet to the client use return true at the end of the function in client source also make sure your header is not over 255 because the client will cast it back to unsigned char
  7. in your case you have to send the message from the client to your current Server (core) where you in this Server has to send the message to each other Game Server (core) and each Server has to send the message back to each client so its along way maybe the p2p packets are working but there is a issue when the server is trying to send it back to each client you can test this very simple if your p2p packet is working goto : input_p2p.cpp void CInputP2P::Shout(const char * c_pData) now when you send a message every server will recieve this packet here to check if this is working use a debug print for example : std::cout << "My Packet is Working! \n"; now when you send a message check the debug console if this message is shown you have a server-client problem
  8. every single "core" is a Server and dont know anything from another one if you want to talk with another one send a packet.
  9. you have to create a user in db root 12345 have you did that?
  10. make sure your server item_proto is synced with your client item_proto if this dont help take a look in uiinventory.py
  11. this happen because the client-server-client communication is slow go to PythonNetworkStreamPhaseGame.cpp void CPythonNetworkStream::GamePhase() and remove this if(dwRecvCount++ >= MAX_RECV_COUNT-1 && GetRecvBufferSize() < SAFE_RECV_BUFSIZE && m_strPhase == "Game") break; you can also rewrite the refine function and resize the packet
  12. you use the same value in a switch statement multiple times only one time allowed
  13. goto input.h #add in private section void GiveStarterSet(LPCHARACTER Player); now goto input_login.cpp #search for void CInputLogin::Entergame(LPDESC d, const char * data) add at the bottom from the function : if(ch != NULL) GiveStarterSet(ch); define the function: void CInputLogin::GiveStarterSet(LPCHARACTER Player) { if (Player != NULL) { if(Player->GetQuestFlag("give_starter_set.source") == 0) { Player->SetQuestFlag("give_starter_set.source", 1); BYTE CharClass = Player->GetJob(); bool Warrior = CharClass == 0; bool Ninja = CharClass == 1; bool Sura = CharClass == 2; bool Schami = CharClass == 3; if (Warrior) Player->EquipWarrior(); if (Sura) Player->EquipSura(); if (Ninja) Player->EquipNinja(); if (Schami) Player->EquipShaman(); } } } goto char.h add the functions in public section ; void EquipWarrior(); void EquipSura(); void EquipShaman(); void EquipNinja(); goto char.cpp now add all 4 functions and add your ID in the vector array void CHARACTER::EquipWarrior() { std::vector<DWORD>WarriorStuff { 10, }; for (BYTE i = 0; i < WarriorStuff.size(); ++i) { LPITEM item = ITEM_MANAGER::instance().CreateItem(WarriorStuff[i]); if (item != NULL) { bool Success = item->EquipTo(this, item->FindEquipCell(this)); if (!Success) M2_DESTROY_ITEM(item); } } } you are done you can now add everything you need in the new character functions
  14. ofc you set the weapon. in your code you use this item2->SetForceAttribute(idx, 72, value); as third parameter you use value. anyway this is the correct if statement : if (item2->GetAttributeValue(idx) >= 80 && item2->GetAttributeValue(idx) <= 200) { item2->SetForceAttribute(idx, 72, value); }
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.