wpdev-commits Mailing List for Wolfpack Emu (Page 200)
Brought to you by:
rip,
thiagocorrea
You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(14) |
Aug
(121) |
Sep
(256) |
Oct
(59) |
Nov
(73) |
Dec
(120) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(259) |
Feb
(381) |
Mar
(501) |
Apr
(355) |
May
(427) |
Jun
(270) |
Jul
(394) |
Aug
(412) |
Sep
(724) |
Oct
(578) |
Nov
(65) |
Dec
|
|
From: <dar...@us...> - 2003-08-20 15:40:42
|
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv17901/src
Modified Files:
srvparams_win.cpp
Log Message:
Fixed an encryption related bug.
Index: srvparams_win.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/srvparams_win.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** srvparams_win.cpp 29 Jun 2003 01:46:03 -0000 1.6
--- srvparams_win.cpp 20 Aug 2003 14:48:59 -0000 1.7
***************
*** 168,176 ****
( part1 == 10 ) ||
( ( part1 == 192 ) && ( part2 == 168 ) ) ||
! ( ( part1 == 172 ) && ( part2 == 16 ) )
)
{
- server.ip = ip;
- inetIp = ip;
continue;
}
--- 168,175 ----
( part1 == 10 ) ||
( ( part1 == 192 ) && ( part2 == 168 ) ) ||
! ( ( part1 == 172 ) && ( part2 >= 16 ) && ( part2 <= 31 ) ) ||
! ( ( part1 == 169 ) && ( part2 == 254 ) ) // DHCP Space Stuff
)
{
continue;
}
***************
*** 185,188 ****
--- 184,191 ----
else if( inetIp )
server.sIP = inetIp;
+
+ // Fall back to localhost
+ if( !server.sIP )
+ server.sIP = 0x7F000001;
}
serverList_.push_back(server);
|
|
From: <thi...@us...> - 2003-08-17 15:19:59
|
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv677
Modified Files:
dbl_single_click.cpp skills.cpp skills.h uobject.cpp uobject.h
Log Message:
removed dead code
Index: dbl_single_click.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/dbl_single_click.cpp,v
retrieving revision 1.209
retrieving revision 1.210
diff -C2 -d -r1.209 -r1.210
*** dbl_single_click.cpp 11 Aug 2003 03:34:40 -0000 1.209
--- dbl_single_click.cpp 17 Aug 2003 15:00:10 -0000 1.210
***************
*** 525,540 ****
return;
- // By Polygon: Clicked on a tattered treasure map, call decipher-function
- case 301:
- Skills->Decipher(pi, s);
- return;
- /*
- By Polygon:
- Clicked on a deciphered treasure map
- Show a map-gump with the treasure location in it
- */
- case 302: // Deciphered treasure map?
- return;
- // END OF: By Polygon
case 402: // Blackwinds Reputation ball
{
--- 525,528 ----
Index: skills.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/skills.cpp,v
retrieving revision 1.202
retrieving revision 1.203
diff -C2 -d -r1.202 -r1.203
*** skills.cpp 14 Aug 2003 19:12:57 -0000 1.202
--- skills.cpp 17 Aug 2003 15:00:14 -0000 1.203
***************
*** 61,70 ****
#include "debug.h"
- /*
- List of implemented skills:
- Arms Lore
-
- */
-
void cSkills::Hide( cUOSocket *socket )
{
--- 61,64 ----
***************
*** 229,335 ****
}
- /////////////////////////
- // name: BottleTarget
- // history: unknown, revamped by Duke,23.04.2000
- // Purpose: Uses the targeted potion bottle *outside* the backpack to
- // pour in the potion from the mortar
- //
- void cSkills::BottleTarget(int s)
- {
- /* P_ITEM pi=FindItemBySerPtr(buffer[s]+7);
- P_CHAR pc_currchar = currchar[s];
- if (!pi || pi->isLockedDown()) return; // Ripper
-
- if (pi->id()==0x0F0E) // an empty potion bottle ?
- {
- pi->ReduceAmount(1);
-
- P_ITEM mortar = FindItemBySerial(calcserial(addid1[s], addid2[s], addid3[s], addid4[s]));
- if(mortar == NULL) return;
- if (mortar->type() == 17)
- {
- pc_currchar->emote( tr("*%1 pours the completed potion into a bottle.*").arg(pc_currchar->name));
- Skills->PotionToBottle(pc_currchar, mortar);
- }
- }
- else
- sysmessage(s,"This is not an appropriate container for a potion.");*/
- }
-
- /////////////////////////
- // name: PotionToBottle
- // history: unknown, revamped by Duke,23.04.2000
- // Purpose: this really creates the potion
- //
- void cSkills::PotionToBottle(P_PLAYER pc, P_ITEM pi_mortar)
- {
- unsigned char id1,id2;
- char pn[50];
-
- if ( pc == NULL ) return;
-
- switch((10*pi_mortar->more1())+pi_mortar->more2())
- {
- case 11: id1=0x0F;id2=0x08;strcpy(pn, "an agility"); break;
- case 12: id1=0x0F;id2=0x08;strcpy(pn, "a greater agility"); break;
- case 21: id1=0x0F;id2=0x07;strcpy(pn, "a lesser cure"); break;
- case 22: id1=0x0F;id2=0x07;strcpy(pn, "a cure"); break;
- case 23: id1=0x0F;id2=0x07;strcpy(pn, "a greater cure"); break;
- case 31: id1=0x0F;id2=0x0D;strcpy(pn, "a lesser explosion"); break;
- case 32: id1=0x0F;id2=0x0D;strcpy(pn, "an explosion"); break;
- case 33: id1=0x0F;id2=0x0D;strcpy(pn, "a greater explosion"); break;
- case 41: id1=0x0F;id2=0x0C;strcpy(pn, "a lesser heal"); break;
- case 42: id1=0x0F;id2=0x0C;strcpy(pn, "a heal"); break;
- case 43: id1=0x0F;id2=0x0C;strcpy(pn, "a greater heal"); break;
- case 51: id1=0x0F;id2=0x06;strcpy(pn, "a night sight"); break;
- case 61: id1=0x0F;id2=0x0A;strcpy(pn, "a lesser poison"); break;
- case 62: id1=0x0F;id2=0x0A;strcpy(pn, "a poison"); break;
- case 63: id1=0x0F;id2=0x0A;strcpy(pn, "a greater poison"); break;
- case 64: id1=0x0F;id2=0x0A;strcpy(pn, "a deadly poison"); break;
- case 71: id1=0x0F;id2=0x0B;strcpy(pn, "a refresh"); break;
- case 72: id1=0x0F;id2=0x0B;strcpy(pn, "a total refreshment"); break;
- case 81: id1=0x0F;id2=0x09;strcpy(pn, "a strength"); break;
- case 82: id1=0x0F;id2=0x09;strcpy(pn, "a greater strength"); break;
- default:
- LogError("switch reached default");
- return;
- }
-
- P_ITEM pi_potion = 0;//Items->SpawnItem(pc, 1,"#",0, id1, id2,0,1,0);
- if (pi_potion == NULL)
- return;
-
- pi_potion->setName( QString( "%1 potion" ).arg( pn ) );
- pi_potion->setType( 19 );
- pi_potion->setMoreX(pi_mortar->morex());
- pi_potion->setMoreY(pi_mortar->more1());
- pi_potion->setMoreZ(pi_mortar->more2());
-
- // the remainder of this function NOT (yet) revamped by Duke !
-
- // Addon for Storing creator NAME and SKILLUSED by Magius(CHE) §
- if(!pc->isGM())
- {
- pi_potion->setCreator(pc->name()); // Magius(CHE) - Memorize Name of the creator
- if (pc->skillValue(ALCHEMY)>950) pi_potion->setMadeWith(ALCHEMY+1); // Memorize Skill used - Magius(CHE)
- else pi_potion->setMadeWith(0-ALCHEMY-1); // Memorize Skill used - Magius(CHE)
- } else {
- pi_potion->setCreator("");
- pi_potion->setMadeWith(0);
- }
-
- pi_potion->update();
- pi_mortar->setType( 0 );
- // items[i].weight=100; // Ripper 11-25-99
- // AntiChrist NOTE: please! use the HARDITEMS.SCP...
- // the settings used in that script are used EVERY TIME we have an item created via
- // code ( and not via script )...so we simply can add the string:
- // WEIGHT 100
- // in the "potion section" of that file, and EVERY TIME the potions are created via scripts
- // they have those settings! :) that's easy isn't it? =P
-
- return;
- }
-
void cSkills::SpiritSpeak(int s) // spirit speak time, on a base of 30 seconds + skill[SPIRITSPEAK]/50 + INT
{
--- 223,226 ----
***************
*** 604,739 ****
}
- ///////////////////////
- // name: TellScroll
- // history: unknown, modified by LB & AntiChrist,
- // partially revamped by Duke, 8 April 2000
- // Purpose: callback function for inscription menue
- // This is the point where control is returned after the user
- // selected a spell to inscribe/engrave from the gump menu.
- //
- void TellScroll( char *menu_name, int s, long snum )
- {
- /* P_CHAR pc_currchar = currchar[s];
- unsigned cir,spl;
- int part;
-
- if(snum<=0) return; // bad spell selction
-
- P_ITEM pi = FindItemBySerial(pc_currchar->lastTarget);
-
- cir=(int)((snum-800)/10); // snum holds the circle/spell as used in inscribe.gmp
- spl=(((snum-800)-(cir*10))+1); // i.e. 800 + 1-based circle*10 + zero-based spell
- // snum is also equals the item # in items.scp of the scrool to be created !
- P_ITEM pBackpack = Packitem(pc_currchar);
- if (pBackpack == NULL) return;
-
- AllItemsIterator iterItems;
- for (iterItems.Begin(); !iterItems.atEnd(); iterItems++) // find the spellbook
- {
- P_ITEM pb = iterItems.GetData();
- if (pb->type()==9 && (pb->contserial==pBackpack->serial ||
- (pb->layer()==1 && pc_currchar->Wears(pb))))
- {
- if (!Magic->CheckBook( cir, spl-1, pb))
- {
- sysmessage(s,"You don't have this spell in your spell book!");
- return;
- }
- }
- }
-
- int num = (8*(cir-1)) + spl; // circle & spell combined to a zero-based index
-
- Magic->Action4Spell(s,num);
- Magic->SpeakMantra4Spell(pc_currchar,num);
-
- if(!Magic->CheckReagents(pc_currchar, num)
- || !Magic->CheckMana(pc_currchar, num))
- {
- Magic->SpellFail(s);
- return;
- }
- Magic->SubtractMana4Spell(pc_currchar, num);
-
- if (pi->id()==0x0E34) //is it a scroll?
- {
- itemmake[s].Mat1id=0x0E34;
- itemmake[s].needs=1;
- itemmake[s].has = getamount(pc_currchar, 0x0E34);
- itemmake[s].minskill=(cir-1)*100; //set range values based on scroll level
- itemmake[s].maxskill=(cir+2)*100;
-
- Magic->DelReagents(pc_currchar, num);
-
- Skills->MakeMenuTarget(s,snum,INSCRIPTION); //put it in your pack
- }
- else if ((pi->att>0)||(pi->def>0)||(pi->hidamage())) //or is it an item?
- {
- part=0;
- switch(cir)
- {
- case 1: part = CheckThreeSkills(s, 11, 401);break;
- case 2: part = CheckThreeSkills(s, 61, 501);break;
- case 3: part = CheckThreeSkills(s, 161, 601);break;
- case 4: part = CheckThreeSkills(s, 261, 701);break;
- case 5: part = CheckThreeSkills(s, 361, 801);break;
- case 6: part = CheckThreeSkills(s, 461, 901);break;
- case 7: part = CheckThreeSkills(s, 661,1101);break;
- case 8: part = CheckThreeSkills(s, 761,1201);break;
- default:
- LogError("switch reached default");
- return;
- }
-
- if( part < 3 ) // failure !
- {
- switch(part)
- {
- case 0:
- sysmessage(s,"Your hand jerks and you punch a hole in the item");
- pi->setHp( pi->hp() - 3 );
- break;
- case 1:
- sysmessage(s,"Your hand slips and you dent the item");
- pi->setHp( pi->hp() - 2 );
- break;
- case 2:
- sysmessage(s,"Your hand cramps and you scratch the item");
- pi->setHp( pi->hp() - 1 );
- break;
- }
- if( pi->hp() < 1 )
- pi->setHp( 1 );
- }
- else // success !
- {
- if (!( pi->morez == 0 ||(pi->morex == cir && pi->morey == spl)) )
- sysmessage(s,"This item already has a spell!");
-
- else if ( pi->morez >= (9 - pi->morex)*2)
- sysmessage(s,"Item at max charges!");
-
- else
- {
- Skills->EngraveAction(s, pi, cir, spl); // check mana & set name
-
- if (!(pi->morex == cir && pi->morey == spl)) // not THIS spell
- {
- pi->setType2( pi->type() ); //kept type of item for returning to this type when item remain no charge
- pi->setType( 15 ); //make it magical
- pi->morex=cir;//spell circle
- pi->morey=spl;//spell number
- sysmessage(s,"Item successfully Engraved");
- }
- else
- sysmessage(s,"You added one more charge to the Item");
-
- pi->morez++; // charges
- sysmessage(s,"Item successfully Engraved");
- }
- }
- }//else if*/
- }
-
void cSkills::Meditation( cUOSocket *socket )
{
--- 495,498 ----
***************
*** 895,899 ****
// SetTimerSec(player->objectdelay(), SrvParams->objectDelay()+SrvParams->snoopdelay());
player->setObjectDelay( SetTimerSec(player->objectDelay(), SrvParams->objectDelay()+SrvParams->snoopdelay()) );
-
}
--- 654,657 ----
***************
*** 901,1023 ****
{
MakeMenus::instance()->callMakeMenu( socket, "CRAFTMENU_CARTOGRAPHY" );
- }
-
- /*
- By Polygon:
- Attempt to decipher a tattered treasure map
- Called when double-clicked such a map
- */
-
- void cSkills::Decipher(P_ITEM tmap, int s)
- {
- /* P_CHAR pc_currchar = currchar[s];
- char sect[500]; // Needed for script search
- int regtouse; // Stores the region-number of the TH-region
- int i; // Loop variable
- int btlx, btly, blrx, blry; // Stores the borders of the tresure region (topleft x-y, lowright x-y)
- int tlx, tly, lrx, lry; // Stores the map borders
- int x, y; // Stores the final treasure location
-
- if(pc_currchar->skilldelay<=uiCurrentTime || pc_currchar->isGM()) // Char doin something?
- {
- if (CheckSkill(pc_currchar, CARTOGRAPHY, tmap->morey * 10, 1000)) // Is the char skilled enaugh to decipher the map
- {
- P_ITEM nmap = Items->SpawnItemBackpack2(s, "70025", 0);
- if (nmap == NULL)
- {
- LogWarning("bad script item # 70025(Item Not found).");
- return; //invalid script item
- }
- char temp[256];
- sprintf(temp, "a deciphered lvl.%d treasure map", tmap->morez); // Give it the correct name
- nmap->setName( temp );
- nmap->morez = tmap->morez; // Give it the correct level
- nmap->creator = pc_currchar->name; // Store the creator
- Script *rscript=i_scripts[regions_script]; // Region script
- if (!rscript->Open())
- {
- LogWarning("Treasure hunting cSkills::Decipher : Cannot open regions-script");
- return;
- }
- sprintf(sect, "TREASURE%i", nmap->morez);
- if (!rscript->find(sect))
- {
- rscript->Close();
- LogWarningVar("Treasure hunting cSkills::Decipher : Unable to find 'SECTION TREASURE%X' in regions-script", nmap->morez);
- return;
- }
- rscript->NextLine(); // Get the number of areas
- regtouse = rand()%str2num(script1); // Select a random one
- for (i = 0; i < regtouse; i++) // Skip the ones before the correct one
- {
- rscript->NextLine();
- rscript->NextLine();
- rscript->NextLine();
- rscript->NextLine();
- }
- rscript->NextLine(); // Get the treasure region borders
- btlx = str2num(script1);
- rscript->NextLine();
- btly = str2num(script1);
- rscript->NextLine();
- blrx = str2num(script1);
- rscript->NextLine();
- blry = str2num(script1);
- rscript->Close(); // Close the script
- if ((btlx < 0) || (btly < 0) || (blrx > 0x13FF) || (blry > 0x0FFF)) // Valid region?
- {
- sprintf(sect, "Treasure Hunting cSkills::Decipher : Invalid region borders for lvl.%d , region %d", nmap->morez, regtouse+1); // Give out detailed warning :D
- LogWarning(sect);
- return;
- }
- x = btlx + (rand()%(blrx-btlx)); // Generate treasure location
- y = btly + (rand()%(blry-btly));
- tlx = x - 250; // Generate map borders
- tly = y - 250;
- lrx = x + 250;
- lry = y + 250;
- // Check if we are over the borders and correct errors
- if (tlx < 0) // Too far left?
- {
- lrx -= tlx; // Add the stuff too far left to the right border (tlx is neg. so - and - gets + ;)
- tlx = 0; // Set tlx to correct value
- }
- else if (lrx > 0x13FF) // Too far right?
- {
- tlx -= lrx - 0x13FF; // Subtract what is to much from the left border
- lrx = 0x13FF; // Set lrx to correct value
- }
- if (tly < 0) // Too far top?
- {
- lry -= tly; // Add the stuff too far top to the bottom border (tly is neg. so - and - gets + ;)
- tly = 0; // Set tly to correct value
- }
- else if (lry > 0x0FFF) // Too far bottom?
- {
- tly -= lry - 0x0FFF; // Subtract what is to much from the top border
- lry = 0x0FFF; // Set lry to correct value
- }
- nmap->more1 = tlx>>8; // Store the map extends
- nmap->more2 = tlx%256;
- nmap->more3 = tly>>8;
- nmap->more4 = tly%256;
- nmap->setMoreb1( lrx>>8 );
- nmap->setMoreb2( lrx%256 );
- nmap->setMoreb3( lry>>8 );
- nmap->setMoreb4( lry%256 );
- nmap->morex = x; // Store the treasure's location
- nmap->morey = y;
- Items->DeleItem(tmap); // Delete the tattered map
- }
- else
- sysmessage(s, "You fail to decipher the map"); // Nope :P
- // Set the skill delay, no matter if it was a success or not
- pc_currchar->setSkillDelay( SetTimerSec(pc_currchar->skilldelay, SrvParams->skillDelay()) );
- soundeffect(s, 0x02, 0x49); // Do some inscription sound regardless of success or failure
- sysmessage(s, "You put the deciphered tresure map in your pack"); // YAY
- }
- else
- sysmessage(s, "You must wait to perform another action"); // wait a bit
- */
}
--- 659,662 ----
Index: skills.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/skills.h,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** skills.h 5 Jul 2003 19:02:13 -0000 1.21
--- skills.h 17 Aug 2003 15:00:15 -0000 1.22
***************
*** 66,79 ****
int GetSubIngotAmt(int p, char id1, char id2, char color1, char color2);
int DeleSubIngot(int p, int id1, int id2, int color1, int color2, int amount);
- void AnvilTarget(int s, int m);
- void AnvilTargetGold(int s, int m);
- void AnvilTargetSilver(int s, int m);
- void AnvilTargetAdam(int s, int m);
- void AnvilTargetMyth(int s, int m);
- void AnvilTargetBronze(int s, int m);
- void AnvilTargetVerite(int s, int m);
- void AnvilTargetMerk(int s, int m);
- void AnvilTargetCop(int s, int m);
- void AnvilTargetAgap(int s, int m);
void Hide( cUOSocket* );
void Stealth( cUOSocket* );
--- 66,69 ----
***************
*** 102,107 ****
void PlayInstrumentPoor(cUOSocket*, P_ITEM pi);
P_ITEM GetInstrument( cUOSocket* );
- void TellScroll(char *menu_name, int player, long item_param);
- void CollectAmmo(int s, int a, int b);
void Meditation(cUOSocket* s);
// skills using crafting menus
--- 92,95 ----
***************
*** 117,138 ****
void SmeltItemTarget(UOXSOCKET s); // Ripper
int TrackingDirection(UOXSOCKET s, P_CHAR pc_i);
- void TinkerAxel(int s);
- void TinkerAwg(int s);
- void TinkerClock(int s);
void Track(P_CHAR pc_i);
- void CookOnFire(int s, short id1, short id2, char* matname);
- void BottleTarget(int s);
void PotionToBottle(P_PLAYER pc, P_ITEM pi_mortar);
- void CreateBandageTarget(int s);
- void HealingSkillTarget(UOXSOCKET s);
void SpiritSpeak(int s);
- void ArmsLoreTarget(int s);
void SkillUse( cUOSocket*, UINT16 );
void CreateTrackingMenu(int s, int m);
void TrackingMenu(int s, int gmindex);
- int Inscribe(int s, long snum);
- int EngraveAction(int s, P_ITEM pi, int cir, int spl);
void Persecute(cUOSocket*);//AntiChrist persecute stuff
- void Decipher(P_ITEM tmap, int s); // By Polygon - attempt to decipher a tattered treasure map
int GetAntiMagicalArmorDefence(P_CHAR pc); // blackwind meditation armor stuff
void Snooping(P_PLAYER, P_ITEM);
--- 105,115 ----
Index: uobject.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/uobject.cpp,v
retrieving revision 1.103
retrieving revision 1.104
diff -C2 -d -r1.103 -r1.104
*** uobject.cpp 11 Aug 2003 12:17:57 -0000 1.103
--- uobject.cpp 17 Aug 2003 15:00:15 -0000 1.104
***************
*** 753,757 ****
}
! void cUObject::changed( UI32 state )
{
if( state & SAVE ) changed_ = true;
--- 753,757 ----
}
! void cUObject::changed( uint state )
{
if( state & SAVE ) changed_ = true;
Index: uobject.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/uobject.h,v
retrieving revision 1.67
retrieving revision 1.68
diff -C2 -d -r1.67 -r1.68
*** uobject.h 11 Aug 2003 03:34:40 -0000 1.67
--- uobject.h 17 Aug 2003 15:00:15 -0000 1.68
***************
*** 85,88 ****
--- 85,89 ----
// Things for building the SQL string
static void buildSqlString( QStringList &fields, QStringList &tables, QStringList &conditions );
+ void changed( uint );
enum eChanged // Each bit controls different state
***************
*** 133,137 ****
virtual ~cUObject() {};
- void changed( UI32 );
void moveTo( const Coord_cl&, bool noRemove = false );
unsigned int dist(cUObject* d) const;
--- 134,137 ----
|
|
From: <thi...@us...> - 2003-08-14 22:18:42
|
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv22368
Modified Files:
skills.cpp targetrequests.cpp targetrequests.h
Log Message:
Removing C++ code from some of the skills which are already implemented in Python
Index: skills.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/skills.cpp,v
retrieving revision 1.201
retrieving revision 1.202
diff -C2 -d -r1.201 -r1.202
*** skills.cpp 14 Aug 2003 18:38:02 -0000 1.201
--- skills.cpp 14 Aug 2003 19:12:57 -0000 1.202
***************
*** 397,440 ****
switch( id )
{
- case ARMSLORE:
- message = tr("What item do you wish to get information about?");
- targetRequest = new cSkArmsLore;
- break;
- case ITEMID:
- message = tr("What do you wish to appraise and identify?");
- targetRequest = new cSkItemID;
- break;
- case EVALUATINGINTEL:
- message = tr("What would you like to evaluate?");
- targetRequest = new cSkIntEval;
- break;
- case TAMING:
- message = tr("Tame which animal?");
- targetRequest = new cSkTame;
- break;
- case HIDING:
- Skills->Hide( socket );
- break;
- case STEALTH:
- Skills->Stealth( socket );
- break;
- case DETECTINGHIDDEN:
- message = tr("Where do you wish to search for hidden characters?");
- targetRequest = new cSkDetectHidden;
- break;
- case PEACEMAKING:
- Skills->PeaceMaking(socket);
- break;
- case PROVOCATION:
- message = tr("Whom do you wish to incite?");
- targetRequest = new cSkProvocation;
- break;
- case DISCORDANCE:
- message = tr("Whom do you wish to entice?");
- //target(s, 0, 1, 0, 81, );
- break;
- case SPIRITSPEAK:
- Skills->SpiritSpeak(s);
- break;
case STEALING:
if( !SrvParams->stealingEnabled() )
--- 397,400 ----
***************
*** 447,461 ****
targetRequest = new cSkStealing;
break;
- case INSCRIPTION:
- message = tr("What do you wish to place a spell on?");
- //target(s, 0, 1, 0, 160, );
- break;
case TRACKING:
trackingMenu( socket );
break;
- case BEGGING:
- message = tr( "Whom do you wish to annoy?" );
- targetRequest = new cSkBegging;
- break;
case FORENSICS:
message = tr("What corpse do you want to examine?");
--- 407,413 ----
***************
*** 466,474 ****
targetRequest = new cSkPoisoning;
break;
-
- case TASTEID:
- message = tr("What do you want to taste?");
- targetRequest = new cSkTasteID;
- break;
case MEDITATION:
--- 418,421 ----
Index: targetrequests.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/targetrequests.cpp,v
retrieving revision 1.69
retrieving revision 1.70
diff -C2 -d -r1.69 -r1.70
*** targetrequests.cpp 26 Jul 2003 01:10:54 -0000 1.69
--- targetrequests.cpp 14 Aug 2003 19:12:58 -0000 1.70
***************
*** 184,701 ****
};
- bool cSkDetectHidden::responsed( cUOSocket *socket, cUORxTarget *target )
- {
- P_PLAYER pChar = socket->player();
-
- if( !pChar )
- return true;
-
- Coord_cl dPos = pChar->pos();
- dPos.x = target->x();
- dPos.y = target->y();
- dPos.z = target->z();
-
- // If its out of the characters visrange cancel (How could he've clicked there??)
- if( dPos.distance( pChar->pos() ) > pChar->visualRange() )
- return true;
-
- UINT16 dSkill = pChar->skillValue( DETECTINGHIDDEN );
- double range = ( dSkill * dSkill / 1.0E6 ) * VISRANGE; // this seems like an ok formula
-
- RegionIterator4Chars ri( dPos );
- bool found = false;
-
- for( ri.Begin(); !ri.atEnd(); ri++ )
- {
- P_CHAR hChar = ri.GetData();
- if( hChar )
- {
- if( hChar->isHidden() && !hChar->isInvisible() ) // do not detect invis people only hidden ones
- {
- UINT16 dx = abs( hChar->pos().x - dPos.x );
- UINT16 dy = abs( hChar->pos().y - dPos.y );
- double c = hypot( dx, dy );
-
- INT16 low = (UINT16)( hChar->skillValue(HIDING) * hChar->skillValue(HIDING) / 1E3 - ( range * 50 / VISRANGE ) * ( range - c ) / range );
- if( low < 0 )
- low = 0;
- else if( low > 1000 )
- low = 1000;
-
- if( ( pChar->checkSkill( DETECTINGHIDDEN, low, 1000 ) ) && ( c <= range ) )
- {
- hChar->unhide();
- if( hChar->objectType() == enPlayer )
- dynamic_cast<P_PLAYER>(hChar)->message( tr( "You have been revealed!" ) );
-
- found = true;
- }
- }
- }
- }
-
- if( !found )
- socket->sysMessage( tr( "You didn't find anything hidden" ) );
- return true;
- }
-
- bool cSkItemID::responsed( cUOSocket *socket, cUORxTarget *target )
- {
- P_CHAR pc_currchar = socket->player();
- const P_ITEM pi = FindItemBySerial( target->serial() );
- if( !pi )
- {
- socket->sysMessage( tr("Unable to identify that.") );
- return true;
- }
-
- if ( !pi->isLockedDown() ) // Ripper
- {
- if( !pc_currchar->checkSkill( ITEMID, 0, 250 ) )
- {
- socket->clilocMessage( 0x7A281 ); // You are not certain...
- }
- else
- {
- if( pi->corpse() )
- {
- socket->sysMessage( tr("You have to use your forensics evalutation skill to know more on this corpse.") );
- return true;
- }
-
- // Identify Item by Antichrist // Changed by MagiusCHE)
- if ( pc_currchar->checkSkill( ITEMID, 250, 500) )
- {
- if (pi->name2() == "#")
- pi->setName( pi->name2() );
-
- socket->sysMessage( tr("You found that this item appears to be called: %1").arg(pi->name()) );
-
- // Show Creator by Magius(CHE)
- if (pc_currchar->checkSkill( ITEMID, 250, 500, false ))
- {
- if (pi->creator().length()>0)
- {
- if (pi->madewith()>0)
- socket->sysMessage( tr("It is crafted by %2").arg(pi->creator()) ); // Magius(CHE)
- else if (pi->madewith()<0)
- socket->sysMessage( tr("It is crafted by %2").arg(pi->creator()) ); // Magius(CHE)
- else
- socket->sysMessage( tr("It is made by %1").arg(pi->creator()) ); // Magius(CHE)
- } else
- socket->sysMessage( tr("You don't know its creator!") );
- } else
- socket->sysMessage( tr("You can't know its creator!") );
- // End Show creator
-
- if (!pc_currchar->checkSkill( ITEMID, 250, 500, false ))
- {
- socket->sysMessage( tr("You can't tell if it is magical or not.") );
- }
- else
- {
- if(pi->type()!=15)
- {
- socket->sysMessage( tr("This item has no hidden magical properties.") );
- }
- else
- {
- if (!pc_currchar->checkSkill( ITEMID, 500, 1000, false ))
- {
- socket->sysMessage( tr("This item is enchanted with a spell, but you cannot determine which") );
- }
- else
- {
- // if (!pc_currchar->checkSkill( ITEMID, 750, 1100, false ))
- // {
- // socket->sysMessage( tr("It is enchanted with the spell %1, but you cannot determine how many charges remain.").arg(spellname[(8*(pi->morex()-1))+pi->morey()-1]) );
- // }
- // else
- // {
- // socket->sysMessage( tr("It is enchanted with the spell %1, and has %2 charges remaining.").arg(spellname[(8*(pi->morex()-1))+pi->morey()-1]).arg(pi->morez()) );
- // }
- }
- }
- }
- }
- }
- }
- return true;
- }
-
- bool cSkIntEval::responsed( cUOSocket *socket, cUORxTarget *target )
- {
- P_CHAR pc = FindCharBySerial( target->serial() );
- P_CHAR pc_currchar = socket->player();
- if(pc == NULL || pc_currchar == NULL)
- return true;
-
- if (pc == pc_currchar)
- {
- socket->sysMessage( tr("You cannot analyze yourself!") );
- return true;
- }
-
-
- // blackwind distance fix
- if( pc->dist(pc_currchar) >= 10 )
- {
- socket->sysMessage( tr("You need to be closer to find out") );
- return true;
- }
-
- if (!pc_currchar->checkSkill(EVALUATINGINTEL, 0, 1000))
- {
- socket->sysMessage( tr("You are not certain..") );
- return true;
- }
- if( !pc->intelligence() )
- socket->sysMessage( tr("It looks smarter than a rock, but dumber than a piece of wood.") );
- else
- {
- if (pc->intelligence() <= 10) socket->sysMessage( tr("That person looks slightly less intelligent than a rock.") );
- else if (pc->intelligence() <= 20) socket->sysMessage( tr("That person looks fairly stupid.") );
- else if (pc->intelligence() <= 30) socket->sysMessage( tr("That person looks not the brightest.") );
- else if (pc->intelligence() <= 40) socket->sysMessage( tr("That person looks about average.") );
- else if (pc->intelligence() <= 50) socket->sysMessage( tr("That person looks moderately intelligent.") );
- else if (pc->intelligence() <= 60) socket->sysMessage( tr("That person looks very intelligent.") );
- else if (pc->intelligence() <= 70) socket->sysMessage( tr("That person looks extremely intelligent.") );
- else if (pc->intelligence() <= 80) socket->sysMessage( tr("That person looks extraordinarily intelligent.") );
- else if (pc->intelligence() <= 90) socket->sysMessage( tr("That person looks like a formidable intellect, well beyond the ordinary.") );
- else if (pc->intelligence() <= 99) socket->sysMessage( tr("That person looks like a definite genius.") );
- else if (pc->intelligence() >=100) socket->sysMessage( tr("That person looks superhumanly intelligent in a manner you cannot comprehend.") );
- }
- return true;
- }
-
- bool cSkTame::responsed( cUOSocket *socket, cUORxTarget *target )
- {
-
- P_CHAR pc = FindCharBySerial(target->serial());
- if ( pc == NULL )
- return true;
- P_PLAYER pc_currchar = socket->player();
-
- if( !lineOfSight( pc_currchar->pos(), pc->pos(), WALLS_CHIMNEYS+DOORS+FLOORS_FLAT_ROOFING ) )
- return true;
-
- bool tamed = false;
- if ((pc->objectType() == enNPC) && ( pc_currchar->dist( pc ) <= 3))
- {
- P_NPC pn = dynamic_cast<P_NPC>(pc);
- if (pn->tamingMinSkill()>1200||pn->tamingMinSkill() == 0 )//Morrolan default is now no tame
- {
- socket->sysMessage( tr("You can't tame that creature.") );
- return true;
- }
-
- // Below... can't tame if you already have!
- if( pn->owner() == pc_currchar )
- {
- socket->sysMessage( tr("You already control that creature!" ) );
- return true;
- }
-
- // This creature is owned by someone else
- if( pn->owner() )
- {
- socket->sysMessage( tr("That creature looks tame already." ) );
- return true;
- }
-
- sprintf((char*)temp, "*%s starts to tame %s*",pc_currchar->name().latin1(),pn->name().latin1());
- for(int a=0;a<3;a++)
- {
- switch( RandomNum( 0, 3 ) )
- {
- case 0: pc_currchar->talk( tr("I've always wanted a pet like you."), -1 ,0); break;
- case 1: pc_currchar->talk( tr("Will you be my friend?"), -1 ,0); break;
- case 2: pc_currchar->talk( tr("Here %1.").arg(pn->name()), -1 ,0); break;
- case 3: pc_currchar->talk( tr("Good %1.").arg(pn->name()), -1 ,0); break;
- }
- }
- if ((!pc_currchar->checkSkill(TAMING, 0, 1000))||
- (pc_currchar->skillValue(TAMING)<pn->tamingMinSkill()))
- {
- socket->sysMessage( tr("You were unable to tame it.") );
-
- return true;
- }
- socket->showSpeech( pc, tr("It seems to accept you as it's master!"));
- tamed = true;
- pn->setOwner( pc_currchar );
- pn->setTamed(true);
- pn->setWanderType(enHalt);
- if( pn->bodyID() == 0x000C || pn->bodyID() == 0x003B )
- {
- if(pn->skin() != 0x0481)
- {
- // pn->setNpcAIType( 10 );
- pn->resend();
- }
- else
- {
- // pn->setNpcAIType( 0 );
- pn->resend();
- }
- }
- }
-
- if( !tamed )
- socket->sysMessage( tr("You can't tame that!") );
-
- return true;
- }
-
- bool cSkArmsLore::responsed( cUOSocket *socket, cUORxTarget *target )
- {
- P_ITEM pItem = FindItemBySerial( target->serial() );
- P_PLAYER pChar = socket->player();
-
- if( !pChar )
- return true;
-
- if( !pItem || !target->serial() )
- {
- socket->sysMessage( tr( "You need to target an item" ) );
- return true;
- }
-
- if( ( ( pItem->lodamage() == 0 ) && ( pItem->hidamage() == 0 ) ) && !pItem->def() )
- {
- socket->sysMessage( tr( "This does not appear to be a weapon" ) );
- return true;
- }
-
- if( pChar->isGM() )
- {
- socket->sysMessage( tr("Attack [%1] Defense [%2] Lodamage [%3] Hidamage [%4]").arg( pItem->att() ).arg( pItem->def() ).arg( pItem->lodamage() ).arg( pItem->hidamage() ) );
- return true;
- }
-
- if( !pChar->checkSkill( ARMSLORE, 0, 250 ) )
- {
- socket->sysMessage( tr( "You are not certain..." ) );
- return true;
- }
-
- QStringList mParts;
-
- // You get the HP Status between 0 and 25%
- if( pItem->maxhp() )
- {
- float totalHp = (float)( pItem->hp() / pItem->maxhp() );
- QString status;
-
- if (totalHp>0.9) status = tr( "is brand new" );
- else if (totalHp>0.8) status = tr( "is almost new" );
- else if (totalHp>0.7) status = tr( "is barely used, with a few nicks and scrapes" );
- else if (totalHp>0.6) status = tr( "is in fairly good condition" );
- else if (totalHp>0.5) status = tr( "suffered some wear and tear" );
- else if (totalHp>0.4) status = tr( "is well used" );
- else if (totalHp>0.3) status = tr( "is rather battered." );
- else if (totalHp>0.2) status = tr( "is somewhat badly damaged." );
- else if (totalHp>0.1) status = tr( "is flimsy and not trustworthy." );
- else status = tr( "is falling apart." );
-
- mParts.push_back( tr( "%1 [%2%%]" ).arg( status ).arg( totalHp*100, 0, 'f', 0 ) );
- }
-
- // You get the Damage status between 25% and 51%
- if( pChar->checkSkill( ARMSLORE, 250, 510, false ) )
- {
- if( pItem->hidamage() && pItem->lodamage() )
- {
- UINT32 mid = (UINT32)( ( pItem->hidamage() + pItem->lodamage() ) / 2 );
- QString status;
- if ( mid > 26 ) status = tr( "would be extraordinarily deadly" );
- else if ( mid > 21 ) status = tr( "would be a superior weapon" );
- else if ( mid > 16 ) status = tr( "would inflict quite a lot of damage and pain" );
- else if ( mid > 11 ) status = tr( "would probably hurt your opponent a fair amount" );
- else if ( mid > 6 ) status = tr( "would do some damage" );
- else if ( mid > 3 ) status = tr( "would do minimal damage" );
- else status = tr( "might scratch your opponent slightly" );
-
- mParts.push_back( status );
-
- // The weapon speed is displayed between 50% and 100%
- if( pChar->checkSkill( ARMSLORE, 500, 1000, false ) )
- {
- if( pItem->speed() > 32 ) status = tr( "is very fast" );
- else if( pItem->speed() > 25 ) status = tr( "is fast" );
- else if( pItem->speed() > 15 ) status = tr( "is slow" );
- else status = tr( "is very slow ");
- mParts.push_back( status );
- }
- }
- // Armor ratings
- else if( pItem->def() )
- {
- QString status;
-
- if ( pItem->def() > 12) status = tr( "is superbly crafted to provide maximum protection" );
- else if ( pItem->def() > 10) status = tr( "offers excellent protection" );
- else if ( pItem->def() > 8 ) status = tr( "is a superior defense against attack" );
- else if ( pItem->def() > 6 ) status = tr( "serves as a sturdy protection" );
- else if ( pItem->def() > 4 ) status = tr( "offers some protection against blows" );
- else if ( pItem->def() > 2 ) status = tr( "provides very little protection" );
- else if ( pItem->def() > 0 ) status = tr( "provides almost no protection" );
- else status = tr( "offers no defense against attackers" );
-
- mParts.push_back( status );
- }
- }
-
- if( mParts.count() == 0 )
- {
- socket->sysMessage( tr( "You are not sure..." ) );
- return true;
- }
-
- // Build a human readable sentence
- if( mParts.count() < 3 )
- socket->sysMessage( tr( "The item %1." ).arg( mParts.join( tr( " and " ) ) ) );
- else
- {
- QString lastPart = mParts.last();
- mParts.remove( mParts.back() );
- socket->sysMessage( tr( "The item %1 and %2" ).arg( mParts.join( ", " ) ).arg( lastPart ) );
- }
-
- // Display the rank if there is one (Between 25% and 50%)
- if( ( pItem->rank() > 0 ) && ( pItem->rank() < 11 ) && SrvParams->rank_system() && pChar->checkSkill( ARMSLORE, 250, 500, false ) )
- {
- switch( pItem->rank() )
- {
- case 1: socket->sysMessage( tr("It seems an item with no quality.") ); break;
- case 2: socket->sysMessage( tr("It seems an item very below standard quality.") ); break;
- case 3: socket->sysMessage( tr("It seems an item below standard quality.") ); break;
- case 4: socket->sysMessage( tr("It seems a weak quality item.") ); break;
- case 5: socket->sysMessage( tr("It seems a standard quality item.") ); break;
- case 6: socket->sysMessage( tr("It seems a nice quality item.") ); break;
- case 7: socket->sysMessage( tr("It seems a good quality item.") ); break;
- case 8: socket->sysMessage( tr("It seems a great quality item.") ); break;
- case 9: socket->sysMessage( tr("It seems a beautiful quality item.") ); break;
- case 10:socket->sysMessage( tr("It seems a perfect quality item.") ); break;
- }
- }
- return true;
- }
-
- bool cSkBegging::responsed( cUOSocket *socket, cUORxTarget *target )
- {
- int gold,x,y,realgold;
- char abort;
- P_PLAYER pc_currchar = socket->player();
-
- P_CHAR pChar = FindCharBySerial( target->serial() );
- if (!pChar)
- return true;
-
- if(pChar->objectType() == enPlayer)
- {
- socket->sysMessage( tr("Maybe you should just ask.") );
- return true;
- }
-
- P_NPC pc = dynamic_cast<P_NPC>(pChar);
-
- if(pc->dist(pc)>=5)
- {
- socket->sysMessage( tr("You are not close enough to beg.") );
- return true;
- }
-
- if(pc->isHuman() && (pc->intelligence() != 0)) //Used on human
- {
- if (pc->nextBeggingTime()>=uiCurrentTime)
- {
- pc->talk(tr("Annoy someone else !"));
- return true;
- }
-
- switch ( RandomNum(0, 2))
- {
- case 0: pc_currchar->talk( tr("Could thou spare a few coins?"), -1 ,0); break;
- case 1: pc_currchar->talk( tr("Hey buddy can you spare some gold?"), -1 ,0); break;
- case 2: pc_currchar->talk( tr("I have a family to feed, think of the children."), -1 ,0); break;
- }
-
- if (!pc_currchar->checkSkill( BEGGING, 0, 1000))
- {
- socket->sysMessage( tr("They seem to ignore your begging plees.") );
- }
- else
- {
- pc->setNextBeggingTime( SrvParams->beggingTime() * MY_CLOCKS_PER_SEC + uiCurrentTime);
- x=pc->skillValue(BEGGING)/50;
-
- if (x<1) x=1;
- y=rand()%x;
- y+=RandomNum(1,4);
- if (y>25) y=25;
- // pre-calculate the random amout of gold that is "targeted"
-
- P_ITEM pi_p = pc->getBackpack();
- gold=0;
- realgold=0;
- abort=0;
-
- // check for gold in target-npc pack
-
- if (pi_p != NULL)
- {
- cItem::ContainerContent container(pi_p->content());
- cItem::ContainerContent::const_iterator it (container.begin());
- cItem::ContainerContent::const_iterator end(container.end());
- for (; it != end; ++it )
- {
- P_ITEM pi_j = *it;
- if (pi_j != NULL)
- {
- if (pi_j->id() == 0x0EED )
- {
- gold += pi_j->amount(); // calc total gold in pack
-
- int k = pi_j->amount();
- if(k >= y) // enough money in that pile in pack to satisfy pre-aclculated amount
- {
- pi_j->reduceAmount( y );
- realgold += y; // calc gold actually given to player
-
- // This does not end in a crash !??
- //if( pi_j != NULL ) // Only if we still have an item
- pi_j->update(); // resend new amount
-
- abort = 1;
- }
- else // not enough money in this pile -> only delete it
- {
- Items->DeleItem( pi_j );
- pi_j->update(); // Refresh a deleted item?
- realgold += pi_j->amount();
- }
- }
- } // end of if j!=-1
- if (abort)
- break;
- }
- }
-
- if (gold<=0)
- {
- pc->talk( tr("Thou dost not look trustworthy... no gold for thee today! ") );
- return true;
- }
- pc->talk( tr("I feel sorry for thee... here have a gold coin ."), -1, 0 );
- addgold(socket, realgold);
- socket->sysMessage( tr("Some gold is placed in your pack.") );
- }
- }
- else
- socket->sysMessage( tr("That would be foolish.") );
- return true;
- }
-
bool cSkStealing::responsed( cUOSocket *socket, cUORxTarget *target )
{
--- 184,187 ----
***************
*** 798,909 ****
else
socket->sysMessage( tr("You are too far away to steal that item.") );
- return true;
- }
-
- bool cSkProvocation::acquireFirst( cUOSocket* socket, cUORxTarget* target )
- {
- P_CHAR pc = FindCharBySerial( target->serial() );
-
- if( pc == NULL )
- return true; // cancel the skill
-
- P_ITEM inst = Skills->GetInstrument(socket);
- if (inst == NULL)
- {
- socket->sysMessage( tr("You do not have an instrument to play on!") );
- return true; // cancel the skill
- }
- if ( pc->isInvulnerable() ) // invul
- /* pc->npcaitype()==0x01 || // healer
- pc->npcaitype()==0x04 || // tele guard
- pc->npcaitype()==0x06 || // chaos guard
- pc->npcaitype()==0x07 || // order guard
- pc->npcaitype()==0x09) // city guard*/
- {
- socket->sysMessage( tr(" You cant entice that npc!") );
- return true;
- }
- if (pc->inGuardedArea())
- {
- socket->sysMessage( tr(" You cant do that in town!") );
- return true;
- }
-
- if (pc->objectType() == enPlayer)
- socket->sysMessage( tr("You cannot provoke other players.") );
- else
- {
- socket->sysMessage( tr("You play your music, inciting anger, and your target begins to look furious. Whom do you wish it to attack?") );
- Skills->PlayInstrumentWell(socket, inst);
- firstTarget = true;
- attacker = pc;
- return false;
- }
- return true;
- }
-
- bool cSkProvocation::selectVictim( cUOSocket* socket, cUORxTarget* target )
- {
- P_CHAR Victim = FindCharBySerial( target->serial() );
- if (!Victim)
- return true;
-
- P_PLAYER Player = socket->player();
-
- if (Victim->inGuardedArea())
- {
- socket->sysMessage( tr("You cant do that in town!") );
- return true;
- }
- if (Victim->isSameAs(attacker))
- {
- socket->sysMessage( tr("Silly bard! You can't get something to attack itself.") );
- return true;
- }
-
- P_ITEM inst = Skills->GetInstrument(socket);
- if (inst == NULL)
- {
- socket->sysMessage( tr("You do not have an instrument to play on!") );
- return true;
- }
- if (Player->checkSkill( MUSICIANSHIP, 0, 1000))
- {
- Skills->PlayInstrumentWell(socket, inst);
- if (Player->checkSkill( PROVOCATION, 0, 1000))
- {
- if( Player->inGuardedArea() )
- {
- Coord_cl cPos = Player->pos();
- cPos.x++;
- Combat::spawnGuard( Player, Player, cPos );
- }
-
- socket->sysMessage( tr("Your music succeeds as you start a fight.") );
- }
- else
- {
- socket->sysMessage( tr("Your music fails to incite enough anger.") );
- Victim = Player; // make the targeted one attack the Player
- }
-
- attacker->fight(Victim);
- attacker->setAttackFirst( true );
-
- Victim->fight(attacker);
- Victim->setAttackFirst( false );
-
- QString temp(tr("* You see %1 attacking %2 *").arg(attacker->name()).arg(Victim->name()) );
- for ( cUOSocket *mSock = cNetwork::instance()->first(); mSock; mSock = cNetwork::instance()->next())
- {
- if( mSock != socket && inrange1p( attacker, mSock->player() ) )
- mSock->showSpeech(Victim, temp);
- }
- }
- else
- {
- Skills->PlayInstrumentPoor(socket, inst);
- socket->sysMessage( tr("You play rather poorly and to no effect.") );
- }
return true;
}
--- 284,287 ----
Index: targetrequests.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/targetrequests.h,v
retrieving revision 1.41
retrieving revision 1.42
diff -C2 -d -r1.41 -r1.42
*** targetrequests.h 26 Jul 2003 02:05:31 -0000 1.41
--- targetrequests.h 14 Aug 2003 19:12:58 -0000 1.42
***************
*** 108,162 ****
};
- // This is the target-request for ArmsLore
- class cSkArmsLore: public cTargetRequest
- {
- Q_OBJECT
- public:
- bool responsed( cUOSocket *socket, cUORxTarget *target );
- };
-
- // Detecting hidden
- class cSkDetectHidden: public cTargetRequest
- {
- Q_OBJECT
- public:
- virtual bool responsed( cUOSocket *socket, cUORxTarget *target );
- };
-
- // Item Identification
- class cSkItemID: public cTargetRequest
- {
- Q_OBJECT
- public:
- virtual bool cSkItemID::responsed( cUOSocket *socket, cUORxTarget *target );
- };
-
-
- // Evaluate Inteligence
- class cSkIntEval: public cTargetRequest
- {
- Q_OBJECT
- public:
- bool responsed( cUOSocket *socket, cUORxTarget *target );
- };
-
-
- // Tame
- class cSkTame: public cTargetRequest
- {
- Q_OBJECT
- public:
- bool responsed( cUOSocket *socket, cUORxTarget *target );
- };
-
-
- // Begging
- class cSkBegging: public cTargetRequest
- {
- Q_OBJECT
- public:
- bool responsed( cUOSocket *socket, cUORxTarget *target );
- };
-
// Stealing
class cSkStealing: public cTargetRequest
--- 108,111 ----
***************
*** 286,379 ****
return selectPoison( socket, target );
}
- };
-
-
- // Taste Identification
- class cSkTasteID: public cTargetRequest
- {
- Q_OBJECT
- public:
- virtual bool responsed( cUOSocket *socket, cUORxTarget *target )
- {
- const P_ITEM pi = FindItemBySerial( target->serial() );
- P_CHAR pc_currchar = socket->player();
- if ( pi && !pi->isLockedDown() ) // Ripper
- {
- if( !( pi->type() == 19 || pi->type() == 14) )
- {
- socket->sysMessage( tr("You cant taste that!") );
- return true;
- }
- if (!pc_currchar->checkSkill( TASTEID, 0, 250))
- {
- socket->sysMessage( tr("You can't quite tell what this item is...") );
- }
- else
- {
- if( pi->corpse() )
- {
- socket->sysMessage( tr("You have to use your forensics evalutation skill to know more on this corpse.") );
- return true;
- }
-
- // Identify Item by Antichrist // Changed by MagiusCHE)
- if (pc_currchar->checkSkill( TASTEID, 250, 500, false ))
- if (pi->name2() != "#")
- pi->setName( pi->name2() ); // Item identified! -- by Magius(CHE)
-
- socket->sysMessage( tr("You found that this item appears to be called: %1").arg(pi->name()) );
-
- if (pc_currchar->checkSkill( TASTEID, 250, 500, false ))
- {
- if((pi->poisoned()>0) || (pi->morex()==4 && pi->morey()==6 && pi->morez()==1))
- socket->sysMessage( tr("This item is poisoned!") );
- else
- socket->sysMessage( tr("This item shows no poison.") );
-
- // Show Creator by Magius(CHE)
- if (pc_currchar->checkSkill( TASTEID, 250, 500, false ))
- {
- if (pi->creator().length()>0)
- {
- if (pi->madewith()>0)
- socket->sysMessage( tr("It is crafted by %2").arg( pi->creator() ) ); // Magius(CHE)
- else if (pi->madewith()<0)
- socket->sysMessage( tr("It is crafted by %2").arg( pi->creator() ) ); // Magius(CHE)
- else
- socket->sysMessage( tr("It is made by %1").arg(pi->creator()) ); // Magius(CHE)
- } else
- socket->sysMessage( tr("You don't know its creator!") );
- } else
- socket->sysMessage( tr("You can't know its creator!") );
- }
- }
- }
- return true;
- }
- };
-
-
- // Provocation
- class cSkProvocation: public cTargetRequest
- {
- Q_OBJECT
- bool firstTarget;
- P_CHAR attacker;
- public:
-
- cSkProvocation() : firstTarget(false) {}
-
- bool acquireFirst( cUOSocket* socket, cUORxTarget* target );
-
- bool cSkProvocation::selectVictim( cUOSocket* socket, cUORxTarget* target );
-
- virtual bool responsed( cUOSocket *socket, cUORxTarget *target )
- {
- if ( !firstTarget )
- return acquireFirst( socket, target );
- else
- return selectVictim( socket, target);
- }
-
};
--- 235,238 ----
|
|
From: <thi...@us...> - 2003-08-14 18:39:27
|
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv15949
Modified Files:
skills.cpp
Log Message:
Possible crash fix. Crash reported by Dreoth at irc channel.
Index: skills.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/skills.cpp,v
retrieving revision 1.200
retrieving revision 1.201
diff -C2 -d -r1.200 -r1.201
*** skills.cpp 11 Aug 2003 03:34:40 -0000 1.200
--- skills.cpp 14 Aug 2003 18:38:02 -0000 1.201
***************
*** 904,909 ****
if (pi->layer() > 1 && pi->layer() < 25)
{
! if (!(strstr(pi->name().ascii(), "leather") || strstr(pi->name().ascii(), "magic") ||
! strstr(pi->name().ascii(), "boot")|| strstr(pi->name().ascii(), "mask")))
ar += pi->def();
}
--- 904,909 ----
if (pi->layer() > 1 && pi->layer() < 25)
{
! if (!(pi->name().contains("leather") || pi->name().contains("magic") ||
! pi->name().contains("boot") || pi->name().contains("mask") ))
ar += pi->def();
}
|
|
From: <xs...@us...> - 2003-08-14 12:19:31
|
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv26407
Modified Files:
items.cpp uobject_flatstore.cpp
Log Message:
item definitions use setProperty,
applying correas changes on flatstore
Index: items.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/items.cpp,v
retrieving revision 1.326
retrieving revision 1.327
diff -C2 -d -r1.326 -r1.327
*** items.cpp 11 Aug 2003 03:34:40 -0000 1.326
--- items.cpp 14 Aug 2003 12:15:04 -0000 1.327
***************
*** 1240,1262 ****
}
- // <name>my Item</name>
- if( TagName == "name" )
- this->setName( Value );
-
// <identified>my magic item</identified>
else if( TagName == "identified" )
this->setName2( Value.latin1() );
- // <amount>120</amount>
- else if( TagName == "amount" )
- {
- this->setAmount( Value.toULong() );
- this->restock_ = Value.toULong(); // Maximumm sell-amount from the beginning
- }
-
- // <color>480</color>
- else if( TagName == "color" )
- this->setColor( Value.toUShort() );
-
// <attack min="1" max="2"/>
else if( TagName == "attack" )
--- 1240,1247 ----
***************
*** 1273,1280 ****
}
- // <defense>10</defense>
- else if( TagName == "defense" )
- this->def_ = Value.toInt();
-
// for convenience
// <food>1</food>
--- 1258,1261 ----
***************
*** 1285,1322 ****
}
- // <type>10</type>
- else if( TagName == "type" )
- this->setType( Value.toUInt() );
-
- // <type2>10</type2>
- else if( TagName == "type2" )
- this->setType2( Value.toUInt() );
-
// <weight>10</weight>
else if( TagName == "weight" )
this->setWeight( (UINT32)( Value.toFloat() * 10 ) );
- // <buyprice>10</buyprice>
- else if( TagName == "buyprice" )
- {
- this->buyprice_ = Value.toInt();
- }
-
- // <sellprice>10</sellprice>
- else if( TagName == "sellprice" )
- this->sellprice_ = Value.toInt();
-
- // <price>10</price>
- // else if( TagName == "price" )
- // this->price_ = Value.toInt(); --> this was supposed to be player vendor price, the player defines it! :)
-
- // <carve></carve> For corpses and item spawners
- // else if( TagName == "carve" )
- // this->carve_ = Value;
-
- // <restock>10</restock>
- else if( TagName == "restock" )
- this->restock_ = Value.toInt();
-
// <durability>10</durabilty>
else if( TagName == "durability" )
--- 1266,1273 ----
***************
*** 1497,1506 ****
}
- // <accuracy>20</accuracy> value between 0 and 100
- else if( TagName == "accuracy" )
- {
- setAccuracy( Value.toUShort() );
- }
-
else if( section )
{
--- 1448,1451 ----
***************
*** 1692,1708 ****
}
! // <color>480</color>
! else if( TagName == "color" )
! this->setColor( color() + Value.toUShort() );
!
! // <id>12f9</id>
! else if( TagName == "id" )
! {
! this->setId( id() + Value.toUShort() );
!
! // In addition to the normal behaviour we retrieve the weight of the
! // item here.
! setWeight( TileCache::instance()->getTile( id_ ).weight );
! }
}
--- 1637,1642 ----
}
! else
! cUObject::processNode( Tag );
}
Index: uobject_flatstore.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/uobject_flatstore.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** uobject_flatstore.cpp 25 Jun 2003 13:21:41 -0000 1.5
--- uobject_flatstore.cpp 14 Aug 2003 12:15:04 -0000 1.6
***************
*** 20,24 ****
OBJECT_POS_Z, // 1 Byte Char
OBJECT_POS_MAP, // 1 Byte Unsigned Char
! OBJECT_EVENTS // String
};
--- 20,25 ----
OBJECT_POS_Z, // 1 Byte Char
OBJECT_POS_MAP, // 1 Byte Unsigned Char
! OBJECT_EVENTS, // String
! OBJECT_DIRECTION
};
***************
*** 47,50 ****
--- 48,53 ----
output->chunkData( OBJECT_EVENTS, eventList().utf8().data() );
+ output->chunkData( OBJECT_DIRECTION, (unsigned char)direction() );
+
output->finishChunkGroup();
***************
*** 93,96 ****
--- 96,107 ----
recreateEvents();
break;
+
+ case OBJECT_DIRECTION:
+ {
+ unsigned char temp;
+ input->readUChar( temp );
+ dir_ = temp;
+ break;
+ }
default:
|
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv13883
Modified Files:
basechar.cpp basechar.h books.h corpse.h items.h npc.cpp npc.h
player.h uobject.cpp
Log Message:
definition tags also use setProperty
Index: basechar.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/basechar.cpp,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** basechar.cpp 11 Aug 2003 03:34:40 -0000 1.30
--- basechar.cpp 11 Aug 2003 12:17:57 -0000 1.31
***************
*** 1204,1211 ****
}
- //<name>my this</name>
- if( TagName == "name" )
- this->setName(Value);
-
//<backpack>
// <color>0x132</color>
--- 1204,1207 ----
***************
*** 1323,1346 ****
}
- //<defense>10</defense>
- else if( TagName == "defense" )
- this->bodyArmor_ = Value.toUInt();
-
- //<emotecolor>0x482</emotecolor>
- else if( TagName == "emotecolor" )
- this->emoteColor_ = Value.toUShort();
-
- //<fame>8000</fame>
- else if( TagName == "fame" )
- this->fame_ = Value.toInt();
-
- //<food>3</food>
- else if( TagName == "food" )
- {
- UI16 bit = Value.toUShort();
- if( bit < 32 && bit > 0 )
- this->nutriment_ |= ( 1 << (bit-1) );
- }
-
//<gold>100</gold>
else if( TagName == "gold" )
--- 1319,1322 ----
***************
*** 1349,1382 ****
}
- //<id>0x11</id>
- else if( TagName == "id" )
- {
- bodyID_ = Value.toInt();
- orgBodyID_ = bodyID_;
- }
-
- //<karma>-500</karma>
- else if( TagName == "karma" )
- this->karma_ = Value.toInt();
-
- //<poison>2</poison>
- else if( TagName == "poison" )
- this->setPoison( Value.toInt() );
-
- //<skin>0x342</skin>
- else if( TagName == "skin" )
- {
- skin_ = Value.toUShort();
- orgSkin_ = Value.toUShort();
- }
-
- //<saycolor>0x110</saycolor>
- else if( TagName == "saycolor" )
- saycolor_ = Value.toUShort();
-
- //<title>the king</title>
- else if( TagName == "title" )
- this->setTitle( Value );
-
//<skill type="alchemy">100</skill>
//<skill type="1">100</skill>
--- 1325,1328 ----
***************
*** 1457,1473 ****
}
- else if( TagName == "inherit" )
- {
- QString inheritID;
- if( Tag->hasAttribute( "id" ) )
- inheritID = Tag->getAttribute( "id" );
- else
- inheritID = Value;
-
- const cElement *element = DefManager->getDefinition( WPDT_NPC, inheritID );
- if( element )
- applyDefinition( element );
- }
-
else
{
--- 1403,1406 ----
***************
*** 1480,1484 ****
}
- // cUObject::processNode( Tag );
}
--- 1413,1416 ----
Index: basechar.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/basechar.h,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** basechar.h 11 Aug 2003 03:34:40 -0000 1.21
--- basechar.h 11 Aug 2003 12:17:57 -0000 1.22
***************
*** 105,110 ****
// other public methods
// Simple Property setting and getting for script engines.
! stError *setProperty( const QString &name, const cVariant &value );
! stError *getProperty( const QString &name, cVariant &value ) const;
void updateHealth( void );
void action( uchar id ); // Do an action
--- 105,110 ----
// other public methods
// Simple Property setting and getting for script engines.
! virtual stError *setProperty( const QString &name, const cVariant &value );
! virtual stError *getProperty( const QString &name, cVariant &value ) const;
void updateHealth( void );
void action( uchar id ); // Do an action
Index: books.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/books.h,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** books.h 6 Jul 2003 13:48:01 -0000 1.24
--- books.h 11 Aug 2003 12:17:57 -0000 1.25
***************
*** 90,95 ****
void refresh( void );
! stError *setProperty( const QString &name, const cVariant &value );
! stError *getProperty( const QString &name, cVariant &value ) const;
private:
bool predefined_;
--- 90,95 ----
void refresh( void );
! virtual stError *setProperty( const QString &name, const cVariant &value );
! virtual stError *getProperty( const QString &name, cVariant &value ) const;
private:
bool predefined_;
Index: corpse.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/corpse.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** corpse.h 14 Jul 2003 16:58:49 -0000 1.11
--- corpse.h 11 Aug 2003 12:17:57 -0000 1.12
***************
*** 103,108 ****
virtual void update( cUOSocket *mSock = 0 );
! stError *setProperty( const QString &name, const cVariant &value );
! stError *getProperty( const QString &name, cVariant &value ) const;
};
--- 103,108 ----
virtual void update( cUOSocket *mSock = 0 );
! virtual stError *setProperty( const QString &name, const cVariant &value );
! virtual stError *getProperty( const QString &name, cVariant &value ) const;
};
Index: items.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/items.h,v
retrieving revision 1.163
retrieving revision 1.164
diff -C2 -d -r1.163 -r1.164
*** items.h 11 Aug 2003 03:34:40 -0000 1.163
--- items.h 11 Aug 2003 12:17:57 -0000 1.164
***************
*** 368,373 ****
P_CHAR getOutmostChar();
! stError *setProperty( const QString &name, const cVariant &value );
! stError *getProperty( const QString &name, cVariant &value ) const;
////
--- 368,373 ----
P_CHAR getOutmostChar();
! virtual stError *setProperty( const QString &name, const cVariant &value );
! virtual stError *getProperty( const QString &name, cVariant &value ) const;
////
Index: npc.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/npc.cpp,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** npc.cpp 11 Aug 2003 03:34:40 -0000 1.28
--- npc.cpp 11 Aug 2003 12:17:57 -0000 1.29
***************
*** 919,933 ****
QDomNodeList ChildTags;
- //<carve>3</carve>
- if( TagName == "carve" )
- this->setCarve( Value );
-
- /* //<cantrain />
- else if( TagName == "cantrain" )
- this->setCantrain( true );*/
-
//<attack min=".." max= "" />
//<attack>10</attack>
! else if( TagName == "attack" )
{
if( Tag->hasAttribute("min") && Tag->hasAttribute("max") )
--- 919,925 ----
QDomNodeList ChildTags;
//<attack min=".." max= "" />
//<attack>10</attack>
! if( TagName == "attack" )
{
if( Tag->hasAttribute("min") && Tag->hasAttribute("max") )
***************
*** 943,968 ****
}
- //<fleeat>10</fleeat>
- else if( TagName == "fleeat" )
- this->setCriticalHealth( Value.toShort() );
-
- //<hidamage>10</hidamage>
- else if( TagName == "hidamage" )
- this->minDamage_ = Value.toInt();
-
- //<loot>lootlist</loot>
- else if( TagName == "loot" )
- {
- this->setLootList( Value );
- }
-
- //<lodamage>10</lodamage>
- else if( TagName == "lodamage" )
- this->maxDamage_ = Value.toInt();
-
- /* //<notrain />
- else if( TagName == "notrain" )
- this->setCantrain( false );*/
-
//<npcwander type="rectangle" x1="-10" x2="12" y1="5" y2="7" />
//<......... type="rect" ... />
--- 935,938 ----
***************
*** 1001,1009 ****
}
- //<ai>Monster_Aggressive_L1</ai>
- //<ai>Monster_Aggressive_L1,Monster_Aggr_L1_Wander</ai>
- else if( TagName == "ai" )
- this->setAI( Value );
-
//<shopkeeper>
// <sellable>...handled like item-<contains>-section...</sellable>
--- 971,974 ----
***************
*** 1037,1054 ****
}
}
-
- /* //<split>1</split>
- else if( TagName == "split" )
- this->setSplit( Value.toUShort() );
! //<splitchance>10</splitchance>
! else if( TagName == "splitchance" )
! this->setSplitchnc( Value.toUShort() );*/
! //<totame>115</totame>
! else if( TagName == "totame" )
! tamingMinSkill_ = Value.toInt();
! else
cBaseChar::processNode( Tag );
--- 1002,1020 ----
}
}
! else if( TagName == "inherit" )
! {
! QString inheritID;
! if( Tag->hasAttribute( "id" ) )
! inheritID = Tag->getAttribute( "id" );
! else
! inheritID = Value;
! const cElement *element = DefManager->getDefinition( WPDT_NPC, inheritID );
! if( element )
! applyDefinition( element );
! }
! else
cBaseChar::processNode( Tag );
***************
*** 1067,1070 ****
--- 1033,1037 ----
else SET_INT_PROPERTY( "stablemaster", stablemasterSerial_ )
else SET_STR_PROPERTY( "lootlist", lootList_ )
+ else SET_STR_PROPERTY( "loot", lootList_ )
else SET_INT_PROPERTY( "maxdamage", maxDamage_ )
else SET_INT_PROPERTY( "mindamage", minDamage_ )
***************
*** 1157,1160 ****
--- 1124,1128 ----
else GET_PROPERTY( "stablemaster", FindCharBySerial( stablemasterSerial_ ) )
else GET_PROPERTY( "lootlist", lootList_ )
+ else GET_PROPERTY( "loot", lootList_ )
else GET_PROPERTY( "maxdamage", maxDamage_ )
else GET_PROPERTY( "mindamage", minDamage_ )
Index: npc.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/npc.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** npc.h 6 Jul 2003 13:48:01 -0000 1.16
--- npc.h 11 Aug 2003 12:17:57 -0000 1.17
***************
*** 103,108 ****
// other public methods
! stError *setProperty( const QString &name, const cVariant &value );
! stError *getProperty( const QString &name, cVariant &value ) const;
void attackTarget( P_CHAR defender );
void toggleCombat();
--- 103,108 ----
// other public methods
! virtual stError *setProperty( const QString &name, const cVariant &value );
! virtual stError *getProperty( const QString &name, cVariant &value ) const;
void attackTarget( P_CHAR defender );
void toggleCombat();
Index: player.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/player.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** player.h 6 Jul 2003 13:48:01 -0000 1.13
--- player.h 11 Aug 2003 12:17:57 -0000 1.14
***************
*** 80,85 ****
// other public methods
! stError *setProperty( const QString &name, const cVariant &value );
! stError *getProperty( const QString &name, cVariant &value ) const;
void turnTo( cUObject *object ); // override
void turnTo( const Coord_cl& data ); // override
--- 80,85 ----
// other public methods
! virtual stError *setProperty( const QString &name, const cVariant &value );
! virtual stError *getProperty( const QString &name, cVariant &value ) const;
void turnTo( cUObject *object ); // override
void turnTo( const Coord_cl& data ); // override
Index: uobject.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/uobject.cpp,v
retrieving revision 1.102
retrieving revision 1.103
diff -C2 -d -r1.102 -r1.103
*** uobject.cpp 11 Aug 2003 03:34:40 -0000 1.102
--- uobject.cpp 11 Aug 2003 12:17:57 -0000 1.103
***************
*** 555,560 ****
recreateEvents();
}
! else
! qWarning( tr("Unknown tag %1").arg(TagName) );
}
--- 555,561 ----
recreateEvents();
}
! else
! setProperty( TagName, Value );
! // qWarning( tr("Unknown tag %1").arg(TagName) );
}
|
|
From: <xs...@us...> - 2003-08-11 12:18:00
|
Update of /cvsroot/wpdev/wolfpack/python In directory sc8-pr-cvs1:/tmp/cvs-serv13883/python Modified Files: char.cpp Log Message: definition tags also use setProperty Index: char.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/python/char.cpp,v retrieving revision 1.97 retrieving revision 1.98 diff -C2 -d -r1.97 -r1.98 *** char.cpp 11 Aug 2003 03:34:40 -0000 1.97 --- char.cpp 11 Aug 2003 12:17:58 -0000 1.98 *************** *** 1367,1371 **** pChar->addPet( npc ); ! npc->setNextMoveTime(); return PyTrue; --- 1367,1372 ---- pChar->addPet( npc ); ! npc->setWanderType( enFollowTarget ); ! npc->setWanderFollowTarget( pChar ); return PyTrue; *************** *** 1418,1423 **** return PyFalse; ! npc->findPath( pos ); ! npc->setNextMoveTime(); return PyTrue; --- 1419,1424 ---- return PyFalse; ! npc->setWanderType( enDestination ); ! npc->setWanderDestination( pos ); return PyTrue; |
|
From: <thi...@us...> - 2003-08-11 03:34:46
|
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv2931
Modified Files:
basechar.cpp basechar.h basechar_flatstore.cpp
dbl_single_click.cpp debug.cpp item_flatstore.cpp items.cpp
items.h npc.cpp player.cpp prototypes.h skills.cpp uobject.cpp
uobject.h wolfpack.cpp
Log Message:
- moved direction from cItem and cBaseChar to cUObject.
- Removed some dead code
- Notice that the SQL changed a bit due to the first item :)
Index: basechar.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/basechar.cpp,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** basechar.cpp 17 Jul 2003 09:14:12 -0000 1.29
--- basechar.cpp 11 Aug 2003 03:34:40 -0000 1.30
***************
*** 63,67 ****
weight_ = 0;
bodyArmor_ = 2;
- direction_ = 0;
dexterity_ = 0;
dexterityMod_ = 0;
--- 63,66 ----
***************
*** 133,137 ****
cUObject::buildSqlString( fields, tables, conditions );
fields.push_back( "characters.name,characters.title,characters.creationdate" );
! fields.push_back( "characters.dir,characters.body,characters.orgbody,characters.skin" );
fields.push_back( "characters.orgskin,characters.saycolor" );
fields.push_back( "characters.emotecolor,characters.strength,characters.strengthmod,characters.dexterity" );
--- 132,136 ----
cUObject::buildSqlString( fields, tables, conditions );
fields.push_back( "characters.name,characters.title,characters.creationdate" );
! fields.push_back( "characters.body,characters.orgbody,characters.skin" );
fields.push_back( "characters.orgskin,characters.saycolor" );
fields.push_back( "characters.emotecolor,characters.strength,characters.strengthmod,characters.dexterity" );
***************
*** 166,170 ****
title_ = result[offset++];
creationDate_ = QDateTime::fromString( result[offset++], Qt::ISODate );
- direction_ = atoi( result[offset++] );
bodyID_ = atoi( result[offset++] );
orgBodyID_ = atoi( result[offset++] );
--- 165,168 ----
***************
*** 252,256 ****
addStrField( "title", title_ );
addField( "creationdate", creationDate_.toString() );
- addField( "dir", direction_ );
addField( "body", bodyID_ );
addField( "orgbody", orgBodyID_ );
--- 250,253 ----
***************
*** 408,412 ****
action.setAction( id );
action.setSerial( serial() );
! action.setDirection( direction_ );
action.setRepeat( 1 );
action.setRepeatFlag( 0 );
--- 405,409 ----
action.setAction( id );
action.setSerial( serial() );
! action.setDirection( direction() );
action.setRepeat( 1 );
action.setRepeatFlag( 0 );
***************
*** 607,614 ****
return;
! if( nDir != direction_ )
{
changed( SAVE );
! direction_ = nDir;
update();
}
--- 604,611 ----
return;
! if( nDir != direction() )
{
changed( SAVE );
! setDirection( nDir );
update();
}
***************
*** 1238,1264 ****
}
- //<direction>SE</direction>
- else if( TagName == "direction" )
- {
- if( Value == "NE" )
- this->direction_ = 1;
- else if( Value == "E" )
- this->direction_ = 2;
- else if( Value == "SE" )
- this->direction_ = 3;
- else if( Value == "S" )
- this->direction_ = 4;
- else if( Value == "SW" )
- this->direction_ = 5;
- else if( Value == "W" )
- this->direction_ = 6;
- else if( Value == "NW" )
- this->direction_ = 7;
- else if( Value == "N" )
- this->direction_ = 0;
- else
- this->direction_ = Value.toUShort();
- }
-
//<stat type="str">100</stats>
else if( TagName == "stat" )
--- 1235,1238 ----
***************
*** 1662,1666 ****
else SET_INT_PROPERTY( "dexterity2", dexterityMod_ )
else SET_INT_PROPERTY( "intelligence2", intelligenceMod_ )
- else SET_INT_PROPERTY( "direction", direction_ )
else SET_INT_PROPERTY( "xid", orgBodyID_ )
else SET_INT_PROPERTY( "orgid", orgBodyID_ )
--- 1636,1639 ----
***************
*** 1759,1763 ****
else GET_PROPERTY( "dexterity2", dexterityMod_ )
else GET_PROPERTY( "intelligence2", intelligenceMod_ )
- else GET_PROPERTY( "direction", direction_ )
else GET_PROPERTY( "orgid", orgBodyID_ )
else GET_PROPERTY( "xid", orgBodyID_ )
--- 1732,1735 ----
Index: basechar.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/basechar.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** basechar.h 6 Jul 2003 13:48:01 -0000 1.20
--- basechar.h 11 Aug 2003 03:34:40 -0000 1.21
***************
*** 80,84 ****
// implementation of interfaces
! void load( char **, UINT16& );
void save();
void save( FlatStore::OutputFile*, bool first = false ) throw();
--- 80,84 ----
// implementation of interfaces
! void load( char **, ushort& );
void save();
[...1609 lines suppressed...]
! inline UINT32 cBaseChar::regenManaTime() const
{
return regenManaTime_;
}
! inline void cBaseChar::setRegenManaTime(UINT32 data)
{
regenManaTime_ = data;
--- 1116,1125 ----
}
! inline uint cBaseChar::regenManaTime() const
{
return regenManaTime_;
}
! inline void cBaseChar::setRegenManaTime(uint data)
{
regenManaTime_ = data;
Index: basechar_flatstore.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/basechar_flatstore.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** basechar_flatstore.cpp 25 Jun 2003 13:21:41 -0000 1.3
--- basechar_flatstore.cpp 11 Aug 2003 03:34:40 -0000 1.4
***************
*** 223,230 ****
break;
- case CHAR_DIR:
- input->readUChar( direction_ );
- break;
-
case CHAR_BODY:
input->readUShort( bodyID_ );
--- 223,226 ----
Index: dbl_single_click.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/dbl_single_click.cpp,v
retrieving revision 1.208
retrieving revision 1.209
diff -C2 -d -r1.208 -r1.209
*** dbl_single_click.cpp 20 Jul 2003 00:04:51 -0000 1.208
--- dbl_single_click.cpp 11 Aug 2003 03:34:40 -0000 1.209
***************
*** 510,578 ****
// PlayerVendors deed
! case 217:
! {
! if (pi->isLockedDown())
! {
! socket->sysMessage(tr("That item is locked down."));
! return;
! }
!
! cMulti* pi_multi = cMulti::findMulti( pc_currchar->pos() );
! if( pi_multi && pc_currchar->inRange( pi_multi, 18 ) )
! {
! if ( !IsHouse( pi_multi->id() ) )
! return;
! int los = 0;
! const P_ITEM pi_p = pc_currchar->getBackpack();
! if( pi_p )
! {
! los = 0;
! cItem::ContainerContent container = pi_p->content();
! cItem::ContainerContent::const_iterator it(container.begin());
! for( ; it != container.end(); ++it )
! {
! const P_ITEM pi_i = *it;
! if ( pi_i ) // lb
! if (pi_i->type() == 7 && calcserial(pi_i->more1(), pi_i->more2(), pi_i->more3(), pi_i->more4()) == pi_multi->serial())
! {
! los = 1;
! break;
! }
! }
! }
!
! if (los)
! {
! P_NPC pc_vendor = cCharStuff::createScriptNpc( "2117", pc_currchar->pos() );
!
! if (pc_vendor == NULL)
! {
! clConsole.send("npc-script couldnt find vendor in npc-section 2117!\n");
! return;
! }
!
! // pc_vendor->setNpcAIType( 17 );
! pc_vendor->setInvulnerable( true );
! pc_vendor->setHidden( false );
! pc_vendor->setInvisible( false );
! pc_vendor->setStealthedSteps(-1);
! pc_vendor->setDirection( pc_currchar->direction() );
! pc_vendor->setWanderType( enHalt );
! pc_vendor->setMurdererTime( 0 );
! pc_vendor->setCriminalTime( 0 );
! pc_vendor->setOwner( pc_currchar );
! pc_vendor->setTamed(false);
! Items->DeleItem(pi);
! pc_vendor->talk( tr("Hello sir! My name is %1 and i will be working for you.").arg(pc_vendor->name()), -1, 0 );
! pc_vendor->update();
! }
! else
! socket->sysMessage(tr("You must be close to a house and have a key in your pack to place that."));
! }
! else if (pi_multi == NULL)
! socket->sysMessage(tr("You must be close to a house and have a key in your pack to place that."));
!
! return;
! }
break;
--- 510,515 ----
// PlayerVendors deed
! case 217:
! qWarning("Player Vendor code is gone, sorry... implement in python");
break;
Index: debug.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/debug.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** debug.cpp 4 Aug 2003 07:28:17 -0000 1.10
--- debug.cpp 11 Aug 2003 03:34:40 -0000 1.11
***************
*** 136,147 ****
Minsk, Belarus
! Modifications from Correa
*/
! #if defined(Q_OS_WIN32) && 0
#include <qfile.h>
#include <qdatetime.h>
#include <qthread.h>
#define SystemBasicInformation 0
--- 136,148 ----
Minsk, Belarus
! Modifications by Correa
*/
! #if defined(Q_OS_WIN32) && 1
#include <qfile.h>
#include <qdatetime.h>
#include <qthread.h>
+ #include <windows.h>
#define SystemBasicInformation 0
***************
*** 558,561 ****
--- 559,563 ----
.arg(hInfo->GetCPUInfo())
.arg(hInfo->HeapCommitedBytes()/1024);
+ hInfo->m_log.device()->flush();
msleep(1000);
};
***************
*** 571,575 ****
// hInfo->HeapCompareDumpWithFile(FALSE); // basic report
! hInfo->HeapCompareDumpWithFile(TRUE); // extended report
delete hInfo;
--- 573,577 ----
// hInfo->HeapCompareDumpWithFile(FALSE); // basic report
! // hInfo->HeapCompareDumpWithFile(TRUE); // extended report
delete hInfo;
***************
*** 577,581 ****
};
! //static debugThread myDebugThread;
--- 579,583 ----
};
! static debugThread myDebugThread;
Index: item_flatstore.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/item_flatstore.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** item_flatstore.cpp 20 Jul 2003 00:04:51 -0000 1.14
--- item_flatstore.cpp 11 Aug 2003 03:34:40 -0000 1.15
***************
*** 450,457 ****
break;
- case ITEM_DIRECTION:
- input->readUChar( dir_ );
- break;
-
case ITEM_PRIV:
input->readUChar( priv_ );
--- 450,453 ----
Index: items.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/items.cpp,v
retrieving revision 1.325
retrieving revision 1.326
diff -C2 -d -r1.325 -r1.326
*** items.cpp 26 Jul 2003 01:10:54 -0000 1.325
--- items.cpp 11 Aug 2003 03:34:40 -0000 1.326
***************
*** 129,133 ****
this->visible_=src.visible_;
this->spawnserial=src.spawnserial;
- this->dir_=src.dir_;
this->priv_=src.priv_;
this->buyprice_ = src.buyprice_;
--- 129,132 ----
***************
*** 513,517 ****
addField("visible", visible_);
addField("spawn", spawnserial);
- addField("dir", dir_);
addField("priv", priv_);
addField("sellprice", sellprice_);
--- 512,515 ----
***************
*** 664,668 ****
this->visible_=0; // 0=Normally Visible, 1=Owner & GM Visible, 2=GM Visible
this->spawnserial=-1;
- this->dir_=0; // Direction, or light source type.
// Everything decays by default.
this->priv_=1; // Bit 0, decay off/on. Bit 1, newbie item off/on. Bit 2 Dispellable
--- 662,665 ----
***************
*** 1861,1865 ****
sendItem->setColor( color() );
sendItem->setCoord( pos() );
! sendItem->setDirection( dir_ );
if( mSock )
--- 1858,1862 ----
sendItem->setColor( color() );
sendItem->setCoord( pos() );
! sendItem->setDirection( direction() );
if( mSock )
***************
*** 2296,2300 ****
visible_ = atoi( result[offset++] );
spawnserial = atoi( result[offset++] );
- dir_ = atoi( result[offset++] );
priv_ = atoi( result[offset++] );
sellprice_ = atoi( result[offset++] );
--- 2293,2296 ----
***************
*** 2317,2321 ****
{
cUObject::buildSqlString( fields, tables, conditions );
! fields.push_back( "items.id,items.name,items.name2,items.creator,items.sk_name,items.color,items.cont,items.layer,items.type,items.type2,items.offspell,items.more1,items.more2,items.more3,items.more4,items.morex,items.morey,items.morez,items.amount,items.doordir,items.dye,items.decaytime,items.att,items.def,items.hidamage,items.lodamage,items.st,items.time_unused,items.weight,items.hp,items.maxhp,items.rank,items.st2,items.dx,items.dx2,items.intelligence,items.intelligence2,items.speed,items.poisoned,items.magic,items.owner,items.visible,items.spawn,items.dir,items.priv,items.sellprice,items.buyprice,items.restock,items.disabled,items.spawnregion,items.good,items.description,items.accuracy" ); // for now! later on we should specify each field
tables.push_back( "items" );
conditions.push_back( "uobjectmap.serial = items.serial" );
--- 2313,2317 ----
{
cUObject::buildSqlString( fields, tables, conditions );
! fields.push_back( "items.id,items.name,items.name2,items.creator,items.sk_name,items.color,items.cont,items.layer,items.type,items.type2,items.offspell,items.more1,items.more2,items.more3,items.more4,items.morex,items.morey,items.morez,items.amount,items.doordir,items.dye,items.decaytime,items.att,items.def,items.hidamage,items.lodamage,items.st,items.time_unused,items.weight,items.hp,items.maxhp,items.rank,items.st2,items.dx,items.dx2,items.intelligence,items.intelligence2,items.speed,items.poisoned,items.magic,items.owner,items.visible,items.spawn,items.priv,items.sellprice,items.buyprice,items.restock,items.disabled,items.spawnregion,items.good,items.description,items.accuracy" ); // for now! later on we should specify each field
tables.push_back( "items" );
conditions.push_back( "uobjectmap.serial = items.serial" );
***************
*** 2650,2654 ****
else SET_INT_PROPERTY( "spawn", spawnserial )
- else SET_INT_PROPERTY( "direction", dir_ )
else SET_INT_PROPERTY( "sellprice", sellprice_ )
else SET_INT_PROPERTY( "buyprice", buyprice_ )
--- 2646,2649 ----
***************
*** 2794,2798 ****
else GET_PROPERTY( "spawn", FindItemBySerial( spawnserial ) )
- else GET_PROPERTY( "direction", dir_ )
else GET_PROPERTY( "buyprice", buyprice_ )
else GET_PROPERTY( "sellprice", sellprice_ )
--- 2789,2792 ----
Index: items.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/items.h,v
retrieving revision 1.162
retrieving revision 1.163
diff -C2 -d -r1.162 -r1.163
*** items.h 21 Jul 2003 00:08:04 -0000 1.162
--- items.h 11 Aug 2003 03:34:40 -0000 1.163
***************
*** 84,88 ****
Q_PROPERTY ( uint poisoned READ poisoned WRITE setPoisoned )
Q_PROPERTY ( int rank READ rank WRITE setRank )
- Q_PROPERTY ( uchar direction READ direction WRITE setDirection )
Q_PROPERTY ( QString description READ description WRITE setDescription )
Q_PROPERTY ( QString creator READ creator WRITE setCreator )
--- 84,87 ----
***************
*** 169,173 ****
uint poisoned() const { return poisoned_; }
int rank() const { return rank_; }
- uchar direction() const { return dir_; }
QString description() const { return desc_; }
QString creator() const { return creator_;}
--- 168,171 ----
***************
*** 228,232 ****
void setAntispamtimer ( uint data ) { antispamtimer_ = data; changed( SAVE );}
void setAccuracy( ushort data ) { accuracy_ = data; changed( SAVE );}
- void setDirection( uchar d ) { dir_ = d; changed( SAVE );}
void setDescription( const QString& d ) { desc_ = d; changed( SAVE+TOOLTIP );}
void setCreator( const QString& d ) { creator_ = d; changed( SAVE+TOOLTIP );}
--- 226,229 ----
***************
*** 439,443 ****
// RANK 10 --> 10*10=100% this item has no malus! RANK 10 is automatically setted if you select RANKSYSTEM 0.
// Vars: LODAMAGE,HIDAMAGE,ATT,DEF,HP,MAXHP
- uchar dir_;
QString desc_;
QString creator_; // Store the name of the player made this item
--- 436,439 ----
Index: npc.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/npc.cpp,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -d -r1.27 -r1.28
*** npc.cpp 9 Jul 2003 20:23:16 -0000 1.27
--- npc.cpp 11 Aug 2003 03:34:40 -0000 1.28
***************
*** 522,526 ****
corpse->setBodyId( orgBodyID_ );
! corpse->setMoreY( ishuman( this ) ); //is human??
corpse->setCarve( carve() ); //store carve section
corpse->setName2( name() );
--- 522,526 ----
corpse->setBodyId( orgBodyID_ );
! corpse->setMoreY( this->isHuman() ); //is human??
corpse->setCarve( carve() ); //store carve section
corpse->setName2( name() );
***************
*** 529,533 ****
corpse->setMore1(nType);
! corpse->setDirection( direction_ );
corpse->startDecay();
--- 529,533 ----
corpse->setMore1(nType);
! corpse->setDirection( direction() );
corpse->startDecay();
Index: player.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/player.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** player.cpp 9 Aug 2003 03:18:52 -0000 1.21
--- player.cpp 11 Aug 2003 03:34:40 -0000 1.22
***************
*** 541,545 ****
corpse->setBodyId( orgBodyID_ );
! corpse->setMoreY( ishuman( this ) ); //is human??
corpse->setName2( name() );
--- 541,545 ----
corpse->setBodyId( orgBodyID_ );
! corpse->setMoreY( this->isHuman() ); //is human??
corpse->setName2( name() );
***************
*** 547,551 ****
corpse->setMore1(nType);
! corpse->setDirection( direction_ );
corpse->startDecay();
--- 547,551 ----
corpse->setMore1(nType);
! corpse->setDirection( direction() );
corpse->startDecay();
***************
*** 690,694 ****
pMount->setWanderRadius( pi->pos().z );
pMount->setBodyID( pi->morey() );
! pMount->setDirection( direction_ );
pMount->setStrength( pi->tags().get("strength").toInt() );
pMount->setDexterity( pi->tags().get("dexterity").toInt() );
--- 690,694 ----
pMount->setWanderRadius( pi->pos().z );
pMount->setBodyID( pi->morey() );
! pMount->setDirection( direction() );
pMount->setStrength( pi->tags().get("strength").toInt() );
pMount->setDexterity( pi->tags().get("dexterity").toInt() );
Index: prototypes.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/prototypes.h,v
retrieving revision 1.99
retrieving revision 1.100
diff -C2 -d -r1.99 -r1.100
*** prototypes.h 1 Jun 2003 14:53:56 -0000 1.99
--- prototypes.h 11 Aug 2003 03:34:40 -0000 1.100
***************
*** 44,48 ****
// Function Declarations
//
- void endScrn() ;
QString hex2dec( const QString& value );
--- 44,47 ----
***************
*** 53,58 ****
void Fame(P_CHAR pc_toChange, int nFame);
- bool ishuman(P_CHAR pc);
- int chardir(P_CHAR a, P_CHAR b);
int fielddir(P_CHAR pc, int x, int y, int z);
--- 52,55 ----
***************
*** 67,72 ****
void sellaction(int s);
void addgold(cUOSocket* s, int totgold);
- int calcValue(P_ITEM pi, int value);
- int calcGoodValue(P_CHAR npcnum, P_ITEM pi, int value,int goodtype); // by Magius(CHE) for trade system
void StoreItemRandomValue(P_ITEM pi,QString tmpreg); // by Magius(CHE) (2) for trade system
--- 64,67 ----
***************
*** 81,86 ****
void bgsound(P_CHAR pc);
int hexnumber(int countx);
- int makenumber(int countx);
- inline int calcserial(unsigned char a1,unsigned char a2,unsigned char a3,unsigned char a4) {return (static_cast<int>((a1<<24))|static_cast<int>((a2<<16)) | static_cast<int>((a3<<8)) | static_cast<int>(a4));}
int lineOfSight( const Coord_cl&, const Coord_cl&, int checkfor );
void reloadScripts();
--- 76,79 ----
Index: skills.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/skills.cpp,v
retrieving revision 1.199
retrieving revision 1.200
diff -C2 -d -r1.199 -r1.200
*** skills.cpp 6 Jul 2003 13:48:02 -0000 1.199
--- skills.cpp 11 Aug 2003 03:34:40 -0000 1.200
***************
*** 891,895 ****
int ar = 0;
! if (ishuman(pc))
{
--- 891,895 ----
int ar = 0;
! if ( pc->isHuman() )
{
Index: uobject.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/uobject.cpp,v
retrieving revision 1.101
retrieving revision 1.102
diff -C2 -d -r1.101 -r1.102
*** uobject.cpp 21 Jul 2003 00:08:04 -0000 1.101
--- uobject.cpp 11 Aug 2003 03:34:40 -0000 1.102
***************
*** 115,118 ****
--- 115,119 ----
serial_ = atoi(result[offset++]);
multis_ = atoi(result[offset++]);
+ dir_ = atoi( result[offset++] );
pos_.x = atoi(result[offset++]);
pos_.y = atoi(result[offset++]);
***************
*** 163,166 ****
--- 164,168 ----
addField( "serial", serial_ );
addField( "multis", multis_ );
+ addField( "direction", dir_);
addField( "pos_x", pos_.x );
addField( "pos_y", pos_.y );
***************
*** 208,212 ****
void cUObject::buildSqlString( QStringList &fields, QStringList &tables, QStringList &conditions )
{
! fields.push_back( "uobject.name,uobject.serial,uobject.multis,uobject.pos_x,uobject.pos_y,uobject.pos_z,uobject.pos_map,uobject.events,uobject.bindmenu,uobject.havetags" );
tables.push_back( "uobject" );
conditions.push_back( "uobjectmap.serial = uobject.serial" );
--- 210,214 ----
void cUObject::buildSqlString( QStringList &fields, QStringList &tables, QStringList &conditions )
{
! fields.push_back( "uobject.name,uobject.serial,uobject.multis,uobject.direction,uobject.pos_x,uobject.pos_y,uobject.pos_z,uobject.pos_map,uobject.events,uobject.bindmenu,uobject.havetags" );
tables.push_back( "uobject" );
conditions.push_back( "uobjectmap.serial = uobject.serial" );
***************
*** 490,498 ****
QString Value = Tag->getValue();
// <tag type="string"> also type="value"
// <key>multisection</key>
// <value>smallboat</value>
// </tag>
! if( TagName == "tag" )
{
QString tkey, tvalue;
--- 492,523 ----
QString Value = Tag->getValue();
+ //<direction>SE</direction>
+ if( TagName == "direction" )
+ {
+ if( Value == "NE" )
+ this->dir_ = 1;
+ else if( Value == "E" )
+ this->dir_ = 2;
+ else if( Value == "SE" )
+ this->dir_ = 3;
+ else if( Value == "S" )
+ this->dir_ = 4;
+ else if( Value == "SW" )
+ this->dir_ = 5;
+ else if( Value == "W" )
+ this->dir_ = 6;
+ else if( Value == "NW" )
+ this->dir_ = 7;
+ else if( Value == "N" )
+ this->dir_ = 0;
+ else
+ this->dir_ = Value.toUShort();
+ }
+
// <tag type="string"> also type="value"
// <key>multisection</key>
// <value>smallboat</value>
// </tag>
! else if( TagName == "tag" )
{
QString tkey, tvalue;
***************
*** 661,664 ****
--- 686,690 ----
else SET_INT_PROPERTY( "serial", serial_ )
else SET_INT_PROPERTY( "multi", multis_ )
+ else SET_INT_PROPERTY( "direction", dir_ )
else SET_BOOL_PROPERTY( "free", free )
else SET_STR_PROPERTY( "name", this->name_ )
***************
*** 700,704 ****
else GET_PROPERTY( "name", this->name() )
else GET_PROPERTY( "pos", pos() )
! else GET_PROPERTY( "eventlist", eventList_ == QString::null ? QString( "" ) : eventList_ );
PROPERTY_ERROR( -1, QString( "Property not found: '%1'" ).arg( name ) )
--- 726,731 ----
else GET_PROPERTY( "name", this->name() )
else GET_PROPERTY( "pos", pos() )
! else GET_PROPERTY( "eventlist", eventList_ == QString::null ? QString( "" ) : eventList_ )
! else GET_PROPERTY( "direction", dir_ )
PROPERTY_ERROR( -1, QString( "Property not found: '%1'" ).arg( name ) )
***************
*** 729,731 ****
--- 756,780 ----
if( state & SAVE ) changed_ = true;
if( state & TOOLTIP ) tooltip_ = 0xFFFFFFFF;
+ }
+
+ /*!
+ Returns the direction from this object to another \s d object
+ */
+ char cUObject::direction( cUObject* d ) const
+ {
+ int dir = -1;
+ int xdif = d->pos().x - this->pos().x;
+ int ydif = d->pos().y - this->pos().y;
+
+ if ((xdif==0)&&(ydif<0)) dir=0;
+ else if ((xdif>0)&&(ydif<0)) dir=1;
+ else if ((xdif>0)&&(ydif==0)) dir=2;
+ else if ((xdif>0)&&(ydif>0)) dir=3;
+ else if ((xdif==0)&&(ydif>0)) dir=4;
+ else if ((xdif<0)&&(ydif>0)) dir=5;
+ else if ((xdif<0)&&(ydif==0)) dir=6;
+ else if ((xdif<0)&&(ydif<0)) dir=7;
+ else dir=-1;
+
+ return dir;
}
Index: uobject.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/uobject.h,v
retrieving revision 1.66
retrieving revision 1.67
diff -C2 -d -r1.66 -r1.67
*** uobject.h 21 Jul 2003 00:08:04 -0000 1.66
--- uobject.h 11 Aug 2003 03:34:40 -0000 1.67
***************
*** 63,109 ****
};
- #define PROPERTY_ERROR( errno, data ) { stError *errRet = new stError; errRet->code = errno; errRet->text = data; return errRet; }
-
- #define GET_PROPERTY( id, getter ) if( name == id ) {\
- value = cVariant( getter ); \
- return 0; \
- }
-
- #define SET_STR_PROPERTY( id, setter ) if( name == id ) {\
- QString text = value.toString(); \
- if( text == QString::null ) \
- PROPERTY_ERROR( -2, "String expected" ) \
- setter = text; \
- return 0; \
- }
-
- #define SET_INT_PROPERTY( id, setter ) if( name == id ) {\
- bool ok; \
- INT32 data = value.toInt( &ok ); \
- if( !ok ) \
- PROPERTY_ERROR( -2, "Integer expected" ) \
- setter = data; \
- return 0; \
- }
-
- #define SET_BOOL_PROPERTY( id, setter ) if( name == id ) {\
- bool ok; \
- INT32 data = value.toInt( &ok ); \
- if( !ok ) \
- PROPERTY_ERROR( -2, "Boolean expected" ) \
- setter = data == 0 ? false : true; \
- return 0; \
- }
-
- #define SET_CHAR_PROPERTY( id, setter ) if( name == id ) {\
- setter = value.toChar(); \
- return 0; \
- }
-
- #define SET_ITEM_PROPERTY( id, setter ) if( name == id ) {\
- setter = value.toItem(); \
- return 0; \
- }
-
struct stError;
--- 63,66 ----
***************
*** 116,128 ****
protected:
QString bindmenu_;
! UINT32 tooltip_;
QString name_;
Coord_cl pos_;
SERIAL serial_;
SERIAL multis_;
cCustomTags tags_;
protected:
- bool changed_;
// Things for building the SQL string
static void buildSqlString( QStringList &fields, QStringList &tables, QStringList &conditions );
--- 73,86 ----
protected:
QString bindmenu_;
! uint tooltip_;
QString name_;
Coord_cl pos_;
SERIAL serial_;
SERIAL multis_;
+ uchar changed_:1;
cCustomTags tags_;
+ uchar dir_:3;
protected:
// Things for building the SQL string
static void buildSqlString( QStringList &fields, QStringList &tables, QStringList &conditions );
***************
*** 177,189 ****
void changed( UI32 );
void moveTo( const Coord_cl&, bool noRemove = false );
! unsigned int dist(cUObject* d) const;
! QString bindmenu() const { return bindmenu_; }
! QString name() const { return name_; }
! Coord_cl pos() const { return pos_; }
! SERIAL serial() const { return serial_; }
! SERIAL multis() const { return multis_; }
! cCustomTags tags() const { return tags_; }
! cCustomTags& tags() { return tags_; }
! UINT32 getTooltip() const { return tooltip_; }
void setBindmenu( const QString& d ) { bindmenu_ = d; changed( SAVE ); }
--- 135,148 ----
void changed( UI32 );
void moveTo( const Coord_cl&, bool noRemove = false );
! unsigned int dist(cUObject* d) const;
! QString bindmenu() const { return bindmenu_; }
! QString name() const { return name_; }
! Coord_cl pos() const { return pos_; }
! SERIAL serial() const { return serial_; }
! SERIAL multis() const { return multis_; }
! cCustomTags tags() const { return tags_; }
! cCustomTags& tags() { return tags_; }
! UINT32 getTooltip() const { return tooltip_; }
! uchar direction() const { return dir_; }
void setBindmenu( const QString& d ) { bindmenu_ = d; changed( SAVE ); }
***************
*** 194,197 ****
--- 153,158 ----
virtual void setSerial( SERIAL d ) { serial_ = d; changed( SAVE ); }
void setTooltip( const UINT32 d ) { tooltip_ = d; }
+ void setDirection( uchar d ) { dir_ = d; changed( SAVE );}
+
virtual void sendTooltip( cUOSocket* mSock );
***************
*** 206,209 ****
--- 167,172 ----
virtual void flagUnchanged() { changed_ = false; }
+ char direction( cUObject* ) const;
+
protected:
***************
*** 298,302 ****
return 0; \
}
-
#endif // __UOBJECT_H__
--- 261,264 ----
Index: wolfpack.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolfpack.cpp,v
retrieving revision 1.434
retrieving revision 1.435
diff -C2 -d -r1.434 -r1.435
*** wolfpack.cpp 26 Jul 2003 01:10:55 -0000 1.434
--- wolfpack.cpp 11 Aug 2003 03:34:40 -0000 1.435
***************
*** 675,679 ****
break;
default:
! clConsole.send(tr("WOLFPACK: Key %1 [%2] does not preform a fucntion.\n").arg(c).arg(QString::number(c)));
break;
}
--- 675,679 ----
break;
default:
! clConsole.send(tr("WOLFPACK: Key %1 [%2] does not preform a function.\n").arg( c > 32 ? c : '¿' ).arg(QString::number(c)));
break;
}
***************
*** 690,708 ****
if ( QFile::exists( param ) )
{
! FILE *fp = fopen(param.latin1(), "r");
! if (fp != NULL)
! {
! (void) PyRun_SimpleFile(fp, (char*)param.latin1());
! PyErr_Clear();
! fclose(fp);
}
! else
! {
! clConsole.send( QString("Can't open %1. Critical macro support data not available!\n").arg(param) );
}
}
else
clConsole.error( QString("The specified python script [%1] doesn't exist.").arg(param) );
}
}
--- 690,742 ----
if ( QFile::exists( param ) )
{
! PyObject *pName, *pModule, *pDict, *pFunc;
! PyObject *pArgs, *pValue;
! int i;
! pName = PyString_FromString( param.left(param.length() - 3).latin1() );
! /* Error checking of pName left out */
!
! pModule = PyImport_Import(pName);
! Py_DECREF(pName);
!
! if (pModule != NULL) {
! pDict = PyModule_GetDict(pModule);
! /* pDict is a borrowed reference */
!
! pFunc = PyDict_GetItemString(pDict, "main");
! /* pFun: Borrowed reference */
!
! if (pFunc && PyCallable_Check(pFunc)) {
! pArgs = PyTuple_New(0);
! pValue = PyObject_CallObject(pFunc, pArgs);
! Py_DECREF(pArgs);
! if (pValue != NULL) {
! printf("Result of call: %ld\n", PyInt_AsLong(pValue));
! Py_DECREF(pValue);
! }
! else {
! Py_DECREF(pModule);
! PyErr_Print();
! fprintf(stderr,"Call failed\n");
! return;
! }
! /* pDict and pFunc are borrowed and must not be Py_DECREF-ed */
! }
! else {
! if (PyErr_Occurred())
! PyErr_Print();
! }
! Py_DECREF(pModule);
}
! else {
! PyErr_Print();
! fprintf(stderr, "Failed to load \"%s\"\n", param.latin1());
}
+ stopPython();
+ exit(0);
}
else
clConsole.error( QString("The specified python script [%1] doesn't exist.").arg(param) );
+
}
}
***************
*** 1178,1208 ****
}
- bool ishuman(P_CHAR pc)
- {
- // Check if the Player or Npc is human! -- by Magius(CHE)
- if (pc->orgBodyID()==0x0190 || pc->orgBodyID()==0x0191) return true;
- else return false;
- }
-
- int chardir(P_CHAR a, P_CHAR b) // direction from character a to char b
- {
- int dir,xdif,ydif;
-
- xdif = b->pos().x - a->pos().x;
- ydif = b->pos().y - a->pos().y;
-
- if ((xdif==0)&&(ydif<0)) dir=0;
- else if ((xdif>0)&&(ydif<0)) dir=1;
- else if ((xdif>0)&&(ydif==0)) dir=2;
- else if ((xdif>0)&&(ydif>0)) dir=3;
- else if ((xdif==0)&&(ydif>0)) dir=4;
- else if ((xdif<0)&&(ydif>0)) dir=5;
- else if ((xdif<0)&&(ydif==0)) dir=6;
- else if ((xdif<0)&&(ydif<0)) dir=7;
- else dir=-1;
-
- return dir;
- }
-
int chardirxyz(P_CHAR pc, int x, int y) // direction from character a to char b
{
--- 1212,1215 ----
***************
*** 1438,1502 ****
{
Items->SpawnItem(socket->player(), totgold,"#",true,0x0EED,0,1);
- }
-
- int calcValue(P_ITEM pi, int value)
- {
- int mod=10;
- if (pi == NULL)
- return value;
-
- if( pi->type() == 19 )
- {
- if (pi->morex()>500)
- mod =mod+1;
- if (pi->morex()>900) mod=mod+1;
- if (pi->morex()>1000) mod=mod+1;
- if (pi->morez()>1) mod=mod+(3*(pi->morez()-1));
- value=(value*mod)/10;
- }
-
- // Lines added for Rank System by Magius(CHE)
- if (pi->rank()>0 && pi->rank()<10 && SrvParams->rank_system()==1)
- {
- value=(int) (pi->rank()*value)/10;
- }
- if (value<1) value=1;
- // end addon
-
- // Lines added for Trade System by Magius(CHE) (2)
- if (pi->rndvaluerate()<0) pi->setRndValueRate(0);
- if (pi->rndvaluerate()!=0 && SrvParams->trade_system()==1) {
- value+=(int) (value*pi->rndvaluerate())/1000;
- }
- if (value<1) value=1;
- // end addon
-
- return value;
- }
-
- int calcGoodValue(P_CHAR npcnum2, P_ITEM pi, int value,int goodtype)
- { // Function Created by Magius(CHE) for trade System
- cTerritory* Region = AllTerritories::instance()->region( npcnum2->pos().x, npcnum2->pos().y, npcnum2->pos().map );
-
- int regvalue=0;
- int x;
- if( pi == NULL || Region == NULL )
- return value;
-
- int good=pi->good();
-
- if (good<=-1 || good >255 ) return value;
-
- if (goodtype==1) regvalue=Region->tradesystem_[good].sellable; // Vendor SELL
- if (goodtype==0) regvalue=Region->tradesystem_[good].buyable; // Vendor BUY
-
- x=(int) (value*abs(regvalue))/1000;
-
- if (regvalue<0) value-=x;
- else value+=x;
-
- if (value<=0) value=1; // Added by Magius(CHE) (2)
-
- return value;
}
--- 1445,1448 ----
|
|
From: <thi...@us...> - 2003-08-11 03:34:46
|
Update of /cvsroot/wpdev/wolfpack/python
In directory sc8-pr-cvs1:/tmp/cvs-serv2931/python
Modified Files:
char.cpp
Log Message:
- moved direction from cItem and cBaseChar to cUObject.
- Removed some dead code
- Notice that the SQL changed a bit due to the first item :)
Index: char.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/char.cpp,v
retrieving revision 1.96
retrieving revision 1.97
diff -C2 -d -r1.96 -r1.97
*** char.cpp 6 Aug 2003 00:20:33 -0000 1.96
--- char.cpp 11 Aug 2003 03:34:40 -0000 1.97
***************
*** 346,350 ****
P_CHAR pChar = getWpChar( pObj );
if( pChar )
! return PyInt_FromLong( chardir( pChar, self->pChar ) );
}
else if( PyTuple_Size( args ) >= 2 ) // Min 2
--- 346,350 ----
P_CHAR pChar = getWpChar( pObj );
if( pChar )
! return PyInt_FromLong( pChar->direction( self->pChar ) );
}
else if( PyTuple_Size( args ) >= 2 ) // Min 2
|
|
From: <thi...@uo...> - 2003-08-10 04:31:42
|
Should work now :) ----- Original Message ----- From: "Dreoth" <Dr...@ra...> To: <wpd...@li...> Sent: Saturday, August 09, 2003 11:43 PM Subject: [wpdev-commits] Someone Fix Linux Compiles! > It's been broken in linux for a while, I dunno how to fix it :( > > Anyone? > > :) > > > > ------------------------------------------------------- > This SF.Net email sponsored by: Free pre-built ASP.NET sites including > Data Reports, E-commerce, Portals, and Forums are available now. > Download today and enter to win an XBOX or Visual Studio .NET. > http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 > _______________________________________________ > wpdev-commits mailing list > wpd...@li... > https://lists.sourceforge.net/lists/listinfo/wpdev-commits --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.506 / Virus Database: 303 - Release Date: 1/8/2003 |
Update of /cvsroot/wpdev/wolfpack/python
In directory sc8-pr-cvs1:/tmp/cvs-serv4728/python
Modified Files:
item.cpp multi.cpp pyaccount.cpp pycoord.cpp pypacket.cpp
pyregion.cpp pytooltip.cpp socket.cpp
Log Message:
Linux compile fixes
Index: item.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/item.cpp,v
retrieving revision 1.68
retrieving revision 1.69
diff -C2 -d -r1.68 -r1.69
*** item.cpp 6 Aug 2003 01:24:55 -0000 1.68
--- item.cpp 10 Aug 2003 04:26:42 -0000 1.69
***************
*** 70,75 ****
// Forward Declarations
! PyObject *wpItem_getAttr( wpItem *self, char *name );
! int wpItem_setAttr( wpItem *self, char *name, PyObject *value );
int wpItem_compare( PyObject *a, PyObject *b );
--- 70,75 ----
// Forward Declarations
! static PyObject *wpItem_getAttr( wpItem *self, char *name );
! static int wpItem_setAttr( wpItem *self, char *name, PyObject *value );
int wpItem_compare( PyObject *a, PyObject *b );
Index: multi.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/multi.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** multi.cpp 6 Aug 2003 01:24:55 -0000 1.14
--- multi.cpp 10 Aug 2003 04:26:42 -0000 1.15
***************
*** 57,62 ****
// Forward Declarations
! PyObject *wpMulti_getAttr( wpMulti *self, char *name );
! int wpMulti_setAttr( wpMulti *self, char *name, PyObject *value );
int wpMulti_compare( PyObject *a, PyObject *b );
--- 57,62 ----
// Forward Declarations
! static PyObject *wpMulti_getAttr( wpMulti *self, char *name );
! static int wpMulti_setAttr( wpMulti *self, char *name, PyObject *value );
int wpMulti_compare( PyObject *a, PyObject *b );
Index: pyaccount.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/pyaccount.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** pyaccount.cpp 9 Aug 2003 03:18:52 -0000 1.16
--- pyaccount.cpp 10 Aug 2003 04:26:42 -0000 1.17
***************
*** 48,53 ****
// Forward Declarations
! PyObject *wpAccount_getAttr( wpAccount *self, char *name );
! int wpAccount_setAttr( wpAccount *self, char *name, PyObject *value );
/*!
--- 48,53 ----
// Forward Declarations
! static PyObject *wpAccount_getAttr( wpAccount *self, char *name );
! static int wpAccount_setAttr( wpAccount *self, char *name, PyObject *value );
/*!
Index: pycoord.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/pycoord.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** pycoord.cpp 6 Aug 2003 01:24:55 -0000 1.5
--- pycoord.cpp 10 Aug 2003 04:26:42 -0000 1.6
***************
*** 41,46 ****
// Forward Declarations
! PyObject *wpCoord_getAttr( wpCoord *self, char *name );
! int wpCoord_setAttr( wpCoord *self, char *name, PyObject *value );
/*!
--- 41,46 ----
// Forward Declarations
! static PyObject *wpCoord_getAttr( wpCoord *self, char *name );
! static int wpCoord_setAttr( wpCoord *self, char *name, PyObject *value );
/*!
Index: pypacket.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/pypacket.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** pypacket.cpp 4 Aug 2003 07:28:18 -0000 1.2
--- pypacket.cpp 10 Aug 2003 04:26:42 -0000 1.3
***************
*** 44,49 ****
};
! PyObject *wpPacket_getattr( PyObject *self, char *name );
! PyMethodDef wpPacketMethods[];
// Object Destructor
--- 44,48 ----
};
! static PyObject *wpPacket_getattr( PyObject *self, char *name );
// Object Destructor
***************
*** 67,76 ****
};
- // Global Object-Getter
- static PyObject *wpPacket_getattr( PyObject *self, char *name )
- {
- return Py_FindMethod( wpPacketMethods, self, name );
- }
-
// Resize the packet
static PyObject *wpPacket_resize( PyObject *self, PyObject *args )
--- 66,69 ----
***************
*** 180,184 ****
// List of Methods
! static PyMethodDef wpPacketMethods[] =
{
{ "resize", wpPacket_resize, METH_VARARGS, NULL },
--- 173,177 ----
// List of Methods
! PyMethodDef wpPacketMethods[] =
{
{ "resize", wpPacket_resize, METH_VARARGS, NULL },
***************
*** 191,194 ****
--- 184,192 ----
{ NULL, NULL, 0, NULL }
};
+
+ static PyObject* wpPacket_getattr( PyObject* self, char* name )
+ {
+ return Py_FindMethod( wpPacketMethods, self, name );
+ }
// Object Constructor
Index: pyregion.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/pyregion.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** pyregion.cpp 6 Aug 2003 01:24:55 -0000 1.8
--- pyregion.cpp 10 Aug 2003 04:26:42 -0000 1.9
***************
*** 46,51 ****
// Forward Declarations
! PyObject *wpRegion_getAttr( wpRegion *self, char *name );
! int wpRegion_setAttr( wpRegion *self, char *name, PyObject *value );
/*!
--- 46,51 ----
// Forward Declarations
! static PyObject *wpRegion_getAttr( wpRegion *self, char *name );
! static int wpRegion_setAttr( wpRegion *self, char *name, PyObject *value );
/*!
Index: pytooltip.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/pytooltip.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** pytooltip.cpp 6 Aug 2003 01:24:55 -0000 1.6
--- pytooltip.cpp 10 Aug 2003 04:26:42 -0000 1.7
***************
*** 42,47 ****
// Forward Declarations
! PyObject *wpTooltip_getAttr( wpTooltip *self, char *name );
! int wpTooltip_setAttr( wpTooltip *self, char *name, PyObject *value );
/*!
--- 42,47 ----
// Forward Declarations
! static PyObject *wpTooltip_getAttr( wpTooltip *self, char *name );
! static int wpTooltip_setAttr( wpTooltip *self, char *name, PyObject *value );
/*!
***************
*** 60,65 ****
};
! PyObject *wpTooltip_add( wpTooltip *self, PyObject *args );
! PyObject *wpTooltip_send( wpTooltip *self, PyObject *args );
static PyMethodDef wpTooltipMethods[] =
--- 60,65 ----
};
! static PyObject *wpTooltip_add( wpTooltip *self, PyObject *args );
! static PyObject *wpTooltip_send( wpTooltip *self, PyObject *args );
static PyMethodDef wpTooltipMethods[] =
Index: socket.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/socket.cpp,v
retrieving revision 1.40
retrieving revision 1.41
diff -C2 -d -r1.40 -r1.41
*** socket.cpp 6 Aug 2003 01:24:55 -0000 1.40
--- socket.cpp 10 Aug 2003 04:26:42 -0000 1.41
***************
*** 44,49 ****
// Forward Declarations
! PyObject *wpSocket_getAttr( wpSocket *self, char *name );
! int wpSocket_setAttr( wpSocket *self, char *name, PyObject *value );
/*!
--- 44,49 ----
// Forward Declarations
! static PyObject *wpSocket_getAttr( wpSocket *self, char *name );
! static int wpSocket_setAttr( wpSocket *self, char *name, PyObject *value );
/*!
|
|
From: Dreoth <Dr...@ra...> - 2003-08-10 02:43:59
|
It's been broken in linux for a while, I dunno how to fix it :( Anyone? :) |
|
From: <thi...@us...> - 2003-08-09 05:18:37
|
Update of /cvsroot/wpdev/xmlscripts/scripts
In directory sc8-pr-cvs1:/tmp/cvs-serv3729
Modified Files:
webadmin.py
Log Message:
Hopefully improved :o)
now we might be able to apply a patch to do POST
Index: webadmin.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/webadmin.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** webadmin.py 8 Feb 2003 15:33:08 -0000 1.8
--- webadmin.py 9 Aug 2003 05:18:22 -0000 1.9
***************
*** 2,6 ****
# ) (\_ | WOLFPACK 13.0.0 Scripts #
# (( _/{ "-; | Created by: DarkStorm #
! # )).-' {{ ;'` | Revised by: #
# ( ( ;._ \\ ctr | Last Modification: Created #
#===============================================================#
--- 2,6 ----
# ) (\_ | WOLFPACK 13.0.0 Scripts #
# (( _/{ "-; | Created by: DarkStorm #
! # )).-' {{ ;'` | Revised by: Correa #
# ( ( ;._ \\ ctr | Last Modification: Created #
#===============================================================#
***************
*** 10,24 ****
from wolfpack.consts import *
from threading import Thread, Event
! import time
! from whrandom import random
from CGIHTTPServer import CGIHTTPRequestHandler
from BaseHTTPServer import HTTPServer
from SocketServer import BaseServer
- import os
import posixpath
- import urllib
import atexit
- import sys
- import socket
import cStringIO
import traceback
--- 10,19 ----
from wolfpack.consts import *
from threading import Thread, Event
! import os, sys, time, string, socket, urllib
from CGIHTTPServer import CGIHTTPRequestHandler
from BaseHTTPServer import HTTPServer
from SocketServer import BaseServer
import posixpath
import atexit
import cStringIO
import traceback
***************
*** 27,147 ****
# Just override handle_error for nicer error handling
class Webserver( HTTPServer ):
! def __init__( self, addr, handler ):
! BaseServer.__init__( self, addr, handler )
! self.socket = socket.socket( self.address_family, self.socket_type )
! self.socket.setblocking( 0 )
! self.server_bind()
! self.server_activate()
! def handle_request(self):
! try:
! request, client_address = self.get_request()
! request.setblocking( 1 )
! except socket.error:
! return
! if self.verify_request(request, client_address):
! try:
! self.process_request(request, client_address)
! except:
! self.handle_error(request, client_address)
! self.close_request(request)
! def handle_error(self, request, client_address):
! # Ignore Socket Errors && IOErrors
! if sys.exc_type == socket.error or sys.exc_type == IOError:
! dummy = cStringIO.StringIO()
! traceback.print_exc( None, dummy )
! dummy.close()
! return
! print '-'*40
! print 'Exception happened during processing of request from ' + str( client_address )
!
! traceback.print_exc() # XXX But this goes to stderr!
! print '-'*40
# Custom Request Handler
class WebserverHandler( CGIHTTPRequestHandler ):
- basepath = 'web/'
! # We ONLY want execfile
! have_fork = 0
! have_popen2 = 0
! have_popen3 = 0
! # CGIs are allowed everywhere
! def is_cgi( self ):
! path = self.path
! # Extract directory and stuff behind query sign (?)
! i = path.rfind( '?' )
!
! if i >= 0:
! scriptpath, query = path[:i], path[i+1:]
! else:
! scriptpath = path
! query = ''
! if self.is_python( scriptpath ):
! path = posixpath.dirname( scriptpath )
! script = posixpath.basename( scriptpath ) + '?' + query
! self.cgi_info = path, script
! return 1
! return 0
! def translate_path(self, path):
! path = posixpath.normpath(urllib.unquote(path))
! words = path.split('/')
! words = filter(None, words)
! path = self.basepath
! for word in words:
! drive, word = os.path.splitdrive(word)
! head, word = os.path.split(word)
! if word in (os.curdir, os.pardir): continue
! path = os.path.join(path, word)
! return path
! def log_message( self, format, *args ):
! try:
! file = open( 'web.log', 'a' )
! file.write( "%s - - [%s] %s\n" % ( self.address_string(), self.log_date_time_string(), format%args ) )
! file.close()
! except:
! print "Could not write to logfile: web.log\n"
class WebserverThread(Thread):
! def __init__( self, port=2594 ):
! Thread.__init__( self )
! self.port = port
! self.stopped = Event()
! self.httpd = None
! def cancel( self ):
! self.stopped.set()
! self.httpd.server_close()
! def run( self ):
! # Wait with binding the webserver for 5 Seconds
! server_address = ( '', self.port )
! time.sleep( 5 )
! # Starting up
! print "Remote Admin running on port %u\n" % self.port
! try:
! self.httpd = Webserver( server_address, WebserverHandler )
! except:
! traceback.print_exc()
! return
! while 1:
! self.httpd.handle_request()
! self.stopped.wait( 0.05 )
! if self.stopped.isSet():
! break
! print "Shutting down the Remote Admin.\n"
thread = None
--- 22,256 ----
# Just override handle_error for nicer error handling
class Webserver( HTTPServer ):
! def __init__( self, addr, htdocs ):
! BaseServer.__init__( self, addr, WebserverHandler )
! self.socket = socket.socket( self.address_family, self.socket_type )
! self.socket.setblocking( 0 )
! self.server_bind()
! self.server_activate()
! self.htdocs = htdocs
!
! def handle_request(self):
! try:
! request, client_address = self.get_request()
! request.setblocking( 1 )
! except socket.error:
! return
! if self.verify_request(request, client_address):
! try:
! self.process_request(request, client_address)
! except:
! self.handle_error(request, client_address)
! self.close_request(request)
! def handle_error(self, request, client_address):
! # Ignore Socket Errors && IOErrors
! if sys.exc_type == socket.error or sys.exc_type == IOError:
! dummy = cStringIO.StringIO()
! traceback.print_exc( None, dummy )
! dummy.close()
! return
!
! print '-'*40
! print 'Exception happened during processing of request from ' + str( client_address )
!
! traceback.print_exc() # XXX But this goes to stderr!
! print '-'*40
# Custom Request Handler
class WebserverHandler( CGIHTTPRequestHandler ):
! # CGIs are allowed everywhere
! def is_cgi( self ):
! path = self.path
! # Extract directory and stuff behind query sign (?)
! i = path.rfind( '?' )
!
! if i >= 0:
! scriptpath, query = path[:i], path[i+1:]
! else:
! scriptpath = path
! query = ''
! if self.is_python( scriptpath ):
! path = posixpath.dirname( scriptpath )
! script = posixpath.basename( scriptpath ) + '?' + query
! self.cgi_info = path, script
! return 1
! return 0
! def translate_path(self, uri):
! """ Translate a /-separated PATH to the local filename syntax.
! Components that mean special things to the local file system
! (e.g. drive or directory names) are ignored.
! """
! file = urllib.unquote(uri)
! file.replace('\\', '/')
! words = file.split('/')
! words = filter(None, words)
!
! path = self.server.htdocs
! bad_uri = 0
! for word in words:
! drive, word = os.path.splitdrive(word)
! if drive:
! bad_uri = 1
! head, word = os.path.split(word)
! if word in (os.curdir, os.pardir):
! bad_uri = 1
! continue
! path = os.path.join(path, word)
!
! if bad_uri:
! self.log_error("Detected bad request URI '%s', translated to '%s'" % (uri, path,))
!
! return path
!
! def run_cgi(self):
! """Execute a CGI script."""
! dir, rest = self.cgi_info
! i = rest.rfind('?')
! if i >= 0:
! rest, query = rest[:i], rest[i+1:]
! else:
! query = ''
! i = rest.find('/')
! if i >= 0:
! script, rest = rest[:i], rest[i:]
! else:
! script, rest = rest, ''
! scriptname = dir + '/' + script
! scriptfile = self.translate_path(scriptname)
! if not os.path.exists(scriptfile):
! self.send_error(404, "No such CGI script (%s)" % `scriptname`)
! return
! if not os.path.isfile(scriptfile):
! self.send_error(403, "CGI script is not a plain file (%s)" %
! `scriptname`)
! return
! ispy = self.is_python(scriptname)
! if not ispy:
! self.send_error(403, "CGI script is not a Python script (%s)" %
! `scriptname`)
! return
!
! # Reference: http://hoohoo.ncsa.uiuc.edu/cgi/env.html
! # XXX Much of the following could be prepared ahead of time!
! env = {}
! env['SERVER_SOFTWARE'] = self.version_string()
! env['SERVER_NAME'] = self.server.server_name
! env['GATEWAY_INTERFACE'] = 'CGI/1.1'
! env['SERVER_PROTOCOL'] = self.protocol_version
! env['SERVER_PORT'] = str(self.server.server_port)
! env['REQUEST_METHOD'] = self.command
! uqrest = urllib.unquote(rest)
! env['PATH_INFO'] = uqrest
! env['PATH_TRANSLATED'] = self.translate_path(uqrest)
! env['SCRIPT_NAME'] = scriptname
! if query:
! env['QUERY_STRING'] = query
! host = self.address_string()
! if host != self.client_address[0]:
! env['REMOTE_HOST'] = host
! env['REMOTE_ADDR'] = self.client_address[0]
! # XXX AUTH_TYPE
! # XXX REMOTE_USER
! # XXX REMOTE_IDENT
! if self.headers.typeheader is None:
! env['CONTENT_TYPE'] = self.headers.type
! else:
! env['CONTENT_TYPE'] = self.headers.typeheader
! length = self.headers.getheader('content-length')
! if length:
! env['CONTENT_LENGTH'] = length
! accept = []
! for line in self.headers.getallmatchingheaders('accept'):
! if line[:1] in "\t\n\r ":
! accept.append(line.strip())
! else:
! accept = accept + line[7:].split(',')
! env['HTTP_ACCEPT'] = ','.join(accept)
! ua = self.headers.getheader('user-agent')
! env['HTTP_USER_AGENT'] = ua or ''
! co = filter(None, self.headers.getheaders('cookie'))
! env['HTTP_COOKIE'] = string.join(co, ', ') or ''
! self.send_response(200, "Script output follows")
! decoded_query = query.replace('+', ' ')
!
! # execute script in this process
! save_env = os.environ
! save_argv = sys.argv
! save_stdin = sys.stdin
! save_stdout = sys.stdout
! save_stderr = sys.stderr
! try:
! try:
! os.environ.update(env)
! sys.argv = [scriptfile]
! if '=' not in decoded_query:
! sys.argv.append(decoded_query)
! sys.stdout = self.wfile
! sys.stdin = self.rfile
! execfile(scriptfile, {"__name__": "__main__"})
! sys.stdout.flush()
! finally:
! os.environ = save_env
! sys.argv = save_argv
! sys.stdin = save_stdin
! sys.stdout = save_stdout
! sys.stderr = save_stderr
! except SystemExit, sts:
! self.log_error("CGI script exit status %s", str(sts))
! else:
! self.log_message("CGI script exited OK")
!
!
! def log_message( self, format, *args ):
! try:
! file = open( 'web.log', 'a' )
! file.write( "%s - - [%s] %s\n" % ( self.address_string(), self.log_date_time_string(), format%args ) )
! file.close()
! except:
! print "Could not write to logfile: web.log\n"
class WebserverThread(Thread):
! def __init__( self, port=2594 ):
! Thread.__init__( self )
! self.port = port
! self.stopped = Event()
! self.httpd = None
! def cancel( self ):
! self.stopped.set()
! self.httpd.server_close()
! def run( self ):
! # Wait with binding the webserver for 5 Seconds
! server_address = ( '', self.port )
! time.sleep( 5 )
! # Starting up
! print "Remote Admin running on port %u\n" % self.port
! try:
! filepath = os.path.normpath(os.path.abspath('web\\'))
! self.httpd = Webserver( ( '', self.port ), filepath )
! except:
! traceback.print_exc()
! return
! while 1:
! self.httpd.handle_request()
! self.stopped.wait( 0.05 )
! if self.stopped.isSet():
! break
! print "Shutting down the Remote Admin.\n"
thread = None
|
|
From: <thi...@us...> - 2003-08-09 03:18:55
|
Update of /cvsroot/wpdev/wolfpack/python
In directory sc8-pr-cvs1:/tmp/cvs-serv19196/python
Modified Files:
pyaccount.cpp
Log Message:
Fixed 2 crashing bugs.
The first related to orphaned cPlayers and the second about PyString_FromString() not handling 0 properly ( Python's C API bug? )
Index: pyaccount.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/pyaccount.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** pyaccount.cpp 6 Aug 2003 01:24:55 -0000 1.15
--- pyaccount.cpp 9 Aug 2003 03:18:52 -0000 1.16
***************
*** 55,59 ****
*/
static PyTypeObject wpAccountType = {
! PyObject_HEAD_INIT(NULL)
0,
"wpaccount",
--- 55,59 ----
*/
static PyTypeObject wpAccountType = {
! PyObject_HEAD_INIT(&wpAccountType)
0,
"wpaccount",
***************
*** 203,207 ****
}
else if( !strcmp( name, "lastlogin" ) )
! return PyString_FromString( self->account->lastLogin().toString().latin1() );
else if( !strcmp( name, "blockuntil" ) )
{
--- 203,212 ----
}
else if( !strcmp( name, "lastlogin" ) )
! {
! if ( !self->account->lastLogin().isValid() )
! return PyString_FromString("Unknown");
! else
! return PyString_FromString( self->account->lastLogin().toString().latin1() );
! }
else if( !strcmp( name, "blockuntil" ) )
{
|
|
From: <thi...@us...> - 2003-08-09 03:18:55
|
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv19196
Modified Files:
player.cpp
Log Message:
Fixed 2 crashing bugs.
The first related to orphaned cPlayers and the second about PyString_FromString() not handling 0 properly ( Python's C API bug? )
Index: player.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/player.cpp,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** player.cpp 20 Jul 2003 00:04:51 -0000 1.20
--- player.cpp 9 Aug 2003 03:18:52 -0000 1.21
***************
*** 148,152 ****
if (pc->account() == 0)
{
! cCharStuff::DeleteChar(pc);
return;
}
--- 148,164 ----
if (pc->account() == 0)
{
! // We need to remove the equipment here.
! cBaseChar::ItemContainer container(pc->content());
! cBaseChar::ItemContainer::const_iterator it (container.begin());
! cBaseChar::ItemContainer::const_iterator end(container.end());
! for (; it != end; ++it )
! {
! P_ITEM pItem = *it;
! if( !pItem )
! continue;
!
! Items->DeleItem( pItem );
! }
! pc->del();
return;
}
|
|
From: <thi...@us...> - 2003-08-09 03:14:11
|
Update of /cvsroot/wpdev/xmlscripts/web In directory sc8-pr-cvs1:/tmp/cvs-serv18539 Modified Files: account.py Log Message: Looks better when there is no character in the account Index: account.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/web/account.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** account.py 7 Apr 2003 14:33:44 -0000 1.2 --- account.py 9 Aug 2003 03:14:05 -0000 1.3 *************** *** 118,130 **** content += "</form></table><br /><br />\n" ! # Character list ! content += '<table width="350" border="0" cellspacing="0" cellpadding="3">' ! content += '<tr><td colspan="2"><b>Characters</b></td></tr>' ! content += '<tr><td colspan="2" height="1"><img src="line_green.png" height="1" width="340" /></td></tr>' ! for char in record.characters: ! content += '<tr><td colspan="2"><b>%s</b> (Serial: 0x%x)</td></tr>' % ( char.name, char.serial ) ! content += '</table><br/><br/><br/>' --- 118,131 ---- content += "</form></table><br /><br />\n" ! # Character list ! if len(record.characters) > 0: ! content += '<table width="350" border="0" cellspacing="0" cellpadding="3">' ! content += '<tr><td colspan="2"><b>Characters</b></td></tr>' ! content += '<tr><td colspan="2" height="1"><img src="line_green.png" height="1" width="340" /></td></tr>' ! for char in record.characters: ! content += '<tr><td colspan="2"><b>%s</b> (Serial: 0x%x)</td></tr>' % ( char.name, char.serial ) ! content += '</table><br/><br/><br/>' |
Update of /cvsroot/wpdev/wolfpack/python
In directory sc8-pr-cvs1:/tmp/cvs-serv9725/python
Modified Files:
item.cpp multi.cpp pyaccount.cpp pycoord.cpp pyregion.cpp
pytooltip.cpp socket.cpp
Log Message:
making the wrappers static, some other clean ups.
Index: item.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/item.cpp,v
retrieving revision 1.67
retrieving revision 1.68
diff -C2 -d -r1.67 -r1.68
*** item.cpp 4 Aug 2003 07:28:18 -0000 1.67
--- item.cpp 6 Aug 2003 01:24:55 -0000 1.68
***************
*** 110,114 ****
Resends the item to all clients in range
*/
! PyObject* wpItem_update( wpItem* self, PyObject* args )
{
Q_UNUSED(args);
--- 110,114 ----
Resends the item to all clients in range
*/
! static PyObject* wpItem_update( wpItem* self, PyObject* args )
{
Q_UNUSED(args);
***************
*** 124,128 ****
Removes the item
*/
! PyObject* wpItem_delete( wpItem* self, PyObject* args )
{
Q_UNUSED(args);
--- 124,128 ----
Removes the item
*/
! static PyObject* wpItem_delete( wpItem* self, PyObject* args )
{
Q_UNUSED(args);
***************
*** 138,142 ****
Moves the item to the specified location
*/
! PyObject* wpItem_moveto( wpItem* self, PyObject* args )
{
if( !self->pItem || self->pItem->free )
--- 138,142 ----
Moves the item to the specified location
*/
! static PyObject* wpItem_moveto( wpItem* self, PyObject* args )
{
if( !self->pItem || self->pItem->free )
***************
*** 173,187 ****
Removes the item from all clients in range
*/
! PyObject* wpItem_removefromview( wpItem* self, PyObject* args )
{
! if( !self->pItem || self->pItem->free )
! return PyFalse;
!
! if( !checkArgInt( 0 ) || getArgInt( 0 ) == 0 )
! self->pItem->removeFromView( false );
! else
! self->pItem->removeFromView( true );
!
! return PyTrue;
}
--- 173,184 ----
Removes the item from all clients in range
*/
! static PyObject* wpItem_removefromview( wpItem* self, PyObject* args )
{
! int k = 1;
! if ( !PyArg_ParseTuple(args, "|i:item.removefromview( clean )", &k) )
! return 0;
! self->pItem->removeFromView( k != 0 ? true : false );
! Py_INCREF(Py_None);
! return Py_None;
}
***************
*** 189,193 ****
Plays a soundeffect originating from the item
*/
! PyObject* wpItem_soundeffect( wpItem* self, PyObject* args )
{
if( !self->pItem || self->pItem->free )
--- 186,190 ----
Plays a soundeffect originating from the item
*/
! static PyObject* wpItem_soundeffect( wpItem* self, PyObject* args )
{
if( !self->pItem || self->pItem->free )
***************
*** 208,212 ****
Returns the distance towards a given object or position
*/
! PyObject* wpItem_distanceto( wpItem* self, PyObject* args )
{
if( !self->pItem || self->pItem->free )
--- 205,209 ----
Returns the distance towards a given object or position
*/
! static PyObject* wpItem_distanceto( wpItem* self, PyObject* args )
{
if( !self->pItem || self->pItem->free )
***************
*** 243,248 ****
}
! PyErr_BadArgument();
! return NULL;
}
--- 240,245 ----
}
! PyErr_BadArgument();
! return NULL;
}
***************
*** 252,256 ****
determine the weapon skill.
*/
! PyObject* wpItem_weaponskill( wpItem* self, PyObject* args )
{
Q_UNUSED(args);
--- 249,253 ----
determine the weapon skill.
*/
! static PyObject* wpItem_weaponskill( wpItem* self, PyObject* args )
{
Q_UNUSED(args);
***************
*** 279,283 ****
and returns how much have been really consumed.
*/
! PyObject* wpItem_useresource( wpItem* self, PyObject* args )
{
if( !self->pItem || self->pItem->free )
--- 276,280 ----
and returns how much have been really consumed.
*/
! static PyObject* wpItem_useresource( wpItem* self, PyObject* args )
{
if( !self->pItem || self->pItem->free )
***************
*** 309,313 ****
available
*/
! PyObject* wpItem_countresource( wpItem* self, PyObject* args )
{
if( !self->pItem || self->pItem->free )
--- 306,310 ----
available
*/
! static PyObject* wpItem_countresource( wpItem* self, PyObject* args )
{
if( !self->pItem || self->pItem->free )
***************
*** 335,339 ****
Returns the custom tag passed
*/
! PyObject* wpItem_gettag( wpItem* self, PyObject* args )
{
if( !self->pItem || self->pItem->free )
--- 332,336 ----
Returns the custom tag passed
*/
! static PyObject* wpItem_gettag( wpItem* self, PyObject* args )
{
if( !self->pItem || self->pItem->free )
***************
*** 371,375 ****
Sets a custom tag
*/
! PyObject* wpItem_settag( wpItem* self, PyObject* args )
{
if( !self->pItem || self->pItem->free )
--- 368,372 ----
Sets a custom tag
*/
! static PyObject* wpItem_settag( wpItem* self, PyObject* args )
{
if( !self->pItem || self->pItem->free )
***************
*** 397,401 ****
Checks if a certain tag exists
*/
! PyObject* wpItem_hastag( wpItem* self, PyObject* args )
{
if( !self->pItem || self->pItem->free )
--- 394,398 ----
Checks if a certain tag exists
*/
! static PyObject* wpItem_hastag( wpItem* self, PyObject* args )
{
if( !self->pItem || self->pItem->free )
***************
*** 416,420 ****
Deletes a given tag
*/
! PyObject* wpItem_deltag( wpItem* self, PyObject* args )
{
if( !self->pItem || self->pItem->free )
--- 413,417 ----
Deletes a given tag
*/
! static PyObject* wpItem_deltag( wpItem* self, PyObject* args )
{
if( !self->pItem || self->pItem->free )
***************
*** 433,437 ****
}
! PyObject* wpItem_ischar( wpItem* self, PyObject* args )
{
Q_UNUSED(args);
--- 430,434 ----
}
! static PyObject* wpItem_ischar( wpItem* self, PyObject* args )
{
Q_UNUSED(args);
***************
*** 440,444 ****
}
! PyObject* wpItem_isitem( wpItem* self, PyObject* args )
{
Q_UNUSED(args);
--- 437,441 ----
}
! static PyObject* wpItem_isitem( wpItem* self, PyObject* args )
{
Q_UNUSED(args);
***************
*** 450,454 ****
Shows a moving effect moving toward a given object or coordinate.
*/
! PyObject* wpItem_movingeffect( wpItem* self, PyObject* args )
{
if( !self->pItem || self->pItem->free )
--- 447,451 ----
Shows a moving effect moving toward a given object or coordinate.
*/
! static PyObject* wpItem_movingeffect( wpItem* self, PyObject* args )
{
if( !self->pItem || self->pItem->free )
***************
*** 505,509 ****
Adds a temp effect to this item.
*/
! PyObject* wpItem_addtimer( wpItem* self, PyObject* args )
{
// Three arguments
--- 502,506 ----
Adds a temp effect to this item.
*/
! static PyObject* wpItem_addtimer( wpItem* self, PyObject* args )
{
// Three arguments
***************
*** 536,540 ****
Gets the outmost item this item is contained in.
*/
! PyObject* wpItem_getoutmostitem( wpItem* self, PyObject* args )
{
Q_UNUSED(args);
--- 533,537 ----
Gets the outmost item this item is contained in.
*/
! static PyObject* wpItem_getoutmostitem( wpItem* self, PyObject* args )
{
Q_UNUSED(args);
***************
*** 548,552 ****
Gets the outmost character this item is contained in.
*/
! PyObject* wpItem_getoutmostchar( wpItem* self, PyObject* args )
{
Q_UNUSED(args);
--- 545,549 ----
Gets the outmost character this item is contained in.
*/
! static PyObject* wpItem_getoutmostchar( wpItem* self, PyObject* args )
{
Q_UNUSED(args);
***************
*** 557,562 ****
}
! PyObject* wpItem_getname( wpItem* self )
{
if( !self->pItem )
return false;
--- 554,563 ----
}
! /*!
! Returns the item's name
! */
! static PyObject* wpItem_getname( wpItem* self, PyObject* args )
{
+ Q_UNUSED(args);
if( !self->pItem )
return false;
***************
*** 569,573 ****
Adds an item to this container.
*/
! PyObject* wpItem_additem( wpItem* self, PyObject* args )
{
if( !self->pItem || self->pItem->free )
--- 570,574 ----
Adds an item to this container.
*/
! static PyObject* wpItem_additem( wpItem* self, PyObject* args )
{
if( !self->pItem || self->pItem->free )
***************
*** 620,624 ****
}
! PyObject* wpItem_getadv( wpItem* self, PyObject* args )
{
if( !self->pItem || self->pItem->free )
--- 621,625 ----
}
! static PyObject* wpItem_getadv( wpItem* self, PyObject* args )
{
if( !self->pItem || self->pItem->free )
***************
*** 659,663 ****
}
! PyObject* wpItem_setadv( wpItem* self, PyObject* args )
{
if( !self->pItem || self->pItem->free )
--- 660,664 ----
}
! static PyObject* wpItem_setadv( wpItem* self, PyObject* args )
{
if( !self->pItem || self->pItem->free )
***************
*** 738,742 ****
// Getters + Setters
! PyObject *wpItem_getAttr( wpItem *self, char *name )
{
// Special Python things
--- 739,743 ----
// Getters + Setters
! static PyObject *wpItem_getAttr( wpItem *self, char *name )
{
// Special Python things
***************
*** 823,827 ****
}
! int wpItem_setAttr( wpItem *self, char *name, PyObject *value )
{
// Special Python things.
--- 824,828 ----
}
! static int wpItem_setAttr( wpItem *self, char *name, PyObject *value )
{
// Special Python things.
Index: multi.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/multi.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** multi.cpp 4 Aug 2003 07:28:18 -0000 1.13
--- multi.cpp 6 Aug 2003 01:24:55 -0000 1.14
***************
*** 95,99 ****
Resends the multi to all clients in range
*/
! PyObject* wpMulti_update( wpMulti* self, PyObject* args )
{
Q_UNUSED(args);
--- 95,99 ----
Resends the multi to all clients in range
*/
! static PyObject* wpMulti_update( wpMulti* self, PyObject* args )
{
Q_UNUSED(args);
***************
*** 109,113 ****
Sends custom house to client
*/
! PyObject* wpMulti_sendcustomhouse( wpMulti* self, PyObject* args )
{
Q_UNUSED(args);
--- 109,113 ----
Sends custom house to client
*/
! static PyObject* wpMulti_sendcustomhouse( wpMulti* self, PyObject* args )
{
Q_UNUSED(args);
***************
*** 138,142 ****
Adds a tile to the custom house
*/
! PyObject* wpMulti_addchtile( wpMulti* self, PyObject* args )
{
Q_UNUSED(args);
--- 138,142 ----
Adds a tile to the custom house
*/
! static PyObject* wpMulti_addchtile( wpMulti* self, PyObject* args )
{
Q_UNUSED(args);
***************
*** 144,168 ****
return PyFalse;
- if( PyTuple_Size( args ) < 4 || !checkArgInt( 0 ) || !checkArgInt( 1 ) || !checkArgInt( 2 ) || !checkArgInt( 3 ) )
- {
- PyErr_BadArgument();
- return NULL;
- }
UINT16 model;
Coord_cl pos;
! model = getArgInt( 0 );
! pos.x = getArgInt( 1 );
! pos.y = getArgInt( 2 );
! pos.z = getArgInt( 3 );
!
self->pMulti->addCHTile( model, pos );
return PyTrue;
}
/*!
Removes the multi
*/
! PyObject* wpMulti_delete( wpMulti* self, PyObject* args )
{
Q_UNUSED(args);
--- 144,162 ----
return PyFalse;
UINT16 model;
Coord_cl pos;
! if ( !PyArg_ParseTuple( args, "iiii:addchtile( model, x, y, z )", &model, &pos.x, &pos.y, &pos.z ) )
! return 0;
!
self->pMulti->addCHTile( model, pos );
return PyTrue;
}
+
/*!
Removes the multi
*/
! static PyObject* wpMulti_delete( wpMulti* self, PyObject* args )
{
Q_UNUSED(args);
***************
*** 179,183 ****
Moves the multi to the specified location
*/
! PyObject* wpMulti_moveto( wpMulti* self, PyObject* args )
{
if( !self->pMulti || self->pMulti->free )
--- 173,177 ----
Moves the multi to the specified location
*/
! static PyObject* wpMulti_moveto( wpMulti* self, PyObject* args )
{
if( !self->pMulti || self->pMulti->free )
***************
*** 236,250 ****
Removes the multi from all clients in range
*/
! PyObject* wpMulti_removefromview( wpMulti* self, PyObject* args )
{
! if( !self->pMulti || self->pMulti->free )
! return PyFalse;
!
! if( !checkArgInt( 0 ) || getArgInt( 0 ) == 0 )
! self->pMulti->removeFromView( false );
! else
! self->pMulti->removeFromView( true );
! return PyTrue;
}
--- 230,242 ----
Removes the multi from all clients in range
*/
! static PyObject* wpMulti_removefromview( wpMulti* self, PyObject* args )
{
! int k = 1;
! if ( !PyArg_ParseTuple(args, "|i:item.removefromview( clean )", &k) )
! return 0;
! self->pMulti->removeFromView( k != 0 ? true : false );
! Py_INCREF(Py_None);
! return Py_None;
}
***************
*** 252,256 ****
Plays a soundeffect originating from the multi
*/
! PyObject* wpMulti_soundeffect( wpMulti* self, PyObject* args )
{
if( !self->pMulti || self->pMulti->free )
--- 244,248 ----
Plays a soundeffect originating from the multi
*/
! static PyObject* wpMulti_soundeffect( wpMulti* self, PyObject* args )
{
if( !self->pMulti || self->pMulti->free )
***************
*** 271,275 ****
* Adds a temp effect to this multi.
*/
! PyObject* wpMulti_addtimer( wpMulti* self, PyObject* args )
{
if( (PyTuple_Size( args ) < 3 && PyTuple_Size( args ) > 4) || !checkArgInt( 0 ) || !checkArgStr( 1 ) || !PyList_Check( PyTuple_GetItem( args, 2 ) ) )
--- 263,267 ----
* Adds a temp effect to this multi.
*/
! static PyObject* wpMulti_addtimer( wpMulti* self, PyObject* args )
{
if( (PyTuple_Size( args ) < 3 && PyTuple_Size( args ) > 4) || !checkArgInt( 0 ) || !checkArgStr( 1 ) || !PyList_Check( PyTuple_GetItem( args, 2 ) ) )
***************
*** 295,299 ****
Returns the custom tag passed
*/
! PyObject* wpMulti_gettag( wpMulti* self, PyObject* args )
{
if( !self->pMulti || self->pMulti->free )
--- 287,291 ----
Returns the custom tag passed
*/
! static PyObject* wpMulti_gettag( wpMulti* self, PyObject* args )
{
if( !self->pMulti || self->pMulti->free )
***************
*** 331,335 ****
Sets a custom tag
*/
! PyObject* wpMulti_settag( wpMulti* self, PyObject* args )
{
if( !self->pMulti || self->pMulti->free )
--- 323,327 ----
Sets a custom tag
*/
! static PyObject* wpMulti_settag( wpMulti* self, PyObject* args )
{
if( !self->pMulti || self->pMulti->free )
***************
*** 357,361 ****
Checks if a certain tag exists
*/
! PyObject* wpMulti_hastag( wpMulti* self, PyObject* args )
{
if( !self->pMulti || self->pMulti->free )
--- 349,353 ----
Checks if a certain tag exists
*/
! static PyObject* wpMulti_hastag( wpMulti* self, PyObject* args )
{
if( !self->pMulti || self->pMulti->free )
***************
*** 376,380 ****
Deletes a given tag
*/
! PyObject* wpMulti_deltag( wpMulti* self, PyObject* args )
{
if( !self->pMulti || self->pMulti->free )
--- 368,372 ----
Deletes a given tag
*/
! static PyObject* wpMulti_deltag( wpMulti* self, PyObject* args )
{
if( !self->pMulti || self->pMulti->free )
***************
*** 393,397 ****
}
! PyObject* wpMulti_ismulti( wpMulti* self, PyObject* args )
{
Q_UNUSED(args);
--- 385,389 ----
}
! static PyObject* wpMulti_ismulti( wpMulti* self, PyObject* args )
{
Q_UNUSED(args);
***************
*** 403,407 ****
* is this multi a house ?
*/
! PyObject* wpMulti_ishouse( wpMulti* self, PyObject* args )
{
Q_UNUSED(args);
--- 395,399 ----
* is this multi a house ?
*/
! static PyObject* wpMulti_ishouse( wpMulti* self, PyObject* args )
{
Q_UNUSED(args);
***************
*** 413,417 ****
* is this multi a boat ?
*/
! PyObject* wpMulti_isboat( wpMulti* self, PyObject* args )
{
Q_UNUSED(args);
--- 405,409 ----
* is this multi a boat ?
*/
! static PyObject* wpMulti_isboat( wpMulti* self, PyObject* args )
{
Q_UNUSED(args);
***************
*** 423,427 ****
Adds an item to this multi.
*/
! PyObject* wpMulti_additem( wpMulti* self, PyObject* args )
{
if( !self->pMulti || self->pMulti->free )
--- 415,419 ----
Adds an item to this multi.
*/
! static PyObject* wpMulti_additem( wpMulti* self, PyObject* args )
{
if( !self->pMulti || self->pMulti->free )
***************
*** 444,448 ****
* Returns the list of the chars in this multi
*/
! PyObject* wpMulti_chars( wpMulti* self, PyObject* args )
{
Q_UNUSED(args);
--- 436,440 ----
* Returns the list of the chars in this multi
*/
! static PyObject* wpMulti_chars( wpMulti* self, PyObject* args )
{
Q_UNUSED(args);
***************
*** 465,469 ****
* Returns the list of the items in this multi
*/
! PyObject* wpMulti_items( wpMulti* self, PyObject* args )
{
Q_UNUSED(args);
--- 457,461 ----
* Returns the list of the items in this multi
*/
! static PyObject* wpMulti_items( wpMulti* self, PyObject* args )
{
Q_UNUSED(args);
***************
*** 486,490 ****
* Returns the friends list of this multi
*/
! PyObject* wpMulti_friends( wpMulti* self, PyObject* args )
{
Q_UNUSED(args);
--- 478,482 ----
* Returns the friends list of this multi
*/
! static PyObject* wpMulti_friends( wpMulti* self, PyObject* args )
{
Q_UNUSED(args);
***************
*** 507,511 ****
* Returns the bans list of this multi
*/
! PyObject* wpMulti_bans( wpMulti* self, PyObject* args )
{
Q_UNUSED(args);
--- 499,503 ----
* Returns the bans list of this multi
*/
! static PyObject* wpMulti_bans( wpMulti* self, PyObject* args )
{
Q_UNUSED(args);
***************
*** 528,533 ****
{
{ "additem", (getattrofunc)wpMulti_additem, METH_VARARGS, "Adds an item to this multi." },
! { "update", (getattrofunc)wpMulti_update, METH_VARARGS, "Sends the multi to all clients in range." },
! { "removefromview", (getattrofunc)wpMulti_removefromview, METH_VARARGS, "Removes the multi from the view of all in-range clients." },
{ "delete", (getattrofunc)wpMulti_delete, METH_VARARGS, "Deletes the multi and the underlying reference." },
{ "moveto", (getattrofunc)wpMulti_moveto, METH_VARARGS, "Moves the multi to the specified location." },
--- 520,525 ----
{
{ "additem", (getattrofunc)wpMulti_additem, METH_VARARGS, "Adds an item to this multi." },
! { "update", (getattrofunc)wpMulti_update, METH_VARARGS, "Sends the multi to all clients in range." },
! { "removefromview", (getattrofunc)wpMulti_removefromview, METH_VARARGS, "Removes the multi from the view of all in-range clients." },
{ "delete", (getattrofunc)wpMulti_delete, METH_VARARGS, "Deletes the multi and the underlying reference." },
{ "moveto", (getattrofunc)wpMulti_moveto, METH_VARARGS, "Moves the multi to the specified location." },
***************
*** 556,560 ****
// Getters + Setters
! PyObject *wpMulti_getAttr( wpMulti *self, char *name )
{
if( !strcmp( "events", name ) )
--- 548,552 ----
// Getters + Setters
! static PyObject *wpMulti_getAttr( wpMulti *self, char *name )
{
if( !strcmp( "events", name ) )
***************
*** 616,620 ****
}
! int wpMulti_setAttr( wpMulti *self, char *name, PyObject *value )
{
if( !strcmp( "events", name ) )
--- 608,612 ----
}
! static int wpMulti_setAttr( wpMulti *self, char *name, PyObject *value )
{
if( !strcmp( "events", name ) )
Index: pyaccount.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/pyaccount.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** pyaccount.cpp 4 Aug 2003 07:28:18 -0000 1.14
--- pyaccount.cpp 6 Aug 2003 01:24:55 -0000 1.15
***************
*** 66,70 ****
};
! PyObject *wpAccount_delete( wpAccount *self, PyObject *args )
{
Q_UNUSED(args);
--- 66,73 ----
};
! /*!
! Removes this account
! */
! static PyObject *wpAccount_delete( wpAccount *self, PyObject *args )
{
Q_UNUSED(args);
***************
*** 82,86 ****
}
! PyObject *wpAccount_block( wpAccount *self, PyObject *args )
{
Q_UNUSED(args);
--- 85,92 ----
}
! /*!
! Blocks the account from logging into the system
! */
! static PyObject *wpAccount_block( wpAccount *self, PyObject *args )
{
Q_UNUSED(args);
***************
*** 92,96 ****
}
! PyObject *wpAccount_unblock( wpAccount *self, PyObject *args )
{
Q_UNUSED(args);
--- 98,105 ----
}
! /*!
! unBlocks the account from logging into the system
! */
! static PyObject *wpAccount_unblock( wpAccount *self, PyObject *args )
{
Q_UNUSED(args);
***************
*** 102,106 ****
}
! PyObject *wpAccount_addcharacter( wpAccount *self, PyObject *args )
{
if( !self->account )
--- 111,115 ----
}
! static PyObject *wpAccount_addcharacter( wpAccount *self, PyObject *args )
{
if( !self->account )
***************
*** 123,127 ****
}
! PyObject *wpAccount_removecharacter( wpAccount *self, PyObject *args )
{
if( !self->account )
--- 132,136 ----
}
! static PyObject *wpAccount_removecharacter( wpAccount *self, PyObject *args )
{
if( !self->account )
***************
*** 144,148 ****
}
! PyObject *wpAccount_authorized( wpAccount *self, PyObject *args )
{
if( !self->account )
--- 153,157 ----
}
! static PyObject *wpAccount_authorized( wpAccount *self, PyObject *args )
{
if( !self->account )
***************
*** 175,179 ****
};
! PyObject *wpAccount_getAttr( wpAccount *self, char *name )
{
if( !strcmp( name, "acl" ) )
--- 184,188 ----
};
! static PyObject *wpAccount_getAttr( wpAccount *self, char *name )
{
if( !strcmp( name, "acl" ) )
***************
*** 213,217 ****
}
! int wpAccount_setAttr( wpAccount *self, char *name, PyObject *value )
{
if( !strcmp( name, "acl" ) && PyString_Check( value ) )
--- 222,226 ----
}
! static int wpAccount_setAttr( wpAccount *self, char *name, PyObject *value )
{
if( !strcmp( name, "acl" ) && PyString_Check( value ) )
Index: pycoord.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/pycoord.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** pycoord.cpp 24 Jun 2003 19:29:37 -0000 1.4
--- pycoord.cpp 6 Aug 2003 01:24:55 -0000 1.5
***************
*** 59,63 ****
};
! PyObject *wpCoord_distance( wpCoord *self, PyObject *args )
{
// Check if the paramter is a coordinate
--- 59,63 ----
};
! static PyObject *wpCoord_distance( wpCoord *self, PyObject *args )
{
// Check if the paramter is a coordinate
***************
*** 80,84 ****
};
! PyObject *wpCoord_getAttr( wpCoord *self, char *name )
{
if( !strcmp( name, "x" ) )
--- 80,84 ----
};
! static PyObject *wpCoord_getAttr( wpCoord *self, char *name )
{
if( !strcmp( name, "x" ) )
***************
*** 94,98 ****
}
! int wpCoord_setAttr( wpCoord *self, char *name, PyObject *value )
{
// I only have integer params in mind
--- 94,98 ----
}
! static int wpCoord_setAttr( wpCoord *self, char *name, PyObject *value )
{
// I only have integer params in mind
Index: pyregion.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/pyregion.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** pyregion.cpp 4 Aug 2003 07:28:18 -0000 1.7
--- pyregion.cpp 6 Aug 2003 01:24:55 -0000 1.8
***************
*** 69,73 ****
};
! PyObject *wpRegion_getAttr( wpRegion *self, char *name )
{
if( !strcmp( name, "parent" ) )
--- 69,73 ----
};
! static PyObject *wpRegion_getAttr( wpRegion *self, char *name )
{
if( !strcmp( name, "parent" ) )
***************
*** 143,147 ****
}
! int wpRegion_setAttr( wpRegion *self, char *name, PyObject *value )
{
Q_UNUSED(self);
--- 143,147 ----
}
! static int wpRegion_setAttr( wpRegion *self, char *name, PyObject *value )
{
Q_UNUSED(self);
Index: pytooltip.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/pytooltip.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** pytooltip.cpp 4 Aug 2003 07:28:18 -0000 1.5
--- pytooltip.cpp 6 Aug 2003 01:24:55 -0000 1.6
***************
*** 70,74 ****
};
! PyObject *wpTooltip_send( wpTooltip *self, PyObject *args )
{
if( !self->list )
--- 70,74 ----
};
! static PyObject *wpTooltip_send( wpTooltip *self, PyObject *args )
{
if( !self->list )
***************
*** 88,92 ****
return PyTrue;
}
! PyObject *wpTooltip_add( wpTooltip *self, PyObject *args )
{
if( !self->list )
--- 88,93 ----
return PyTrue;
}
!
! static PyObject *wpTooltip_add( wpTooltip *self, PyObject *args )
{
if( !self->list )
***************
*** 120,124 ****
}
! PyObject *wpTooltip_getAttr( wpTooltip *self, char *name )
{
if( !strcmp( name, "id" ) )
--- 121,125 ----
}
! static PyObject *wpTooltip_getAttr( wpTooltip *self, char *name )
{
if( !strcmp( name, "id" ) )
***************
*** 130,134 ****
}
! int wpTooltip_setAttr( wpTooltip *self, char *name, PyObject *value )
{
if( !PyInt_Check( value ) )
--- 131,135 ----
}
! static int wpTooltip_setAttr( wpTooltip *self, char *name, PyObject *value )
{
if( !PyInt_Check( value ) )
Index: socket.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/socket.cpp,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -d -r1.39 -r1.40
*** socket.cpp 4 Aug 2003 07:28:18 -0000 1.39
--- socket.cpp 6 Aug 2003 01:24:55 -0000 1.40
***************
*** 83,87 ****
Disconnects the socket.
*/
! PyObject* wpSocket_disconnect( wpSocket* self, PyObject* args )
{
Q_UNUSED(args);
--- 83,87 ----
Disconnects the socket.
*/
! static PyObject* wpSocket_disconnect( wpSocket* self, PyObject* args )
{
Q_UNUSED(args);
***************
*** 96,100 ****
Sends a system message to the socket
*/
! PyObject* wpSocket_sysmessage( wpSocket* self, PyObject* args )
{
if( !self->pSock )
--- 96,100 ----
Sends a system message to the socket
*/
! static PyObject* wpSocket_sysmessage( wpSocket* self, PyObject* args )
{
if( !self->pSock )
***************
*** 125,129 ****
Sends a localized message to the socket
*/
! PyObject* wpSocket_clilocmessage( wpSocket* self, PyObject* args )
{
if( !self->pSock )
--- 125,129 ----
Sends a localized message to the socket
*/
! static PyObject* wpSocket_clilocmessage( wpSocket* self, PyObject* args )
{
if( !self->pSock )
***************
*** 184,188 ****
Sends speech of a given object to the socket
*/
! PyObject* wpSocket_showspeech( wpSocket* self, PyObject* args )
{
// Needed/Allowed arugments:
--- 184,188 ----
Sends speech of a given object to the socket
*/
! static PyObject* wpSocket_showspeech( wpSocket* self, PyObject* args )
{
// Needed/Allowed arugments:
***************
*** 242,246 ****
Attachs a target request to the socket.
*/
! PyObject* wpSocket_attachtarget( wpSocket* self, PyObject* args )
{
if( !self->pSock )
--- 242,246 ----
Attachs a target request to the socket.
*/
! static PyObject* wpSocket_attachtarget( wpSocket* self, PyObject* args )
{
if( !self->pSock )
***************
*** 285,289 ****
Attachs a multi target request to the socket.
*/
! PyObject* wpSocket_attachmultitarget( wpSocket* self, PyObject* args )
{
if( !self->pSock )
--- 285,289 ----
Attachs a multi target request to the socket.
*/
! static PyObject* wpSocket_attachmultitarget( wpSocket* self, PyObject* args )
{
if( !self->pSock )
***************
*** 330,334 ****
Begins CH customization
*/
! PyObject* wpSocket_customize( wpSocket* self, PyObject* args )
{
Q_UNUSED(args);
--- 330,334 ----
Begins CH customization
*/
! static PyObject* wpSocket_customize( wpSocket* self, PyObject* args )
{
Q_UNUSED(args);
***************
*** 353,357 ****
Sends a gump to the socket. This function is used internally only.
*/
! PyObject* wpSocket_sendgump( wpSocket* self, PyObject* args )
{
if( !self->pSock )
--- 353,357 ----
Sends a gump to the socket. This function is used internally only.
*/
! static PyObject* wpSocket_sendgump( wpSocket* self, PyObject* args )
{
if( !self->pSock )
***************
*** 419,423 ****
serial.
*/
! PyObject* wpSocket_closegump( wpSocket* self, PyObject* args )
{
if( !self->pSock )
--- 419,423 ----
serial.
*/
! static PyObject* wpSocket_closegump( wpSocket* self, PyObject* args )
{
if( !self->pSock )
***************
*** 441,445 ****
Resends the world around this socket.
*/
! PyObject* wpSocket_resendworld( wpSocket* self, PyObject* args )
{
Q_UNUSED(args);
--- 441,445 ----
Resends the world around this socket.
*/
! static PyObject* wpSocket_resendworld( wpSocket* self, PyObject* args )
{
Q_UNUSED(args);
***************
*** 453,457 ****
Resends the player only.
*/
! PyObject* wpSocket_resendplayer( wpSocket* self, PyObject* args )
{
Q_UNUSED(args);
--- 453,457 ----
Resends the player only.
*/
! static PyObject* wpSocket_resendplayer( wpSocket* self, PyObject* args )
{
Q_UNUSED(args);
***************
*** 465,469 ****
Sends a container and it's content to a socket.
*/
! PyObject* wpSocket_sendcontainer( wpSocket* self, PyObject* args )
{
if( !self->pSock )
--- 465,469 ----
Sends a container and it's content to a socket.
*/
! static PyObject* wpSocket_sendcontainer( wpSocket* self, PyObject* args )
{
if( !self->pSock )
***************
*** 487,491 ****
Sends a packet to this socket.
*/
! PyObject* wpSocket_sendpacket( wpSocket* self, PyObject* args )
{
if( PyTuple_Size( args ) != 1 )
--- 487,491 ----
Sends a packet to this socket.
*/
! static PyObject* wpSocket_sendpacket( wpSocket* self, PyObject* args )
{
if( PyTuple_Size( args ) != 1 )
***************
*** 520,524 ****
Returns the custom tag passed
*/
! PyObject* wpSocket_gettag( wpSocket* self, PyObject* args )
{
if( !self->pSock )
--- 520,524 ----
Returns the custom tag passed
*/
! static PyObject* wpSocket_gettag( wpSocket* self, PyObject* args )
{
if( !self->pSock )
***************
*** 549,553 ****
Sets a custom tag
*/
! PyObject* wpSocket_settag( wpSocket* self, PyObject* args )
{
if( !self->pSock )
--- 549,553 ----
Sets a custom tag
*/
! static PyObject* wpSocket_settag( wpSocket* self, PyObject* args )
{
if( !self->pSock )
***************
*** 575,579 ****
Checks if a certain tag exists
*/
! PyObject* wpSocket_hastag( wpSocket* self, PyObject* args )
{
if( !self->pSock )
--- 575,579 ----
Checks if a certain tag exists
*/
! static PyObject* wpSocket_hastag( wpSocket* self, PyObject* args )
{
if( !self->pSock )
***************
*** 594,598 ****
Deletes a given tag
*/
! PyObject* wpSocket_deltag( wpSocket* self, PyObject* args )
{
if( !self->pSock )
--- 594,598 ----
Deletes a given tag
*/
! static PyObject* wpSocket_deltag( wpSocket* self, PyObject* args )
{
if( !self->pSock )
***************
*** 614,625 ****
Resends the status window to this client.
*/
! PyObject *wpSocket_resendstatus( wpSocket *self, PyObject *args )
{
Q_UNUSED(args);
self->pSock->sendStatWindow();
! return PyTrue;
}
! PyObject *wpSocket_questarrow( wpSocket *self, PyObject *args )
{
int show;
--- 614,626 ----
Resends the status window to this client.
*/
! static PyObject *wpSocket_resendstatus( wpSocket *self, PyObject *args )
{
Q_UNUSED(args);
self->pSock->sendStatWindow();
! Py_INCREF(Py_None);
! return Py_None;
}
! static PyObject *wpSocket_questarrow( wpSocket *self, PyObject *args )
{
int show;
***************
*** 660,664 ****
// Getters & Setters
! PyObject *wpSocket_getAttr( wpSocket *self, char *name )
{
if( !strcmp( name, "player" ) )
--- 661,665 ----
// Getters & Setters
! static PyObject *wpSocket_getAttr( wpSocket *self, char *name )
{
if( !strcmp( name, "player" ) )
***************
*** 668,672 ****
}
! int wpSocket_setAttr( wpSocket *self, char *name, PyObject *value )
{
Q_UNUSED(self);
--- 669,673 ----
}
! static int wpSocket_setAttr( wpSocket *self, char *name, PyObject *value )
{
Q_UNUSED(self);
|
|
From: <thi...@us...> - 2003-08-06 00:20:36
|
Update of /cvsroot/wpdev/wolfpack/python
In directory sc8-pr-cvs1:/tmp/cvs-serv32628/python
Modified Files:
char.cpp global.cpp
Log Message:
Fixing our METH_NOARG calls... they were wrong according to Python 2.3 docs :(
Index: char.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/char.cpp,v
retrieving revision 1.95
retrieving revision 1.96
diff -C2 -d -r1.95 -r1.96
*** char.cpp 4 Aug 2003 07:28:17 -0000 1.95
--- char.cpp 6 Aug 2003 00:20:33 -0000 1.96
***************
*** 70,77 ****
}
- // Forward Declarations
- #define pGetInt( a, b ) if( !strcmp( name, a ) ) return PyInt_FromLong( self->pChar->b );
- #define pGetStr( a, b ) if( !strcmp( name, a ) ) return PyString_FromString( self->pChar->b );
-
PyObject *wpChar_getAttr( wpChar *self, char *name );
int wpChar_setAttr( wpChar *self, char *name, PyObject *value );
--- 70,73 ----
***************
*** 114,118 ****
Resends the character.
*/
! PyObject* wpChar_update( wpChar* self, PyObject* args )
{
Q_UNUSED(args);
--- 110,114 ----
Resends the character.
*/
! static PyObject* wpChar_update( wpChar* self, PyObject* args )
{
Q_UNUSED(args);
***************
*** 128,132 ****
Removes the character from view.
*/
! PyObject* wpChar_removefromview( wpChar* self, PyObject* args )
{
if( !self->pChar || self->pChar->free )
--- 124,128 ----
Removes the character from view.
*/
! static PyObject* wpChar_removefromview( wpChar* self, PyObject* args )
{
if( !self->pChar || self->pChar->free )
***************
*** 144,148 ****
Displays a message to the character if connected.
*/
! PyObject* wpChar_message( wpChar* self, PyObject* args )
{
P_PLAYER player = dynamic_cast<P_PLAYER>(self->pChar);
--- 140,144 ----
Displays a message to the character if connected.
*/
! static PyObject* wpChar_message( wpChar* self, PyObject* args )
{
P_PLAYER player = dynamic_cast<P_PLAYER>(self->pChar);
***************
*** 173,177 ****
Moves the char to the specified location
*/
! PyObject* wpChar_moveto( wpChar* self, PyObject* args )
{
if( !self->pChar || self->pChar->free )
--- 169,173 ----
Moves the char to the specified location
*/
! static PyObject* wpChar_moveto( wpChar* self, PyObject* args )
{
if( !self->pChar || self->pChar->free )
***************
*** 229,233 ****
Plays a creature specific sound.
*/
! PyObject* wpChar_sound( wpChar* self, PyObject* args )
{
if( !self->pChar || self->pChar->free )
--- 225,229 ----
Plays a creature specific sound.
*/
! static PyObject* wpChar_sound( wpChar* self, PyObject* args )
{
if( !self->pChar || self->pChar->free )
***************
*** 247,251 ****
Plays a soundeffect originating from the char
*/
! PyObject* wpChar_soundeffect( wpChar* self, PyObject* args )
{
if( !self->pChar || self->pChar->free )
--- 243,247 ----
Plays a soundeffect originating from the char
*/
! static PyObject* wpChar_soundeffect( wpChar* self, PyObject* args )
{
if( !self->pChar || self->pChar->free )
***************
*** 269,273 ****
Returns the distance towards a given object or position
*/
! PyObject* wpChar_distanceto( wpChar* self, PyObject* args )
{
if( !self->pChar || self->pChar->free )
--- 265,269 ----
Returns the distance towards a given object or position
*/
! static PyObject* wpChar_distanceto( wpChar* self, PyObject* args )
{
if( !self->pChar || self->pChar->free )
***************
*** 311,315 ****
Lets the character perform an action
*/
! PyObject* wpChar_action( wpChar* self, PyObject* args )
{
if( PyTuple_Size( args ) < 1 || !PyInt_Check( PyTuple_GetItem( args, 0 ) ) )
--- 307,311 ----
Lets the character perform an action
*/
! static PyObject* wpChar_action( wpChar* self, PyObject* args )
{
if( PyTuple_Size( args ) < 1 || !PyInt_Check( PyTuple_GetItem( args, 0 ) ) )
***************
*** 327,331 ****
toward some object or position
*/
! PyObject* wpChar_directionto( wpChar* self, PyObject* args )
{
if( !self->pChar || self->pChar->free )
--- 323,327 ----
toward some object or position
*/
! static PyObject* wpChar_directionto( wpChar* self, PyObject* args )
{
if( !self->pChar || self->pChar->free )
***************
*** 373,377 ****
and minimum and maximum arguments.
*/
! PyObject* wpChar_checkskill( wpChar* self, PyObject* args )
{
if( self->pChar->free )
--- 369,373 ----
and minimum and maximum arguments.
*/
! static PyObject* wpChar_checkskill( wpChar* self, PyObject* args )
{
if( self->pChar->free )
***************
*** 394,398 ****
it returns Py_None.
*/
! PyObject* wpChar_itemonlayer( wpChar* self, PyObject* args )
{
if( !self->pChar || self->pChar->free )
--- 390,394 ----
it returns Py_None.
*/
! static PyObject* wpChar_itemonlayer( wpChar* self, PyObject* args )
{
if( !self->pChar || self->pChar->free )
***************
*** 411,415 ****
Returns the combat skill currently used by the character
*/
! PyObject* wpChar_combatskill( wpChar* self, PyObject* args )
{
Q_UNUSED(args);
--- 407,411 ----
Returns the combat skill currently used by the character
*/
! static PyObject* wpChar_combatskill( wpChar* self, PyObject* args )
{
Q_UNUSED(args);
***************
*** 431,435 ****
and returns how much have been really consumed.
*/
! PyObject* wpChar_useresource( wpChar* self, PyObject* args )
{
if( !self->pChar || self->pChar->free )
--- 427,431 ----
and returns how much have been really consumed.
*/
! static PyObject* wpChar_useresource( wpChar* self, PyObject* args )
{
if( !self->pChar || self->pChar->free )
***************
*** 461,465 ****
Resurrects the current character
*/
! PyObject* wpChar_resurrect( wpChar* self, PyObject* args )
{
Q_UNUSED(args);
--- 457,461 ----
Resurrects the current character
*/
! static PyObject* wpChar_resurrect( wpChar* self, PyObject* args )
{
Q_UNUSED(args);
***************
*** 475,479 ****
Kills the current character
*/
! PyObject* wpChar_kill( wpChar* self, PyObject* args )
{
Q_UNUSED(args);
--- 471,475 ----
Kills the current character
*/
! static PyObject* wpChar_kill( wpChar* self, PyObject* args )
{
Q_UNUSED(args);
***************
*** 491,495 ****
This cannot be used for healing!
*/
! PyObject* wpChar_damage( wpChar* self, PyObject* args )
{
if( self->pChar->free )
--- 487,491 ----
This cannot be used for healing!
*/
! static PyObject* wpChar_damage( wpChar* self, PyObject* args )
{
if( self->pChar->free )
***************
*** 520,524 ****
Shows an emote above the chars head
*/
! PyObject* wpChar_emote( wpChar* self, PyObject* args )
{
if( !self->pChar || self->pChar->free )
--- 516,520 ----
Shows an emote above the chars head
*/
! static PyObject* wpChar_emote( wpChar* self, PyObject* args )
{
if( !self->pChar || self->pChar->free )
***************
*** 539,543 ****
The character says something.
*/
! PyObject* wpChar_say( wpChar* self, PyObject* args )
{
if( !self->pChar || self->pChar->free )
--- 535,539 ----
The character says something.
*/
! static PyObject* wpChar_say( wpChar* self, PyObject* args )
{
if( !self->pChar || self->pChar->free )
***************
*** 565,569 ****
available
*/
! PyObject* wpChar_countresource( wpChar* self, PyObject* args )
{
if( !self->pChar || self->pChar->free )
--- 561,565 ----
available
*/
! static PyObject* wpChar_countresource( wpChar* self, PyObject* args )
{
if( !self->pChar || self->pChar->free )
***************
*** 591,595 ****
}
! PyObject* wpChar_isitem( wpChar* self, PyObject* args )
{
Q_UNUSED(args);
--- 587,591 ----
}
! static PyObject* wpChar_isitem( wpChar* self, PyObject* args )
{
Q_UNUSED(args);
***************
*** 598,602 ****
}
! PyObject* wpChar_ischar( wpChar* self, PyObject* args )
{
Q_UNUSED(args);
--- 594,598 ----
}
! static PyObject* wpChar_ischar( wpChar* self, PyObject* args )
{
Q_UNUSED(args);
***************
*** 608,612 ****
Returns the custom tag passed
*/
! PyObject* wpChar_gettag( wpChar* self, PyObject* args )
{
if( !self->pChar || self->pChar->free )
--- 604,608 ----
Returns the custom tag passed
*/
! static PyObject* wpChar_gettag( wpChar* self, PyObject* args )
{
if( !self->pChar || self->pChar->free )
***************
*** 639,643 ****
Sets a custom tag
*/
! PyObject* wpChar_settag( wpChar* self, PyObject* args )
{
if( self->pChar->free )
--- 635,639 ----
Sets a custom tag
*/
! static PyObject* wpChar_settag( wpChar* self, PyObject* args )
{
if( self->pChar->free )
***************
*** 672,676 ****
Checks if a certain tag exists
*/
! PyObject* wpChar_hastag( wpChar* self, PyObject* args )
{
if( !self->pChar || self->pChar->free )
--- 668,672 ----
Checks if a certain tag exists
*/
! static PyObject* wpChar_hastag( wpChar* self, PyObject* args )
{
if( !self->pChar || self->pChar->free )
***************
*** 691,695 ****
Deletes a given tag
*/
! PyObject* wpChar_deltag( wpChar* self, PyObject* args )
{
if( !self->pChar || self->pChar->free )
--- 687,691 ----
Deletes a given tag
*/
! static PyObject* wpChar_deltag( wpChar* self, PyObject* args )
{
if( !self->pChar || self->pChar->free )
***************
*** 711,715 ****
* Sends MakeMenu defined as xml file to this character
*/
! PyObject* wpChar_sendmakemenu( wpChar* self, PyObject* args )
{
P_PLAYER player = dynamic_cast<P_PLAYER>( self->pChar );
--- 707,711 ----
* Sends MakeMenu defined as xml file to this character
*/
! static PyObject* wpChar_sendmakemenu( wpChar* self, PyObject* args )
{
P_PLAYER player = dynamic_cast<P_PLAYER>( self->pChar );
***************
*** 733,737 ****
Adds a follower
*/
! PyObject* wpChar_addfollower( wpChar* self, PyObject* args )
{
if( !self->pChar || self->pChar->free )
--- 729,733 ----
Adds a follower
*/
! static PyObject* wpChar_addfollower( wpChar* self, PyObject* args )
{
if( !self->pChar || self->pChar->free )
***************
*** 761,765 ****
Removes a follower
*/
! PyObject* wpChar_removefollower( wpChar* self, PyObject* args )
{
if( !self->pChar || self->pChar->free )
--- 757,761 ----
Removes a follower
*/
! static PyObject* wpChar_removefollower( wpChar* self, PyObject* args )
{
if( !self->pChar || self->pChar->free )
***************
*** 790,794 ****
Checks if the Char has a follower
*/
! PyObject* wpChar_hasfollower( wpChar* self, PyObject* args )
{
if( !self->pChar || self->pChar->free )
--- 786,790 ----
Checks if the Char has a follower
*/
! static PyObject* wpChar_hasfollower( wpChar* self, PyObject* args )
{
if( !self->pChar || self->pChar->free )
***************
*** 820,824 ****
Resends the healthbar to the environment.
*/
! PyObject* wpChar_updatehealth( wpChar* self, PyObject* args )
{
Q_UNUSED(args);
--- 816,820 ----
Resends the healthbar to the environment.
*/
! static PyObject* wpChar_updatehealth( wpChar* self, PyObject* args )
{
Q_UNUSED(args);
***************
*** 833,837 ****
Resends the mana to this character.
*/
! PyObject* wpChar_updatemana( wpChar* self, PyObject* args )
{
Q_UNUSED(args);
--- 829,833 ----
Resends the mana to this character.
*/
! static PyObject* wpChar_updatemana( wpChar* self, PyObject* args )
{
Q_UNUSED(args);
***************
*** 855,859 ****
Resends the Stamina to this character.
*/
! PyObject* wpChar_updatestamina( wpChar* self, PyObject* args )
{
Q_UNUSED(args);
--- 851,855 ----
Resends the Stamina to this character.
*/
! static PyObject* wpChar_updatestamina( wpChar* self, PyObject* args )
{
Q_UNUSED(args);
***************
*** 877,881 ****
Resends all stats to this character.
*/
! PyObject* wpChar_updatestats( wpChar* self, PyObject* args )
{
Q_UNUSED(args);
--- 873,877 ----
Resends all stats to this character.
*/
! static PyObject* wpChar_updatestats( wpChar* self, PyObject* args )
{
Q_UNUSED(args);
***************
*** 900,904 ****
What weapon is the character currently wearing?
*/
! PyObject* wpChar_getweapon( wpChar* self, PyObject* args )
{
Q_UNUSED(args);
--- 896,900 ----
What weapon is the character currently wearing?
*/
! static PyObject* wpChar_getweapon( wpChar* self, PyObject* args )
{
Q_UNUSED(args);
***************
*** 912,916 ****
Turns towards a specific object.
*/
! PyObject* wpChar_turnto( wpChar* self, PyObject* args )
{
if( !self->pChar || self->pChar->free )
--- 908,912 ----
Turns towards a specific object.
*/
! static PyObject* wpChar_turnto( wpChar* self, PyObject* args )
{
if( !self->pChar || self->pChar->free )
***************
*** 946,950 ****
Mounts this character on a specific mount.
*/
! PyObject* wpChar_mount( wpChar* self, PyObject* args )
{
if( !self->pChar || self->pChar->free )
--- 942,946 ----
Mounts this character on a specific mount.
*/
! static PyObject* wpChar_mount( wpChar* self, PyObject* args )
{
if( !self->pChar || self->pChar->free )
***************
*** 975,979 ****
Unmounts this character and returns the old mount.
*/
! PyObject* wpChar_unmount( wpChar* self, PyObject* args )
{
Q_UNUSED(args);
--- 971,975 ----
Unmounts this character and returns the old mount.
*/
! static PyObject* wpChar_unmount( wpChar* self, PyObject* args )
{
Q_UNUSED(args);
***************
*** 991,995 ****
Equips a given item on this character.
*/
! PyObject* wpChar_equip( wpChar* self, PyObject* args )
{
if( !self->pChar || self->pChar->free )
--- 987,991 ----
Equips a given item on this character.
*/
! static PyObject* wpChar_equip( wpChar* self, PyObject* args )
{
if( !self->pChar || self->pChar->free )
***************
*** 1013,1017 ****
Gets or Autocreates a bankbox for the character.
*/
! PyObject* wpChar_getbankbox( wpChar* self, PyObject* args )
{
Q_UNUSED(args);
--- 1009,1013 ----
Gets or Autocreates a bankbox for the character.
*/
! static PyObject* wpChar_getbankbox( wpChar* self, PyObject* args )
{
Q_UNUSED(args);
***************
*** 1030,1034 ****
Gets or Autocreates a backpack for the character.
*/
! PyObject* wpChar_getbackpack( wpChar* self, PyObject* args )
{
Q_UNUSED(args);
--- 1026,1030 ----
Gets or Autocreates a backpack for the character.
*/
! static PyObject* wpChar_getbackpack( wpChar* self, PyObject* args )
{
Q_UNUSED(args);
***************
*** 1042,1046 ****
Shows a moving effect moving toward a given object or coordinate.
*/
! PyObject* wpChar_movingeffect( wpChar* self, PyObject* args )
{
if( !self->pChar || self->pChar->free )
--- 1038,1042 ----
Shows a moving effect moving toward a given object or coordinate.
*/
! static PyObject* wpChar_movingeffect( wpChar* self, PyObject* args )
{
if( !self->pChar || self->pChar->free )
***************
*** 1097,1101 ****
Shows an effect staying with this character.
*/
! PyObject* wpChar_effect( wpChar* self, PyObject* args )
{
if( !self->pChar || self->pChar->free )
--- 1093,1097 ----
Shows an effect staying with this character.
*/
! static PyObject* wpChar_effect( wpChar* self, PyObject* args )
{
if( !self->pChar || self->pChar->free )
***************
*** 1136,1140 ****
Adds a temp effect to this character.
*/
! PyObject* wpChar_dispel( wpChar* self, PyObject* args )
{
if( !self->pChar || self->pChar->free )
--- 1132,1136 ----
Adds a temp effect to this character.
*/
! static PyObject* wpChar_dispel( wpChar* self, PyObject* args )
{
if( !self->pChar || self->pChar->free )
***************
*** 1208,1212 ****
Adds a temp effect to this character.
*/
! PyObject* wpChar_addtimer( wpChar* self, PyObject* args )
{
if( !self->pChar || self->pChar->free )
--- 1204,1208 ----
Adds a temp effect to this character.
*/
! static PyObject* wpChar_addtimer( wpChar* self, PyObject* args )
{
if( !self->pChar || self->pChar->free )
***************
*** 1256,1260 ****
Checks if we can stand at a certain point.
*/
! PyObject* wpChar_maywalk( wpChar* self, PyObject* args )
{
if( !self->pChar || self->pChar->free )
--- 1252,1256 ----
Checks if we can stand at a certain point.
*/
! static PyObject* wpChar_maywalk( wpChar* self, PyObject* args )
{
if( !self->pChar || self->pChar->free )
***************
*** 1283,1287 ****
Are we criminal.
*/
! PyObject* wpChar_iscriminal( wpChar* self, PyObject* args )
{
Q_UNUSED(args);
--- 1279,1283 ----
Are we criminal.
*/
! static PyObject* wpChar_iscriminal( wpChar* self, PyObject* args )
{
Q_UNUSED(args);
***************
*** 1295,1299 ****
Are we a murderer.
*/
! PyObject* wpChar_ismurderer( wpChar* self, PyObject* args )
{
Q_UNUSED(args);
--- 1291,1295 ----
Are we a murderer.
*/
! static PyObject* wpChar_ismurderer( wpChar* self, PyObject* args )
{
Q_UNUSED(args);
***************
*** 1307,1311 ****
Make this character criminal.
*/
! PyObject* wpChar_criminal( wpChar* self, PyObject* args )
{
Q_UNUSED(args);
--- 1303,1307 ----
Make this character criminal.
*/
! static PyObject* wpChar_criminal( wpChar* self, PyObject* args )
{
Q_UNUSED(args);
***************
*** 1326,1330 ****
Let's this character attack someone else.
*/
! PyObject* wpChar_attack( wpChar* self, PyObject* args )
{
if( !self->pChar || self->pChar->free )
--- 1322,1326 ----
Let's this character attack someone else.
*/
! static PyObject* wpChar_attack( wpChar* self, PyObject* args )
{
if( !self->pChar || self->pChar->free )
***************
*** 1350,1354 ****
The character should follow someone else.
*/
! PyObject* wpChar_follow( wpChar* self, PyObject* args )
{
if( !self->pChar || self->pChar->free )
--- 1346,1350 ----
The character should follow someone else.
*/
! static PyObject* wpChar_follow( wpChar* self, PyObject* args )
{
if( !self->pChar || self->pChar->free )
***************
*** 1379,1383 ****
Disturbs whatever this character is doing right now.
*/
! PyObject* wpChar_disturb( wpChar* self, PyObject* args )
{
Q_UNUSED(args);
--- 1375,1379 ----
Disturbs whatever this character is doing right now.
*/
! static PyObject* wpChar_disturb( wpChar* self, PyObject* args )
{
Q_UNUSED(args);
***************
*** 1398,1402 ****
The character should follow someone else.
*/
! PyObject* wpChar_goto( wpChar* self, PyObject* args )
{
if( !self->pChar || self->pChar->free )
--- 1394,1398 ----
The character should follow someone else.
*/
! static PyObject* wpChar_goto( wpChar* self, PyObject* args )
{
if( !self->pChar || self->pChar->free )
***************
*** 1433,1437 ****
to this if you want to update the socket itself.
*/
! PyObject* wpChar_updateflags( wpChar* self, PyObject* args )
{
Q_UNUSED(args);
--- 1429,1433 ----
to this if you want to update the socket itself.
*/
! static PyObject* wpChar_updateflags( wpChar* self, PyObject* args )
{
Q_UNUSED(args);
***************
*** 1448,1452 ****
The second parameter specifies the range the character needs to be in.
*/
! PyObject* wpChar_canreach( wpChar* self, PyObject* args )
{
Q_UNUSED(args);
--- 1444,1448 ----
The second parameter specifies the range the character needs to be in.
*/
! static PyObject* wpChar_canreach( wpChar* self, PyObject* args )
{
Q_UNUSED(args);
***************
*** 1491,1569 ****
static PyMethodDef wpCharMethods[] =
{
! { "moveto", (getattrofunc)wpChar_moveto, METH_VARARGS, "Moves the character to the specified location." },
! { "resurrect", (getattrofunc)wpChar_resurrect, METH_VARARGS, "Resurrects the character." },
! { "kill", (getattrofunc)wpChar_kill, METH_VARARGS, "This kills the character." },
! { "damage", (getattrofunc)wpChar_damage, METH_VARARGS, "This damages the current character." },
! { "update", (getattrofunc)wpChar_update, METH_VARARGS, "Resends the char to all clients in range." },
! { "updateflags", (getattrofunc)wpChar_updateflags, METH_VARARGS, "Resends the character if flags have changed (take care, this might look like a move)." },
! { "removefromview", (getattrofunc)wpChar_removefromview, METH_VARARGS, "Removes the char from all surrounding clients." },
! { "message", (getattrofunc)wpChar_message, METH_VARARGS, "Displays a message above the characters head - only visible for the player." },
! { "soundeffect", (getattrofunc)wpChar_soundeffect, METH_VARARGS, "Plays a soundeffect for the character." },
! { "distanceto", (getattrofunc)wpChar_distanceto, METH_VARARGS, "Distance to another object or a given position." },
! { "action", (getattrofunc)wpChar_action, METH_VARARGS, "Lets the char perform an action." },
! { "directionto", (getattrofunc)wpChar_directionto, METH_VARARGS, "Distance to another object or a given position." },
! { "checkskill", (getattrofunc)wpChar_checkskill, METH_VARARGS, "Performs a skillcheck for the character." },
! { "itemonlayer", (getattrofunc)wpChar_itemonlayer, METH_VARARGS, "Returns the item currently weared on a specific layer, or returns none." },
! { "combatskill", (getattrofunc)wpChar_combatskill, METH_VARARGS, "Returns the combat skill the character would currently use." },
! { "getweapon", (getattrofunc)wpChar_getweapon, METH_VARARGS, "What weapon does the character currently wear." },
! { "useresource", (getattrofunc)wpChar_useresource, METH_VARARGS, "Consumes a resource posessed by the char." },
! { "countresource", (getattrofunc)wpChar_countresource, METH_VARARGS, "Counts the amount of a certain resource the user has." },
! { "emote", (getattrofunc)wpChar_emote, METH_VARARGS, "Shows an emote above the character." },
! { "say", (getattrofunc)wpChar_say, METH_VARARGS, "The character begins to talk." },
! { "turnto", (getattrofunc)wpChar_turnto, METH_VARARGS, "Turns towards a specific object and resends if neccesary." },
! { "equip", (getattrofunc)wpChar_equip, METH_VARARGS, "Equips a given item on this character." },
! { "maywalk", (getattrofunc)wpChar_maywalk, METH_VARARGS, "Checks if this character may walk to a specific cell." },
! { "sound", (getattrofunc)wpChar_sound, METH_VARARGS, "Play a creature specific sound." },
! { "disturb", (getattrofunc)wpChar_disturb, METH_VARARGS, "Disturbs whatever this character is doing right now." },
! { "canreach", (getattrofunc)wpChar_canreach, METH_VARARGS, "Checks if this character can reach a certain object." },
// Mostly NPC functions
! { "attack", (getattrofunc)wpChar_attack, METH_VARARGS, "Let's the character attack someone else." },
! { "goto", (getattrofunc)wpChar_goto, METH_VARARGS, "The character should go to a coordinate." },
! { "follow", (getattrofunc)wpChar_follow, METH_VARARGS, "The character should follow someone else." },
! { "addtimer", (getattrofunc)wpChar_addtimer, METH_VARARGS, "Adds a timer to this character." },
! { "dispel", (getattrofunc)wpChar_dispel, METH_VARARGS, "Dispels this character (with special options)." },
// Update Stats
! { "updatestats", (getattrofunc)wpChar_updatestats, METH_VARARGS, "Resends other stats to this character." },
! { "updatemana", (getattrofunc)wpChar_updatemana, METH_VARARGS, "Resends the manabar to this character." },
! { "updatestamina", (getattrofunc)wpChar_updatestamina, METH_VARARGS, "Resends the stamina bar to this character." },
! { "updatehealth", (getattrofunc)wpChar_updatehealth, METH_VARARGS, "Resends the healthbar to the environment." },
// Mount/Unmount
! { "unmount", (getattrofunc)wpChar_unmount, METH_VARARGS, "Unmounts this character and returns the character it was previously mounted." },
! { "mount", (getattrofunc)wpChar_mount, METH_VARARGS, "Mounts this on a specific mount." },
// Effects
! { "movingeffect", (getattrofunc)wpChar_movingeffect, METH_VARARGS, "Shows a moving effect moving toward a given object or coordinate." },
! { "effect", (getattrofunc)wpChar_effect, METH_VARARGS, "Shows an effect staying with this character." },
// Bank/Backpack
! { "getbankbox", (getattrofunc)wpChar_getbankbox, METH_VARARGS, "Gets and autocreates a bankbox for the character." },
! { "getbackpack", (getattrofunc)wpChar_getbackpack, METH_VARARGS, "Gets and autocreates a backpack for the character." },
// Follower System
! { "addfollower", (getattrofunc)wpChar_addfollower, METH_VARARGS, "Adds a follower to the user." },
! { "removefollower", (getattrofunc)wpChar_removefollower, METH_VARARGS, "Removes a follower from the user." },
! { "hasfollower", (getattrofunc)wpChar_hasfollower, METH_VARARGS, "Checks if a certain character is a follower of this." },
// Tag System
! { "gettag", (getattrofunc)wpChar_gettag, METH_VARARGS, "Gets a tag assigned to a specific char." },
! { "settag", (getattrofunc)wpChar_settag, METH_VARARGS, "Sets a tag assigned to a specific char." },
! { "hastag", (getattrofunc)wpChar_hastag, METH_VARARGS, "Checks if a certain char has the specified tag." },
! { "deltag", (getattrofunc)wpChar_deltag, METH_VARARGS, "Deletes the specified tag." },
// Crafting Menu
! { "sendmakemenu", (getattrofunc)wpChar_sendmakemenu, METH_VARARGS, "Sends MakeMenu to this character." },
// Reputation System
! { "iscriminal", (getattrofunc)wpChar_iscriminal, METH_VARARGS, "Is this character criminal.." },
! { "ismurderer", (getattrofunc)wpChar_ismurderer, METH_VARARGS, "Is this character a murderer." },
! { "criminal", (getattrofunc)wpChar_criminal, METH_VARARGS, "Make this character criminal." },
// Is*? Functions
! { "isitem", (getattrofunc)wpChar_isitem, METH_VARARGS, "Is this an item." },
! { "ischar", (getattrofunc)wpChar_ischar, METH_VARARGS, "Is this a char." },
{ NULL, NULL, 0, NULL }
};
--- 1487,1565 ----
static PyMethodDef wpCharMethods[] =
{
! { "moveto", (getattrofunc)wpChar_moveto, METH_VARARGS, "Moves the character to the specified location." },
! { "resurrect", (getattrofunc)wpChar_resurrect, METH_VARARGS, "Resurrects the character." },
! { "kill", (getattrofunc)wpChar_kill, METH_VARARGS, "This kills the character." },
! { "damage", (getattrofunc)wpChar_damage, METH_VARARGS, "This damages the current character." },
! { "update", (getattrofunc)wpChar_update, METH_VARARGS, "Resends the char to all clients in range." },
! { "updateflags", (getattrofunc)wpChar_updateflags, METH_VARARGS, "Resends the character if flags have changed (take care, this might look like a move)." },
! { "removefromview", (getattrofunc)wpChar_removefromview, METH_VARARGS, "Removes the char from all surrounding clients." },
! { "message", (getattrofunc)wpChar_message, METH_VARARGS, "Displays a message above the characters head - only visible for the player." },
! { "soundeffect", (getattrofunc)wpChar_soundeffect, METH_VARARGS, "Plays a soundeffect for the character." },
! { "distanceto", (getattrofunc)wpChar_distanceto, METH_VARARGS, "Distance to another object or a given position." },
! { "action", (getattrofunc)wpChar_action, METH_VARARGS, "Lets the char perform an action." },
! { "directionto", (getattrofunc)wpChar_directionto, METH_VARARGS, "Distance to another object or a given position." },
! { "checkskill", (getattrofunc)wpChar_checkskill, METH_VARARGS, "Performs a skillcheck for the character." },
! { "itemonlayer", (getattrofunc)wpChar_itemonlayer, METH_VARARGS, "Returns the item currently weared on a specific layer, or returns none." },
! { "combatskill", (getattrofunc)wpChar_combatskill, METH_VARARGS, "Returns the combat skill the character would currently use." },
! { "getweapon", (getattrofunc)wpChar_getweapon, METH_VARARGS, "What weapon does the character currently wear." },
! { "useresource", (getattrofunc)wpChar_useresource, METH_VARARGS, "Consumes a resource posessed by the char." },
! { "countresource", (getattrofunc)wpChar_countresource, METH_VARARGS, "Counts the amount of a certain resource the user has." },
! { "emote", (getattrofunc)wpChar_emote, METH_VARARGS, "Shows an emote above the character." },
! { "say", (getattrofunc)wpChar_say, METH_VARARGS, "The character begins to talk." },
! { "turnto", (getattrofunc)wpChar_turnto, METH_VARARGS, "Turns towards a specific object and resends if neccesary." },
! { "equip", (getattrofunc)wpChar_equip, METH_VARARGS, "Equips a given item on this character." },
! { "maywalk", (getattrofunc)wpChar_maywalk, METH_VARARGS, "Checks if this character may walk to a specific cell." },
! { "sound", (getattrofunc)wpChar_sound, METH_VARARGS, "Play a creature specific sound." },
! { "disturb", (getattrofunc)wpChar_disturb, METH_VARARGS, "Disturbs whatever this character is doing right now." },
! { "canreach", (getattrofunc)wpChar_canreach, METH_VARARGS, "Checks if this character can reach a certain object." },
// Mostly NPC functions
! { "attack", (getattrofunc)wpChar_attack, METH_VARARGS, "Let's the character attack someone else." },
! { "goto", (getattrofunc)wpChar_goto, METH_VARARGS, "The character should go to a coordinate." },
! { "follow", (getattrofunc)wpChar_follow, METH_VARARGS, "The character should follow someone else." },
! { "addtimer", (getattrofunc)wpChar_addtimer, METH_VARARGS, "Adds a timer to this character." },
! { "dispel", (getattrofunc)wpChar_dispel, METH_VARARGS, "Dispels this character (with special options)." },
// Update Stats
! { "updatestats", (getattrofunc)wpChar_updatestats, METH_VARARGS, "Resends other stats to this character." },
! { "updatemana", (getattrofunc)wpChar_updatemana, METH_VARARGS, "Resends the manabar to this character." },
! { "updatestamina", (getattrofunc)wpChar_updatestamina, METH_VARARGS, "Resends the stamina bar to this character." },
! { "updatehealth", (getattrofunc)wpChar_updatehealth, METH_VARARGS, "Resends the healthbar to the environment." },
// Mount/Unmount
! { "unmount", (getattrofunc)wpChar_unmount, METH_VARARGS, "Unmounts this character and returns the character it was previously mounted." },
! { "mount", (getattrofunc)wpChar_mount, METH_VARARGS, "Mounts this on a specific mount." },
// Effects
! { "movingeffect", (getattrofunc)wpChar_movingeffect, METH_VARARGS, "Shows a moving effect moving toward a given object or coordinate." },
! { "effect", (getattrofunc)wpChar_effect, METH_VARARGS, "Shows an effect staying with this character." },
// Bank/Backpack
! { "getbankbox", (getattrofunc)wpChar_getbankbox, METH_VARARGS, "Gets and autocreates a bankbox for the character." },
! { "getbackpack", (getattrofunc)wpChar_getbackpack, METH_VARARGS, "Gets and autocreates a backpack for the character." },
// Follower System
! { "addfollower", (getattrofunc)wpChar_addfollower, METH_VARARGS, "Adds a follower to the user." },
! { "removefollower", (getattrofunc)wpChar_removefollower, METH_VARARGS, "Removes a follower from the user." },
! { "hasfollower", (getattrofunc)wpChar_hasfollower, METH_VARARGS, "Checks if a certain character is a follower of this." },
// Tag System
! { "gettag", (getattrofunc)wpChar_gettag, METH_VARARGS, "Gets a tag assigned to a specific char." },
! { "settag", (getattrofunc)wpChar_settag, METH_VARARGS, "Sets a tag assigned to a specific char." },
! { "hastag", (getattrofunc)wpChar_hastag, METH_VARARGS, "Checks if a certain char has the specified tag." },
! { "deltag", (getattrofunc)wpChar_deltag, METH_VARARGS, "Deletes the specified tag." },
// Crafting Menu
! { "sendmakemenu", (getattrofunc)wpChar_sendmakemenu, METH_VARARGS, "Sends MakeMenu to this character." },
// Reputation System
! { "iscriminal", (getattrofunc)wpChar_iscriminal, METH_VARARGS, "Is this character criminal.." },
! { "ismurderer", (getattrofunc)wpChar_ismurderer, METH_VARARGS, "Is this character a murderer." },
! { "criminal", (getattrofunc)wpChar_criminal, METH_VARARGS, "Make this character criminal." },
// Is*? Functions
! { "isitem", (getattrofunc)wpChar_isitem, METH_VARARGS, "Is this an item." },
! { "ischar", (getattrofunc)wpChar_ischar, METH_VARARGS, "Is this a char." },
{ NULL, NULL, 0, NULL }
};
Index: global.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/global.cpp,v
retrieving revision 1.78
retrieving revision 1.79
diff -C2 -d -r1.78 -r1.79
*** global.cpp 4 Aug 2003 07:28:18 -0000 1.78
--- global.cpp 6 Aug 2003 00:20:33 -0000 1.79
***************
*** 121,125 ****
Sends a string to the wolfpack console.
*/
! PyObject* wpConsole_send( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
--- 121,125 ----
Sends a string to the wolfpack console.
*/
! static PyObject* wpConsole_send( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
***************
*** 140,144 ****
Sends a progress-bar to the wolfpack console
*/
! PyObject* wpConsole_progress( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
--- 140,144 ----
Sends a progress-bar to the wolfpack console
*/
! static PyObject* wpConsole_progress( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
***************
*** 159,165 ****
Sends a [done] progress section to the console
*/
! PyObject* wpConsole_progressDone( PyObject* self )
{
Q_UNUSED(self);
clConsole.ProgressDone();
return PyInt_FromLong( 1 );
--- 159,166 ----
Sends a [done] progress section to the console
*/
! static PyObject* wpConsole_progressDone( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
+ Q_UNUSED(args);
clConsole.ProgressDone();
return PyInt_FromLong( 1 );
***************
*** 169,175 ****
Sends a [fail] progress section to the console
*/
! PyObject* wpConsole_progressFail( PyObject* self )
{
Q_UNUSED(self);
clConsole.ProgressFail();
return PyInt_FromLong( 1 );
--- 170,177 ----
Sends a [fail] progress section to the console
*/
! static PyObject* wpConsole_progressFail( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
+ Q_UNUSED(args);
clConsole.ProgressFail();
return PyInt_FromLong( 1 );
***************
*** 179,185 ****
Sends a [skip] progress section to the console
*/
! PyObject* wpConsole_progressSkip( PyObject* self )
{
Q_UNUSED(self);
clConsole.ProgressSkip();
return PyInt_FromLong( 1 );
--- 181,188 ----
Sends a [skip] progress section to the console
*/
! static PyObject* wpConsole_progressSkip( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
+ Q_UNUSED(args);
clConsole.ProgressSkip();
return PyInt_FromLong( 1 );
***************
*** 189,195 ****
Returns a list of Strings (the linebuffer)
*/
! PyObject* wpConsole_getbuffer( PyObject* self )
{
Q_UNUSED(self);
QStringList linebuffer = clConsole.linebuffer();
PyObject *list = PyList_New( linebuffer.count() );
--- 192,199 ----
Returns a list of Strings (the linebuffer)
*/
! static PyObject* wpConsole_getbuffer( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
+ Q_UNUSED(args);
QStringList linebuffer = clConsole.linebuffer();
PyObject *list = PyList_New( linebuffer.count() );
***************
*** 206,212 ****
extern QStringList commandQueue;
extern QMutex commandMutex;
! PyObject* wpConsole_reloadScripts( PyObject* self )
{
Q_UNUSED(self);
// Temporary implementation while thread comunication is not done
QMutexLocker lock(&commandMutex);
--- 210,217 ----
extern QStringList commandQueue;
extern QMutex commandMutex;
! static PyObject* wpConsole_reloadScripts( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
+ Q_UNUSED(args);
// Temporary implementation while thread comunication is not done
QMutexLocker lock(&commandMutex);
***************
*** 230,240 ****
static PyMethodDef wpConsole[] =
{
! { "send", wpConsole_send, METH_VARARGS, "Prints something to the wolfpack console" },
! { "progress", wpConsole_progress, METH_VARARGS, "Prints a .....[xxxx] block" },
! { "progressDone", (PyCFunction)wpConsole_progressDone, METH_NOARGS, "Prints a [done] block" },
! { "progressFail", (PyCFunction)wpConsole_progressFail, METH_NOARGS, "Prints a [fail] block" },
! { "progressSkip", (PyCFunction)wpConsole_progressSkip, METH_NOARGS, "Prints a [skip] block" },
! { "getbuffer", (PyCFunction)wpConsole_getbuffer, METH_NOARGS, "Gets the linebuffer of the console" },
! { "reloadScripts", (PyCFunction)wpConsole_reloadScripts, METH_NOARGS, "Reloads Scripts and Definitions" },
{ NULL, NULL, 0, NULL } // Terminator
};
--- 235,245 ----
static PyMethodDef wpConsole[] =
{
! { "send", wpConsole_send, METH_VARARGS, "Prints something to the wolfpack console" },
! { "progress", wpConsole_progress, METH_VARARGS, "Prints a .....[xxxx] block" },
! { "progressDone", wpConsole_progressDone, METH_NOARGS, "Prints a [done] block" },
! { "progressFail", wpConsole_progressFail, METH_NOARGS, "Prints a [fail] block" },
! { "progressSkip", wpConsole_progressSkip, METH_NOARGS, "Prints a [skip] block" },
! { "getbuffer", wpConsole_getbuffer, METH_NOARGS, "Gets the linebuffer of the console" },
! { "reloadScripts", wpConsole_reloadScripts, METH_NOARGS, "Reloads Scripts and Definitions" },
{ NULL, NULL, 0, NULL } // Terminator
};
***************
*** 243,249 ****
Gets the seconds of the current uo time
*/
! PyObject* wpTime_second( PyObject* self )
{
Q_UNUSED(self);
return PyInt_FromLong( uoTime.time().second() );
}
--- 248,255 ----
Gets the seconds of the current uo time
*/
! static PyObject* wpTime_second( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
+ Q_UNUSED(args);
return PyInt_FromLong( uoTime.time().second() );
}
***************
*** 252,258 ****
Gets the minutes of the current uo time
*/
! PyObject* wpTime_minute( PyObject* self )
{
Q_UNUSED(self);
return PyInt_FromLong( uoTime.time().minute() );
}
--- 258,265 ----
Gets the minutes of the current uo time
*/
! static PyObject* wpTime_minute( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
+ Q_UNUSED(args);
return PyInt_FromLong( uoTime.time().minute() );
}
***************
*** 261,267 ****
Gets the hours of the current uo time
*/
! PyObject* wpTime_hour( PyObject* self )
{
Q_UNUSED(self);
return PyInt_FromLong( uoTime.time().hour() );
}
--- 268,275 ----
Gets the hours of the current uo time
*/
! static PyObject* wpTime_hour( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
+ Q_UNUSED(args);
return PyInt_FromLong( uoTime.time().hour() );
}
***************
*** 270,276 ****
Gets the current day
*/
! PyObject* wpTime_day( PyObject* self )
{
Q_UNUSED(self);
return PyInt_FromLong( uoTime.date().day() );
}
--- 278,285 ----
Gets the current day
*/
! static PyObject* wpTime_day( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
+ Q_UNUSED(args);
return PyInt_FromLong( uoTime.date().day() );
}
***************
*** 279,285 ****
Gets the current month
*/
! PyObject* wpTime_month( PyObject* self )
{
Q_UNUSED(self);
return PyInt_FromLong( uoTime.date().month() );
}
--- 288,295 ----
Gets the current month
*/
! static PyObject* wpTime_month( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
+ Q_UNUSED(args);
return PyInt_FromLong( uoTime.date().month() );
}
***************
*** 288,294 ****
Gets the current year
*/
! PyObject* wpTime_year( PyObject* self )
{
Q_UNUSED(self);
return PyInt_FromLong( uoTime.date().year() );
}
--- 298,305 ----
Gets the current year
*/
! static PyObject* wpTime_year( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
+ Q_UNUSED(args);
return PyInt_FromLong( uoTime.date().year() );
}
***************
*** 297,303 ****
Gets a timestamp of the current uo time
*/
! PyObject* wpTime_timestamp( PyObject* self )
{
Q_UNUSED(self);
return PyInt_FromLong( uoTime.time().elapsed() );
}
--- 308,315 ----
Gets a timestamp of the current uo time
*/
! static PyObject* wpTime_timestamp( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
+ Q_UNUSED(args);
return PyInt_FromLong( uoTime.time().elapsed() );
}
***************
*** 308,318 ****
static PyMethodDef wpTime[] =
{
! { "second", (PyCFunction)wpTime_second, METH_NOARGS, "Returns the current time-seconds" },
! { "minute", (PyCFunction)wpTime_minute, METH_NOARGS, "Returns the current time-minutes" },
! { "hour", (PyCFunction)wpTime_hour, METH_NOARGS, "Returns the current time-hour" },
! { "day", (PyCFunction)wpTime_day, METH_NOARGS, "Returns the current date-day" },
! { "month", (PyCFunction)wpTime_month, METH_NOARGS, "Returns the current date-month" },
! { "year", (PyCFunction)wpTime_year, METH_NOARGS, "Returns the current date-year" },
! { "timestamp", (PyCFunction)wpTime_timestamp, METH_NOARGS, "Returns the current timestamp" },
{ NULL, NULL, 0, NULL } // Terminator
};
--- 320,330 ----
static PyMethodDef wpTime[] =
{
! { "second", wpTime_second, METH_NOARGS, "Returns the current time-seconds" },
! { "minute", wpTime_minute, METH_NOARGS, "Returns the current time-minutes" },
! { "hour", wpTime_hour, METH_NOARGS, "Returns the current time-hour" },
! { "day", wpTime_day, METH_NOARGS, "Returns the current date-day" },
! { "month", wpTime_month, METH_NOARGS, "Returns the current date-month" },
! { "year", wpTime_year, METH_NOARGS, "Returns the current date-year" },
! { "timestamp", wpTime_timestamp, METH_NOARGS, "Returns the current timestamp" },
{ NULL, NULL, 0, NULL } // Terminator
};
***************
*** 328,332 ****
Argument is just the def-section
*/
! PyObject* wpAdditem( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
--- 340,344 ----
Argument is just the def-section
*/
! static PyObject* wpAdditem( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
***************
*** 345,349 ****
Adds a npc
*/
! PyObject* wpAddnpc( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
--- 357,361 ----
Adds a npc
*/
! static PyObject* wpAddnpc( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
***************
*** 364,368 ****
passed serial
*/
! PyObject* wpFinditem( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
--- 376,380 ----
passed serial
*/
! static PyObject* wpFinditem( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
***************
*** 381,385 ****
passed serial
*/
! PyObject* wpFindchar( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
--- 393,397 ----
passed serial
*/
! static PyObject* wpFindchar( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
***************
*** 397,401 ****
* Creates a multi object based on the passed pos
*/
! PyObject* wpFindmulti( PyObject* self, PyObject* args )
{
Q_UNUSED( self );
--- 409,413 ----
* Creates a multi object based on the passed pos
*/
! static PyObject* wpFindmulti( PyObject* self, PyObject* args )
{
Q_UNUSED( self );
***************
*** 424,428 ****
Adds a tempeffect
*/
! PyObject* wpAddtimer( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
--- 436,440 ----
Adds a tempeffect
*/
! static PyObject* wpAddtimer( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
***************
*** 455,459 ****
Tries to find a region for a specific position.
*/
! PyObject* wpRegion( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
--- 467,471 ----
Tries to find a region for a specific position.
*/
! static PyObject* wpRegion( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
***************
*** 472,478 ****
used for object-delays and others
*/
! PyObject* wpCurrenttime( PyObject* self )
{
Q_UNUSED(self);
return PyInt_FromLong( uiCurrentTime );
}
--- 484,491 ----
used for object-delays and others
*/
! static PyObject* wpCurrenttime( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
+ Q_UNUSED(args);
return PyInt_FromLong( uiCurrentTime );
}
***************
*** 481,485 ****
Returns a list of Static item at a given position
*/
! PyObject *wpStatics( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
--- 494,498 ----
Returns a list of Static item at a given position
*/
! static PyObject *wpStatics( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
***************
*** 522,526 ****
Returns a list of all items serials
*/
! PyObject *wpAllItemsSerials( PyObject* self, PyObject* args )
{
Q_UNUSED(args);
--- 535,539 ----
Returns a list of all items serials
*/
! static PyObject *wpAllItemsSerials( PyObject* self, PyObject* args )
{
Q_UNUSED(args);
***************
*** 538,542 ****
Returns a list of all chars serials
*/
! PyObject *wpAllCharsSerials( PyObject* self, PyObject* args )
{
Q_UNUSED(args);
--- 551,555 ----
Returns a list of all chars serials
*/
! static PyObject *wpAllCharsSerials( PyObject* self, PyObject* args )
{
Q_UNUSED(args);
***************
*** 554,558 ****
Returns a list of items at a given position (sector)
*/
! PyObject *wpItems( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
--- 567,571 ----
Returns a list of items at a given position (sector)
*/
! static PyObject *wpItems( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
***************
*** 587,591 ****
Returns a list of chars at a given position (sector)
*/
! PyObject *wpChars( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
--- 600,604 ----
Returns a list of chars at a given position (sector)
*/
! static PyObject *wpChars( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
***************
*** 620,624 ****
Shows a graphical effect at a certain position
*/
! PyObject *wpEffect( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
--- 633,637 ----
Shows a graphical effect at a certain position
*/
! static PyObject *wpEffect( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
***************
*** 653,657 ****
Returns information about a given map cell.
*/
! PyObject *wpMap( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
--- 666,670 ----
Returns information about a given map cell.
*/
! static PyObject *wpMap( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
***************
*** 674,678 ****
Returns the tiledata information for a item id.
*/
! PyObject *wpTiledata( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
--- 687,691 ----
Returns the tiledata information for a item id.
*/
! static PyObject *wpTiledata( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
***************
*** 712,716 ****
Returns a stringlist out of the definitions.
*/
! PyObject *wpList( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
--- 725,729 ----
Returns a stringlist out of the definitions.
*/
! static PyObject *wpList( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
***************
*** 733,737 ****
Registers a global script hook.
*/
! PyObject *wpRegisterGlobal( PyObject* self, PyObject* args )
{
if( !checkArgInt( 0 ) || !checkArgInt( 1 ) || !checkArgStr( 2 ) )
--- 746,750 ----
Registers a global script hook.
*/
! static PyObject *wpRegisterGlobal( PyObject* self, PyObject* args )
{
if( !checkArgInt( 0 ) || !checkArgInt( 1 ) || !checkArgStr( 2 ) )
***************
*** 760,764 ****
Registers a global command hook.
*/
! PyObject *wpRegisterCommand( PyObject* self, PyObject* args )
{
if( !checkArgStr( 0 ) || !checkArgStr( 1 ) )
--- 773,777 ----
Registers a global command hook.
*/
! static PyObject *wpRegisterCommand( PyObject* self, PyObject* args )
{
if( !checkArgStr( 0 ) || !checkArgStr( 1 ) )
***************
*** 786,790 ****
Coord object creation
*/
! PyObject *wpCoord( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
--- 799,803 ----
Coord object creation
*/
! static PyObject *wpCoord( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
***************
*** 808,812 ****
Multi object creation
*/
! PyObject *wpMulti( PyObject* self, PyObject* args )
{
Q_UNUSED( self);
--- 821,825 ----
Multi object creation
*/
! static PyObject *wpMulti( PyObject* self, PyObject* args )
{
Q_UNUSED( self);
***************
*** 838,844 ****
Returns uptime of server in seconds
*/
! PyObject* wpServerUptime( PyObject* self )
{
Q_UNUSED(self);
return PyInt_FromLong( uiCurrentTime / MY_CLOCKS_PER_SEC );
}
--- 851,858 ----
Returns uptime of server in seconds
*/
! static PyObject* wpServerUptime( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
+ Q_UNUSED(args);
return PyInt_FromLong( uiCurrentTime / MY_CLOCKS_PER_SEC );
}
***************
*** 847,853 ****
Returns the server version string
*/
! PyObject* wpServerVersion( PyObject* self )
{
Q_UNUSED(self);
wp_version_info wpversioninfo;
return PyString_FromString( QString("%1 %2 %3").arg( wpversioninfo.productstring.c_str() ).arg( wpversioninfo.betareleasestring.c_str() ).arg( wpversioninfo.verstring.c_str() ).latin1() );
--- 861,868 ----
Returns the server version string
*/
! static PyObject* wpServerVersion( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
+ Q_UNUSED(args);
wp_version_info wpversioninfo;
return PyString_FromString( QString("%1 %2 %3").arg( wpversioninfo.productstring.c_str() ).arg( wpversioninfo.betareleasestring.c_str() ).arg( wpversioninfo.verstring.c_str() ).latin1() );
***************
*** 857,863 ****
Returns the current real date/time
*/
! PyObject* wpCurrentdatetime( PyObject* self )
{
Q_UNUSED(self);
return PyString_FromString( QDateTime::currentDateTime().toString() );
}
--- 872,879 ----
Returns the current real date/time
*/
! static PyObject* wpCurrentdatetime( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
+ Q_UNUSED(args);
return PyString_FromString( QDateTime::currentDateTime().toString() );
}
***************
*** 866,872 ****
Returns if the server is in starting state
*/
! PyObject* wpIsStarting( PyObject* self )
{
Q_UNUSED(self);
if( serverState == STARTUP )
return PyTrue;
--- 882,889 ----
Returns if the server is in starting state
*/
! static PyObject* wpIsStarting( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
+ Q_UNUSED(args);
if( serverState == STARTUP )
return PyTrue;
***************
*** 878,884 ****
Returns if the server is in running state
*/
! PyObject* wpIsRunning( PyObject* self )
{
Q_UNUSED(self);
if( serverState == RUNNING )
return PyTrue;
--- 895,902 ----
Returns if the server is in running state
*/
! static PyObject* wpIsRunning( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
+ Q_UNUSED(args);
if( serverState == RUNNING )
return PyTrue;
***************
*** 890,896 ****
Returns if the server is in reload state
*/
! PyObject* wpIsReloading( PyObject* self )
{
Q_UNUSED(self);
if( serverState == SCRIPTRELOAD )
return PyTrue;
--- 908,915 ----
Returns if the server is in reload state
*/
! static PyObject* wpIsReloading( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
+ Q_UNUSED(args);
if( serverState == SCRIPTRELOAD )
return PyTrue;
***************
*** 902,908 ****
Returns if the server is in closing state
*/
! PyObject* wpIsClosing( PyObject* self )
{
Q_UNUSED(self);
if( serverState == SHUTDOWN )
return PyTrue;
--- 921,928 ----
Returns if the server is in closing state
*/
! static PyObject* wpIsClosing( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
+ Q_UNUSED(args);
if( serverState == SHUTDOWN )
return PyTrue;
***************
*** 1008,1014 ****
}
! static PyObject* wpTickcount( PyObject* self )
{
Q_UNUSED(self);
return PyInt_FromLong( getNormalizedTime() );
}
--- 1028,1035 ----
}
! static PyObject* wpTickcount( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
+ Q_UNUSED(args);
return PyInt_FromLong( getNormalizedTime() );
}
***************
*** 1017,1021 ****
{
Q_UNUSED(self);
!
unsigned int id, size;
--- 1038,1042 ----
{
Q_UNUSED(self);
! Q_UNUSED(args);
unsigned int id, size;
***************
*** 1061,1084 ****
{ "registerglobal", wpRegisterGlobal, METH_VARARGS, "Registers a global script hook." },
{ "registercommand", wpRegisterCommand, METH_VARARGS, "Registers a global command hook." },
! { "serveruptime", (PyCFunction)wpServerUptime, METH_NOARGS, "Returns uptime of server in seconds." },
! { "serverversion", (PyCFunction)wpServerVersion, METH_NOARGS, "Returns the server version string." },
! { "currentdatetime", (PyCFunction)wpCurrentdatetime, METH_NOARGS, "Returns the current real date/time" },
! { "isstarting", (PyCFunction)wpIsStarting, METH_NOARGS, "Returns if the server is in starting state" },
! { "isrunning", (PyCFunction)wpIsRunning, METH_NOARGS, "Returns if the server is in running state" },
! { "isreloading", (PyCFunction)wpIsReloading, METH_NOARGS, "Returns if the server is in reload state" },
! { "isclosing", (PyCFunction)wpIsClosing, METH_NOARGS, "Returns if the server is in closing state" },
! { "tickcount", (PyCFunction)wpTickcount, METH_NOARGS, "Returns the current Tickcount on Windows" },
{ NULL, NULL, 0, NULL } // Terminator
};
! static PyObject *wpSocketsFirst( PyObject* self )
{
Q_UNUSED(self);
return PyGetSocketObject( cNetwork::instance()->first() );
}
! static PyObject *wpSocketsNext( PyObject* self )
{
Q_UNUSED(self);
return PyGetSocketObject( cNetwork::instance()->next() );
}
--- 1082,1107 ----
{ "registerglobal", wpRegisterGlobal, METH_VARARGS, "Registers a global script hook." },
{ "registercommand", wpRegisterCommand, METH_VARARGS, "Registers a global command hook." },
! { "serveruptime", wpServerUptime, METH_NOARGS, "Returns uptime of server in seconds." },
! { "serverversion", wpServerVersion, METH_NOARGS, "Returns the server version string." },
! { "currentdatetime", wpCurrentdatetime, METH_NOARGS, "Returns the current real date/time" },
! { "isstarting", wpIsStarting, METH_NOARGS, "Returns if the server is in starting state" },
! { "isrunning", wpIsRunning, METH_NOARGS, "Returns if the server is in running state" },
! { "isreloading", wpIsReloading, METH_NOARGS, "Returns if the server is in reload state" },
! { "isclosing", wpIsClosing, METH_NOARGS, "Returns if the server is in closing state" },
! { "tickcount", wpTickcount, METH_NOARGS, "Returns the current Tickcount on Windows" },
{ NULL, NULL, 0, NULL } // Terminator
};
! static PyObject *wpSocketsFirst( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
+ Q_UNUSED(args);
return PyGetSocketObject( cNetwork::instance()->first() );
}
! static PyObject *wpSocketsNext( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
+ Q_UNUSED(args);
return PyGetSocketObject( cNetwork::instance()->next() );
}
***************
*** 1087,1093 ****
Retrieves the number of currently connected sockets
*/
! static PyObject *wpSocketsCount( PyObject* self )
{
Q_UNUSED(self);
return PyInt_FromLong( cNetwork::instance()->count() );
}
--- 1110,1117 ----
Retrieves the number of currently connected sockets
*/
! static PyObject *wpSocketsCount( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
+ Q_UNUSED(args);
return PyInt_FromLong( cNetwork::instance()->count() );
}
***************
*** 1099,1105 ****
static PyMethodDef wpSockets[] =
{
! { "first", (PyCFunction)wpSocketsFirst, METH_NOARGS, "Returns the first connected socket." },
! { "next", (PyCFunction)wpSocketsNext, METH_NOARGS, "Returns the next connected socket." },
! { "count", (PyCFunction)wpSocketsCount, METH_NOARGS, "Returns the number of connected sockets." },
{ NULL, NULL, 0, NULL } // Terminator
};
--- 1123,1129 ----
static PyMethodDef wpSockets[] =
{
! { "first", wpSocketsFirst, METH_NOARGS, "Returns the first connected socket." },
! { "next", wpSocketsNext, METH_NOARGS, "Returns the next connected socket." },
! { "count", wpSocketsCount, METH_NOARGS, "Returns the number of connected sockets." },
{ NULL, NULL, 0, NULL } // Terminator
};
***************
*** 1238,1244 ****
Gets a list of Account names.
*/
! static PyObject *wpAccountsList( PyObject* self )
{
Q_UNUSED(self);
PyObject *list = PyList_New( 0 );
--- 1262,1269 ----
Gets a list of Account names.
*/
! static PyObject *wpAccountsList( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
+ Q_UNUSED(args);
PyObject *list = PyList_New( 0 );
***************
*** 1258,1264 ****
Gets a list of ACL names.
*/
! static PyObject *wpAccountsAcls( PyObject* self )
{
Q_UNUSED(self);
PyObject *list = PyList_New( 0 );
--- 1283,1290 ----
Gets a list of ACL names.
*/
! static PyObject *wpAccountsAcls( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
+ Q_UNUSED(args);
PyObject *list = PyList_New( 0 );
***************
*** 1340,1346 ****
Reload accounts.
*/
! static PyObject *wpAccountsReload( PyObject* self )
{
Q_UNUSED(self);
Accounts::instance()->reload();
return PyTrue;
--- 1366,1373 ----
Reload accounts.
*/
! static PyObject *wpAccountsReload( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
+ Q_UNUSED(args);
Accounts::instance()->reload();
return PyTrue;
***************
*** 1350,1356 ****
Save accounts.
*/
! static PyObject *wpAccountsSave( PyObject* self )
{
Q_UNUSED(self);
Accounts::instance()->save();
return PyTrue;
--- 1377,1384 ----
Save accounts.
*/
! static PyObject *wpAccountsSave( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
+ Q_UNUSED(args);
Accounts::instance()->save();
return PyTrue;
***************
*** 1363,1373 ****
static PyMethodDef wpAccounts[] =
{
! { "find", wpAccountsFind, METH_VARARGS, "Finds an account object." },
! { "list", (PyCFunction)wpAccountsList, METH_NOARGS, "Gets a list of Account names." },
! { "acls", (PyCFunction)wpAccountsAcls, METH_NOARGS, "Gets a list of valid ACL names." },
! { "acl", wpAccountsAcl, METH_VARARGS, "Returns an acl as a double dictionary." },
! { "add", wpAccountsAdd, METH_VARARGS, "Creates an account." },
! { "save", (PyCFunction)wpAccountsSave, METH_NOARGS, "Save accounts." },
! { "reload", (PyCFunction)wpAccountsReload, METH_NOARGS, "Reload accounts." },
{ NULL, NULL, 0, NULL } // Terminator
};
--- 1391,1401 ----
static PyMethodDef wpAccounts[] =
{
! { "find", wpAccountsFind, METH_VARARGS, "Finds an account object." },
! { "list", wpAccountsList, METH_NOARGS, "Gets a list of Account names." },
! { "acls", wpAccountsAcls, METH_NOARGS, "Gets a list of valid ACL names." },
! { "acl", wpAccountsAcl, METH_VARARGS, "Returns an acl as a double dictionary." },
! { "add", wpAccountsAdd, METH_VARARGS, "Creates an account." },
! { "save", wpAccountsSave, METH_NOARGS, "Save accounts." },
! { "reload", wpAccountsReload, METH_NOARGS, "Reload accounts." },
{ NULL, NULL, 0, NULL } // Terminator
};
***************
*** 1464,1470 ****
Reloads wolfpack.xml
*/
! static PyObject* wpSettingsReload( PyObject* self )
{
Q_UNUSED(self);
SrvParams->reload();
return PyTrue;
--- 1492,1499 ----
Reloads wolfpack.xml
*/
! static PyObject* wpSettingsReload( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
+ Q_UNUSED(args);
SrvParams->reload();
return PyTrue;
***************
*** 1474,1480 ****
Saves wolfpack.xml
*/
! static PyObject* wpSettingsSave( PyObject* self )
{
Q_UNUSED(self);
SrvParams->flush();
return PyTrue;
--- 1503,1510 ----
Saves wolfpack.xml
*/
! static PyObject* wpSettingsSave( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
+ Q_UNUSED(args);
SrvParams->flush();
return PyTrue;
***************
*** 1487,1498 ****
static PyMethodDef wpSettings[] =
{
! { "getBool", wpSettingsGetBool, METH_VARARGS, "Reads a boolean value from wolfpack.xml." },
! { "setBool", wpSettingsSetBool, METH_VARARGS, "Sets a boolean value to wolfpack.xml." },
! { "getNumber", wpSettingsGetNumber, METH_VARARGS, "Gets a numeric value from wolfpack.xml." },
! { "setNumber", wpSettingsSetNumber, METH_VARARGS, "Sets a numeric value to wolfpack.xml." },
! { "getString", w...
[truncated message content] |
|
From: <thi...@us...> - 2003-08-04 07:28:21
|
Update of /cvsroot/wpdev/wolfpack/python
In directory sc8-pr-cvs1:/tmp/cvs-serv9097/python
Modified Files:
char.cpp content.h engine.h global.cpp item.cpp multi.cpp
pyaccount.cpp pypacket.cpp pyregion.cpp pytooltip.cpp
socket.cpp target.h
Log Message:
Fixed some Python 2.3 compile errors, and added Py_INC( Py_None ) everywhere we return it.
Index: char.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/char.cpp,v
retrieving revision 1.94
retrieving revision 1.95
diff -C2 -d -r1.94 -r1.95
*** char.cpp 15 Jul 2003 08:30:18 -0000 1.94
--- char.cpp 4 Aug 2003 07:28:17 -0000 1.95
***************
*** 98,102 ****
--- 98,105 ----
{
if( !pChar )
+ {
+ Py_INCREF( Py_None );
return Py_None;
+ }
// wpChar *returnVal = CharCache::instance()->allocObj( &wpCharType );
***************
*** 389,393 ****
Returns an item object for an item equipped
on the specified layer. If there is no item
! it returns py_none.
*/
PyObject* wpChar_itemonlayer( wpChar* self, PyObject* args )
--- 392,396 ----
Returns an item object for an item equipped
on the specified layer. If there is no item
! it returns Py_None.
*/
PyObject* wpChar_itemonlayer( wpChar* self, PyObject* args )
***************
*** 608,612 ****
--- 611,618 ----
{
if( !self->pChar || self->pChar->free )
+ {
+ Py_INCREF( Py_None );
return Py_None;
+ }
if( PyTuple_Size( args ) < 1 || !checkArgStr( 0 ) )
***************
*** 626,629 ****
--- 632,636 ----
return PyFloat_FromDouble( value.asDouble() );
+ Py_INCREF( Py_None );
return Py_None;
}
***************
*** 1581,1585 ****
--- 1588,1595 ----
P_PLAYER player = dynamic_cast<P_PLAYER>( self->pChar );
if ( !player )
+ {
+ Py_INCREF( Py_None );
return Py_None;
+ }
return PyGetAccountObject( player->account() );
}
***************
*** 1589,1593 ****
--- 1599,1606 ----
if ( !player )
+ {
+ Py_INCREF( Py_None );
return Py_None;
+ }
return PyGetSocketObject( player->socket() );
}
***************
*** 1621,1625 ****
--- 1634,1641 ----
if ( !player )
+ {
+ Py_INCREF( Py_None );
return Py_None;
+ }
cBaseChar::CharContainer followers = player->pets();
Index: content.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/content.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** content.h 30 May 2003 03:20:24 -0000 1.6
--- content.h 4 Aug 2003 07:28:18 -0000 1.7
***************
*** 64,76 ****
P_CHAR pc = FindCharBySerial( self->contserial );
if (!pc)
! return Py_None;
cBaseChar::ItemContainer container = pc->content();
if ( id >= container.size() || id < 0 )
! return Py_None;
cBaseChar::ItemContainer::const_iterator it(container.begin());
for ( uint i = 0; i < id && it != container.end(); ++i ) // Ask Correa before trying
++it; // to 'optimize' this, there
// isn't much standard complient options here
! return it != container.end() ? PyGetItemObject( *it ) : Py_None;
}
--- 64,79 ----
P_CHAR pc = FindCharBySerial( self->contserial );
if (!pc)
! goto error;
cBaseChar::ItemContainer container = pc->content();
if ( id >= container.size() || id < 0 )
! goto error;
cBaseChar::ItemContainer::const_iterator it(container.begin());
for ( uint i = 0; i < id && it != container.end(); ++i ) // Ask Correa before trying
++it; // to 'optimize' this, there
// isn't much standard complient options here
! if ( it != container.end() )
! return PyGetItemObject( *it );
! else
! goto error;
}
***************
*** 79,92 ****
P_ITEM pi = FindItemBySerial( self->contserial );
if (!pi)
! return Py_None;
cItem::ContainerContent container = pi->content();
if ( id >= container.size() || id < 0 )
! return Py_None;
cItem::ContainerContent::const_iterator it(container.begin());
for ( uint i = 0; i < id && it != container.end(); ++i ) // Ask Correa before trying
++it; // to 'optimize' this, there
// isn't much standard complient options here
! return it != container.end() ? PyGetItemObject( *it ) : Py_None;
}
return Py_None;
}
--- 82,100 ----
P_ITEM pi = FindItemBySerial( self->contserial );
if (!pi)
! goto error;
cItem::ContainerContent container = pi->content();
if ( id >= container.size() || id < 0 )
! goto error;
cItem::ContainerContent::const_iterator it(container.begin());
for ( uint i = 0; i < id && it != container.end(); ++i ) // Ask Correa before trying
++it; // to 'optimize' this, there
// isn't much standard complient options here
! if ( it != container.end() )
! return PyGetItemObject( *it );
! else
! goto error;
}
+ error:
+ Py_INCREF( Py_None );
return Py_None;
}
Index: engine.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/engine.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** engine.h 12 Jun 2003 02:19:39 -0000 1.6
--- engine.h 4 Aug 2003 07:28:18 -0000 1.7
***************
*** 40,44 ****
//#define DEBUG_PYTHON
!
#if defined(_DEBUG) && defined(Q_CC_MSVC) && !defined(DEBUG_PYTHON)
# undef _DEBUG
--- 40,44 ----
//#define DEBUG_PYTHON
! #undef slots
#if defined(_DEBUG) && defined(Q_CC_MSVC) && !defined(DEBUG_PYTHON)
# undef _DEBUG
***************
*** 48,51 ****
--- 48,52 ----
# include <Python.h>
#endif
+ #define slots
void reloadPython( void );
***************
*** 54,55 ****
--- 55,57 ----
#endif // __PYTHON_ENGINE_H__
+
Index: global.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/global.cpp,v
retrieving revision 1.77
retrieving revision 1.78
diff -C2 -d -r1.77 -r1.78
*** global.cpp 26 Jul 2003 01:10:55 -0000 1.77
--- global.cpp 4 Aug 2003 07:28:18 -0000 1.78
***************
*** 1282,1290 ****
--- 1282,1296 ----
Q_UNUSED(self);
if( !checkArgStr( 0 ) )
+ {
+ Py_INCREF( Py_None );
return Py_None;
+ }
cAcl *acl = cCommands::instance()->getACL( getArgStr( 0 ) );
if( !acl )
+ {
+ Py_INCREF( Py_None );
return Py_None;
+ }
PyObject *dict = PyDict_New();
Index: item.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/item.cpp,v
retrieving revision 1.66
retrieving revision 1.67
diff -C2 -d -r1.66 -r1.67
*** item.cpp 26 Jul 2003 01:10:55 -0000 1.66
--- item.cpp 4 Aug 2003 07:28:18 -0000 1.67
***************
*** 94,98 ****
--- 94,101 ----
{
if( item == NULL )
+ {
+ Py_INCREF( Py_None );
return Py_None;
+ }
// wpItem *returnVal = ItemCache::instance()->allocObj( &wpItemType );
***************
*** 335,339 ****
--- 338,345 ----
{
if( !self->pItem || self->pItem->free )
+ {
+ Py_INCREF( Py_None );
return Py_None;
+ }
if( PyTuple_Size( args ) < 1 || !checkArgStr( 0 ) )
***************
*** 358,361 ****
--- 364,368 ----
return PyInt_FromLong( value.asInt() );
+ Py_INCREF( Py_None );
return Py_None;
}
Index: multi.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/multi.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** multi.cpp 26 Jul 2003 01:10:55 -0000 1.12
--- multi.cpp 4 Aug 2003 07:28:18 -0000 1.13
***************
*** 80,84 ****
--- 80,87 ----
{
if( pMulti == NULL )
+ {
+ Py_INCREF( Py_None );
return Py_None;
+ }
wpMulti *returnVal = PyObject_New( wpMulti, &wpMultiType );
***************
*** 295,299 ****
--- 298,305 ----
{
if( !self->pMulti || self->pMulti->free )
+ {
+ Py_INCREF( Py_None );
return Py_None;
+ }
if( PyTuple_Size( args ) < 1 || !checkArgStr( 0 ) )
***************
*** 318,321 ****
--- 324,328 ----
return PyInt_FromLong( value.asInt() );
+ Py_INCREF( Py_None );
return Py_None;
}
Index: pyaccount.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/pyaccount.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** pyaccount.cpp 2 Jun 2003 04:37:59 -0000 1.13
--- pyaccount.cpp 4 Aug 2003 07:28:18 -0000 1.14
***************
*** 243,247 ****
--- 243,250 ----
{
if( !account )
+ {
+ Py_INCREF( Py_None );
return Py_None;
+ }
wpAccount *cObject = PyObject_New( wpAccount, &wpAccountType );
Index: pypacket.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/pypacket.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** pypacket.cpp 26 Jul 2003 15:47:17 -0000 1.1
--- pypacket.cpp 4 Aug 2003 07:28:18 -0000 1.2
***************
*** 83,87 ****
( (wpPacket*)self )->packet->resize( (unsigned short)size );
! Py_XINCREF( Py_None );
return Py_None;
}
--- 83,87 ----
( (wpPacket*)self )->packet->resize( (unsigned short)size );
! Py_INCREF( Py_None );
return Py_None;
}
***************
*** 97,101 ****
( *( (wpPacket*)self )->packet )[ (unsigned short)pos ] = (char)value;
! Py_XINCREF( Py_None );
return Py_None;
}
--- 97,101 ----
( *( (wpPacket*)self )->packet )[ (unsigned short)pos ] = (char)value;
! Py_INCREF( Py_None );
return Py_None;
}
***************
*** 111,115 ****
( (wpPacket*)self )->packet->setShort( (unsigned short)pos, (unsigned short)value );
! Py_XINCREF( Py_None );
return Py_None;
}
--- 111,115 ----
( (wpPacket*)self )->packet->setShort( (unsigned short)pos, (unsigned short)value );
! Py_INCREF( Py_None );
return Py_None;
}
***************
*** 125,129 ****
( (wpPacket*)self )->packet->setInt( (unsigned short)pos, (unsigned int)value );
! Py_XINCREF( Py_None );
return Py_None;
}
--- 125,129 ----
( (wpPacket*)self )->packet->setInt( (unsigned short)pos, (unsigned int)value );
! Py_INCREF( Py_None );
return Py_None;
}
***************
*** 142,146 ****
PyMem_Free( buffer );
! Py_XINCREF( Py_None );
return Py_None;
}
--- 142,146 ----
PyMem_Free( buffer );
! Py_INCREF( Py_None );
return Py_None;
}
***************
*** 161,165 ****
PyMem_Free( buffer );
! Py_XINCREF( Py_None );
return Py_None;
}
--- 161,165 ----
PyMem_Free( buffer );
! Py_INCREF( Py_None );
return Py_None;
}
***************
*** 175,179 ****
socket->send( ( (wpPacket*)self )->packet );
! Py_XINCREF( Py_None );
return Py_None;
}
--- 175,179 ----
socket->send( ( (wpPacket*)self )->packet );
! Py_INCREF( Py_None );
return Py_None;
}
Index: pyregion.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/pyregion.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** pyregion.cpp 5 Jul 2003 19:02:14 -0000 1.6
--- pyregion.cpp 4 Aug 2003 07:28:18 -0000 1.7
***************
*** 160,164 ****
--- 160,167 ----
{
if( !pRegion )
+ {
+ Py_INCREF( Py_None );
return Py_None;
+ }
wpRegion *returnVal = PyObject_New( wpRegion, &wpRegionType );
Index: pytooltip.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/pytooltip.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** pytooltip.cpp 2 Jun 2003 04:37:59 -0000 1.4
--- pytooltip.cpp 4 Aug 2003 07:28:18 -0000 1.5
***************
*** 110,114 ****
--- 110,117 ----
{
if( !tooltip )
+ {
+ Py_INCREF( Py_None );
return Py_None;
+ }
wpTooltip *cObject = PyObject_New( wpTooltip, &wpTooltipType );
Index: socket.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/socket.cpp,v
retrieving revision 1.38
retrieving revision 1.39
diff -C2 -d -r1.38 -r1.39
*** socket.cpp 26 Jul 2003 01:10:55 -0000 1.38
--- socket.cpp 4 Aug 2003 07:28:18 -0000 1.39
***************
*** 65,69 ****
--- 65,72 ----
{
if( !socket )
+ {
+ Py_INCREF( Py_None );
return Py_None;
+ }
wpSocket *rVal = PyObject_New( wpSocket, &wpSocketType );
***************
*** 72,77 ****
if( rVal )
return (PyObject*)rVal;
! else
! return Py_None;
}
--- 75,81 ----
if( rVal )
return (PyObject*)rVal;
!
! Py_INCREF( Py_None );
! return Py_None;
}
***************
*** 519,523 ****
--- 523,530 ----
{
if( !self->pSock )
+ {
+ Py_INCREF( Py_None );
return Py_None;
+ }
if( PyTuple_Size( args ) < 1 || !checkArgStr( 0 ) )
***************
*** 535,538 ****
--- 542,546 ----
return PyInt_FromLong( value.asInt() );
+ Py_INCREF( Py_None );
return Py_None;
}
Index: target.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/target.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** target.h 28 Feb 2003 21:50:39 -0000 1.7
--- target.h 4 Aug 2003 07:28:18 -0000 1.8
***************
*** 80,84 ****
--- 80,87 ----
{
if( !target )
+ {
+ Py_INCREF( Py_None );
return Py_None;
+ }
wpTarget *returnVal = PyObject_New( wpTarget, &wpTargetType );
|
|
From: <thi...@us...> - 2003-08-04 07:28:20
|
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv9097
Modified Files:
ai.cpp debug.cpp pythonscript.h wolf.dsp
Log Message:
Fixed some Python 2.3 compile errors, and added Py_INC( Py_None ) everywhere we return it.
Index: ai.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/ai.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** ai.cpp 17 Jul 2003 09:14:12 -0000 1.13
--- ai.cpp 4 Aug 2003 07:28:17 -0000 1.14
***************
*** 29,32 ****
--- 29,34 ----
//==================================================================================
+ #include "python/utilities.h"
+
#include "ai.h"
#include "npc.h"
***************
*** 39,43 ****
#include "itemid.h"
#include "world.h"
- #include "python/utilities.h"
// library includes
--- 41,44 ----
Index: debug.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/debug.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** debug.cpp 23 Jul 2003 22:39:07 -0000 1.9
--- debug.cpp 4 Aug 2003 07:28:17 -0000 1.10
***************
*** 139,143 ****
*/
! #if defined(Q_OS_WIN32) && 1
#include <qfile.h>
--- 139,143 ----
*/
! #if defined(Q_OS_WIN32) && 0
#include <qfile.h>
Index: pythonscript.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/pythonscript.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** pythonscript.h 6 Jul 2003 13:48:01 -0000 1.2
--- pythonscript.h 4 Aug 2003 07:28:17 -0000 1.3
***************
*** 60,63 ****
--- 60,66 ----
public:
+ cPythonScript(): catchAllSpeech_( false ), handleSpeech_( false ), codeModule( 0 ) {}
+ virtual ~cPythonScript() {};
+
void addKeyword( UINT16 data );
void addWord( const QString &data );
***************
*** 72,79 ****
// We need an identification value for the scripts
void setName( const QString &value ) { name_ = value; }
! const QString &name() { return name_; }
!
! cPythonScript(): catchAllSpeech_( false ), handleSpeech_( false ), codeModule( 0 ) {}
! virtual ~cPythonScript() {};
bool load( const cElement *element );
--- 75,79 ----
// We need an identification value for the scripts
void setName( const QString &value ) { name_ = value; }
! QString name() const { return name_; }
bool load( const cElement *element );
Index: wolf.dsp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolf.dsp,v
retrieving revision 1.200
retrieving revision 1.201
diff -C2 -d -r1.200 -r1.201
*** wolf.dsp 26 Jul 2003 01:10:55 -0000 1.200
--- wolf.dsp 4 Aug 2003 07:28:17 -0000 1.201
***************
*** 1,23 ****
# Microsoft Developer Studio Project File - Name="wolf" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
! # ** NICHT BEARBEITEN **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=wolf - Win32 Debug
! !MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE
! !MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl
!MESSAGE
!MESSAGE NMAKE /f "wolf.mak".
!MESSAGE
! !MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben
! !MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel:
!MESSAGE
!MESSAGE NMAKE /f "wolf.mak" CFG="wolf - Win32 Debug"
!MESSAGE
! !MESSAGE Für die Konfiguration stehen zur Auswahl:
!MESSAGE
! !MESSAGE "wolf - Win32 Release" (basierend auf "Win32 (x86) Console Application")
! !MESSAGE "wolf - Win32 Debug" (basierend auf "Win32 (x86) Console Application")
!MESSAGE
--- 1,23 ----
# Microsoft Developer Studio Project File - Name="wolf" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
! # ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=wolf - Win32 Debug
! !MESSAGE This is not a valid makefile. To build this project using NMAKE,
! !MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "wolf.mak".
!MESSAGE
! !MESSAGE You can specify a configuration when running NMAKE
! !MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "wolf.mak" CFG="wolf - Win32 Debug"
!MESSAGE
! !MESSAGE Possible choices for configuration are:
!MESSAGE
! !MESSAGE "wolf - Win32 Release" (based on "Win32 (x86) Console Application")
! !MESSAGE "wolf - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
***************
*** 26,30 ****
# PROP Scc_ProjName "wolf"
# PROP Scc_LocalPath "."
! CPP=cl.exe
RSC=rc.exe
--- 26,30 ----
# PROP Scc_ProjName "wolf"
# PROP Scc_LocalPath "."
! CPP=xicl6.exe
RSC=rc.exe
***************
*** 50,54 ****
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
! LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib advapi32.lib ws2_32.lib $(QTDIR)\lib\qt-mt312.lib libmysql.lib flatstore.lib /nologo /subsystem:console /map /machine:I386 /nodefaultlib:"libcmt MSVCRTD" /out:"D:\wolfpack\wolfpack.exe" /libpath:"lib\ZThread\lib" /libpath:"lib\Python\lib" /libpath:"lib\bugreport\lib" /libpath:"flatstore\Release" /opt:ref /opt:nowin98
--- 50,54 ----
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
! LINK32=xilink6.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib advapi32.lib ws2_32.lib $(QTDIR)\lib\qt-mt312.lib libmysql.lib flatstore.lib /nologo /subsystem:console /map /machine:I386 /nodefaultlib:"libcmt MSVCRTD" /out:"D:\wolfpack\wolfpack.exe" /libpath:"lib\ZThread\lib" /libpath:"lib\Python\lib" /libpath:"lib\bugreport\lib" /libpath:"flatstore\Release" /opt:ref /opt:nowin98
***************
*** 69,73 ****
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
! # ADD CPP /nologo /MD /Gm /GR /GX /ZI /Od /I "lib/Python/PC" /I "lib/Python/include" /I "lib\bugreport" /I "$(QTDIR)\include" /I "c:\mysql\include" /D "_CONSOLE" /D "_MBCS" /D "_DEBUG" /D "WIN32" /D "QT_DLL" /D "QT_NO_STL" /D "QT_THREAD_SUPPORT" /FR /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
--- 69,73 ----
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
! # ADD CPP /nologo /MD /Gm /GR /GX /ZI /Od /I "lib\bugreport" /I "$(QTDIR)\include" /D "_CONSOLE" /D "_MBCS" /D "_DEBUG" /D "WIN32" /D "QT_DLL" /D "QT_NO_STL" /D "QT_THREAD_SUPPORT" /FR /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
***************
*** 75,81 ****
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
! LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
! # ADD LINK32 kernel32.lib user32.lib advapi32.lib ws2_32.lib $(QTDIR)\lib\qt-mt312.lib libmysql.lib flatstore.lib /nologo /version:12.9 /subsystem:console /map /debug /machine:I386 /out:"..\Wolfpack.exe" /pdbtype:sept /libpath:"lib\Python\lib" /libpath:"lib\bugreport\lib" /libpath:"flatstore\Debug"
# SUBTRACT LINK32 /pdb:none
--- 75,81 ----
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
! LINK32=xilink6.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
! # ADD LINK32 kernel32.lib user32.lib advapi32.lib ws2_32.lib $(QTDIR)\lib\qt-mt320.lib libmysql.lib flatstore.lib /nologo /version:12.9 /subsystem:console /map /debug /machine:I386 /out:"..\Wolfpack.exe" /pdbtype:sept /libpath:"lib\bugreport\lib" /libpath:"flatstore\Debug"
# SUBTRACT LINK32 /pdb:none
|
|
From: <dar...@us...> - 2003-07-26 15:47:21
|
Update of /cvsroot/wpdev/wolfpack/python In directory sc8-pr-cvs1:/tmp/cvs-serv20834/src/python Added Files: pypacket.cpp pypacket.h Log Message: Moved Spellbook from Code to Python --- NEW FILE: pypacket.cpp --- //================================================================================== // // Wolfpack Emu (WP) // UO Server Emulation Program // // Copyright 1997, 98 by Marcus Rating (Cironian) // Copyright 2001-2003 by holders identified in authors.txt // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Palace - Suite 330, Boston, MA 02111-1307, USA. // // * In addition to that license, if you are running this program or modified // * versions of it on a public system you HAVE TO make the complete source of // * the version used by you available or provide people with a location to // * download it. // // // // Wolfpack Homepage: http://wpdev.sf.net/ //================================================================================== #include <qstring.h> #include "utilities.h" #include "pypacket.h" #include "../network/uopacket.h" #include "../network/uosocket.h" // Object Information struct wpPacket { PyObject_HEAD; cUOPacket *packet; }; PyObject *wpPacket_getattr( PyObject *self, char *name ); PyMethodDef wpPacketMethods[]; // Object Destructor static void wpPacketDestructor( PyObject *obj ) { delete ( (wpPacket*)obj )->packet; PyObject_Del( obj ); } // Static Type Information static PyTypeObject wpPacketType = { PyObject_HEAD_INIT( &PyType_Type ) 0, "wppacket", sizeof( wpPacketType ), 0, wpPacketDestructor, 0, wpPacket_getattr, }; // Global Object-Getter static PyObject *wpPacket_getattr( PyObject *self, char *name ) { return Py_FindMethod( wpPacketMethods, self, name ); } // Resize the packet static PyObject *wpPacket_resize( PyObject *self, PyObject *args ) { int size; if( !PyArg_ParseTuple( args, "i:wppacket.resize( size )", &size ) ) return 0; ( (wpPacket*)self )->packet->resize( (unsigned short)size ); Py_XINCREF( Py_None ); return Py_None; } // Set a byte static PyObject *wpPacket_setbyte( PyObject *self, PyObject *args ) { unsigned int pos, value; if( !PyArg_ParseTuple( args, "ii:wppacket.setbyte( position, value )", &pos, &value ) ) return 0; ( *( (wpPacket*)self )->packet )[ (unsigned short)pos ] = (char)value; Py_XINCREF( Py_None ); return Py_None; } // Set a short static PyObject *wpPacket_setshort( PyObject *self, PyObject *args ) { unsigned int pos, value; if( !PyArg_ParseTuple( args, "ii:wppacket.setshort( position, value )", &pos, &value ) ) return 0; ( (wpPacket*)self )->packet->setShort( (unsigned short)pos, (unsigned short)value ); Py_XINCREF( Py_None ); return Py_None; } // Set an integer static PyObject *wpPacket_setint( PyObject *self, PyObject *args ) { unsigned int pos, value; if( !PyArg_ParseTuple( args, "ii:wppacket.setint( position, value )", &pos, &value ) ) return 0; ( (wpPacket*)self )->packet->setInt( (unsigned short)pos, (unsigned int)value ); Py_XINCREF( Py_None ); return Py_None; } // Set raw data in the packet buffer static PyObject *wpPacket_setascii( PyObject *self, PyObject *args ) { int pos, size; char *buffer; if( !PyArg_ParseTuple( args, "ies#:wppacket.setbuffer( position, value )", &pos, "ascii", &buffer, &size ) ) return 0; ( (wpPacket*)self )->packet->setAsciiString( (unsigned short)pos, buffer, size ); PyMem_Free( buffer ); Py_XINCREF( Py_None ); return Py_None; } // Set data in unicode encoding static PyObject *wpPacket_setunicode( PyObject *self, PyObject *args ) { int pos; char *buffer; if( !PyArg_ParseTuple( args, "ies:wppacket.setunicode( position, value )", &pos, "utf-8", &buffer ) ) return 0; QString string = QString::fromUtf8( buffer ); ( (wpPacket*)self )->packet->setUnicodeString( pos, string, string.length() ); PyMem_Free( buffer ); Py_XINCREF( Py_None ); return Py_None; } // Send the packet static PyObject *wpPacket_send( PyObject *self, PyObject *args ) { cUOSocket *socket; if( !PyArg_ParseTuple( args, "O&:wppacket.send( socket )", &PyConvertSocket, &socket ) ) return 0; socket->send( ( (wpPacket*)self )->packet ); Py_XINCREF( Py_None ); return Py_None; } // List of Methods static PyMethodDef wpPacketMethods[] = { { "resize", wpPacket_resize, METH_VARARGS, NULL }, { "setbyte", wpPacket_setbyte, METH_VARARGS, NULL }, { "setshort", wpPacket_setshort, METH_VARARGS, NULL }, { "setint", wpPacket_setint, METH_VARARGS, NULL }, { "setascii", wpPacket_setascii, METH_VARARGS, NULL }, { "setunicode", wpPacket_setunicode, METH_VARARGS, NULL }, { "send", wpPacket_send, METH_VARARGS, NULL }, { NULL, NULL, 0, NULL } }; // Object Constructor PyObject *CreatePyPacket( unsigned char id, unsigned short size ) { wpPacket *obj = (wpPacket*)PyObject_New( wpPacket, &wpPacketType ); obj->packet = new cUOPacket( id, size ); return (PyObject*)obj; } --- NEW FILE: pypacket.h --- //================================================================================== // // Wolfpack Emu (WP) // UO Server Emulation Program // // Copyright 2001-2003 by holders identified in authors.txt // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Palace - Suite 330, Boston, MA 02111-1307, USA. // // * In addition to that license, if you are running this program or modified // * versions of it on a public system you HAVE TO make the complete source of // * the version used by you available or provide people with a location to // * download it. // // // // Wolfpack Homepage: http://wpdev.sf.net/ //================================================================================== #ifndef __PYPACKET_H__ #define __PYPACKET_H__ #include "engine.h" PyObject *CreatePyPacket( unsigned char id, unsigned short size ); #endif |
|
From: <dar...@us...> - 2003-07-26 03:44:09
|
Update of /cvsroot/wpdev/wolfpack/python
In directory sc8-pr-cvs1:/tmp/cvs-serv3205/src/python
Modified Files:
global.cpp item.cpp multi.cpp socket.cpp utilities.h
Log Message:
Moved Spellbook from Code to Python
Index: global.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/global.cpp,v
retrieving revision 1.76
retrieving revision 1.77
diff -C2 -d -r1.76 -r1.77
*** global.cpp 5 Jul 2003 19:02:14 -0000 1.76
--- global.cpp 26 Jul 2003 01:10:55 -0000 1.77
***************
*** 60,63 ****
--- 60,64 ----
#include "../utilsys.h"
+ #include "pypacket.h"
#include "regioniterator.h"
#include "utilities.h"
***************
*** 920,924 ****
return 0;
-
return PyGetCharRegionIterator( xBlock, yBlock, map );
}
--- 921,924 ----
***************
*** 1008,1015 ****
}
-
- /*!
- Returns the number of milliseconds since the server has started
- */
static PyObject* wpTickcount( PyObject* self )
{
--- 1008,1011 ----
***************
*** 1018,1021 ****
--- 1014,1029 ----
}
+ static PyObject* wpPacket( PyObject* self, PyObject* args )
+ {
+ Q_UNUSED(self);
+
+ unsigned int id, size;
+
+ if( !PyArg_ParseTuple( args, "ii:wolfpack.packet", &id, &size ) )
+ return 0;
+
+ return CreatePyPacket( (unsigned char)id, (unsigned short)size );
+ }
+
/*!
wolfpack
***************
*** 1024,1027 ****
--- 1032,1036 ----
static PyMethodDef wpGlobal[] =
{
+ { "packet", wpPacket, METH_VARARGS, NULL },
{ "charblock", wpCharBlock, METH_VARARGS, NULL },
{ "itemblock", wpItemBlock, METH_VARARGS, NULL },
Index: item.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/item.cpp,v
retrieving revision 1.65
retrieving revision 1.66
diff -C2 -d -r1.65 -r1.66
*** item.cpp 15 Jul 2003 08:30:18 -0000 1.65
--- item.cpp 26 Jul 2003 01:10:55 -0000 1.66
***************
*** 37,41 ****
#include "../scriptmanager.h"
#include "../itemid.h"
- #include "../spellbook.h"
#include "../books.h"
#include "../basechar.h"
--- 37,40 ----
***************
*** 696,738 ****
}
- PyObject* wpItem_spellscount( wpItem* self, PyObject* args )
- {
- Q_UNUSED(args);
- if( !self->pItem || self->pItem->free )
- return PyFalse;
-
- cSpellBook *pBook = dynamic_cast< cSpellBook* >( self->pItem );
- if( !pBook )
- {
- return PyFalse;
- }
- return PyInt_FromLong( pBook->spellCount() );
-
- }
-
- /*
- * Check if this spellbook has a spell
- */
- PyObject* wpItem_hasspell( wpItem* self, PyObject* args )
- {
- if( !self->pItem || self->pItem->free )
- {
- return PyFalse;
- }
- if( !checkArgInt( 0 ) )
- {
- PyErr_BadArgument();
- return 0;
- }
- cSpellBook *pBook = dynamic_cast< cSpellBook* >( self->pItem );
- if( !pBook )
- {
- return PyFalse;
- }
-
- UINT8 spell_num = getArgInt( 0 );
- return PyInt_FromLong( pBook->hasSpell( spell_num ) );
- }
-
static PyMethodDef wpItemMethods[] =
{
--- 695,698 ----
***************
*** 753,758 ****
{ "getadv", (getattrofunc)wpItem_getadv, METH_VARARGS,"Get advanced modifiers." },
{ "setadv", (getattrofunc)wpItem_setadv, METH_VARARGS,"Set advanced modifiers." },
- { "spellscount", (getattrofunc)wpItem_spellscount, METH_VARARGS,"Get spells count in spellbook" },
- { "hasspell", (getattrofunc)wpItem_hasspell, METH_VARARGS,"Check if this spellbook has the spell" },
// Effects
--- 713,716 ----
Index: multi.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/multi.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** multi.cpp 5 Jul 2003 19:02:14 -0000 1.11
--- multi.cpp 26 Jul 2003 01:10:55 -0000 1.12
***************
*** 37,41 ****
#include "../scriptmanager.h"
#include "../itemid.h"
- #include "../spellbook.h"
#include "../multis.h"
#include "../player.h"
--- 37,40 ----
Index: socket.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/socket.cpp,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -d -r1.37 -r1.38
*** socket.cpp 5 Jul 2003 19:02:14 -0000 1.37
--- socket.cpp 26 Jul 2003 01:10:55 -0000 1.38
***************
*** 668,669 ****
--- 668,680 ----
}
+ int PyConvertSocket( PyObject *object, cUOSocket** sock )
+ {
+ if( object->ob_type != &wpSocketType )
+ {
+ PyErr_BadArgument();
+ return 0;
+ }
+
+ *sock = ( (wpSocket*)object )->pSock;
+ return 1;
+ }
Index: utilities.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/utilities.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** utilities.h 24 Jun 2003 19:29:37 -0000 1.18
--- utilities.h 26 Jul 2003 01:10:55 -0000 1.19
***************
*** 86,89 ****
--- 86,90 ----
PyObject *PyGetSocketObject( cUOSocket* );
cUOSocket *getWpSocket( PyObject* object );
+ int PyConvertSocket( PyObject *object, cUOSocket** sock );
bool checkWpCoord( PyObject *object );
|
|
From: <dar...@us...> - 2003-07-26 02:26:14
|
Update of /cvsroot/wpdev/wolfpack/network
In directory sc8-pr-cvs1:/tmp/cvs-serv3205/src/network
Modified Files:
uopacket.h
Log Message:
Moved Spellbook from Code to Python
Index: uopacket.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/network/uopacket.h,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** uopacket.h 22 Jul 2003 17:16:56 -0000 1.23
--- uopacket.h 26 Jul 2003 01:10:55 -0000 1.24
***************
*** 50,55 ****
void init();
void compress();
! void assign( cUOPacket& );
! void resize( uint );
void setRawData( uint, const char*, uint );
--- 50,54 ----
void init();
void compress();
! void assign( cUOPacket& );
void setRawData( uint, const char*, uint );
***************
*** 62,68 ****
uint size() const;
uint count() const;
!
virtual QByteArray compressed();
virtual QByteArray uncompressed() { return rawPacket; }
int getInt( uint ) const;
short getShort( uint) const;
--- 61,68 ----
uint size() const;
uint count() const;
!
virtual QByteArray compressed();
virtual QByteArray uncompressed() { return rawPacket; }
+ void resize( uint );
int getInt( uint ) const;
short getShort( uint) const;
|
|
From: <dar...@us...> - 2003-07-26 02:22:06
|
Update of /cvsroot/wpdev/xmlscripts/definitions In directory sc8-pr-cvs1:/tmp/cvs-serv12003/definitions Modified Files: scripts.xml Log Message: Rewrote some other commands in Python. Index: scripts.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/scripts.xml,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** scripts.xml 26 Jul 2003 01:07:32 -0000 1.49 --- scripts.xml 26 Jul 2003 01:54:08 -0000 1.50 *************** *** 30,36 **** <!-- Commands --> <script>wolfpack.commands</script> ! <script>wolfpack.commands.info</script> <script>wolfpack.commands.export</script> <script>wolfpack.commands.import</script> <!-- Magic --> --- 30,39 ---- <!-- Commands --> <script>wolfpack.commands</script> ! <script>wolfpack.commands.action</script> ! <script>wolfpack.commands.bank</script> <script>wolfpack.commands.export</script> <script>wolfpack.commands.import</script> + <script>wolfpack.commands.info</script> + <script>wolfpack.commands.where</script> <!-- Magic --> |
|
From: <dar...@us...> - 2003-07-26 02:13:31
|
Update of /cvsroot/wpdev/xmlscripts/scripts/wolfpack/commands
In directory sc8-pr-cvs1:/tmp/cvs-serv12069/scripts/wolfpack/commands
Added Files:
action.py bank.py where.py
Log Message:
Rewrote some other commands in Python.
--- NEW FILE: action.py ---
#===============================================================#
# ) (\_ | WOLFPACK 13.0.0 Scripts #
# (( _/{ "-; | Created by: DarkStorm #
# )).-' {{ ;'` | Revised by: #
# ( ( ;._ \\ ctr | Last Modification: Created #
#===============================================================#
# .action Command #
#===============================================================#
import wolfpack
def onLoad():
wolfpack.registercommand( "action", "wolfpack.commands.action" )
def onCommand( socket, command, arguments ):
try:
action = hex2dec( arguments )
socket.player.action( action )
except:
socket.sysmessage( 'Usage: action <animation-id>' )
--- NEW FILE: bank.py ---
#===============================================================#
# ) (\_ | WOLFPACK 13.0.0 Scripts #
# (( _/{ "-; | Created by: DarkStorm #
# )).-' {{ ;'` | Revised by: #
# ( ( ;._ \\ ctr | Last Modification: Created #
#===============================================================#
# .bank Command #
#===============================================================#
import wolfpack
from wolfpack.utilities import hex2dec
def onLoad():
wolfpack.registercommand( "bank", "wolfpack.commands.bank" )
def onCommand( socket, command, arguments ):
arguments = arguments.strip() # Remove trailing and leading whitespaces
layer = 0x1d
if len( arguments ) > 0:
try:
layer = hex2dec( arguments )
except:
socket.sysmessage( 'Usage: bank <layer-id>' )
return
socket.sysmessage( 'Please choose a target.' )
socket.attachtarget( "wolfpack.commands.bank.callback", [ layer ] )
def callback( char, args, target ):
if not target.char:
char.socket.sysmessage( 'You have to target a character.' )
return
container = target.char.itemonlayer( args[0] )
if not container:
char.socket.sysmessage( 'The target has no item on layer 0x%02x' % args[0] )
return
char.socket.sendcontainer( container )
--- NEW FILE: where.py ---
#===============================================================#
# ) (\_ | WOLFPACK 13.0.0 Scripts #
# (( _/{ "-; | Created by: DarkStorm #
# )).-' {{ ;'` | Revised by: #
# ( ( ;._ \\ ctr | Last Modification: Created #
#===============================================================#
# .where Command #
#===============================================================#
import wolfpack
def onLoad():
wolfpack.registercommand( "where", "wolfpack.commands.where" )
def onCommand( socket, command, arguments ):
char = socket.player
region = char.region
pos = char.pos
name = None
while region:
if region.name and len( region.name ) > 0:
name = region.name
break
region = region.parent
if pos.map == 0:
map = 'Felucca'
elif pos.map == 1:
map = 'Trammel'
elif pos.map == 2:
map = 'Ilshenar'
elif pos.map == 3:
map = 'Malas'
else:
map = 'Map %d' % pos.map
if name:
char.message( "You are in %s at %d,%d,%d on %s" % ( name, pos.x, pos.y, pos.z, map ) )
else:
char.message( "You are at %d,%d,%d on %s" % ( pos.x, pos.y, pos.z, map ) )
|