From: <Ven...@us...> - 2008-11-26 05:29:02
|
Revision: 2516 http://planeshift.svn.sourceforge.net/planeshift/?rev=2516&view=rev Author: Vengeance2001 Date: 2008-11-26 05:28:51 +0000 (Wed, 26 Nov 2008) Log Message: ----------- Fixed the sound caching issue that made it not work on the first try. Got Xillix's quest working, with audio. Talk to the Smith to test it. Modified Paths: -------------- trunk/src/client/modehandler.cpp trunk/src/common/net/messages.cpp trunk/src/server/chatmanager.cpp trunk/src/server/database/mysql/item_stats.sql trunk/src/server/database/mysql/quest_scripts.sql Modified: trunk/src/client/modehandler.cpp =================================================================== --- trunk/src/client/modehandler.cpp 2008-11-25 23:13:26 UTC (rev 2515) +++ trunk/src/client/modehandler.cpp 2008-11-26 05:28:51 UTC (rev 2516) @@ -2125,15 +2125,15 @@ csString fname; fname.Format("/planeshift/userdata/cache/%s",msg.hash.GetDataSafe() ); - printf("Got audio file '%s' to play.\n", msg.hash.GetDataSafe() ); + printf(">>Got audio file '%s' to play, in '%s'.\n", msg.hash.GetDataSafe(), fname.GetDataSafe() ); // Check for cached version if (!msg.databuf.IsValid()) { - printf("Checking if file exists locally already.\n"); + printf(">>Checking if file exists locally already.\n"); if (!vfs->Exists(fname)) // doesn't exist so we need to request it { - printf("Requesting file from server.\n"); + printf(">>Requesting file '%s' from server.\n", msg.hash.GetDataSafe() ); psCachedFileMessage request(0,msg.hash,NULL); // cheating here to send the hash back in the filename field request.SendMessage(); } @@ -2145,11 +2145,11 @@ } else { - printf("Received file from server. Putting in cache.\n"); + printf(">>Received file from server. Putting in cache.\n"); // Save sound file if (!vfs->WriteFile(fname,msg.databuf->GetData(), msg.databuf->GetSize() )) { - Error2("Could not write cached file '%s'.",fname.GetData()); + Error2(">>Could not write cached file '%s'.",fname.GetData()); return; } // Play sound file Modified: trunk/src/common/net/messages.cpp =================================================================== --- trunk/src/common/net/messages.cpp 2008-11-25 23:13:26 UTC (rev 2515) +++ trunk/src/common/net/messages.cpp 2008-11-26 05:28:51 UTC (rev 2516) @@ -7123,11 +7123,13 @@ psCachedFileMessage::psCachedFileMessage( uint32_t client, const char *pathname, iDataBuffer *contents) { + printf("::Building cached file message for '%s'.\n", pathname); + // We send the hash along with it to save as the filename on the client - if (pathname[0] == '/') + if (pathname[0] == '(') // timestamp always starts with '(' { hash = csMD5::Encode(pathname).HexString(); - // printf("Hashed %s to %s.\n", pathname, hash.GetData() ); + printf("::Hashed %s to %s.\n", pathname, hash.GetData() ); } else hash = pathname; @@ -7147,6 +7149,8 @@ psCachedFileMessage::psCachedFileMessage( MsgEntry* me ) { hash = me->GetStr(); + printf("::Received cached message for file '%s'.\n", hash.GetDataSafe() ); + uint32_t size=0; char *ptr = (char *)me->GetBufferPointerUnsafe(size); if (ptr) Modified: trunk/src/server/chatmanager.cpp =================================================================== --- trunk/src/server/chatmanager.cpp 2008-11-25 23:13:26 UTC (rev 2515) +++ trunk/src/server/chatmanager.cpp 2008-11-26 05:28:51 UTC (rev 2516) @@ -486,7 +486,7 @@ csFileTime oTime; psserver->vfs->GetFileTime(voiceFile,oTime); - timestamp.Format("%d/%d/%d %d:%d:%d ", + timestamp.Format("(%d/%d/%d %d:%d:%d) ", oTime.mon, oTime.day, oTime.year, oTime.hour, oTime.min, oTime.sec); Modified: trunk/src/server/database/mysql/item_stats.sql =================================================================== --- trunk/src/server/database/mysql/item_stats.sql 2008-11-25 23:13:26 UTC (rev 2515) +++ trunk/src/server/database/mysql/item_stats.sql 2008-11-26 05:28:51 UTC (rev 2516) @@ -148,6 +148,8 @@ (57,'B','Sphere',0.00,5.00,1,0,'BULK,BLUE','STACKABLE,GLYPH',0.10,-1,-1,-1,'0','0','0',0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,101,94,0,0,0,'0',5,2000.00,'GLYPH','',0.00,'',0.00,'',0.00,'0',0,0.0000,0,0,0,0,'0','nosound',50,'','',NULL,NULL,-1,2), (58,'B','Water',0.00,10.00,1,0,'BULK,BLUE','STACKABLE,GLYPH',0.10,-1,-1,-1,'0','0','0',0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,101,95,0,0,0,'0',5,2000.00,'GLYPH','',0.00,'',0.00,'',0.00,'0',0,0.0000,0,0,0,0,'0','nosound',50,'','',NULL,NULL,-1,2), (59,'B','Chest',1.00,10.00,70,65,'BULK','CONTAINER',0.10,-1,-1,-1,'0','0','0',0.00,0.00,0.00,0.00,0.00,0.00,4.00,2.00,0.20,0.20,0.20,0.00,111,112,0,0,0,'3c',3,200.00,'CONTAINER','',0.00,'',0.00,'',0.00,'0',0,0.0000,0,0,0,0,'0','nosound',50,'','',NULL,NULL,-1,2), + (3014,'B','Juiceberry fruit',1.00,25.00,1,0,'BULK','STACKABLE',0.10,-1,-1,-1,'0','0','0',0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,113,114,0,0,0,'0',3,0.00,'FOOD','',0.00,'',0.00,'',0.00,'0',0,0.0000,0,0,0,0,'0','nosound',50,'','',NULL,NULL,-1,2), + (3015,'B','Lapar',1.00,25.00,1,0,'BULK','STACKABLE',0.10,-1,-1,-1,'0','0','0',0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,113,114,0,0,0,'0',3,0.00,'FOOD','',0.00,'',0.00,'',0.00,'0',0,0.0000,0,0,0,0,'0','nosound',50,'','',NULL,NULL,-1,2), (60,'B','Egg',1.00,25.00,1,0,'BULK','STACKABLE',0.10,-1,-1,-1,'0','0','0',0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,113,114,0,0,0,'0',3,0.00,'FOOD','',0.00,'',0.00,'',0.00,'0',0,0.0000,0,0,0,0,'0','nosound',50,'','',NULL,NULL,-1,2); INSERT INTO `item_stats` VALUES (61,'B','Milk',1.00,25.00,1,0,'BULK','STACKABLE',0.10,-1,-1,-1,'0','0','0',0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,113,114,0,0,0,'0',3,0.00,'FOOD','',0.00,'',0.00,'',0.00,'0',0,0.0000,0,0,0,0,'0','nosound',50,'','',NULL,NULL,-1,2), (62,'B','Flour',1.00,25.00,1,0,'BULK','STACKABLE',0.10,-1,-1,-1,'0','0','0',0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,113,114,0,0,0,'0',3,0.00,'FOOD','',0.00,'',0.00,'',0.00,'0',0,0.0000,0,0,0,0,'0','nosound',50,'','',NULL,NULL,-1,2), Modified: trunk/src/server/database/mysql/quest_scripts.sql =================================================================== --- trunk/src/server/database/mysql/quest_scripts.sql 2008-11-25 23:13:26 UTC (rev 2515) +++ trunk/src/server/database/mysql/quest_scripts.sql 2008-11-26 05:28:51 UTC (rev 2516) @@ -506,3 +506,40 @@ P: laanx g: Not sure if she is a he or a she, but s/he likes very spiky temples apparently."); + + + +INSERT INTO quest_scripts VALUES("208","207","# Quest Acquire Lapar +# ID 1214 +# Quest Description: Smith needs some juiceberry fruit before he will sell you any lapar. +# Player lockout: 43200 +# 12 hours +# Quest Lockout: 1800 +# 30 minutes +# Syntax update 5.11.2008 +# Updated with menu system 11/2008. + +P: Give me Lapar. +Menu: I\'m looking for some Lapar. + +Smith: Very well $sir, I have some lapar you can have, but it will cost you. [Levrus chuckles.] Shall we say two hundred tria, and three juiceberry fruit? (/planeshift/data/voice/Levrusacquirelapar/1verywellsir.spx) +P: No. P: Yes. +Menu: No, that is too much! Are you kidding me old man? Menu: You hold your lapar dear old man, but I\'ll pay your price. + +Smith: That is my price $playerrace, come back if you change your mind. (/planeshift/data/voice/Levrusacquirelapar/2thatismyprice.spx) +Smith: Excellent! Bring me the fruit, and I\'ll have some lapar ready for you. (/planeshift/data/voice/Levrusacquirelapar/3excellentbringmethefruit.spx) +Assign Quest. + +... NoRepeat +# Step 2 +Player Gives Smith 3 Juiceberry fruit. +Smith: Very nice, now for the tria, all two hundred of them please. [Levrus holds out his hand with a smile.] (/planeshift/data/voice/Levrusacquirelapar/4verynicenowforthetria.spx) +Complete Acquire Lapar Step 2. + +... +# Step 3 +Require Completion of Acquire Lapar Step 2. +Player Gives Smith 200 tria. +Smith: [The Smith takes the coins and stuffs them into his coin-pouch.] Very well, one bottle of Lapar for the $playerrace. [Smith hands you a bottle.] Use it wisely, it is not as abundant as water. [Smith chuckles as he turns his attention elsewhere.] (/planeshift/data/voice/Levrusacquirelapar/5verywellonebottle.spx) +Give 1 Lapar. Give 600 Exp. +Complete Acquire Lapar Step 3."); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |