2002-09-23 05:26:26 +00:00
|
|
|
// HTML Template
|
2002-04-07 20:53:41 +00:00
|
|
|
|
2002-09-23 05:26:26 +00:00
|
|
|
// Code added to update when shutting down -avtotar (16/09/02)
|
|
|
|
|
// Slight modification on avotars fix (19/09/02)
|
2002-04-07 20:53:41 +00:00
|
|
|
|
Added:
-JS Get/Set "vulnerable" handlers for character properties (Abaddon)
-willHunger with Get/Set HungerStatus() wrappers to CChar class (can now
selectively stop a character/creature from continuing to hunger)
-JS Get/Set "willhunger" handlers for character properties Changed:
Linux compile fixes (thanks Malketh)
Hash.h warning fixed (thanks Philantrop)
Fixes to getRootPack() and getPackOwner()
Removed many #includes from the global scope, including them in the specific files that need them
This should greatly reduce compile time and filesize, along with the need to recompile after altering most headers
Removed the linux ifdefs around typedefd function declarations, this should work with gcc 3.2
Moved global loading functions into a new cFileIO() class to take them out of global scope
Fixed an issue causing items to not be sent to the client (thanks Malketh)
Moved some global structs into the CWorldMain class
Fixed a bug causing a crash on character / item creation
Moved all effects stuff into its own class to take it out of global scope
Changed the variable CChar::region to CChar::regionNum to avoid conflicts with the cTownRegion region[] indexes
Moved getbestskill(), isHuman(), and inDungeon() into the CChar class to remove them from global scope
Took npcSimpleAttackTarget() out of global scope
Rewrote restock() to make use of restockNPC()
Changed the typedef'd iterator in hash.h to HASHITERATOR to kill a Linux warning
Renamed cEffects::soundeffect() to PlaySound() and removed unneeded overloads
Fixed a bug causing executebatch to be set with locationcount data
Rewrote cEffects::bgsound()
Documented sounds.cpp
Misc minor cleanups / fixes
Removed:
sendItemsInRange() (CChar::Teleport() does the same thing)
Many #includes that were not being used
deathMenu()
respawnnow() and moved all of its code into command_respawn()
one instance of cEffects::scpSoundEffect() and renamed the other to PlaySound()
3/13/2003
Changed
Fixed an issue allowing the server to not have a dictionary.ZRO (which would cause a crash when a dictionary entry was called with no language)
Fixed an issue causing the server to puke when it attempted a restart
Moved SpawnRandomItem() into cItem class
Moved SpawnRandomMonster() into cCharHandle class
Broke necro.dfn into fishing.dfn and digging.dfn
Made better use of SpawnRandomItem() and SpawnRandomMonster()
3/12/2003
Added:
CPOpenGump and CPSpeech packet class to remove some global vars (Note these are pretty basic classes and someone
with a better understanding of how we handle sending/recieving packets could probably expand these to make better use of them)
Changed:
Moved many global vars into the CWorldMain() class
Cleaned ResetVars() in uox3.cpp as ResetDefaults() in CWorldMain() now handles much of that
Added a check to ensure text wasn't sent twice in talking(), should fix double-speech
Cleaned up cmdtable.cpp removing a couple duplicate entries, etc
Changed target() to only require 4 values (as the first two were always 0 and 1)
Removed many unneeded typedefs and globals
Went through cServerData() and noted unused server.ini entries
Moved title1(), title2(), and title3() to cClick.cpp since that is their only usage, made use
of MAX_TITLE to ensure we wouldn't overrun the buffers, and renamed them matching what title they were
3/11/2003
Changed:
Fixed a potentially very serious bugs with how containers were being set upon loading the world
Fixed possible re-adding of weight to containers and characters at load
Fixed a bug causing equipped items that were not weapons to take damage in combat
Minor cleanups / warning fixes / Linux compatability issues (punt)
3/7/2003
Overhauls/Additions/Major Changes
Changed:
Tweaks/Object Conversions/Misc Small Changes
Changed:
Changed CItem::Get/SetLayer() to a UI08
Fixed a bug in speech causing you to see your own text twice
Fixed a nasty crash bug
2003-03-23 10:18:02 +00:00
|
|
|
#include "uox3.h"
|
2002-09-23 05:26:26 +00:00
|
|
|
#include "cHTMLSystem.h"
|
2002-10-25 04:57:23 +00:00
|
|
|
#include "cVersionClass.h"
|
Added:
-JS Get/Set "vulnerable" handlers for character properties (Abaddon)
-willHunger with Get/Set HungerStatus() wrappers to CChar class (can now
selectively stop a character/creature from continuing to hunger)
-JS Get/Set "willhunger" handlers for character properties Changed:
Linux compile fixes (thanks Malketh)
Hash.h warning fixed (thanks Philantrop)
Fixes to getRootPack() and getPackOwner()
Removed many #includes from the global scope, including them in the specific files that need them
This should greatly reduce compile time and filesize, along with the need to recompile after altering most headers
Removed the linux ifdefs around typedefd function declarations, this should work with gcc 3.2
Moved global loading functions into a new cFileIO() class to take them out of global scope
Fixed an issue causing items to not be sent to the client (thanks Malketh)
Moved some global structs into the CWorldMain class
Fixed a bug causing a crash on character / item creation
Moved all effects stuff into its own class to take it out of global scope
Changed the variable CChar::region to CChar::regionNum to avoid conflicts with the cTownRegion region[] indexes
Moved getbestskill(), isHuman(), and inDungeon() into the CChar class to remove them from global scope
Took npcSimpleAttackTarget() out of global scope
Rewrote restock() to make use of restockNPC()
Changed the typedef'd iterator in hash.h to HASHITERATOR to kill a Linux warning
Renamed cEffects::soundeffect() to PlaySound() and removed unneeded overloads
Fixed a bug causing executebatch to be set with locationcount data
Rewrote cEffects::bgsound()
Documented sounds.cpp
Misc minor cleanups / fixes
Removed:
sendItemsInRange() (CChar::Teleport() does the same thing)
Many #includes that were not being used
deathMenu()
respawnnow() and moved all of its code into command_respawn()
one instance of cEffects::scpSoundEffect() and renamed the other to PlaySound()
3/13/2003
Changed
Fixed an issue allowing the server to not have a dictionary.ZRO (which would cause a crash when a dictionary entry was called with no language)
Fixed an issue causing the server to puke when it attempted a restart
Moved SpawnRandomItem() into cItem class
Moved SpawnRandomMonster() into cCharHandle class
Broke necro.dfn into fishing.dfn and digging.dfn
Made better use of SpawnRandomItem() and SpawnRandomMonster()
3/12/2003
Added:
CPOpenGump and CPSpeech packet class to remove some global vars (Note these are pretty basic classes and someone
with a better understanding of how we handle sending/recieving packets could probably expand these to make better use of them)
Changed:
Moved many global vars into the CWorldMain() class
Cleaned ResetVars() in uox3.cpp as ResetDefaults() in CWorldMain() now handles much of that
Added a check to ensure text wasn't sent twice in talking(), should fix double-speech
Cleaned up cmdtable.cpp removing a couple duplicate entries, etc
Changed target() to only require 4 values (as the first two were always 0 and 1)
Removed many unneeded typedefs and globals
Went through cServerData() and noted unused server.ini entries
Moved title1(), title2(), and title3() to cClick.cpp since that is their only usage, made use
of MAX_TITLE to ensure we wouldn't overrun the buffers, and renamed them matching what title they were
3/11/2003
Changed:
Fixed a potentially very serious bugs with how containers were being set upon loading the world
Fixed possible re-adding of weight to containers and characters at load
Fixed a bug causing equipped items that were not weapons to take damage in combat
Minor cleanups / warning fixes / Linux compatability issues (punt)
3/7/2003
Overhauls/Additions/Major Changes
Changed:
Tweaks/Object Conversions/Misc Small Changes
Changed:
Changed CItem::Get/SetLayer() to a UI08
Fixed a bug in speech causing you to see your own text twice
Fixed a nasty crash bug
2003-03-23 10:18:02 +00:00
|
|
|
#include "cGuild.h"
|
|
|
|
|
#include "townregion.h"
|
|
|
|
|
#include "cRaces.h"
|
|
|
|
|
#include "cServerDefinitions.h"
|
|
|
|
|
#include "ssection.h"
|
|
|
|
|
#include "gump.h"
|
|
|
|
|
#include "scriptc.h"
|
2012-11-03 18:11:04 +00:00
|
|
|
#include "CPacketSend.h"
|
|
|
|
|
#include "ObjectFactory.h"
|
|
|
|
|
namespace UOX
|
|
|
|
|
{
|
2002-10-25 04:57:23 +00:00
|
|
|
|
2012-11-03 18:11:04 +00:00
|
|
|
cHTMLTemplates *HTMLTemplates;
|
2002-04-07 20:53:41 +00:00
|
|
|
|
2012-11-03 18:11:04 +00:00
|
|
|
cHTMLTemplate::cHTMLTemplate() : UpdateTimer( 60 ), Loaded( false ), Type( ETT_INVALIDTEMPLATE ), ScheduledUpdate( 0 )
|
2002-04-07 20:53:41 +00:00
|
|
|
{
|
2012-11-03 18:11:04 +00:00
|
|
|
Name = "";
|
|
|
|
|
Content = "";
|
|
|
|
|
OutputFile.reserve( MAX_PATH );
|
|
|
|
|
InputFile.reserve( MAX_PATH );
|
2002-04-07 20:53:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cHTMLTemplate::~cHTMLTemplate()
|
|
|
|
|
{
|
2012-11-03 18:11:04 +00:00
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
UString GetUptime( void )
|
|
|
|
|
{
|
|
|
|
|
UI32 total = (cwmWorldState->GetUICurrentTime() - cwmWorldState->GetStartTime() ) / 1000;
|
|
|
|
|
UI32 ho = total / 3600;
|
|
|
|
|
total -= ho * 3600;
|
|
|
|
|
UI32 mi = total / 60;
|
|
|
|
|
total -= mi * 60;
|
|
|
|
|
UI32 se = total;
|
|
|
|
|
total = 0;
|
|
|
|
|
UString builtString = "";
|
|
|
|
|
if( ho < 10 )
|
|
|
|
|
builtString += "0";
|
|
|
|
|
builtString += UString::number( ho ) + ":";
|
|
|
|
|
if( mi < 10 )
|
|
|
|
|
builtString += "0";
|
|
|
|
|
builtString += UString::number( mi ) + ":";
|
|
|
|
|
if( se < 10 )
|
|
|
|
|
builtString += "0";
|
|
|
|
|
builtString += UString::number( se );
|
|
|
|
|
return builtString;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool CountNPCFunctor( CBaseObject *a, UI32 &b, void *extraData )
|
|
|
|
|
{
|
|
|
|
|
bool retVal = true;
|
|
|
|
|
if( ValidateObject( a ) )
|
|
|
|
|
{
|
|
|
|
|
CChar *j = static_cast< CChar * >(a);
|
|
|
|
|
if( j->IsNpc() )
|
|
|
|
|
++b;
|
|
|
|
|
}
|
|
|
|
|
return retVal;
|
2002-04-07 20:53:41 +00:00
|
|
|
}
|
|
|
|
|
|
2003-01-20 16:24:24 +00:00
|
|
|
//o--------------------------------------------------------------------------o
|
2012-11-03 18:11:04 +00:00
|
|
|
//| Function - void cHTMLTemplate::Process( void )
|
|
|
|
|
//| Date - 1/18/2003 4:43:17 AM
|
2003-01-20 16:24:24 +00:00
|
|
|
//| Developers - DarkStorm / EviLDeD
|
2012-11-03 18:11:04 +00:00
|
|
|
//| Organization - UOX3 DevTeam
|
|
|
|
|
//| Status - Currently under development
|
2003-01-20 16:24:24 +00:00
|
|
|
//o--------------------------------------------------------------------------o
|
|
|
|
|
//| Description -
|
2012-11-03 18:11:04 +00:00
|
|
|
//|
|
|
|
|
|
//| Modification - 08062003 - EviLDeD - For the record this is some of the
|
|
|
|
|
//| most fucked up shit I have EVER SEEN!! Written to truely
|
|
|
|
|
//| handle multiple Templates.
|
2003-01-20 16:24:24 +00:00
|
|
|
//o--------------------------------------------------------------------------o
|
|
|
|
|
//| Modifications -
|
|
|
|
|
//o--------------------------------------------------------------------------o
|
2002-04-07 20:53:41 +00:00
|
|
|
void cHTMLTemplate::Process( void )
|
|
|
|
|
{
|
2012-11-03 18:11:04 +00:00
|
|
|
// Need to check to see if the server is actually running, of so we do not want to process the offline template.
|
|
|
|
|
if(cwmWorldState->GetKeepRun() && this->GetTemplateType() == ETT_OFFLINE )
|
|
|
|
|
return;
|
|
|
|
|
|
2002-04-07 20:53:41 +00:00
|
|
|
// Only read the Status Page if it's not already loaded
|
|
|
|
|
if( !Loaded )
|
|
|
|
|
LoadTemplate();
|
|
|
|
|
|
|
|
|
|
// Parse the Content...
|
2003-01-13 15:58:29 +00:00
|
|
|
std::string ParsedContent = Content;
|
2002-04-07 20:53:41 +00:00
|
|
|
|
|
|
|
|
// Replacing Placeholders
|
|
|
|
|
|
|
|
|
|
// Account-Count
|
2012-11-03 18:11:04 +00:00
|
|
|
UString AccountCount = UString::number( Accounts->size() );
|
|
|
|
|
size_t Pos = ParsedContent.find( "%accounts" );
|
|
|
|
|
while( Pos != std::string::npos )
|
2002-04-07 20:53:41 +00:00
|
|
|
{
|
|
|
|
|
ParsedContent.replace( Pos, 9, AccountCount );
|
2012-11-03 18:11:04 +00:00
|
|
|
Pos = ParsedContent.find( "%accounts" );
|
2002-04-07 20:53:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Version
|
2012-11-03 18:11:04 +00:00
|
|
|
std::string Version = CVersionClass::GetVersion();
|
|
|
|
|
Version += ".";
|
|
|
|
|
Version += CVersionClass::GetBuild();
|
Changed:
-Fixed a potentially very serious bugs with how containers were being set upon
loading the world
-Fixed possible re-adding of weight to containers and characters at load
-Fixed a bug causing equipped items that were not weapons to take damage in
combat
-Minor cleanups / warning fixes / Linux compatability issues (punt)
-Changed CItem::Get/SetLayer() to a UI08
-Fixed a bug in speech causing you to see your own text twice
-Fixed a nasty crash bug caused by changing an items layer
-Fixed a bug causing NPC's to always be the first attacker
-Armor DEF system overhauled to match OSI system
-Updated Hash Table Remove() calls to remove unrefrenced parameter "index"
-Changed cSocket::Get/SetDWord() to a UI32 to fix problems checking it against
INVALIDSERIAL and storing large serial numbers
-Changed cSocket::AddID() to a UI32 for the same reason as above
-Changed cSocket:::Get/SetWord() to a UI16 to fix possible problems storing ID's
-Fixed up calcStealDiff() to match new weight system
-Minor updates to CPStatsWindow to match the new Armor DEF system and Weight
system
-Fixed calls to getTileName() so the names container was set with MAX_NAME
-Fixed up getFieldDir() using direction typedefs
-Changed Get/SetMagic() to Get/SetMovable()
-Cleaned up some unrefrenced params
-Changed some int's to UI16's in books.cpp
-WorldSave Changes:
-XYZ and worldnum to Location=x,y,z,worldnum
-HiDamage and LoDamage into Damage=hidamage,lodamage
-Strength,st2,Dexterity,dx2,Intelligence,in2 changed to Strength=str,st2,
Intelligence=int,in2, Dexterity=dex,dx2
-DWord0-3 changed to DWords=0,1,2,3
-FX1,FY1,FX2,FY2,FZ1 changed to WanderArea=FX1,FY1,FX2,FY2,FZ1
-MoreX,MoreY,MoreZ changed to MoreXYZ=morex,morey,morez
-More,More2 changed to More=more,more2
-Type,Type2 changed to Type=type,type2
-Light,Rain,Heat,Cold,Snow,Lightning changed to
RaceDamage=Light,Rain,Heat,Cold,Snow,Lightning
-Fame,Karma,Kills changed to Reputation=fame,karma,kills
-Complete rewrite to the Weight system
-Weight is more permanent, removed need to recalc it constantly
-Packs now show the weight of themselves and all their contents
-Packs now have a weight limit (currently hardcapped to 400, should make it
based on type of container and possibly scriptable)
-All items use the weight value given to them in the scripts unless the entry
is 0 in which case they pull weight from the MUL's
-Better handling of overloaded for teleport / recall / walking
-Weight will max out at 65535 stones and can not go lower than 0 stones
-Items container is now set as a cBaseObject
-Fixed up itemsfx() and renamed it to itemSound(), now better handles Gold
sfx and where an item was dropped (ie in a pack or on the ground)
-Cleaned up goldsfx() and renamed it to goldSound()
-Many fixes to get/drop/wear/packItem functions
-Minor fixes/cleanups in movement.cpp
-Fixed a worldsave crash with tamed creatures
-Pressing 0 in console reloads items as well as everything else
-Made dagger usable for carve again
-Fixed a horse mounting distance check
-Noted (and in some cases fixed) unrefrenced variables throughout the code
-Converted inscribe.gmp to inscribe.dfn and used NewMakeMenu() in favor of the
old make menu system
-Updated GetMagic() == 3 calls to IsLockedDown() calls (as that is all it
should be used for)
-Fixed up all IsLockedDown() calls, resources that are LockedDown can NOT be
used, even by GM, until released
-Also note, items that should be usable if locked: Skill items (looms, training
dummies, etc, Recall runes)
-Moved the two functions from newbie.cpp to pcmanage.cpp and removed newbie.cpp
from the project
-Moved action() and impaction() to effects.cpp
-Moved isHuman() to npcs.cpp
-Where possible made functions that were part of classes private
-Made use of cCombat::getWeaponTyp
2003-03-13 09:05:58 +00:00
|
|
|
Version += " [";
|
|
|
|
|
Version += OS_STR;
|
|
|
|
|
Version += "]";
|
2002-04-07 20:53:41 +00:00
|
|
|
|
2012-11-03 18:11:04 +00:00
|
|
|
Pos = ParsedContent.find( "%version" );
|
|
|
|
|
while( Pos != std::string::npos )
|
2002-04-07 20:53:41 +00:00
|
|
|
{
|
|
|
|
|
ParsedContent.replace( Pos, 8, Version );
|
2012-11-03 18:11:04 +00:00
|
|
|
Pos = ParsedContent.find( "%version" );
|
2002-04-07 20:53:41 +00:00
|
|
|
}
|
|
|
|
|
// Character Count
|
2012-11-03 18:11:04 +00:00
|
|
|
UString CharacterCount = UString::number( ObjectFactory::getSingleton().CountOfObjects( OT_CHAR ) );
|
|
|
|
|
Pos = ParsedContent.find( "%charcount" );
|
|
|
|
|
while( Pos != std::string::npos )
|
2002-04-07 20:53:41 +00:00
|
|
|
{
|
|
|
|
|
ParsedContent.replace( Pos, 10, CharacterCount );
|
2012-11-03 18:11:04 +00:00
|
|
|
Pos = ParsedContent.find( "%charcount" );
|
2002-04-07 20:53:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Item Count
|
2012-11-03 18:11:04 +00:00
|
|
|
UString ItemCount = UString::number( ObjectFactory::getSingleton().CountOfObjects( OT_ITEM ) );
|
|
|
|
|
Pos = ParsedContent.find( "%itemcount" );
|
|
|
|
|
while( Pos != std::string::npos )
|
2002-04-07 20:53:41 +00:00
|
|
|
{
|
|
|
|
|
ParsedContent.replace( Pos, 10, ItemCount );
|
2012-11-03 18:11:04 +00:00
|
|
|
Pos = ParsedContent.find( "%itemcount" );
|
2002-04-07 20:53:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Connection Count (GMs, Counselors, Player)
|
|
|
|
|
UI32 gm = 0, cns = 0, ccount = 0;
|
2012-11-03 18:11:04 +00:00
|
|
|
|
2002-04-07 20:53:41 +00:00
|
|
|
// Get all Network Connections
|
|
|
|
|
Network->PushConn();
|
2012-11-03 18:11:04 +00:00
|
|
|
CSocket *tSock = NULL;
|
|
|
|
|
CChar *tChar = NULL;
|
2002-04-07 20:53:41 +00:00
|
|
|
for( tSock = Network->FirstSocket(); !Network->FinishedSockets(); tSock = Network->NextSocket() )
|
|
|
|
|
{
|
2002-09-29 04:49:07 +00:00
|
|
|
tChar = tSock->CurrcharObj();
|
2012-11-03 18:11:04 +00:00
|
|
|
if( !ValidateObject( tChar ) )
|
2002-09-29 04:49:07 +00:00
|
|
|
continue;
|
2012-11-03 18:11:04 +00:00
|
|
|
|
|
|
|
|
if( tChar->IsGM() )
|
|
|
|
|
++gm;
|
|
|
|
|
else if( tChar->IsCounselor() )
|
|
|
|
|
++cns;
|
|
|
|
|
else
|
|
|
|
|
++ccount;
|
2002-04-07 20:53:41 +00:00
|
|
|
}
|
|
|
|
|
Network->PopConn();
|
|
|
|
|
|
|
|
|
|
// GMs
|
2012-11-03 18:11:04 +00:00
|
|
|
UString GMCount = UString::number( gm );
|
|
|
|
|
Pos = ParsedContent.find( "%online_gms" );
|
|
|
|
|
while( Pos != std::string::npos )
|
2002-04-07 20:53:41 +00:00
|
|
|
{
|
2003-03-14 23:23:37 +00:00
|
|
|
(cwmWorldState->GetKeepRun())?ParsedContent.replace( Pos, 11, GMCount ):ParsedContent.replace( Pos, 11, "0" );
|
2012-11-03 18:11:04 +00:00
|
|
|
Pos = ParsedContent.find( "%online_gms" );
|
2002-04-07 20:53:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Counselor
|
2012-11-03 18:11:04 +00:00
|
|
|
UString CounsiCount = UString::number( cns );
|
|
|
|
|
Pos = ParsedContent.find( "%online_couns" );
|
|
|
|
|
while( Pos != std::string::npos )
|
2002-04-07 20:53:41 +00:00
|
|
|
{
|
2003-03-14 23:23:37 +00:00
|
|
|
(cwmWorldState->GetKeepRun())?ParsedContent.replace( Pos, 13, CounsiCount ):ParsedContent.replace( Pos, 13, "0");
|
2012-11-03 18:11:04 +00:00
|
|
|
Pos = ParsedContent.find( "%online_couns" );
|
2002-04-07 20:53:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Player
|
2012-11-03 18:11:04 +00:00
|
|
|
UString PlayerCount = UString::number( ccount );
|
|
|
|
|
Pos = ParsedContent.find( "%online_player" );
|
|
|
|
|
while( Pos != std::string::npos )
|
2002-04-07 20:53:41 +00:00
|
|
|
{
|
2003-03-14 23:23:37 +00:00
|
|
|
(cwmWorldState->GetKeepRun())?ParsedContent.replace( Pos, 14, PlayerCount ):ParsedContent.replace( Pos, 14, "0" );
|
2012-11-03 18:11:04 +00:00
|
|
|
Pos = ParsedContent.find( "%online_player" );
|
2002-04-07 20:53:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Total
|
2012-11-03 18:11:04 +00:00
|
|
|
UString AllCount = UString::number( (ccount + gm + cns) );
|
|
|
|
|
Pos = ParsedContent.find( "%online_all" );
|
|
|
|
|
while( Pos != std::string::npos )
|
2002-04-07 20:53:41 +00:00
|
|
|
{
|
2003-03-14 23:23:37 +00:00
|
|
|
(cwmWorldState->GetKeepRun())?ParsedContent.replace( Pos, 11, AllCount ):ParsedContent.replace( Pos, 11, "0" );
|
2012-11-03 18:11:04 +00:00
|
|
|
Pos = ParsedContent.find( "%online_all" );
|
2002-04-07 20:53:41 +00:00
|
|
|
}
|
2012-11-03 18:11:04 +00:00
|
|
|
|
|
|
|
|
// Time
|
2002-04-07 20:53:41 +00:00
|
|
|
char time_str[80];
|
|
|
|
|
RealTime( time_str );
|
2012-11-03 18:11:04 +00:00
|
|
|
Pos = ParsedContent.find( "%time" );
|
|
|
|
|
while( Pos != std::string::npos )
|
2002-04-07 20:53:41 +00:00
|
|
|
{
|
2003-03-14 23:23:37 +00:00
|
|
|
(cwmWorldState->GetKeepRun())?ParsedContent.replace( Pos, 5, time_str ):ParsedContent.replace( Pos, 5, "Down" );
|
2012-11-03 18:11:04 +00:00
|
|
|
Pos = ParsedContent.find( "%time" );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 24Time
|
|
|
|
|
RealTime24( time_str );
|
|
|
|
|
Pos = ParsedContent.find( "%24time" );
|
|
|
|
|
while( Pos != std::string::npos )
|
|
|
|
|
{
|
|
|
|
|
(cwmWorldState->GetKeepRun())?ParsedContent.replace( Pos, 7, time_str ):ParsedContent.replace( Pos, 7, "Down" );
|
|
|
|
|
Pos = ParsedContent.find( "%24time" );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Timestamp
|
|
|
|
|
time_t currTime;
|
|
|
|
|
time( &currTime );
|
|
|
|
|
currTime = mktime( gmtime( &currTime ) );
|
|
|
|
|
UString timestamp = UString::number( static_cast<size_t>(currTime) );
|
|
|
|
|
Pos = ParsedContent.find( "%tstamp" );
|
|
|
|
|
while( Pos != std::string::npos )
|
|
|
|
|
{
|
|
|
|
|
(cwmWorldState->GetKeepRun())?ParsedContent.replace( Pos, 7, timestamp ):ParsedContent.replace( Pos, 7, "Down" );
|
|
|
|
|
Pos = ParsedContent.find( "%tstamp" );
|
2002-04-07 20:53:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// IP(s) + PORT(s)
|
2012-11-03 18:11:04 +00:00
|
|
|
UI16 ServerCount = cwmWorldState->ServerData()->ServerCount();
|
|
|
|
|
if( ServerCount > 0 )
|
2002-04-07 20:53:41 +00:00
|
|
|
{
|
2012-11-03 18:11:04 +00:00
|
|
|
for( UI16 i = 0; i < ServerCount; ++i )
|
2002-04-07 20:53:41 +00:00
|
|
|
{
|
2012-11-03 18:11:04 +00:00
|
|
|
physicalServer *mServ = cwmWorldState->ServerData()->ServerEntry( i );
|
2002-04-07 20:53:41 +00:00
|
|
|
char ipToken[8]; // i think we'll never get higher than 2 digits, anyway...
|
|
|
|
|
sprintf( ipToken, "%%ip%i", i+1 );
|
|
|
|
|
|
2012-11-03 18:11:04 +00:00
|
|
|
if( mServ != NULL )
|
2002-04-07 20:53:41 +00:00
|
|
|
{
|
2012-11-03 18:11:04 +00:00
|
|
|
Pos = ParsedContent.find( ipToken );
|
|
|
|
|
while( Pos != std::string::npos )
|
2002-04-07 20:53:41 +00:00
|
|
|
{
|
2003-03-14 23:23:37 +00:00
|
|
|
(cwmWorldState->GetKeepRun())?ParsedContent.replace( Pos, strlen(ipToken), mServ->getIP().c_str()):ParsedContent.replace( Pos, strlen(ipToken), "Down" );
|
2012-11-03 18:11:04 +00:00
|
|
|
Pos = ParsedContent.find( ipToken );
|
2002-04-07 20:53:41 +00:00
|
|
|
}
|
|
|
|
|
}
|
2012-11-03 18:11:04 +00:00
|
|
|
|
|
|
|
|
char portToken[10]; // i think we'll never get higher than 2 digits, anyway...
|
2002-04-07 20:53:41 +00:00
|
|
|
sprintf( portToken, "%%port%i", i+1 );
|
|
|
|
|
|
2012-11-03 18:11:04 +00:00
|
|
|
if( mServ != NULL )
|
2002-04-07 20:53:41 +00:00
|
|
|
{
|
2012-11-03 18:11:04 +00:00
|
|
|
Pos = ParsedContent.find( portToken );
|
|
|
|
|
while( Pos != std::string::npos )
|
2002-04-07 20:53:41 +00:00
|
|
|
{
|
2012-11-03 18:11:04 +00:00
|
|
|
UString myPort = UString::number( mServ->getPort() );
|
2003-03-14 23:23:37 +00:00
|
|
|
(cwmWorldState->GetKeepRun())?ParsedContent.replace( Pos, strlen( portToken ), myPort ):ParsedContent.replace( Pos, strlen( portToken ), "NA" );
|
2012-11-03 18:11:04 +00:00
|
|
|
Pos = ParsedContent.find( portToken );
|
2002-04-07 20:53:41 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
char serverToken[10]; // i think we'll never get higher than 2 digits, anyway...
|
|
|
|
|
sprintf( serverToken, "%%server%i", i+1 );
|
|
|
|
|
|
2012-11-03 18:11:04 +00:00
|
|
|
if( mServ != NULL )
|
2002-04-07 20:53:41 +00:00
|
|
|
{
|
2012-11-03 18:11:04 +00:00
|
|
|
Pos = ParsedContent.find( serverToken );
|
|
|
|
|
while( Pos != std::string::npos )
|
2002-04-07 20:53:41 +00:00
|
|
|
{
|
2003-03-14 23:23:37 +00:00
|
|
|
(cwmWorldState->GetKeepRun())?ParsedContent.replace( Pos, strlen( serverToken ), mServ->getName().c_str() ):ParsedContent.replace( Pos, strlen( serverToken ), "Down" );
|
2012-11-03 18:11:04 +00:00
|
|
|
Pos = ParsedContent.find( serverToken );
|
2002-04-07 20:53:41 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// PLAYERLIST
|
2012-11-03 18:11:04 +00:00
|
|
|
Pos = ParsedContent.find( "%playerlist%" );
|
|
|
|
|
while( Pos != std::string::npos )
|
2002-04-07 20:53:41 +00:00
|
|
|
{
|
2012-11-03 18:11:04 +00:00
|
|
|
size_t SecondPos = ParsedContent.find( "%playerlist%", Pos+1 );
|
|
|
|
|
if( SecondPos == std::string::npos ) // there's no closing part!
|
|
|
|
|
break;
|
|
|
|
|
std::string myInline = ParsedContent.substr( Pos, SecondPos - Pos + 12 );
|
2003-01-13 15:58:29 +00:00
|
|
|
std::string PlayerList;
|
2002-04-07 20:53:41 +00:00
|
|
|
|
|
|
|
|
Network->PushConn();
|
|
|
|
|
for( tSock = Network->FirstSocket(); !Network->FinishedSockets(); tSock = Network->NextSocket() )
|
2012-11-03 18:11:04 +00:00
|
|
|
{
|
2002-10-01 00:57:59 +00:00
|
|
|
try
|
2002-04-07 20:53:41 +00:00
|
|
|
{
|
2002-10-01 00:57:59 +00:00
|
|
|
if( tSock != NULL )
|
2002-04-07 20:53:41 +00:00
|
|
|
{
|
2002-10-01 00:57:59 +00:00
|
|
|
CChar *tChar = tSock->CurrcharObj();
|
2012-11-03 18:11:04 +00:00
|
|
|
if( ValidateObject( tChar ) )
|
2002-04-07 20:53:41 +00:00
|
|
|
{
|
2003-01-13 15:58:29 +00:00
|
|
|
std::string parsedInline = myInline;
|
2002-10-01 00:57:59 +00:00
|
|
|
parsedInline.replace( 0, 12, "" );
|
|
|
|
|
parsedInline.replace( parsedInline.length()-12, 12, "" );
|
|
|
|
|
|
2012-11-03 18:11:04 +00:00
|
|
|
// Tokens for the PlayerList
|
|
|
|
|
// %playername
|
|
|
|
|
// %playertitle
|
|
|
|
|
// %playerip
|
|
|
|
|
// %playeraccount
|
|
|
|
|
// %playerx
|
|
|
|
|
// %playery
|
|
|
|
|
// %playerz
|
|
|
|
|
// %playerrace
|
|
|
|
|
// %playerregion
|
2002-10-01 00:57:59 +00:00
|
|
|
|
|
|
|
|
// PlayerName
|
2012-11-03 18:11:04 +00:00
|
|
|
size_t sPos = parsedInline.find( "%playername" );
|
|
|
|
|
while( sPos != std::string::npos )
|
2002-10-01 00:57:59 +00:00
|
|
|
{
|
2003-03-14 23:23:37 +00:00
|
|
|
(cwmWorldState->GetKeepRun())?parsedInline.replace( sPos, 11, tChar->GetName() ):parsedInline.replace( sPos, 11, "" );
|
2012-11-03 18:11:04 +00:00
|
|
|
sPos = parsedInline.find( "%playername" );
|
2002-10-01 00:57:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// PlayerTitle
|
2012-11-03 18:11:04 +00:00
|
|
|
sPos = parsedInline.find( "%playertitle" );
|
|
|
|
|
while( sPos != std::string::npos )
|
2002-10-01 00:57:59 +00:00
|
|
|
{
|
2003-03-14 23:23:37 +00:00
|
|
|
(cwmWorldState->GetKeepRun())?parsedInline.replace( sPos, 12, tChar->GetTitle() ):parsedInline.replace( sPos, 12, "" );
|
2012-11-03 18:11:04 +00:00
|
|
|
sPos = parsedInline.find( "%playertitle" );
|
2002-10-01 00:57:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// PlayerIP
|
2012-11-03 18:11:04 +00:00
|
|
|
sPos = parsedInline.find( "%playerip" );
|
|
|
|
|
while( sPos != std::string::npos )
|
2002-10-01 00:57:59 +00:00
|
|
|
{
|
2012-11-03 18:11:04 +00:00
|
|
|
CSocket *mySock = tChar->GetSocket();
|
2002-10-01 00:57:59 +00:00
|
|
|
char ClientIP[32];
|
|
|
|
|
sprintf( ClientIP, "%i.%i.%i.%i", mySock->ClientIP4(), mySock->ClientIP3(), mySock->ClientIP3(), mySock->ClientIP1() );
|
2003-03-14 23:23:37 +00:00
|
|
|
(cwmWorldState->GetKeepRun())?parsedInline.replace( sPos, 9, ClientIP ):parsedInline.replace( sPos, 9, "" );
|
2012-11-03 18:11:04 +00:00
|
|
|
sPos = parsedInline.find( "%playerip" );
|
2002-10-01 00:57:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// PlayerAccount
|
2012-11-03 18:11:04 +00:00
|
|
|
sPos = parsedInline.find( "%playeraccount" );
|
|
|
|
|
while( sPos != std::string::npos )
|
2002-10-01 00:57:59 +00:00
|
|
|
{
|
2012-11-03 18:11:04 +00:00
|
|
|
CAccountBlock& toScan = tChar->GetAccount();
|
|
|
|
|
if( toScan.wAccountIndex != AB_INVALID_ID )
|
2003-03-14 23:23:37 +00:00
|
|
|
(cwmWorldState->GetKeepRun())?parsedInline.replace( sPos, 14, toScan.sUsername):parsedInline.replace( sPos, 14, "" );
|
2012-11-03 18:11:04 +00:00
|
|
|
sPos = parsedInline.find( "%playeraccount" );
|
2002-10-01 00:57:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// PlayerX
|
2012-11-03 18:11:04 +00:00
|
|
|
sPos = parsedInline.find( "%playerx" );
|
|
|
|
|
while( sPos != std::string::npos )
|
2002-10-01 00:57:59 +00:00
|
|
|
{
|
2012-11-03 18:11:04 +00:00
|
|
|
UString myX = UString::number( tChar->GetX() );
|
2003-03-14 23:23:37 +00:00
|
|
|
(cwmWorldState->GetKeepRun())?parsedInline.replace( sPos, 8, myX ):parsedInline.replace( sPos, 8, "" );
|
2012-11-03 18:11:04 +00:00
|
|
|
sPos = parsedInline.find( "%playerx" );
|
2002-10-01 00:57:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// PlayerY
|
2012-11-03 18:11:04 +00:00
|
|
|
sPos = parsedInline.find( "%playery" );
|
|
|
|
|
while( sPos != std::string::npos )
|
2002-10-01 00:57:59 +00:00
|
|
|
{
|
2012-11-03 18:11:04 +00:00
|
|
|
UString myY = UString::number( tChar->GetY() );
|
2018-09-19 18:43:11 +08:00
|
|
|
(cwmWorldState->GetKeepRun())?parsedInline.replace( sPos, 8, myY ):parsedInline.replace( sPos, 8, "" );
|
2012-11-03 18:11:04 +00:00
|
|
|
sPos = parsedInline.find( "%playery" );
|
2002-10-01 00:57:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// PlayerZ
|
2012-11-03 18:11:04 +00:00
|
|
|
sPos = parsedInline.find( "%playerz" );
|
|
|
|
|
while( sPos != std::string::npos )
|
2002-10-01 00:57:59 +00:00
|
|
|
{
|
2012-11-03 18:11:04 +00:00
|
|
|
UString myZ = UString::number( tChar->GetZ() );
|
2003-03-14 23:23:37 +00:00
|
|
|
(cwmWorldState->GetKeepRun())?parsedInline.replace( sPos, 8, myZ ):parsedInline.replace( sPos, 8, "" );
|
2012-11-03 18:11:04 +00:00
|
|
|
sPos = parsedInline.find( "%playerz" );
|
2002-10-01 00:57:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// PlayerRace -- needs testing
|
2012-11-03 18:11:04 +00:00
|
|
|
sPos = parsedInline.find( "%playerrace" );
|
|
|
|
|
while( sPos != std::string::npos )
|
2002-10-01 00:57:59 +00:00
|
|
|
{
|
2012-11-03 18:11:04 +00:00
|
|
|
RACEID myRace = tChar->GetRace();
|
|
|
|
|
const std::string rName = Races->Name( myRace );
|
|
|
|
|
size_t raceLenName = rName.length();
|
|
|
|
|
|
|
|
|
|
if( raceLenName > 0 )
|
|
|
|
|
(cwmWorldState->GetKeepRun())?parsedInline.replace( sPos, 11, rName ):parsedInline.replace( sPos, 11, "");
|
|
|
|
|
sPos = parsedInline.find( "%playerrace" );
|
2002-10-01 00:57:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// PlayerRegion
|
2012-11-03 18:11:04 +00:00
|
|
|
sPos = parsedInline.find( "%playerregion" );
|
|
|
|
|
while( sPos != std::string::npos )
|
2002-10-01 00:57:59 +00:00
|
|
|
{
|
2012-11-03 18:11:04 +00:00
|
|
|
(cwmWorldState->GetKeepRun())?parsedInline.replace( sPos, 13, tChar->GetRegion()->GetName() ):parsedInline.replace( sPos, 13, "");
|
|
|
|
|
sPos = parsedInline.find( "%playerregion" );
|
2002-10-01 00:57:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PlayerList += parsedInline;
|
2002-04-07 20:53:41 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2012-11-03 18:11:04 +00:00
|
|
|
catch( ... )
|
2002-10-01 00:57:59 +00:00
|
|
|
{
|
|
|
|
|
Console << "| EXCEPTION: Invalid character/socket pointer found. Ignored." << myendl;
|
|
|
|
|
}
|
2002-04-07 20:53:41 +00:00
|
|
|
}
|
2012-11-03 18:11:04 +00:00
|
|
|
Network->PopConn();
|
2002-04-07 20:53:41 +00:00
|
|
|
|
2003-03-14 23:23:37 +00:00
|
|
|
(cwmWorldState->GetKeepRun())?ParsedContent.replace( Pos, myInline.length(), PlayerList ):ParsedContent.replace( Pos, myInline.length(), "");
|
2012-11-03 18:11:04 +00:00
|
|
|
Pos = ParsedContent.find( "%playerlist%" );
|
2002-04-07 20:53:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GuildCount
|
2012-11-03 18:11:04 +00:00
|
|
|
UString GuildCount = UString::number( GuildSys->NumGuilds() );
|
|
|
|
|
Pos = ParsedContent.find( "%guildcount" );
|
|
|
|
|
while( Pos != std::string::npos )
|
2002-04-07 20:53:41 +00:00
|
|
|
{
|
2012-11-03 18:11:04 +00:00
|
|
|
(cwmWorldState->GetKeepRun())?ParsedContent.replace( Pos, 11, GuildCount ):ParsedContent.replace( Pos, 11, "" );
|
|
|
|
|
Pos = ParsedContent.find( "%guildcount" );
|
2002-04-07 20:53:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GUILDLIST
|
2012-11-03 18:11:04 +00:00
|
|
|
Pos = ParsedContent.find( "%guildlist%" );
|
|
|
|
|
while( Pos != std::string::npos )
|
2002-04-07 20:53:41 +00:00
|
|
|
{
|
2012-11-03 18:11:04 +00:00
|
|
|
size_t SecondPos = ParsedContent.find( "%guildlist%", Pos+1 );
|
|
|
|
|
if( SecondPos == std::string::npos ) // can't find closing
|
|
|
|
|
break;
|
|
|
|
|
std::string myInline = ParsedContent.substr( Pos, SecondPos - Pos + 11 );
|
2003-01-13 15:58:29 +00:00
|
|
|
std::string GuildList;
|
2002-04-07 20:53:41 +00:00
|
|
|
|
2012-11-03 18:11:04 +00:00
|
|
|
for( SI16 i = 0; i < (SI16)GuildSys->NumGuilds(); ++i )
|
2002-04-07 20:53:41 +00:00
|
|
|
{
|
2003-01-13 15:58:29 +00:00
|
|
|
std::string parsedInline = myInline;
|
2002-04-07 20:53:41 +00:00
|
|
|
parsedInline.replace( 0, 11, "" );
|
|
|
|
|
parsedInline.replace( parsedInline.length()-11, 11, "" );
|
|
|
|
|
|
|
|
|
|
// Tokens for the GuildList
|
|
|
|
|
// %guildid
|
|
|
|
|
// %guildname
|
|
|
|
|
|
|
|
|
|
// GuildID
|
2012-11-03 18:11:04 +00:00
|
|
|
size_t sPos;
|
2002-04-07 20:53:41 +00:00
|
|
|
CGuild *myGuild = GuildSys->Guild( i );
|
|
|
|
|
|
2012-11-03 18:11:04 +00:00
|
|
|
UString GuildID = UString::number( i );
|
|
|
|
|
sPos = parsedInline.find( "%guildid" );
|
|
|
|
|
while( sPos != std::string::npos )
|
2002-04-07 20:53:41 +00:00
|
|
|
{
|
2003-03-14 23:23:37 +00:00
|
|
|
(cwmWorldState->GetKeepRun())?parsedInline.replace( sPos, 8, GuildID ):parsedInline.replace( sPos, 8, "" );
|
2012-11-03 18:11:04 +00:00
|
|
|
sPos = parsedInline.find( "%guildid" );
|
2002-04-07 20:53:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GuildName
|
2012-11-03 18:11:04 +00:00
|
|
|
sPos = parsedInline.find( "%guildname" );
|
|
|
|
|
while( sPos != std::string::npos )
|
2002-04-07 20:53:41 +00:00
|
|
|
{
|
2003-03-14 23:23:37 +00:00
|
|
|
(cwmWorldState->GetKeepRun())?parsedInline.replace( sPos, 10, myGuild->Name() ):parsedInline.replace( sPos, 10, "" );
|
2012-11-03 18:11:04 +00:00
|
|
|
sPos = parsedInline.find( "%guildname" );
|
2002-04-07 20:53:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GuildList += parsedInline;
|
|
|
|
|
}
|
|
|
|
|
|
2003-03-14 23:23:37 +00:00
|
|
|
(cwmWorldState->GetKeepRun())?ParsedContent.replace( Pos, myInline.length(), GuildList ):ParsedContent.replace( Pos, myInline.length(), "" );
|
2012-11-03 18:11:04 +00:00
|
|
|
Pos = ParsedContent.find( "%guildlist%" );
|
2002-04-07 20:53:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//NPCCount
|
|
|
|
|
UI32 npccount = 0;
|
2012-11-03 18:11:04 +00:00
|
|
|
UI32 b = 0;
|
|
|
|
|
ObjectFactory::getSingleton().IterateOver( OT_CHAR, b, NULL, &CountNPCFunctor );
|
|
|
|
|
npccount = b;
|
2002-04-07 20:53:41 +00:00
|
|
|
|
2012-11-03 18:11:04 +00:00
|
|
|
UString npcs = UString::number( npccount );
|
|
|
|
|
Pos = ParsedContent.find( "%npcs" );
|
|
|
|
|
while( Pos != std::string::npos )
|
2002-04-07 20:53:41 +00:00
|
|
|
{
|
2003-03-14 23:23:37 +00:00
|
|
|
(cwmWorldState->GetKeepRun())?ParsedContent.replace( Pos, 5, npcs ):ParsedContent.replace( Pos, 5, "0" );
|
2012-11-03 18:11:04 +00:00
|
|
|
Pos = ParsedContent.find( "%npcs" );
|
2002-04-07 20:53:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Performance Dump
|
2012-11-03 18:11:04 +00:00
|
|
|
R64 eps = 0.00000000001;
|
|
|
|
|
Pos = ParsedContent.find( "%performance" );
|
|
|
|
|
while( Pos != std::string::npos )
|
2002-04-07 20:53:41 +00:00
|
|
|
{
|
2003-01-13 15:58:29 +00:00
|
|
|
std::string performance;
|
|
|
|
|
std::ostringstream myStream( performance );
|
2012-11-03 18:11:04 +00:00
|
|
|
if( cwmWorldState->GetKeepRun() )
|
2002-09-23 05:26:26 +00:00
|
|
|
{
|
2012-11-03 18:11:04 +00:00
|
|
|
UI32 networkTimeCount = cwmWorldState->ServerProfile()->NetworkTimeCount();
|
|
|
|
|
UI32 timerTimeCount = cwmWorldState->ServerProfile()->TimerTimeCount();
|
|
|
|
|
UI32 autoTimeCount = cwmWorldState->ServerProfile()->AutoTimeCount();
|
|
|
|
|
UI32 loopTimeCount = cwmWorldState->ServerProfile()->LoopTimeCount();
|
|
|
|
|
myStream << "Network code: " << (R32)((R32)cwmWorldState->ServerProfile()->NetworkTime()/(R32)networkTimeCount) << "msec [" << networkTimeCount << " samples] <BR>";
|
|
|
|
|
myStream << "Timer code: " << (R32)((R32)cwmWorldState->ServerProfile()->TimerTime()/(R32)timerTimeCount) << "msec [" << timerTimeCount << " samples] <BR>";
|
|
|
|
|
myStream << "Auto code: " << (R32)((R32)cwmWorldState->ServerProfile()->AutoTime()/(R32)autoTimeCount) << "msec [" << autoTimeCount << " samples] <BR>";
|
|
|
|
|
myStream << "Loop Time: " << (R32)((R32)cwmWorldState->ServerProfile()->LoopTime()/(R32)loopTimeCount) << "msec [" << loopTimeCount << " samples] <BR>";
|
|
|
|
|
if( !( cwmWorldState->ServerProfile()->LoopTime() < eps || loopTimeCount < eps ) )
|
|
|
|
|
myStream << "Simulation Cycles: " << (1000.0*(1.0/(R32)((R32)cwmWorldState->ServerProfile()->LoopTime()/(R32)loopTimeCount))) << " per sec <BR>";
|
|
|
|
|
else
|
2002-09-23 05:26:26 +00:00
|
|
|
myStream << "Simulation Cycles: Greater than 10000 <BR> ";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
myStream << "Network code: 0" << "<BR>";
|
|
|
|
|
myStream << "Timer code: 0" << "<BR>";
|
|
|
|
|
myStream << "Auto code: 0" << "<BR>";
|
|
|
|
|
myStream << "Loop Time: 0" << "<BR>";
|
|
|
|
|
myStream << "Simulation Cycles: 0<BR>";
|
|
|
|
|
}
|
2012-11-03 18:11:04 +00:00
|
|
|
ParsedContent.replace( Pos, 12, myStream.str() );
|
|
|
|
|
Pos = ParsedContent.find( "%performance" );
|
2002-04-07 20:53:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Uptime
|
2012-11-03 18:11:04 +00:00
|
|
|
Pos = ParsedContent.find( "%uptime" );
|
|
|
|
|
while( Pos != std::string::npos )
|
|
|
|
|
{
|
|
|
|
|
UString builtString = GetUptime();
|
|
|
|
|
ParsedContent.replace( Pos, 7, builtString );
|
|
|
|
|
Pos = ParsedContent.find( "%uptime" );
|
2002-04-07 20:53:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Simulation Cycles (whatever that may be...)
|
2012-11-03 18:11:04 +00:00
|
|
|
Pos = ParsedContent.find( "%simcycles" );
|
|
|
|
|
while( Pos != std::string::npos )
|
2002-04-07 20:53:41 +00:00
|
|
|
{
|
2003-01-13 15:58:29 +00:00
|
|
|
std::string simcycles;
|
|
|
|
|
std::ostringstream myStream( simcycles );
|
2002-04-07 20:53:41 +00:00
|
|
|
|
2012-11-03 18:11:04 +00:00
|
|
|
if( cwmWorldState->GetKeepRun() )
|
2002-09-23 05:26:26 +00:00
|
|
|
{
|
2012-11-03 18:11:04 +00:00
|
|
|
if( !( cwmWorldState->ServerProfile()->LoopTime() < eps || cwmWorldState->ServerProfile()->LoopTimeCount() < eps ) )
|
|
|
|
|
myStream << "Simulation Cycles: " << (1000.0*(1.0/(R32)((R32)cwmWorldState->ServerProfile()->LoopTime()/(R32)cwmWorldState->ServerProfile()->LoopTimeCount()))) << " per sec <BR>";
|
|
|
|
|
else
|
2002-09-23 05:26:26 +00:00
|
|
|
myStream << "Simulation Cycles: Greater than 10000 <BR> ";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
myStream << "Simulation Cycles: 0<BR> ";
|
|
|
|
|
}
|
2012-11-03 18:11:04 +00:00
|
|
|
ParsedContent.replace( Pos, 10, myStream.str() );
|
|
|
|
|
Pos = ParsedContent.find( "%simcycles" );
|
2002-04-07 20:53:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Update Time in SECONDS
|
2012-11-03 18:11:04 +00:00
|
|
|
Pos = ParsedContent.find( "%updatetime" );
|
|
|
|
|
while( Pos != std::string::npos )
|
2002-04-07 20:53:41 +00:00
|
|
|
{
|
2012-11-03 18:11:04 +00:00
|
|
|
UString strUpdateTimer = UString::number( UpdateTimer );
|
2003-03-14 23:23:37 +00:00
|
|
|
(cwmWorldState->GetKeepRun())?ParsedContent.replace( Pos, 11, strUpdateTimer ):ParsedContent.replace( Pos, 11, "0" );
|
2012-11-03 18:11:04 +00:00
|
|
|
Pos = ParsedContent.find( "%updatetime" );
|
2002-04-07 20:53:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// End Replacing Placeholders
|
|
|
|
|
|
|
|
|
|
// Print the Content out to the new file...
|
2012-11-03 18:11:04 +00:00
|
|
|
std::ofstream Output;
|
|
|
|
|
Output.open( OutputFile.c_str(), std::ios::out );
|
|
|
|
|
if( Output.is_open() )
|
2002-04-07 20:53:41 +00:00
|
|
|
{
|
2012-11-03 18:11:04 +00:00
|
|
|
Output << ParsedContent;
|
|
|
|
|
Output.close();
|
2002-04-07 20:53:41 +00:00
|
|
|
}
|
2012-11-03 18:11:04 +00:00
|
|
|
else
|
|
|
|
|
Console.Error( " Couldn't open the template file %s for writing", OutputFile.c_str() );
|
2002-04-07 20:53:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//o---------------------------------------------------------------------------o
|
|
|
|
|
//| Function - cHTMLTemplate::Poll
|
|
|
|
|
//| Programmer - Dark-Storm
|
|
|
|
|
//o---------------------------------------------------------------------------o
|
|
|
|
|
//| Purpose - Updates the page if needed
|
|
|
|
|
//o---------------------------------------------------------------------------o
|
2012-11-03 18:11:04 +00:00
|
|
|
void cHTMLTemplate::Poll( void )
|
2002-04-07 20:53:41 +00:00
|
|
|
{
|
2012-11-03 18:11:04 +00:00
|
|
|
if( ScheduledUpdate < cwmWorldState->GetUICurrentTime() || !cwmWorldState->GetKeepRun() )
|
2002-04-07 20:53:41 +00:00
|
|
|
{
|
|
|
|
|
Process();
|
|
|
|
|
ScheduledUpdate = BuildTimeValue( (R32)UpdateTimer );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//o---------------------------------------------------------------------------o
|
|
|
|
|
//| Function - cHTMLTemplate::LoadTemplate
|
|
|
|
|
//| Programmer - Dark-Storm
|
2012-11-03 18:11:04 +00:00
|
|
|
//|
|
|
|
|
|
//| Modification - 08062003 - Updated this member function to actually handle
|
|
|
|
|
//| loading the different templates for use later.
|
2002-04-07 20:53:41 +00:00
|
|
|
//o---------------------------------------------------------------------------o
|
|
|
|
|
//| Purpose - Loads the Template into memory
|
|
|
|
|
//o---------------------------------------------------------------------------o
|
|
|
|
|
void cHTMLTemplate::LoadTemplate( void )
|
|
|
|
|
{
|
2012-11-03 18:11:04 +00:00
|
|
|
Content = "";
|
2002-04-07 20:53:41 +00:00
|
|
|
|
2012-11-03 18:11:04 +00:00
|
|
|
std::ifstream InputFile1( InputFile.c_str() );
|
2002-04-07 20:53:41 +00:00
|
|
|
|
2012-11-03 18:11:04 +00:00
|
|
|
if( !InputFile1.is_open() )
|
|
|
|
|
{
|
|
|
|
|
Console.Error( "Couldn't open HTML Template File %s", InputFile.c_str() );
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
while( !InputFile1.eof() && !InputFile1.fail() )
|
|
|
|
|
{
|
|
|
|
|
std::string Line;
|
|
|
|
|
std::getline( InputFile1, Line );
|
|
|
|
|
Content += Line;
|
|
|
|
|
}
|
2002-04-07 20:53:41 +00:00
|
|
|
|
2012-11-03 18:11:04 +00:00
|
|
|
InputFile1.close();
|
2002-04-07 20:53:41 +00:00
|
|
|
|
2012-11-03 18:11:04 +00:00
|
|
|
Loaded = true;
|
2002-04-07 20:53:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//o---------------------------------------------------------------------------o
|
|
|
|
|
//| Function - cHTMLTemplate::UnloadTemplate
|
|
|
|
|
//| Programmer - Dark-Storm
|
|
|
|
|
//o---------------------------------------------------------------------------o
|
|
|
|
|
//| Purpose - Unloads the Template (i.e. for reloading)
|
2012-11-03 18:11:04 +00:00
|
|
|
//|
|
|
|
|
|
//| Modification - 08062003 - EviLDeD - Updated to properly unload a template
|
|
|
|
|
//| and to unload the correect template, instead of just the
|
|
|
|
|
//| status template.
|
2002-04-07 20:53:41 +00:00
|
|
|
//o---------------------------------------------------------------------------o
|
|
|
|
|
void cHTMLTemplate::UnloadTemplate( void )
|
|
|
|
|
{
|
2012-11-03 18:11:04 +00:00
|
|
|
Content="";
|
2002-04-07 20:53:41 +00:00
|
|
|
Loaded = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//o---------------------------------------------------------------------------o
|
|
|
|
|
//| Function - cHTMLTemplate::Load
|
|
|
|
|
//| Programmer - Dark-Storm
|
|
|
|
|
//o---------------------------------------------------------------------------o
|
|
|
|
|
//| Purpose - Loads the HTML Template from a ScriptSection
|
|
|
|
|
//o---------------------------------------------------------------------------o
|
|
|
|
|
void cHTMLTemplate::Load( ScriptSection *found )
|
|
|
|
|
{
|
2012-11-03 18:11:04 +00:00
|
|
|
UString tag, data, UTag, UData, fullPath;
|
2002-04-07 20:53:41 +00:00
|
|
|
|
|
|
|
|
for( tag = found->First(); !found->AtEnd(); tag = found->Next() )
|
|
|
|
|
{
|
|
|
|
|
data = found->GrabData();
|
2012-11-03 18:11:04 +00:00
|
|
|
UTag = tag.upper();
|
|
|
|
|
|
|
|
|
|
if( UTag == "UPDATE" )
|
|
|
|
|
UpdateTimer = data.toULong();
|
|
|
|
|
else if( UTag == "TYPE" )
|
2002-04-07 20:53:41 +00:00
|
|
|
{
|
2012-11-03 18:11:04 +00:00
|
|
|
UData = data.upper();
|
|
|
|
|
if( UData == "STATUS" )
|
|
|
|
|
Type = ETT_ONLINE;
|
|
|
|
|
else if( UData == "OFFLINE" )
|
2002-04-07 20:53:41 +00:00
|
|
|
Type = ETT_OFFLINE;
|
2012-11-03 18:11:04 +00:00
|
|
|
else if( UData == "PLAYER" )
|
2002-04-07 20:53:41 +00:00
|
|
|
Type = ETT_PLAYER;
|
2012-11-03 18:11:04 +00:00
|
|
|
else if( UData == "GUILD" )
|
2002-04-07 20:53:41 +00:00
|
|
|
Type = ETT_GUILD;
|
2012-11-03 18:11:04 +00:00
|
|
|
else if( UData == "GMSTATUS" )
|
|
|
|
|
Type = ETT_GMSTATUS;
|
2002-04-07 20:53:41 +00:00
|
|
|
}
|
2012-11-03 18:11:04 +00:00
|
|
|
else if( UTag == "INPUT" )
|
2002-04-07 20:53:41 +00:00
|
|
|
{
|
2012-11-03 18:11:04 +00:00
|
|
|
fullPath = cwmWorldState->ServerData()->Directory( CSDDP_DEFS ) + "html/" + data;
|
|
|
|
|
InputFile = fullPath.stripWhiteSpace().substr( 0, MAX_PATH - 1 );
|
2002-04-07 20:53:41 +00:00
|
|
|
}
|
2012-11-03 18:11:04 +00:00
|
|
|
else if( UTag == "OUTPUT" )
|
2002-04-07 20:53:41 +00:00
|
|
|
{
|
2012-11-03 18:11:04 +00:00
|
|
|
fullPath = cwmWorldState->ServerData()->Directory( CSDDP_HTML ) + data;
|
|
|
|
|
OutputFile = fullPath.stripWhiteSpace().substr( 0, MAX_PATH - 1 );
|
2002-04-07 20:53:41 +00:00
|
|
|
}
|
2012-11-03 18:11:04 +00:00
|
|
|
else if( UTag == "NAME" )
|
2002-04-07 20:53:41 +00:00
|
|
|
Name = data;
|
|
|
|
|
}
|
2012-11-03 18:11:04 +00:00
|
|
|
|
2002-04-07 20:53:41 +00:00
|
|
|
ScheduledUpdate = 0;
|
|
|
|
|
Loaded = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cHTMLTemplates::cHTMLTemplates()
|
|
|
|
|
{
|
2012-11-03 18:11:04 +00:00
|
|
|
Templates.resize( 0 );
|
2002-04-07 20:53:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cHTMLTemplates::~cHTMLTemplates()
|
|
|
|
|
{
|
2012-11-03 18:11:04 +00:00
|
|
|
Unload();
|
2002-04-07 20:53:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//o---------------------------------------------------------------------------o
|
|
|
|
|
//| Function - cHTMLTemplates::Load
|
|
|
|
|
//| Programmer - Dark-Storm
|
|
|
|
|
//o---------------------------------------------------------------------------o
|
|
|
|
|
//| Purpose - Loads the HTML Templates from the scripts
|
|
|
|
|
//o---------------------------------------------------------------------------o
|
|
|
|
|
void cHTMLTemplates::Load( void )
|
|
|
|
|
{
|
2012-11-03 18:11:04 +00:00
|
|
|
for( Script *toCheck = FileLookup->FirstScript( html_def ); !FileLookup->FinishedScripts( html_def ); toCheck = FileLookup->NextScript( html_def ) )
|
2002-04-07 20:53:41 +00:00
|
|
|
{
|
2012-11-03 18:11:04 +00:00
|
|
|
if( toCheck != NULL )
|
2002-04-07 20:53:41 +00:00
|
|
|
{
|
2012-11-03 18:11:04 +00:00
|
|
|
size_t NumEntries = toCheck->NumEntries();
|
2002-04-07 20:53:41 +00:00
|
|
|
if( NumEntries == 0 )
|
2012-11-03 18:11:04 +00:00
|
|
|
continue;
|
2002-04-07 20:53:41 +00:00
|
|
|
|
|
|
|
|
for( ScriptSection *found = toCheck->FirstEntry(); found != NULL; found = toCheck->NextEntry() )
|
|
|
|
|
{
|
|
|
|
|
cHTMLTemplate *Template = new cHTMLTemplate();
|
|
|
|
|
Template->Load( found );
|
|
|
|
|
Templates.push_back( Template );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//o---------------------------------------------------------------------------o
|
|
|
|
|
//| Function - cHTMLTemplates::Unload
|
|
|
|
|
//| Programmer - Dark-Storm
|
|
|
|
|
//o---------------------------------------------------------------------------o
|
|
|
|
|
//| Purpose - Unloads all Templates
|
|
|
|
|
//o---------------------------------------------------------------------------o
|
|
|
|
|
void cHTMLTemplates::Unload( void )
|
|
|
|
|
{
|
2012-11-03 18:11:04 +00:00
|
|
|
if( Templates.empty() )
|
2002-04-07 20:53:41 +00:00
|
|
|
return;
|
|
|
|
|
|
2012-11-03 18:11:04 +00:00
|
|
|
for( size_t i = 0; i < Templates.size(); ++i )
|
2002-04-07 20:53:41 +00:00
|
|
|
{
|
2012-11-03 18:11:04 +00:00
|
|
|
delete Templates[ i ];
|
|
|
|
|
Templates[i] = NULL;
|
2002-04-07 20:53:41 +00:00
|
|
|
}
|
|
|
|
|
Templates.clear();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//o---------------------------------------------------------------------------o
|
|
|
|
|
//| Function - cHTMLTemplates::Poll
|
|
|
|
|
//| Programmer - Dark-Storm
|
|
|
|
|
//o---------------------------------------------------------------------------o
|
|
|
|
|
//| Purpose - Polls the templates for updates
|
|
|
|
|
//o---------------------------------------------------------------------------o
|
2012-11-03 18:11:04 +00:00
|
|
|
void cHTMLTemplates::Poll( ETemplateType nTemplateID )
|
2002-04-07 20:53:41 +00:00
|
|
|
{
|
2012-11-03 18:11:04 +00:00
|
|
|
std::vector< cHTMLTemplate* >::const_iterator tIter;
|
|
|
|
|
for( tIter = Templates.begin(); tIter != Templates.end(); ++tIter )
|
2002-04-07 20:53:41 +00:00
|
|
|
{
|
2012-11-03 18:11:04 +00:00
|
|
|
cHTMLTemplate *toPoll = (*tIter);
|
|
|
|
|
if( toPoll != NULL )
|
|
|
|
|
{
|
|
|
|
|
if( nTemplateID == -1 || toPoll->GetTemplateType() == nTemplateID )
|
|
|
|
|
toPoll->Poll();
|
|
|
|
|
}
|
2002-04-07 20:53:41 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//o---------------------------------------------------------------------------o
|
|
|
|
|
//| Function - cHTMLTemplates::TemplateInfoGump
|
|
|
|
|
//| Programmer - Dark-Storm
|
|
|
|
|
//o---------------------------------------------------------------------------o
|
|
|
|
|
//| Purpose - Shows an information gump about current templates
|
|
|
|
|
//o---------------------------------------------------------------------------o
|
2012-11-03 18:11:04 +00:00
|
|
|
void cHTMLTemplates::TemplateInfoGump( CSocket *mySocket )
|
2002-04-07 20:53:41 +00:00
|
|
|
{
|
|
|
|
|
CGump InfoGump = CGump( false, false );
|
|
|
|
|
|
|
|
|
|
InfoGump.SetSerial( 1 ); // Serial for the HTML Status Callback
|
|
|
|
|
|
|
|
|
|
InfoGump.StartPage();
|
|
|
|
|
// Add an exit button
|
2012-11-03 18:11:04 +00:00
|
|
|
InfoGump.AddButton( 40, 300, cwmWorldState->ServerData()->ButtonCancel(), static_cast<UI16>( cwmWorldState->ServerData()->ButtonCancel() + 1 ), 1, 0, 0 );
|
2002-04-07 20:53:41 +00:00
|
|
|
|
2012-11-03 18:11:04 +00:00
|
|
|
InfoGump.AddBackground( 0, 0, cwmWorldState->ServerData()->BackgroundPic(), 350, 350 );
|
2002-04-07 20:53:41 +00:00
|
|
|
|
|
|
|
|
// 10 Max Templates per page
|
|
|
|
|
UI32 Entries = 0; // Entries per page
|
2012-11-03 18:11:04 +00:00
|
|
|
UI16 CurrentPage = 0; // Page
|
2002-04-07 20:53:41 +00:00
|
|
|
|
2018-09-19 18:43:11 +08:00
|
|
|
for( unsigned int i = 0; i < Templates.size(); ++i )
|
2002-04-07 20:53:41 +00:00
|
|
|
{
|
|
|
|
|
if( Entries == 0 )
|
|
|
|
|
{
|
|
|
|
|
// We should add a next button if we're not starting the first page
|
|
|
|
|
if( CurrentPage != 0 )
|
2012-11-03 18:11:04 +00:00
|
|
|
InfoGump.AddButton( 300, 250, cwmWorldState->ServerData()->ButtonRight(), static_cast<UI16>( cwmWorldState->ServerData()->ButtonRight() + 1 ), 0, static_cast<UI16>( CurrentPage + 1 ), 0 );
|
2002-04-07 20:53:41 +00:00
|
|
|
|
|
|
|
|
CurrentPage = InfoGump.StartPage();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// If we're not on the first page add the "back" button
|
|
|
|
|
if( CurrentPage > 1 )
|
2012-11-03 18:11:04 +00:00
|
|
|
InfoGump.AddButton( 30, 250, cwmWorldState->ServerData()->ButtonLeft(), static_cast<UI16>( cwmWorldState->ServerData()->ButtonLeft() + 1 ), 0, static_cast<UI16>( CurrentPage - 1 ), 0 );
|
2002-04-07 20:53:41 +00:00
|
|
|
|
2012-11-03 18:11:04 +00:00
|
|
|
++Entries;
|
2002-04-07 20:53:41 +00:00
|
|
|
|
|
|
|
|
// ~25 pixel per entry
|
|
|
|
|
char tmpName[256];
|
|
|
|
|
sprintf( tmpName, "%s (%i)", Templates[ i ]->GetName().c_str(), i );
|
|
|
|
|
|
2012-11-03 18:11:04 +00:00
|
|
|
InfoGump.AddText( 40, static_cast<UI16>( 40 + (Entries-1)*25 ), cwmWorldState->ServerData()->LeftTextColour(), tmpName );
|
|
|
|
|
|
2002-04-07 20:53:41 +00:00
|
|
|
if( Entries == 5 )
|
|
|
|
|
Entries = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
InfoGump.Send( mySocket );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//o---------------------------------------------------------------------------o
|
|
|
|
|
//| Function - cHTMLTemplates::GetName
|
|
|
|
|
//| Programmer - Dark-Storm
|
|
|
|
|
//o---------------------------------------------------------------------------o
|
|
|
|
|
//| Purpose - Returns the name of the Template
|
|
|
|
|
//o---------------------------------------------------------------------------o
|
2012-11-03 18:11:04 +00:00
|
|
|
std::string cHTMLTemplate::GetName( void ) const
|
2002-04-07 20:53:41 +00:00
|
|
|
{
|
|
|
|
|
return Name;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//o---------------------------------------------------------------------------o
|
|
|
|
|
//| Function - cHTMLTemplates::GetOutput
|
|
|
|
|
//| Programmer - Dark-Storm
|
|
|
|
|
//o---------------------------------------------------------------------------o
|
|
|
|
|
//| Purpose - Gets the Output Filename
|
|
|
|
|
//o---------------------------------------------------------------------------o
|
2012-11-03 18:11:04 +00:00
|
|
|
std::string cHTMLTemplate::GetOutput( void ) const
|
2002-04-07 20:53:41 +00:00
|
|
|
{
|
|
|
|
|
return OutputFile;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//o---------------------------------------------------------------------------o
|
|
|
|
|
//| Function - cHTMLTemplates::GetInput
|
|
|
|
|
//| Programmer - Dark-Storm
|
|
|
|
|
//o---------------------------------------------------------------------------o
|
|
|
|
|
//| Purpose - Gets the Input Filename
|
|
|
|
|
//o---------------------------------------------------------------------------o
|
2012-11-03 18:11:04 +00:00
|
|
|
std::string cHTMLTemplate::GetInput( void ) const
|
2002-04-07 20:53:41 +00:00
|
|
|
{
|
|
|
|
|
return InputFile;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//o---------------------------------------------------------------------------o
|
|
|
|
|
//| Function - cHTMLTemplates::TemplateInfoGump
|
|
|
|
|
//| Programmer - Dark-Storm
|
|
|
|
|
//o---------------------------------------------------------------------------o
|
|
|
|
|
//| Purpose - Gets the next scheduled Update time
|
|
|
|
|
//o---------------------------------------------------------------------------o
|
2012-11-03 18:11:04 +00:00
|
|
|
UI32 cHTMLTemplate::GetScheduledUpdate( void ) const
|
2002-04-07 20:53:41 +00:00
|
|
|
{
|
|
|
|
|
return ScheduledUpdate;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//o---------------------------------------------------------------------------o
|
|
|
|
|
//| Function - cHTMLTemplates::GetUpdateTimer
|
|
|
|
|
//| Programmer - Dark-Storm
|
|
|
|
|
//o---------------------------------------------------------------------------o
|
|
|
|
|
//| Purpose - Gets the Update timer
|
|
|
|
|
//o---------------------------------------------------------------------------o
|
2012-11-03 18:11:04 +00:00
|
|
|
UI32 cHTMLTemplate::GetUpdateTimer( void ) const
|
2002-04-07 20:53:41 +00:00
|
|
|
{
|
|
|
|
|
return UpdateTimer;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//o---------------------------------------------------------------------------o
|
|
|
|
|
//| Function - cHTMLTemplate::GetTemplateType
|
|
|
|
|
//| Programmer - Dark-Storm
|
|
|
|
|
//o---------------------------------------------------------------------------o
|
|
|
|
|
//| Purpose - Gets the Template Type
|
|
|
|
|
//o---------------------------------------------------------------------------o
|
2012-11-03 18:11:04 +00:00
|
|
|
ETemplateType cHTMLTemplate::GetTemplateType( void ) const
|
2002-04-07 20:53:41 +00:00
|
|
|
{
|
|
|
|
|
return Type;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|