Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1643
Modified Files:
accounts.cpp basechar.cpp combat.cpp commands.cpp configure
console.cpp corpse.cpp definitions.cpp dragdrop.cpp gumps.cpp
items.cpp log.cpp npc.cpp player.cpp server.cpp skills.cpp
spawnregions.cpp speech.cpp targetrequests.cpp territories.cpp
timers.cpp timing.cpp trade.cpp walking.cpp wolf.dsp
wolfpack.pro wolfpack.vcproj world.cpp
Added Files:
serverconfig.cpp serverconfig.h
Removed Files:
config.cpp config.h
Log Message:
config.h and config.cpp moved to serverconfig.h and serverconfig.cpp
This is to prevent a conflict with Automake.
Index: trade.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/trade.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** trade.cpp 2 Jun 2004 15:04:07 -0000 1.4
--- trade.cpp 4 Aug 2004 23:17:37 -0000 1.5
***************
*** 28,32 ****
#include "trade.h"
#include "inlines.h"
! #include "config.h"
#include "typedefs.h"
#include "basechar.h"
--- 28,32 ----
#include "trade.h"
#include "inlines.h"
! #include "serverconfig.h"
#include "typedefs.h"
#include "basechar.h"
***************
*** 315,319 ****
continue;
! if ( ( *it )->id() == pItem->id() && ( *it )->color() == pItem->color() &&
// (*it)->amount() >= pItem->amount() &&
( *it )->eventList() == pItem->eventList() )
--- 315,319 ----
continue;
! if ( ( *it )->id() == pItem->id() && ( *it )->color() == pItem->color() &&
// (*it)->amount() >= pItem->amount() &&
( *it )->eventList() == pItem->eventList() )
Index: wolf.dsp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolf.dsp,v
retrieving revision 1.268
retrieving revision 1.269
diff -C2 -d -r1.268 -r1.269
*** wolf.dsp 29 Jul 2004 19:36:19 -0000 1.268
--- wolf.dsp 4 Aug 2004 23:17:37 -0000 1.269
***************
*** 8,24 ****
!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
# Begin Project
--- 8,24 ----
!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
# Begin Project
***************
*** 80,84 ****
# SUBTRACT LINK32 /pdb:none /map
! !ENDIF
# Begin Target
--- 80,84 ----
# SUBTRACT LINK32 /pdb:none /map
! !ENDIF
# Begin Target
***************
*** 131,135 ****
# Begin Source File
! SOURCE=.\config.cpp
# End Source File
# Begin Source File
--- 131,135 ----
# Begin Source File
! SOURCE=.\serverconfig.cpp
# End Source File
# Begin Source File
***************
*** 366,370 ****
# Begin Source File
! SOURCE=.\config.h
# End Source File
# Begin Source File
--- 366,370 ----
# Begin Source File
! SOURCE=.\serverconfig.h
# End Source File
# Begin Source File
***************
*** 676,680 ****
# PROP Ignore_Default_Tool 1
! !ENDIF
# End Source File
--- 676,680 ----
# PROP Ignore_Default_Tool 1
! !ENDIF
# End Source File
Index: gumps.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/gumps.cpp,v
retrieving revision 1.167
retrieving revision 1.168
diff -C2 -d -r1.167 -r1.168
*** gumps.cpp 27 Jul 2004 06:35:21 -0000 1.167
--- gumps.cpp 4 Aug 2004 23:17:35 -0000 1.168
***************
*** 29,33 ****
#include "gumps.h"
! #include "config.h"
#include "definitions.h"
#include "network/network.h"
--- 29,33 ----
#include "gumps.h"
! #include "serverconfig.h"
#include "definitions.h"
#include "network/network.h"
Index: basechar.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/basechar.cpp,v
retrieving revision 1.122
retrieving revision 1.123
diff -C2 -d -r1.122 -r1.123
*** basechar.cpp 20 Jul 2004 11:35:36 -0000 1.122
--- basechar.cpp 4 Aug 2004 23:17:35 -0000 1.123
***************
*** 54,58 ****
#include "skills.h"
#include "definitions.h"
! #include "config.h"
cBaseChar::cBaseChar()
--- 54,58 ----
#include "skills.h"
#include "definitions.h"
! #include "serverconfig.h"
cBaseChar::cBaseChar()
Index: log.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/log.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** log.cpp 2 Jun 2004 15:04:06 -0000 1.18
--- log.cpp 4 Aug 2004 23:17:36 -0000 1.19
***************
*** 29,33 ****
#include "log.h"
! #include "config.h"
#include "network/uosocket.h"
#include "console.h"
--- 29,33 ----
#include "log.h"
! #include "serverconfig.h"
#include "network/uosocket.h"
#include "console.h"
Index: speech.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/speech.cpp,v
retrieving revision 1.181
retrieving revision 1.182
diff -C2 -d -r1.181 -r1.182
*** speech.cpp 20 Jul 2004 11:35:37 -0000 1.181
--- speech.cpp 4 Aug 2004 23:17:36 -0000 1.182
***************
*** 35,39 ****
#include "sectors.h"
#include "uotime.h"
! #include "config.h"
#include "network/network.h"
#include "territories.h"
--- 35,39 ----
#include "sectors.h"
#include "uotime.h"
! #include "serverconfig.h"
#include "network/network.h"
#include "territories.h"
Index: targetrequests.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/targetrequests.cpp,v
retrieving revision 1.100
retrieving revision 1.101
diff -C2 -d -r1.100 -r1.101
*** targetrequests.cpp 20 Jul 2004 11:35:37 -0000 1.100
--- targetrequests.cpp 4 Aug 2004 23:17:37 -0000 1.101
***************
*** 34,38 ****
#include "items.h"
//#include "muls/tilecache.h"
! #include "config.h"
#include "skills.h"
#include "combat.h"
--- 34,38 ----
#include "items.h"
//#include "muls/tilecache.h"
! #include "serverconfig.h"
#include "skills.h"
#include "combat.h"
Index: items.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/items.cpp,v
retrieving revision 1.427
retrieving revision 1.428
diff -C2 -d -r1.427 -r1.428
*** items.cpp 24 Jul 2004 18:59:56 -0000 1.427
--- items.cpp 4 Aug 2004 23:17:35 -0000 1.428
***************
*** 36,40 ****
#include "items.h"
#include "muls/tilecache.h"
! #include "config.h"
#include "definitions.h"
#include "pythonscript.h"
--- 36,40 ----
#include "items.h"
#include "muls/tilecache.h"
! #include "serverconfig.h"
#include "definitions.h"
#include "pythonscript.h"
***************
*** 52,56 ****
#include "player.h"
#include "basics.h"
- #include "config.h"
#include "inlines.h"
--- 52,55 ----
***************
*** 2068,2072 ****
*/
PY_PROPERTY( "watersource", isWaterSource() )
!
return cUObject::getProperty( name );
}
--- 2067,2071 ----
*/
PY_PROPERTY( "watersource", isWaterSource() )
!
return cUObject::getProperty( name );
}
Index: spawnregions.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/spawnregions.cpp,v
retrieving revision 1.65
retrieving revision 1.66
diff -C2 -d -r1.65 -r1.66
*** spawnregions.cpp 27 Jul 2004 06:35:22 -0000 1.65
--- spawnregions.cpp 4 Aug 2004 23:17:36 -0000 1.66
***************
*** 39,43 ****
#include "console.h"
#include "sectors.h"
! #include "config.h"
#include "inlines.h"
#include "scriptmanager.h"
--- 39,43 ----
#include "console.h"
#include "sectors.h"
! #include "serverconfig.h"
#include "inlines.h"
#include "scriptmanager.h"
***************
*** 62,66 ****
}
! void cSpawnRegion::add(cUObject *object)
{
if (object->isItem()) {
--- 62,66 ----
}
! void cSpawnRegion::add(cUObject *object)
{
if (object->isItem()) {
***************
*** 204,208 ****
bool cSpawnRegion::findValidSpot(Coord_cl& pos) {
// Try up to 100 times.
! for(unsigned int i = 0; i < 100; ++i)
{
int rndRectNum = RandomNum( 0, this->rectangles_.size() - 1 );
--- 204,208 ----
bool cSpawnRegion::findValidSpot(Coord_cl& pos) {
// Try up to 100 times.
! for(unsigned int i = 0; i < 100; ++i)
{
int rndRectNum = RandomNum( 0, this->rectangles_.size() - 1 );
***************
*** 251,255 ****
return true;
! }
}
--- 251,255 ----
return true;
! }
}
***************
*** 435,439 ****
void cAllSpawnRegions::reload()
{
! // Save a list of all objects and their spawnregions
// So the references can be recreated later.
QMap<QString, QPtrList<cUObject> > objects;
--- 435,439 ----
void cAllSpawnRegions::reload()
{
! // Save a list of all objects and their spawnregions
// So the references can be recreated later.
QMap<QString, QPtrList<cUObject> > objects;
***************
*** 444,448 ****
if (region)
{
! if (!objects.contains(region->name()))
{
objects[region->name()].setAutoDelete(false);
--- 444,448 ----
if (region)
{
! if (!objects.contains(region->name()))
{
objects[region->name()].setAutoDelete(false);
***************
*** 459,463 ****
if (region)
{
! if (!objects.contains(region->name()))
{
objects[region->name()].setAutoDelete(false);
--- 459,463 ----
if (region)
{
! if (!objects.contains(region->name()))
{
objects[region->name()].setAutoDelete(false);
Index: corpse.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/corpse.cpp,v
retrieving revision 1.59
retrieving revision 1.60
diff -C2 -d -r1.59 -r1.60
*** corpse.cpp 20 Jul 2004 11:35:36 -0000 1.59
--- corpse.cpp 4 Aug 2004 23:17:35 -0000 1.60
***************
*** 26,30 ****
*/
! #include "config.h"
#include "corpse.h"
#include "network/network.h"
--- 26,30 ----
*/
! #include "serverconfig.h"
#include "corpse.h"
#include "network/network.h"
Index: player.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/player.cpp,v
retrieving revision 1.113
retrieving revision 1.114
diff -C2 -d -r1.113 -r1.114
*** player.cpp 27 Jul 2004 06:35:22 -0000 1.113
--- player.cpp 4 Aug 2004 23:17:36 -0000 1.114
***************
*** 37,41 ****
#include "basics.h"
#include "muls/maps.h"
! #include "config.h"
#include "world.h"
#include "definitions.h"
--- 37,41 ----
#include "basics.h"
#include "muls/maps.h"
! #include "serverconfig.h"
#include "world.h"
#include "definitions.h"
***************
*** 1233,1237 ****
PyObject *cPlayer::getProperty(const QString& name) {
! PY_PROPERTY("account", account_)
/*
\rproperty controlslots The amount of controlslots currently used for this
--- 1233,1237 ----
PyObject *cPlayer::getProperty(const QString& name) {
! PY_PROPERTY("account", account_)
/*
\rproperty controlslots The amount of controlslots currently used for this
Index: console.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/console.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** console.cpp 20 Jul 2004 04:40:51 -0000 1.21
--- console.cpp 4 Aug 2004 23:17:35 -0000 1.22
***************
*** 33,37 ****
#include "world.h"
#include "network/network.h"
! #include "config.h"
#include "player.h"
#include "accounts.h"
--- 33,37 ----
#include "world.h"
#include "network/network.h"
! #include "serverconfig.h"
#include "player.h"
#include "accounts.h"
--- NEW FILE: serverconfig.h ---
/*
* Wolfpack Emu (WP)
* UO Server Emulation Program
*
* Copyright 2001-2004 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/
*/
#if !defined (__CONFIG_H__)
#define __CONFIG_H__
// System headers
#include <vector>
// Our own headers
#include "preferences.h"
#include "server.h"
#include "singleton.h"
#include "coord.h"
// Library Headers
#include <qstring.h>
#include <qstringlist.h>
// Structs
struct StartLocation_st
{
QString name;
Coord_cl pos;
};
struct ServerList_st
{
Q_UINT16 uiIndex;
QString sServer;
Q_UINT8 uiFull;
Q_UINT8 uiTime;
Q_UINT32 ip;
QCString sIP;
Q_UINT16 uiPort;
};
// Constants
const unsigned int FIRST_YEAR = 1970;
class cConfig : public Preferences, public cComponent
{
protected:
QString getGroupDoc( const QString& group );
QString getEntryDoc( const QString& group, const QString& entry );
std::vector<ServerList_st> serverList_;
std::vector<StartLocation_st> startLocation_;
// loaded data
bool overwriteDefinitions_;
bool antiSpeedHack_;
unsigned int antiSpeedHackDelay_;
unsigned int antiSpeedHackDelayMounted_;
bool hashAccountPasswords_;
bool convertUnhashedPasswords_;
bool allowUnencryptedClients_;
bool allowStatRequest_;
unsigned int skillcap_;
bool showSkillTitles_;
unsigned int statcap_;
QString commandPrefix_;
unsigned int skillAdvanceModifier_;
unsigned int statsAdvanceModifier_;
unsigned short objectDelay_;
bool stealing_;
bool guardsActive_;
bool saveSpawns_;
bool dontStackSpawnedObjects_;
bool autoAccountCreate_;
float checkNPCTime_;
float checkFollowTime_;
float checkTamedTime_;
unsigned int itemDecayTime_;
unsigned int corpseDecayTime_;
int niceLevel_;
unsigned short loginPort_;
unsigned int logMask_;
bool enableLogin_;
unsigned short gamePort_;
bool enableGame_;
unsigned int playercorpsedecaymultiplier_;
bool lootdecayswithcorpse_;
float invisTimer_;
unsigned short skillDelay_;
int skillLevel_;
unsigned int poisonTimer_;
signed int maxStealthSteps_;
unsigned int runningStamSteps_;
unsigned int hungerRate_;
unsigned int hungerDamageRate_;
unsigned char hungerDamage_;
float boatSpeed_;
unsigned int tamedDisappear_;
unsigned int houseInTown_;
unsigned int shopRestock_;
unsigned int snoopdelay_;
unsigned short int quittime_;
unsigned long int housedecay_secs_;
unsigned int spawnRegionCheckTime_;
unsigned int secondsPerUOMinute_;
bool cacheMulFiles_;
QString databaseDriver_;
QString databaseName_;
QString databaseUsername_;
QString databasePassword_;
QString databaseHost_;
QString accountsDriver_;
QString accountsName_;
QString accountsUsername_;
QString accountsPassword_;
QString accountsHost_;
int saveInterval_;
QString mulPath_;
QString logPath_;
bool logRotate_;
bool categoryTagAddMenu_;
double npcMoveTime_;
double tamedNpcMoveTime_;
unsigned int showNpcTitles_;
// AI
float checkAITime_;
unsigned int animalWildFleeRange_;
unsigned int guardDispelTime_;
// Combat
int attackstamina_;
unsigned char attack_distance_;
//Repsys
long int murderdecay_;
unsigned int maxkills_;
int crimtime_;
// Resources
unsigned int resourceitemdecaytime_;
// Light
unsigned char worldBrightLevel_;
unsigned char worldFixedLevel_;
unsigned char worldDarkLevel_;
unsigned char dungeonLightLevel_;
unsigned char worldCurrentLevel_;
// Path Finding
int pathfindMaxSteps_;
int pathfindMaxIterations_;
bool pathfind4Follow_;
bool pathfind4Combat_;
int pathfindFollowRadius_;
float pathfindFollowMinCost_;
int pathfindFleeRadius_;
public:
cConfig();
void load();
void unload();
void reload();
std::vector<ServerList_st>& serverList(); // read-only
std::vector<StartLocation_st>& startLocation();
// gets
bool hashAccountPasswords() const;
bool convertUnhashedPasswords() const;
bool showSkillTitles() const;
bool allowUnencryptedClients() const;
bool allowStatRequest() const;
unsigned int skillcap() const;
unsigned int statcap() const;
QString commandPrefix() const;
unsigned int skillAdvanceModifier() const;
unsigned int statsAdvanceModifier() const;
bool stealingEnabled() const;
bool guardsActive() const;
void guardsActive( bool );
unsigned short objectDelay() const;
bool autoAccountCreate() const;
bool saveSpawns() const;
float checkNPCTime() const;
float checkAITime() const;
unsigned int animalWildFleeRange() const;
float checkFollowTime() const;
float checkTamedTime() const;
bool antiSpeedHack() const {
return antiSpeedHack_;
}
unsigned int antiSpeedHackDelay() const {
return antiSpeedHackDelay_;
}
unsigned int antiSpeedHackDelayMounted() const {
return antiSpeedHackDelayMounted_;
}
int niceLevel() const;
unsigned int itemDecayTime() const;
unsigned int corpseDecayTime() const;
bool lootdecayswithcorpse() const;
float invisTimer() const;
unsigned short skillDelay() const;
unsigned int poisonTimer() const;
signed int maxStealthSteps() const;
unsigned int runningStamSteps() const;
unsigned int hungerRate() const;
unsigned int hungerDamageRate() const;
unsigned char hungerDamage() const;
float boatSpeed() const;
unsigned int tamedDisappear() const;
unsigned int houseInTown() const;
inline bool dontStackSpawnedObjects() const {
return dontStackSpawnedObjects_;
}
unsigned int shopRestock() const;
unsigned int snoopdelay() const;
unsigned short int quittime() const;
unsigned long int housedecay_secs() const;
unsigned int default_jail_time() const;
bool cacheMulFiles() const;
unsigned int spawnRegionCheckTime() const;
unsigned int secondsPerUOMinute() const;
unsigned int logMask() const;
void setSecondsPerUOMinute( unsigned int );
int saveInterval() const;
bool heartBeat() const;
int defaultpriv2() const;
QString mulPath() const;
QString logPath() const;
bool logRotate() const;
void setMulPath( const QString& data );
void setLogPath( const QString& data );
bool addMenuByCategoryTag() const;
double npcMoveTime() const;
double tamedNpcMoveTime() const;
unsigned int showNpcTitles() const;
bool overwriteDefinitions() const;
// Persistency Module
QString databaseDriver() const;
QString databaseHost() const;
QString databasePassword() const;
QString databaseUsername() const;
QString databaseName() const;
QString accountsDriver() const;
QString accountsHost() const;
QString accountsPassword() const;
QString accountsUsername() const;
QString accountsName() const;
// Combat
int attackstamina() const;
unsigned char attack_distance() const;
// Repsys
long int murderdecay() const;
unsigned int maxkills() const;
int crimtime() const;
// Resources
unsigned int resitemdecaytime() const;
// Light
unsigned char worldBrightLevel() const;
unsigned char worldFixedLevel() const;
unsigned char worldDarkLevel() const;
unsigned char dungeonLightLevel() const;
unsigned char& worldCurrentLevel();
void setWorldBrightLevel( unsigned char );
void setWorldFixedLevel( unsigned char );
void setWorldDarkLevel( unsigned char );
void setDungeonLightLevel( unsigned char );
// Network
unsigned short loginPort() const;
unsigned short gamePort() const;
bool enableLogin() const;
bool enableGame() const;
// Path Finding
int pathfindMaxSteps() const;
int pathfindMaxIterations() const;
bool pathfind4Follow() const;
bool pathfind4Combat() const;
int pathfindFollowRadius() const;
float pathfindFollowMinCost() const;
int pathfindFleeRadius() const;
// AI
unsigned int guardDispelTime() const;
private:
void setDefaultStartLocation();
void setDefaultServerList();
void readData();
};
// inline members
inline double cConfig::npcMoveTime() const
{
return npcMoveTime_;
}
inline double cConfig::tamedNpcMoveTime() const
{
return tamedNpcMoveTime_;
}
inline unsigned int cConfig::skillcap() const
{
return skillcap_;
}
inline unsigned int cConfig::statcap() const
{
return statcap_;
}
inline unsigned int cConfig::logMask() const
{
return logMask_;
}
inline QString cConfig::commandPrefix() const
{
return commandPrefix_;
}
inline unsigned int cConfig::skillAdvanceModifier() const
{
return skillAdvanceModifier_;
}
inline unsigned int cConfig::statsAdvanceModifier() const
{
return statsAdvanceModifier_;
}
inline bool cConfig::stealingEnabled() const
{
return stealing_;
}
inline bool cConfig::guardsActive() const
{
return guardsActive_;
}
inline unsigned short cConfig::objectDelay() const
{
return objectDelay_;
}
inline bool cConfig::allowUnencryptedClients() const
{
return allowUnencryptedClients_;
}
inline bool cConfig::allowStatRequest() const
{
return allowStatRequest_;
}
inline bool cConfig::autoAccountCreate() const
{
return autoAccountCreate_;
}
inline bool cConfig::saveSpawns() const
{
return saveSpawns_;
}
inline float cConfig::checkNPCTime() const
{
return checkNPCTime_;
}
inline float cConfig::checkAITime() const
{
return checkAITime_;
}
inline unsigned int cConfig::animalWildFleeRange() const
{
return animalWildFleeRange_;
}
inline float cConfig::checkFollowTime() const
{
return checkFollowTime_;
}
inline float cConfig::checkTamedTime() const
{
return checkTamedTime_;
}
inline int cConfig::niceLevel() const
{
return niceLevel_;
}
inline unsigned int cConfig::itemDecayTime() const
{
return itemDecayTime_;
}
inline unsigned int cConfig::corpseDecayTime() const
{
return corpseDecayTime_;
}
inline bool cConfig::lootdecayswithcorpse() const
{
return lootdecayswithcorpse_;
}
inline unsigned short cConfig::skillDelay() const
{
return skillDelay_;
}
inline unsigned int cConfig::poisonTimer() const
{
return poisonTimer_;
}
inline signed int cConfig::maxStealthSteps() const
{
return maxStealthSteps_;
}
inline unsigned int cConfig::runningStamSteps() const
{
return runningStamSteps_;
}
inline unsigned int cConfig::hungerRate() const
{
return hungerRate_;
}
inline unsigned int cConfig::hungerDamageRate() const
{
return hungerDamageRate_;
}
inline unsigned char cConfig::hungerDamage() const
{
return hungerDamage_;
}
inline float cConfig::boatSpeed() const
{
return boatSpeed_;
}
inline unsigned int cConfig::tamedDisappear() const
{
return tamedDisappear_;
}
inline unsigned int cConfig::houseInTown() const
{
return houseInTown_;
}
inline unsigned int cConfig::shopRestock() const
{
return shopRestock_;
}
inline int cConfig::attackstamina() const
{
return attackstamina_;
}
inline unsigned char cConfig::attack_distance() const
{
return attack_distance_;
}
inline unsigned int cConfig::snoopdelay() const
{
return snoopdelay_;
}
inline unsigned short int cConfig::quittime() const
{
return quittime_;
}
inline unsigned long int cConfig::housedecay_secs() const
{
return housedecay_secs_;
}
inline long int cConfig::murderdecay() const
{
return murderdecay_;
}
inline unsigned int cConfig::maxkills() const
{
return maxkills_;
}
inline int cConfig::crimtime() const
{
return crimtime_;
}
inline unsigned int cConfig::resitemdecaytime() const
{
return resourceitemdecaytime_;
}
inline bool cConfig::cacheMulFiles() const
{
return cacheMulFiles_;
}
inline unsigned int cConfig::spawnRegionCheckTime() const
{
return spawnRegionCheckTime_;
}
inline unsigned int cConfig::secondsPerUOMinute() const
{
return secondsPerUOMinute_;
}
inline unsigned char cConfig::worldBrightLevel() const
{
return worldBrightLevel_;
}
inline unsigned char cConfig::worldFixedLevel() const
{
return worldFixedLevel_;
}
inline unsigned char cConfig::worldDarkLevel() const
{
return worldDarkLevel_;
}
inline unsigned char cConfig::dungeonLightLevel() const
{
return dungeonLightLevel_;
}
inline int cConfig::saveInterval() const
{
return saveInterval_;
}
inline unsigned int cConfig::showNpcTitles() const
{
return showNpcTitles_;
}
inline QString cConfig::databaseDriver() const
{
return databaseDriver_;
}
inline QString cConfig::databaseHost() const
{
return databaseHost_;
}
inline QString cConfig::databaseName() const
{
return databaseName_;
}
inline QString cConfig::databaseUsername() const
{
return databaseUsername_;
}
inline QString cConfig::databasePassword() const
{
return databasePassword_;
}
inline QString cConfig::accountsDriver() const
{
return accountsDriver_;
}
inline QString cConfig::accountsHost() const
{
return accountsHost_;
}
inline QString cConfig::accountsName() const
{
return accountsName_;
}
inline QString cConfig::accountsUsername() const
{
return accountsUsername_;
}
inline QString cConfig::accountsPassword() const
{
return accountsPassword_;
}
inline bool cConfig::showSkillTitles() const
{
return showSkillTitles_;
}
inline bool cConfig::enableLogin() const
{
return enableLogin_;
}
inline bool cConfig::enableGame() const
{
return enableGame_;
}
inline unsigned short cConfig::gamePort() const
{
return gamePort_;
}
inline unsigned short cConfig::loginPort() const
{
return loginPort_;
}
inline bool cConfig::addMenuByCategoryTag() const
{
return categoryTagAddMenu_;
}
inline int cConfig::pathfindMaxSteps() const
{
return pathfindMaxSteps_;
}
inline bool cConfig::pathfind4Follow() const
{
return pathfind4Follow_;
}
inline bool cConfig::pathfind4Combat() const
{
return pathfind4Combat_;
}
inline int cConfig::pathfindFollowRadius() const
{
return pathfindFollowRadius_;
}
inline float cConfig::pathfindFollowMinCost() const
{
return pathfindFollowMinCost_;
}
inline int cConfig::pathfindFleeRadius() const
{
return pathfindFleeRadius_;
}
inline QString cConfig::logPath() const
{
return logPath_;
}
inline bool cConfig::logRotate() const
{
return logRotate_;
}
inline int cConfig::pathfindMaxIterations() const
{
return pathfindMaxIterations_;
}
inline unsigned int cConfig::guardDispelTime() const
{
return guardDispelTime_;
}
inline bool cConfig::hashAccountPasswords() const
{
return hashAccountPasswords_;
}
inline bool cConfig::convertUnhashedPasswords() const
{
return convertUnhashedPasswords_;
}
inline bool cConfig::overwriteDefinitions() const
{
return overwriteDefinitions_;
}
typedef SingletonHolder<cConfig> Config;
#endif //__SRVPARAMS_H___
Index: server.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/server.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** server.cpp 27 Jul 2004 06:35:22 -0000 1.13
--- server.cpp 4 Aug 2004 23:17:36 -0000 1.14
***************
*** 46,50 ****
#include "skills.h"
#include "spawnregions.h"
! #include "config.h"
#include "territories.h"
#include "muls/tilecache.h"
--- 46,50 ----
#include "skills.h"
#include "spawnregions.h"
! #include "serverconfig.h"
#include "territories.h"
#include "muls/tilecache.h"
Index: combat.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/combat.cpp,v
retrieving revision 1.172
retrieving revision 1.173
diff -C2 -d -r1.172 -r1.173
*** combat.cpp 2 Jun 2004 15:04:03 -0000 1.172
--- combat.cpp 4 Aug 2004 23:17:35 -0000 1.173
***************
*** 31,35 ****
#include "npc.h"
#include "basics.h"
! #include "config.h"
#include <qstring.h>
--- 31,35 ----
#include "npc.h"
#include "basics.h"
! #include "serverconfig.h"
#include <qstring.h>
Index: timing.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/timing.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** timing.cpp 10 Jun 2004 00:27:12 -0000 1.8
--- timing.cpp 4 Aug 2004 23:17:37 -0000 1.9
***************
*** 35,39 ****
#include "combat.h"
#include "sectors.h"
! #include "config.h"
#include "network/network.h"
#include "spawnregions.h"
--- 35,39 ----
#include "combat.h"
#include "sectors.h"
! #include "serverconfig.h"
#include "network/network.h"
#include "spawnregions.h"
***************
*** 103,107 ****
++it;
}
!
QValueVector<SERIAL>::iterator sit;
for (sit = toRemove.begin(); sit != toRemove.end(); ++sit) {
--- 103,107 ----
++it;
}
!
QValueVector<SERIAL>::iterator sit;
for (sit = toRemove.begin(); sit != toRemove.end(); ++sit) {
Index: configure
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/configure,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -d -r1.34 -r1.35
*** configure 13 May 2004 05:34:39 -0000 1.34
--- configure 4 Aug 2004 23:17:35 -0000 1.35
***************
*** 111,115 ****
Python version is ${VERSION}, but should be 2.3.x!
Please install the appropriate version from:
! http://www.python.org/2.3.3/
or use ${0} --help for help with specifying the correct path.
EOF
--- 111,115 ----
Python version is ${VERSION}, but should be 2.3.x!
Please install the appropriate version from:
! http://www.python.org/2.3.4/
or use ${0} --help for help with specifying the correct path.
EOF
--- config.h DELETED ---
Index: dragdrop.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/dragdrop.cpp,v
retrieving revision 1.237
retrieving revision 1.238
diff -C2 -d -r1.237 -r1.238
*** dragdrop.cpp 27 Jul 2004 06:35:21 -0000 1.237
--- dragdrop.cpp 4 Aug 2004 23:17:35 -0000 1.238
***************
*** 30,34 ****
#include "speech.h"
#include "sectors.h"
! #include "config.h"
#include "skills.h"
#include "muls/maps.h"
--- 30,34 ----
#include "speech.h"
#include "sectors.h"
! #include "serverconfig.h"
#include "skills.h"
#include "muls/maps.h"
***************
*** 170,175 ****
pContainer->addItem( splitItem, false );
splitItem->SetOwnSerial( pItem->ownSerial() );
!
! splitItem->setSpawnregion(pItem->spawnregion());
// He needs to see the new item
--- 170,175 ----
pContainer->addItem( splitItem, false );
splitItem->SetOwnSerial( pItem->ownSerial() );
!
! splitItem->setSpawnregion(pItem->spawnregion());
// He needs to see the new item
Index: commands.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/commands.cpp,v
retrieving revision 1.251
retrieving revision 1.252
diff -C2 -d -r1.251 -r1.252
*** commands.cpp 27 Jul 2004 04:15:19 -0000 1.251
--- commands.cpp 4 Aug 2004 23:17:35 -0000 1.252
***************
*** 34,38 ****
#include "network/uosocket.h"
#include "spawnregions.h"
! #include "config.h"
#include "targetrequests.h"
#include "territories.h"
--- 34,38 ----
#include "network/uosocket.h"
#include "spawnregions.h"
! #include "serverconfig.h"
#include "targetrequests.h"
#include "territories.h"
Index: wolfpack.vcproj
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolfpack.vcproj,v
retrieving revision 1.38
retrieving revision 1.39
diff -C2 -d -r1.38 -r1.39
*** wolfpack.vcproj 22 Jul 2004 19:39:11 -0000 1.38
--- wolfpack.vcproj 4 Aug 2004 23:17:37 -0000 1.39
***************
*** 274,281 ****
</File>
<File
! RelativePath=".\config.cpp">
</File>
<File
! RelativePath=".\config.h">
</File>
<File
--- 274,281 ----
</File>
<File
! RelativePath=".\serverconfig.cpp">
</File>
<File
! RelativePath=".\serverconfig.h">
</File>
<File
Index: walking.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/walking.cpp,v
retrieving revision 1.129
retrieving revision 1.130
diff -C2 -d -r1.129 -r1.130
*** walking.cpp 21 Jul 2004 17:14:12 -0000 1.129
--- walking.cpp 4 Aug 2004 23:17:37 -0000 1.130
***************
*** 32,36 ****
#include "walking.h"
#include "sectors.h"
! #include "config.h"
#include "network/network.h"
#include "muls/maps.h"
--- 32,36 ----
#include "walking.h"
#include "sectors.h"
! #include "serverconfig.h"
#include "network/network.h"
#include "muls/maps.h"
Index: skills.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/skills.cpp,v
retrieving revision 1.227
retrieving revision 1.228
diff -C2 -d -r1.227 -r1.228
*** skills.cpp 27 Jul 2004 06:35:22 -0000 1.227
--- skills.cpp 4 Aug 2004 23:17:36 -0000 1.228
***************
*** 33,37 ****
#include "targetrequests.h"
#include "sectors.h"
! #include "config.h"
#include "scriptmanager.h"
#include "skills.h"
--- 33,37 ----
#include "targetrequests.h"
#include "sectors.h"
! #include "serverconfig.h"
#include "scriptmanager.h"
#include "skills.h"
--- config.cpp DELETED ---
Index: definitions.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/definitions.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** definitions.cpp 20 Jul 2004 04:40:51 -0000 1.11
--- definitions.cpp 4 Aug 2004 23:17:35 -0000 1.12
***************
*** 42,46 ****
#include "world.h"
#include "skills.h"
! #include "config.h"
#include "basechar.h"
#include "network/network.h"
--- 42,46 ----
#include "world.h"
#include "skills.h"
! #include "serverconfig.h"
#include "basechar.h"
#include "network/network.h"
Index: territories.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/territories.cpp,v
retrieving revision 1.50
retrieving revision 1.51
diff -C2 -d -r1.50 -r1.51
*** territories.cpp 27 Jul 2004 06:35:22 -0000 1.50
--- territories.cpp 4 Aug 2004 23:17:37 -0000 1.51
***************
*** 31,35 ****
#include "network/uosocket.h"
#include "defines.h"
! #include "config.h"
#include "network/network.h"
#include "basics.h"
--- 31,35 ----
#include "network/uosocket.h"
#include "defines.h"
! #include "serverconfig.h"
#include "network/network.h"
#include "basics.h"
--- NEW FILE: serverconfig.cpp ---
/*
* Wolfpack Emu (WP)
* UO Server Emulation Program
*
* Copyright 2001-2004 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 "serverconfig.h"
#include "verinfo.h"
#include "preferences.h"
#include "log.h"
// Library Includes
#include <qstring.h>
#include <qstringlist.h>
#include <qdir.h>
#include <qhostaddress.h>
#include <qdatetime.h>
#include <qglobal.h>
#if defined( Q_OS_WIN32 )
# include <winsock.h>
#elif defined ( Q_OS_UNIX )
# include <arpa/inet.h>
# include <sys/types.h>
# include <sys/socket.h>
# include <netinet/in.h>
# include <netdb.h>
#endif
const char preferencesFileVersion[] = "1.0";
#ifndef INADDR_NONE
#define INADDR_NONE (-1)
#endif
Q_INT32 resolveName( const QString& data )
{
if ( data.isEmpty() )
return INADDR_NONE;
// we do a dns lookup on this
Q_INT32 uiValue = inet_addr( ( char* ) data.latin1() ) ;
if ( uiValue == INADDR_NONE )
{
hostent* ptrHost = gethostbyname( ( char* ) data.latin1() );
if ( ptrHost != 0 )
{
char** ptrPtr = ptrHost->h_addr_list;
//We only use the first one
if ( *ptrPtr != NULL )
{
// I can think of no other way
memcpy( &uiValue, *ptrPtr, sizeof( in_addr ) ) ;
}
}
}
// inet_addr returns the ip in reverse order
return ntohl( uiValue );
}
cConfig::cConfig() : Preferences( "wolfpack.xml", "Wolfpack", "1.0" )
{
readData();
}
void cConfig::readData()
{
Preferences::readData();
// Account Group
autoAccountCreate_ = getBool( "Accounts", "Auto Create", false, true );
accountsDriver_ = getString( "Accounts", "Database Driver", "sqlite", true );
accountsHost_ = getString( "Accounts", "Database Host", "", true );
accountsName_ = getString( "Accounts", "Database Name", "accounts.db", true );
accountsUsername_ = getString( "Accounts", "Database Username", "", true );
accountsPassword_ = getString( "Accounts", "Database Password", "", true );
hashAccountPasswords_ = getBool( "Accounts", "Use MD5 Hashed Passwords", false, true );
convertUnhashedPasswords_ = getBool( "Accounts", "Automatically Hash Loaded Passwords", false, true );
// AI
checkAITime_ = getDouble( "AI", "Default AI Check Time", 0.5, true );
animalWildFleeRange_ = getNumber( "AI", "Wild animals flee range", 8, true );
guardDispelTime_ = getNumber( "AI", "Guard dispel time (sec)", 25, true );
// Persistency
databasePassword_ = getString( "Database", "password", "", true );
databaseUsername_ = getString( "Database", "username", "", true );
databaseHost_ = getString( "Database", "host", "", true );
databaseDriver_ = getString( "Database", "driver", "sqlite", true );
databaseName_ = getString( "Database", "name", "world.db", true );
// Repsys
murderdecay_ = getNumber( "Repsys", "Murder Decay", 28800, true );
maxkills_ = getNumber( "Repsys", "Max Kills", 5, true );
crimtime_ = getNumber( "Repsys", "Criminal Time", 120, true );
// Game Speed Group
objectDelay_ = getNumber( "Game Speed", "ObjectDelay", 1, true );
checkNPCTime_ = getDouble( "Game Speed", "NPCs Check Time", 0.8, true );
checkTamedTime_ = getDouble( "Game Speed", "Tamed Check Time", 0.6, true );
niceLevel_ = getNumber( "Game Speed", "Nice Level", 2, true );
skillDelay_ = getNumber( "Game Speed", "SkillDelay", 7, true );
skillLevel_ = getNumber( "Game Speed", "SkillLevel", 3, true );
maxStealthSteps_ = getNumber( "Game Speed", "Max Stealth Steps", 10, true );
runningStamSteps_ = getNumber( "Game Speed", "Running Stamina Steps", 15, true );
hungerRate_ = getNumber( "Game Speed", "Hunger Rate", 6000, true );
hungerDamageRate_ = getNumber( "Game Speed", "Hunger Damage Rate", 10, true );
boatSpeed_ = getDouble( "Game Speed", "Boat Speed", 0.750000, true );
snoopdelay_ = getNumber( "Game Speed", "Snoop Delay", 7, true );
housedecay_secs_ = getNumber( "Game Speed", "House Decay-Sec.", 604800, true );
spawnRegionCheckTime_ = getNumber( "Game Speed", "SpawnRegion Check Time", 300, true );
itemDecayTime_ = getNumber( "Game Speed", "Item Decay Time", 300, true );
corpseDecayTime_ = getNumber( "Game Speed", "Corpse Decay Time", 600, true );
secondsPerUOMinute_ = getNumber( "Game Speed", "Seconds Per UO Minute", 5, true );
npcMoveTime_ = getDouble( "Game Speed", "NPC Move Time", 0.8, true );
tamedNpcMoveTime_ = getDouble( "Game Speed", "Tamed NPC Move Time", 0.6, true );
// General Group
showSkillTitles_ = getBool( "General", "ShowSkillTitles", true, true );
skillcap_ = getNumber( "General", "SkillCap", 700, true );
statcap_ = getNumber( "General", "StatsCap", 225, true );
commandPrefix_ = getString( "General", "Command Prefix", "'", true );
skillAdvanceModifier_ = getNumber( "General", "Skill Advance Modifier", 1000, true );
statsAdvanceModifier_ = getNumber( "General", "Stats Advance Modifier", 500, true );
stealing_ = getBool( "General", "Stealing Enabled", true, true );
guardsActive_ = getBool( "General", "Guards Enabled", true, true );
saveSpawns_ = getBool( "General", "Save Spawned Regions", true, true );
lootdecayswithcorpse_ = getBool( "General", "Loot Decays With Corpse", true, true );
invisTimer_ = getDouble( "General", "InvisTimer", 60, true );
poisonTimer_ = getNumber( "General", "PoisonTimer", 180, true );
hungerDamage_ = getNumber( "General", "Hunger Damage", 0, true );
tamedDisappear_ = getNumber( "General", "Tamed Disappear", 0, true );
houseInTown_ = getNumber( "General", "House In Town", 0, true );
shopRestock_ = getNumber( "General", "Shop Restock", 1, true );
quittime_ = getNumber( "General", "Char Time Out", 300, true );
cacheMulFiles_ = getBool( "General", "Cache Mul Files", true, true );
categoryTagAddMenu_ = getBool( "General", "Build AddMenu by Category Tags", true, true );
showNpcTitles_ = getNumber( "General", "Show Npc Titles", 1, true );
logMask_ = getNumber( "General", "Logging Mask", LOG_ALL, true );
overwriteDefinitions_ = getBool( "General", "Overwrite Definitions", false, true );
dontStackSpawnedObjects_ = getBool("General", "Don't Stack Spawned Objects", true, true);
antiSpeedHack_ = getBool("General", "Anti Speed Hack", true, true);
antiSpeedHackDelay_ = getNumber("General", "Anti Speed Hack Delay", 175, true);
antiSpeedHackDelayMounted_ = getNumber("General", "Anti Speed Hack Delay Mounted", 75, true);
saveInterval_ = getNumber( "General", "Save Interval", 900, true );
mulPath_ = QDir::convertSeparators( getString( "General", "MulPath", "./muls/", true ) );
logPath_ = QDir::convertSeparators( getString( "General", "LogPath", "./logs/", true ) );
logRotate_ = getBool( "General", "LogRotate", true, true );
// Network
loginPort_ = getNumber( "Network", "Loginserver Port", 2593, true );
gamePort_ = getNumber( "Network", "Gameserver Port", 2592, true );
enableLogin_ = getBool( "Network", "Enable Loginserver", true, true );
enableGame_ = getBool( "Network", "Enable Gameserver", true, true );
allowUnencryptedClients_ = getBool( "Network", "Allow Unencrypted Clients", true, true );
allowStatRequest_ = getBool( "Network", "Allow Stat Request", true, true );
// Combat
attackstamina_ = getNumber( "Combat", "Attack Stamina", -2, true );
attack_distance_ = getNumber( "Combat", "Attack Distance", 13, true );
// Resources 60*60*12
resourceitemdecaytime_ = getNumber( "Resources", "ResourceItem Decay Time (not empty)", 43200, true );
// Light
worldBrightLevel_ = getNumber( "Light", "World Bright Level", 1, true );
worldFixedLevel_ = getNumber( "Light", "World Fixed Level", 0, true );
worldDarkLevel_ = getNumber( "Light", "World Dark Level", 18, true );
dungeonLightLevel_ = getNumber( "Light", "Dungeon Level", 18, true );
// Path Finding
pathfind4Follow_ = getBool( "Path Finding", "Activate for Following", true, true );
pathfind4Combat_ = getBool( "Path Finding", "Activate for Combat", false, true );
pathfindMaxIterations_ = getNumber( "Path Finding", "Maximum Iterations during Calculation", 100, true );
pathfindMaxSteps_ = getNumber( "Path Finding", "Maximum Steps for Calculation", 20, true );
pathfindFollowRadius_ = getNumber( "Path Finding", "Follow Radius", 10, true );
pathfindFollowMinCost_ = getDouble( "Path Finding", "Follow min. estimated Cost", 1.5, true );
pathfindFleeRadius_ = getNumber( "Path Finding", "Flee Radius", 10, true );
}
void cConfig::load()
{
// Load data into binary format
// If value not found, create key.
readData();
if ( !containGroup( "StartLocation" ) )
setDefaultStartLocation();
if ( !containGroup( "LoginServer" ) )
setDefaultServerList();
flush(); // if any key created, save it.
cComponent::load();
}
void cConfig::unload()
{
serverList_.clear();
startLocation_.clear();
cComponent::unload();
}
void cConfig::reload()
{
unload();
load();
}
std::vector<StartLocation_st>& cConfig::startLocation()
{
if ( startLocation_.empty() ) // Empty? Try to load
{
bool bKeepLooping = true;
unsigned int i = 1;
do
{
QString tmp = getString( "StartLocation", QString( "Location %1" ).arg( i++ ), "" ).simplifyWhiteSpace();
bKeepLooping = ( tmp != "" );
if ( bKeepLooping ) // valid data.
{
QStringList strList = QStringList::split( "=", tmp );
if ( strList.size() == 2 )
{
StartLocation_st loc;
loc.name = strList[0];
QStringList strList2 = QStringList::split( ",", strList[1].stripWhiteSpace() );
if ( strList2.size() == 4 )
{
loc.pos.x = strList2[0].toUShort();
loc.pos.y = strList2[1].toUShort();
loc.pos.z = strList2[2].toShort();
loc.pos.map = strList2[3].toUShort();
startLocation_.push_back( loc );
}
}
}
}
while ( bKeepLooping );
}
return startLocation_;
}
void cConfig::setDefaultStartLocation()
{
setString( "StartLocation", "Location 1", "Yew=567,978,0,1" );
setString( "StartLocation", "Location 2", "Minoc=2477,407,15,1" );
setString( "StartLocation", "Location 3", "Britain=1496,1629,10,1" );
setString( "StartLocation", "Location 4", "Moonglow=4404,1169,0,1" );
setString( "StartLocation", "Location 5", "Trinsic=1844,2745,0,1" );
setString( "StartLocation", "Location 6", "Magincia=3738,2223,20,1" );
setString( "StartLocation", "Location 7", "Jhelom=1378,3817,0,1" );
setString( "StartLocation", "Location 8", "Skara Brae=594,2227,0,1" );
setString( "StartLocation", "Location 9", "Vesper=2771,977,0,1" );
flush(); // save
}
void cConfig::setDefaultServerList()
{
setString( "LoginServer", "Shard 1", "Your Shard Name=127.0.0.1,2592" );
flush(); // save.
}
void cConfig::setSecondsPerUOMinute( unsigned int data )
{
secondsPerUOMinute_ = data;
setNumber( "Game Speed", "Seconds Per UO Minute", secondsPerUOMinute_ );
flush();
}
void cConfig::setWorldBrightLevel( unsigned char data )
{
worldBrightLevel_ = data;
setNumber( "Light", "World Bright Level", data );
flush();
}
void cConfig::setWorldFixedLevel( unsigned char data )
{
worldFixedLevel_ = data;
setNumber( "Light", "World Fixed Level", data );
flush();
}
void cConfig::setWorldDarkLevel( unsigned char data )
{
worldDarkLevel_ = data;
setNumber( "Light", "World Dark Level", data );
flush();
}
void cConfig::setDungeonLightLevel( unsigned char data )
{
dungeonLightLevel_ = data;
setNumber( "Light", "Dungeon Level", data );
flush();
}
void cConfig::setMulPath( const QString& data )
{
mulPath_ = data;
setString( "General", "MulPath", data );
flush();
}
void cConfig::setLogPath( const QString& data )
{
logPath_ = data;
setString( "General", "LogPath", data );
flush();
}
unsigned char& cConfig::worldCurrentLevel()
{
return worldCurrentLevel_;
}
void cConfig::guardsActive( bool enabled )
{
guardsActive_ = enabled;
setBool( "General", "Guards Enabled", enabled );
}
struct stGroupDoc
{
const char* group;
const char* documentation;
};
static stGroupDoc group_doc[] =
{
{"AI", "This group configures the NPC AI."}, {"Accounts", "This group configures the account management."}, {"Database", "This group configures access to the worldsave database."}, {0, 0}
};
QString cConfig::getGroupDoc( const QString& group )
{
// Try to find documentation for a group in our table
unsigned int i = 0;
while ( group_doc[i].group )
{
if ( group == group_doc[i].group )
{
return group_doc[i].documentation;
}
++i;
}
return Preferences::getGroupDoc( group );
}
struct stEntryDoc
{
const char* group;
const char* entry;
const char* documentation;
};
static stEntryDoc entry_doc[] =
{
{"Accounts", "Database Driver", "Possible values are: sqlite, mysql"}, {0, 0, 0}
};
QString cConfig::getEntryDoc( const QString& group, const QString& entry )
{
// Try to find documentation for an entry in our table
unsigned int i = 0;
while ( entry_doc[i].group && entry_doc[i].entry )
{
if ( group == entry_doc[i].group && entry == entry_doc[i].entry )
{
return entry_doc[i].documentation;
}
++i;
}
return Preferences::getEntryDoc( group, entry );
}
Index: timers.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/timers.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** timers.cpp 19 Jun 2004 02:06:51 -0000 1.4
--- timers.cpp 4 Aug 2004 23:17:37 -0000 1.5
***************
*** 34,38 ****
#include "items.h"
! #include "config.h"
#include "network/network.h"
#include "definitions.h"
--- 34,38 ----
#include "items.h"
! #include "serverconfig.h"
#include "network/network.h"
#include "definitions.h"
Index: wolfpack.pro
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolfpack.pro,v
retrieving revision 1.199
retrieving revision 1.200
diff -C2 -d -r1.199 -r1.200
*** wolfpack.pro 27 Jul 2004 04:15:20 -0000 1.199
--- wolfpack.pro 4 Aug 2004 23:17:37 -0000 1.200
***************
*** 39,43 ****
MOC_DIR = obj
! INCLUDEPATH += sqlite
win32:DEFINES -= UNICODE
--- 39,43 ----
MOC_DIR = obj
! INCLUDEPATH += sqlite
win32:DEFINES -= UNICODE
***************
*** 60,64 ****
combat.h \
commands.h \
! config.h \
console.h \
contextmenu.h \
--- 60,64 ----
combat.h \
commands.h \
! serverconfig.h \
console.h \
contextmenu.h \
***************
*** 124,128 ****
combat.cpp \
commands.cpp \
! config.cpp \
console.cpp \
contextmenu.cpp \
--- 124,128 ----
combat.cpp \
commands.cpp \
! serverconfig.cpp \
console.cpp \
contextmenu.cpp \
***************
*** 168,172 ****
walking.cpp \
world.cpp
!
# Twofish Module
SOURCES += twofish/twofish2.c
--- 168,172 ----
walking.cpp \
world.cpp
!
# Twofish Module
SOURCES += twofish/twofish2.c
Index: accounts.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/accounts.cpp,v
retrieving revision 1.96
retrieving revision 1.97
diff -C2 -d -r1.96 -r1.97
*** accounts.cpp 15 Jun 2004 02:44:43 -0000 1.96
--- accounts.cpp 4 Aug 2004 23:17:35 -0000 1.97
***************
*** 28,32 ****
// Wolfpack Includes
#include "accounts.h"
! #include "config.h"
#include "network/uosocket.h"
#include "dbdriver.h"
--- 28,32 ----
// Wolfpack Includes
#include "accounts.h"
! #include "serverconfig.h"
#include "network/uosocket.h"
#include "dbdriver.h"
Index: world.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/world.cpp,v
retrieving revision 1.106
retrieving revision 1.107
diff -C2 -d -r1.106 -r1.107
*** world.cpp 27 Jul 2004 06:35:22 -0000 1.106
--- world.cpp 4 Aug 2004 23:17:37 -0000 1.107
***************
*** 30,34 ****
#include "console.h"
! #include "config.h"
#include "dbdriver.h"
#include "progress.h"
--- 30,34 ----
#include "console.h"
! #include "serverconfig.h"
#include "dbdriver.h"
#include "progress.h"
Index: npc.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/npc.cpp,v
retrieving revision 1.100
retrieving revision 1.101
diff -C2 -d -r1.100 -r1.101
*** npc.cpp 20 Jul 2004 11:35:37 -0000 1.100
--- npc.cpp 4 Aug 2004 23:17:36 -0000 1.101
***************
*** 41,45 ****
#include "dbdriver.h"
#include "sectors.h"
! #include "config.h"
#include "log.h"
#include "console.h"
--- 41,45 ----
#include "dbdriver.h"
#include "sectors.h"
! #include "serverconfig.h"
#include "log.h"
#include "console.h"
|