From: <lpa...@us...> - 2018-04-30 11:45:56
|
Revision: 10001 http://sourceforge.net/p/planeshift/code/10001 Author: lpancallo Date: 2018-04-30 11:45:31 +0000 (Mon, 30 Apr 2018) Log Message: ----------- Added some documentation Modified Paths: -------------- trunk/src/common/net/messages.h trunk/src/common/util/eventmanager.cpp trunk/src/server/bulkobjects/dictionary.cpp trunk/src/server/bulkobjects/pscharacter.cpp trunk/src/server/bulkobjects/pscharinventory.h trunk/src/server/exchangemanager.cpp trunk/src/server/gem.cpp trunk/src/server/psserver.cpp trunk/src/server/spawnmanager.cpp trunk/src/tools/ccheck/ccheck.h Modified: trunk/src/common/net/messages.h =================================================================== --- trunk/src/common/net/messages.h 2018-03-05 09:05:22 UTC (rev 10000) +++ trunk/src/common/net/messages.h 2018-04-30 11:45:31 UTC (rev 10001) @@ -3990,7 +3990,7 @@ csVector3 posWorld; csVector3 rot; bool guarded; - bool inplace; + bool inplace; // drop at the character's position. }; class psCmdDropMessage : public psMessageCracker Modified: trunk/src/common/util/eventmanager.cpp =================================================================== --- trunk/src/common/util/eventmanager.cpp 2018-03-05 09:05:22 UTC (rev 10000) +++ trunk/src/common/util/eventmanager.cpp 2018-04-30 11:45:31 UTC (rev 10001) @@ -211,11 +211,13 @@ csTicks now = csGetTicks(); int timeout = nextEvent - now; + // checks if we reached the time to execute the next event + // and consumes all the messages which are past due if (timeout > 0) { msg = queue->GetWait(timeout); } - + // if there is a message to process, then process it if (msg) { csTicks start = csGetTicks(); @@ -233,6 +235,7 @@ // don't forget to release the packet msg = NULL; } + // if there are no messages, process events else if (now >= nextEvent) { nextEvent = ProcessEventQueue(); Modified: trunk/src/server/bulkobjects/dictionary.cpp =================================================================== --- trunk/src/server/bulkobjects/dictionary.cpp 2018-03-05 09:05:22 UTC (rev 10000) +++ trunk/src/server/bulkobjects/dictionary.cpp 2018-04-30 11:45:31 UTC (rev 10001) @@ -2917,10 +2917,11 @@ for(size_t count=0; count < triggers.GetSize(); count++) { - // fetch the prerequisites + // Checks if quest is valid, check if quest is enabled server side (Active), check if we are not in testing mode if(triggers[count].quest && !triggers[count].quest->Active() && !IsTesting) continue; + // check if the player meets the prerequisites of the quest if(triggers[count].prerequisite && !IsTesting) { if(!triggers[count].prerequisite->Check(client->GetCharacterData())) Modified: trunk/src/server/bulkobjects/pscharacter.cpp =================================================================== --- trunk/src/server/bulkobjects/pscharacter.cpp 2018-03-05 09:05:22 UTC (rev 10000) +++ trunk/src/server/bulkobjects/pscharacter.cpp 2018-04-30 11:45:31 UTC (rev 10001) @@ -1429,6 +1429,7 @@ if(guarded) //if we want to guard the item assign the guarding pid item->SetGuardingCharacterID(pid); + // create the 3d object gemObject* obj = EntityManager::GetSingleton().MoveItemToWorld(item, location.worldInstance, location.loc_sector, suggestedPos.x, suggestedPos.y, suggestedPos.z, Modified: trunk/src/server/bulkobjects/pscharinventory.h =================================================================== --- trunk/src/server/bulkobjects/pscharinventory.h 2018-03-05 09:05:22 UTC (rev 10000) +++ trunk/src/server/bulkobjects/pscharinventory.h 2018-04-30 11:45:31 UTC (rev 10001) @@ -171,7 +171,20 @@ * @return true if the player has enough capacity for the requiredSpace. */ bool HasEnoughUnusedSpace(float desiredSpace); + + /** + * Sums up all the items in inventory with GetItemSize() + * to calculate the totale space currently used by your inventory items + * + * @return inventory size + */ int GetCurrentTotalSpace(); + + /** + * Returns the max space in units this character can carry + * calculated by mathscript + containers size + * @return max space + */ int GetCurrentMaxSpace(); /** Modified: trunk/src/server/exchangemanager.cpp =================================================================== --- trunk/src/server/exchangemanager.cpp 2018-03-05 09:05:22 UTC (rev 10000) +++ trunk/src/server/exchangemanager.cpp 2018-04-30 11:45:31 UTC (rev 10001) @@ -785,6 +785,7 @@ if(count == -1) count = invItem->exchangeStackCount; // stack count of offer, not of item + // if I selected the maximum amount if(invItem->exchangeStackCount <= count) { invItem->exchangeStackCount = 0; // take out of offering array @@ -791,6 +792,7 @@ invItem->exchangeOfferSlot = -1; SendRemoveItemMessage(fromClient, fromSlot); } + // if I selected less items than max else { invItem->exchangeStackCount -= count; @@ -1311,7 +1313,7 @@ { csString trigger; - // Check if NPC require the exact among of money + // Check if NPC require the exact amount of money starterChar.GetSimpleOffering(trigger,client->GetCharacterData(),true); if(!CheckXMLResponse(client,dlg,trigger)) { Modified: trunk/src/server/gem.cpp =================================================================== --- trunk/src/server/gem.cpp 2018-03-05 09:05:22 UTC (rev 10000) +++ trunk/src/server/gem.cpp 2018-04-30 11:45:31 UTC (rev 10001) @@ -1556,11 +1556,14 @@ evt.FireEvent(); } + // send pick up text message to all clients psSystemMessage newmsg(clientnum, MSG_INFO_BASE, "%s picked up %s", actor->GetName(), qname.GetData()); newmsg.Multicast(actor->GetMulticastClients(),0,RANGE_TO_SELECT); + // update inventory or other windows open psserver->GetCharManager()->UpdateItemViews(clientnum); + // remove the object from 3d world if(GetItemData()) { cel->RemoveItemEntity(this, origUID); Modified: trunk/src/server/psserver.cpp =================================================================== --- trunk/src/server/psserver.cpp 2018-03-05 09:05:22 UTC (rev 10000) +++ trunk/src/server/psserver.cpp 2018-04-30 11:45:31 UTC (rev 10001) @@ -364,6 +364,7 @@ // MathScript Engine mathscriptengine = new MathScriptEngine(db,"math_script"); + // Initialize Cache Manager cachemanager = new CacheManager(); //Loads the standard motd message from db @@ -455,6 +456,7 @@ // Init Bank Manager. bankmanager = new BankManager(); + // Init User Manager usermanager = new UserManager(GetConnections(), cachemanager, bankmanager, entitymanager); Debug1(LOG_STARTUP,0,"Started User Manager"); Modified: trunk/src/server/spawnmanager.cpp =================================================================== --- trunk/src/server/spawnmanager.cpp 2018-03-05 09:05:22 UTC (rev 10000) +++ trunk/src/server/spawnmanager.cpp 2018-04-30 11:45:31 UTC (rev 10001) @@ -473,7 +473,8 @@ break; } - for(int i = 0; i < (amount - (int) handledSpawnsCount); ++i) //Make desired amount of items that are not already existing + //Make desired amount of items that are not already existing + for(int i = 0; i < (amount - (int) handledSpawnsCount); ++i) { // This object won't get destroyed in a while (until something stops it or psItem is destroyed without moving) psScheduledItem* item = new psScheduledItem(id,itemid,pos,spawnsector,0,interval,max_rnd,range, lock_str, lock_skill, flags); Modified: trunk/src/tools/ccheck/ccheck.h =================================================================== --- trunk/src/tools/ccheck/ccheck.h 2018-03-05 09:05:22 UTC (rev 10000) +++ trunk/src/tools/ccheck/ccheck.h 2018-04-30 11:45:31 UTC (rev 10001) @@ -17,6 +17,10 @@ * */ +/** + * This application checks for duplicate meshfact and texture inclusions in art files. + * Used while packaging a new update + */ class CCheck { public: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |