Pol  Revision:3cfda13
Pol::Accounts::AccountObjImp Class Reference

#include <acscrobj.h>

+ Inheritance diagram for Pol::Accounts::AccountObjImp:

Public Member Functions

 AccountObjImp (const AccountPtrHolder &other)
 
virtual Bscript::BObjectImpcall_method (const char *methodname, Bscript::Executor &ex) POL_OVERRIDE
 [1] Account Scripting Object Methods More...
 
virtual Bscript::BObjectImpcall_method_id (const int id, Bscript::Executor &ex, bool forcebuiltin=false) POL_OVERRIDE
 [1] Account Scripting Object Methods More...
 
virtual Bscript::BObjectImpcopy () const POL_OVERRIDE
 
virtual Bscript::BObjectRef get_member (const char *membername) POL_OVERRIDE
 
virtual Bscript::BObjectRef get_member_id (const int id) POL_OVERRIDE
 [2] Account Scripting Object Members MemberName Type Access name string read-only enabled boolean read-only banned boolean read-only More...
 
virtual const char * typeOf () const POL_OVERRIDE
 
virtual u8 typeOfInt () const POL_OVERRIDE
 
- Public Member Functions inherited from Pol::Bscript::BApplicObj< AccountPtrHolder >
 BApplicObj (const BApplicObjType *object_type)
 
 BApplicObj (const BApplicObjType *, const AccountPtrHolder &)
 
AccountPtrHolder * operator-> ()
 
virtual size_t sizeEstimate () const POL_OVERRIDE
 
AccountPtrHolder & value ()
 
const AccountPtrHolder & value () const
 
- Public Member Functions inherited from Pol::Bscript::BApplicObjBase
 BApplicObjBase (const BApplicObjType *object_type)
 
virtual std::string getStringRep () const POL_OVERRIDE
 
const BApplicObjTypeobject_type () const
 
virtual void printOn (std::ostream &) const POL_OVERRIDE
 
- Public Member Functions inherited from Pol::Bscript::BObjectImp
 BObjectImp (BObjectType type)
 
virtual ~BObjectImp ()
 
virtual BObjectImparray_assign (BObjectImp *idx, BObjectImp *target, bool copy)
 
virtual BObjectImpbitnot () const
 
virtual long contains (const BObjectImp &objimp) const
 
virtual ContIteratorcreateIterator (BObject *pIterVal)
 
virtual std::string getFormattedStringRep () const
 
unsigned int instance () const
 
virtual BObjectImpinverse () const
 
bool isa (BObjectType type) const
 
virtual bool isTrue () const
 
virtual char member (const BObject &obj) const
 
virtual bool operator!= (const BObjectImp &objimp) const
 
virtual BObject operator- () const
 
virtual bool operator< (const BObjectImp &objimp) const
 
virtual bool operator<= (const BObjectImp &objimp) const
 
virtual bool operator== (const BObjectImp &objimp) const
 
virtual bool operator> (const BObjectImp &objimp) const
 
virtual bool operator>= (const BObjectImp &objimp) const
 
virtual void operDivideEqual (BObject &obj, BObjectImp &objimp)
 
virtual BObjectRef operDotMinus (const char *name)
 
virtual BObjectRef operDotPlus (const char *name)
 
virtual BObjectRef operDotQMark (const char *name)
 
virtual void operInsertInto (BObject &obj, const BObjectImp &objimp)
 
virtual void operMinusEqual (BObject &obj, BObjectImp &objimp)
 
virtual void operModulusEqual (BObject &obj, BObjectImp &objimp)
 
virtual BObjectRef OperMultiSubscript (std::stack< BObjectRef > &indices)
 
virtual BObjectRef OperMultiSubscriptAssign (std::stack< BObjectRef > &indices, BObjectImp *target)
 
virtual void operPlusEqual (BObject &obj, BObjectImp &objimp)
 
virtual BObjectRef OperSubscript (const BObject &obj)
 
virtual void operTimesEqual (BObject &obj, BObjectImp &objimp)
 
virtual std::string pack () const
 
virtual void packonto (std::ostream &os) const
 
virtual BObjectImpselfBitAndObj (const BObjectImp &objimp) const
 
virtual BObjectImpselfBitAndObj (const BLong &objimp) const
 
virtual BObjectImpselfBitAndObj (const Double &objimp) const
 
virtual BObjectImpselfBitAndObj (const String &objimp) const
 
virtual BObjectImpselfBitAndObj (const ObjArray &objimp) const
 
virtual void selfBitAndObj (BObjectImp &objimp, BObject &obj)
 
virtual void selfBitAndObj (BLong &objimp, BObject &obj)
 
virtual void selfBitAndObj (Double &objimp, BObject &obj)
 
virtual void selfBitAndObj (String &objimp, BObject &obj)
 
virtual void selfBitAndObj (ObjArray &objimp, BObject &obj)
 
virtual BObjectImpselfBitAndObjImp (const BObjectImp &objimp) const
 
virtual void selfBitAndObjImp (BObjectImp &objimp, BObject &obj)
 
virtual BObjectImpselfBitOrObj (const BObjectImp &objimp) const
 
virtual BObjectImpselfBitOrObj (const BLong &objimp) const
 
virtual BObjectImpselfBitOrObj (const Double &objimp) const
 
virtual BObjectImpselfBitOrObj (const String &objimp) const
 
virtual BObjectImpselfBitOrObj (const ObjArray &objimp) const
 
virtual void selfBitOrObj (BObjectImp &objimp, BObject &obj)
 
virtual void selfBitOrObj (BLong &objimp, BObject &obj)
 
virtual void selfBitOrObj (Double &objimp, BObject &obj)
 
virtual void selfBitOrObj (String &objimp, BObject &obj)
 
virtual void selfBitOrObj (ObjArray &objimp, BObject &obj)
 
virtual BObjectImpselfBitOrObjImp (const BObjectImp &objimp) const
 
virtual void selfBitOrObjImp (BObjectImp &objimp, BObject &obj)
 
virtual BObjectImpselfBitShiftLeftObj (const BObjectImp &objimp) const
 
virtual BObjectImpselfBitShiftLeftObj (const BLong &objimp) const
 
virtual BObjectImpselfBitShiftLeftObj (const Double &objimp) const
 
virtual BObjectImpselfBitShiftLeftObj (const String &objimp) const
 
virtual BObjectImpselfBitShiftLeftObj (const ObjArray &objimp) const
 
virtual void selfBitShiftLeftObj (BObjectImp &objimp, BObject &obj)
 
virtual void selfBitShiftLeftObj (BLong &objimp, BObject &obj)
 
virtual void selfBitShiftLeftObj (Double &objimp, BObject &obj)
 
virtual void selfBitShiftLeftObj (String &objimp, BObject &obj)
 
virtual void selfBitShiftLeftObj (ObjArray &objimp, BObject &obj)
 
virtual BObjectImpselfBitShiftLeftObjImp (const BObjectImp &objimp) const
 
virtual void selfBitShiftLeftObjImp (BObjectImp &objimp, BObject &obj)
 
virtual BObjectImpselfBitShiftRightObj (const BObjectImp &objimp) const
 
virtual BObjectImpselfBitShiftRightObj (const BLong &objimp) const
 
virtual BObjectImpselfBitShiftRightObj (const Double &objimp) const
 
virtual BObjectImpselfBitShiftRightObj (const String &objimp) const
 
virtual BObjectImpselfBitShiftRightObj (const ObjArray &objimp) const
 
virtual void selfBitShiftRightObj (BObjectImp &objimp, BObject &obj)
 
virtual void selfBitShiftRightObj (BLong &objimp, BObject &obj)
 
virtual void selfBitShiftRightObj (Double &objimp, BObject &obj)
 
virtual void selfBitShiftRightObj (String &objimp, BObject &obj)
 
virtual void selfBitShiftRightObj (ObjArray &objimp, BObject &obj)
 
virtual BObjectImpselfBitShiftRightObjImp (const BObjectImp &objimp) const
 
virtual void selfBitShiftRightObjImp (BObjectImp &objimp, BObject &obj)
 
virtual BObjectImpselfBitXorObj (const BObjectImp &objimp) const
 
virtual BObjectImpselfBitXorObj (const BLong &objimp) const
 
virtual BObjectImpselfBitXorObj (const Double &objimp) const
 
virtual BObjectImpselfBitXorObj (const String &objimp) const
 
virtual BObjectImpselfBitXorObj (const ObjArray &objimp) const
 
virtual void selfBitXorObj (BObjectImp &objimp, BObject &obj)
 
virtual void selfBitXorObj (BLong &objimp, BObject &obj)
 
virtual void selfBitXorObj (Double &objimp, BObject &obj)
 
virtual void selfBitXorObj (String &objimp, BObject &obj)
 
virtual void selfBitXorObj (ObjArray &objimp, BObject &obj)
 
virtual BObjectImpselfBitXorObjImp (const BObjectImp &objimp) const
 
virtual void selfBitXorObjImp (BObjectImp &objimp, BObject &obj)
 
virtual BObjectImpselfDividedByObj (const BObjectImp &objimp) const
 
virtual BObjectImpselfDividedByObj (const BLong &objimp) const
 
virtual BObjectImpselfDividedByObj (const Double &objimp) const
 
virtual BObjectImpselfDividedByObj (const String &objimp) const
 
virtual BObjectImpselfDividedByObj (const ObjArray &objimp) const
 
virtual void selfDividedByObj (BObjectImp &objimp, BObject &obj)
 
virtual void selfDividedByObj (BLong &objimp, BObject &obj)
 
virtual void selfDividedByObj (Double &objimp, BObject &obj)
 
virtual void selfDividedByObj (String &objimp, BObject &obj)
 
virtual void selfDividedByObj (ObjArray &objimp, BObject &obj)
 
virtual BObjectImpselfDividedByObjImp (const BObjectImp &objimp) const
 
virtual void selfDividedByObjImp (BObjectImp &objimp, BObject &obj)
 
virtual BObjectImpselfMinusObj (const BObjectImp &objimp) const
 
virtual BObjectImpselfMinusObj (const BLong &objimp) const
 
virtual BObjectImpselfMinusObj (const Double &objimp) const
 
virtual BObjectImpselfMinusObj (const String &objimp) const
 
virtual BObjectImpselfMinusObj (const ObjArray &objimp) const
 
virtual void selfMinusObj (BObjectImp &objimp, BObject &obj)
 
virtual void selfMinusObj (BLong &objimp, BObject &obj)
 
virtual void selfMinusObj (Double &objimp, BObject &obj)
 
virtual void selfMinusObj (String &objimp, BObject &obj)
 
virtual void selfMinusObj (ObjArray &objimp, BObject &obj)
 
virtual BObjectImpselfMinusObjImp (const BObjectImp &objimp) const
 
virtual void selfMinusObjImp (BObjectImp &objimp, BObject &obj)
 
virtual BObjectImpselfModulusObj (const BObjectImp &objimp) const
 
virtual BObjectImpselfModulusObj (const BLong &objimp) const
 
virtual BObjectImpselfModulusObj (const Double &objimp) const
 
virtual BObjectImpselfModulusObj (const String &objimp) const
 
virtual BObjectImpselfModulusObj (const ObjArray &objimp) const
 
virtual void selfModulusObj (BObjectImp &objimp, BObject &obj)
 
virtual void selfModulusObj (BLong &objimp, BObject &obj)
 
virtual void selfModulusObj (Double &objimp, BObject &obj)
 
virtual void selfModulusObj (String &objimp, BObject &obj)
 
virtual void selfModulusObj (ObjArray &objimp, BObject &obj)
 
virtual BObjectImpselfModulusObjImp (const BObjectImp &objimp) const
 
virtual void selfModulusObjImp (BObjectImp &objimp, BObject &obj)
 
virtual BObjectImpselfPlusObj (const BObjectImp &objimp) const
 
virtual BObjectImpselfPlusObj (const BLong &objimp) const
 
virtual BObjectImpselfPlusObj (const Double &objimp) const
 
virtual BObjectImpselfPlusObj (const String &objimp) const
 
virtual BObjectImpselfPlusObj (const ObjArray &objimp) const
 
virtual void selfPlusObj (BObjectImp &objimp, BObject &obj)
 
virtual void selfPlusObj (BLong &objimp, BObject &obj)
 
virtual void selfPlusObj (Double &objimp, BObject &obj)
 
virtual void selfPlusObj (String &objimp, BObject &obj)
 
virtual void selfPlusObj (ObjArray &objimp, BObject &obj)
 
virtual BObjectImpselfPlusObjImp (const BObjectImp &objimp) const
 
virtual void selfPlusObjImp (BObjectImp &objimp, BObject &obj)
 
virtual BObjectImpselfTimesObj (const BObjectImp &objimp) const
 
virtual BObjectImpselfTimesObj (const BLong &objimp) const
 
virtual BObjectImpselfTimesObj (const Double &objimp) const
 
virtual BObjectImpselfTimesObj (const String &objimp) const
 
virtual BObjectImpselfTimesObj (const ObjArray &objimp) const
 
virtual void selfTimesObj (BObjectImp &objimp, BObject &obj)
 
virtual void selfTimesObj (BLong &objimp, BObject &obj)
 
virtual void selfTimesObj (Double &objimp, BObject &obj)
 
virtual void selfTimesObj (String &objimp, BObject &obj)
 
virtual void selfTimesObj (ObjArray &objimp, BObject &obj)
 
virtual BObjectImpselfTimesObjImp (const BObjectImp &objimp) const
 
virtual void selfTimesObjImp (BObjectImp &objimp, BObject &obj)
 
virtual BObjectRef set_member (const char *membername, BObjectImp *valueimp, bool copy)
 
virtual BObjectRef set_member_id (const int id, BObjectImp *valueimp, bool copy)
 
virtual char str_member (const std::string &membername) const
 
BObjectType type () const
 
- Public Member Functions inherited from ref_counted
unsigned int add_ref ()
 
unsigned int count () const
 
unsigned int release ()
 

Private Types

typedef Bscript::BApplicObj< AccountPtrHolderbase
 

Additional Inherited Members

- Public Types inherited from Pol::Bscript::BObjectImp
enum  BObjectType : u8 {
  OTUnknown = 0, OTUninit = 1, OTString = 2, OTLong = 3,
  OTDouble = 4, OTArray = 5, OTApplicPtr = 6, OTApplicObj = 7,
  OTError = 8, OTDictionary = 9, OTStruct = 10, OTPacket = 11,
  OTBinaryFile = 12, OTXMLFile = 13, OTXMLNode = 14, OTXMLAttributes = 15,
  OTPolCoreRef = 16, OTAccountRef = 17, OTConfigFileRef = 18, OTConfigElemRef = 19,
  OTDataFileRef = 20, OTDataElemRef = 21, OTGuildRef = 22, OTPartyRef = 23,
  OTBoundingBox = 24, OTDebugContext = 25, OTScriptExRef = 26, OTPackage = 27,
  OTMenuRef = 28, OTMobileRef = 29, OTOfflineMobileRef = 30, OTItemRef = 31,
  OTBoatRef = 32, OTMultiRef = 33, OTClientRef = 34, OTSQLConnection = 35,
  OTSQLResultSet = 36, OTSQLRow = 37, OTBoolean = 38, OTFuncRef = 39
}
 
- Static Public Member Functions inherited from Pol::Bscript::BObjectImp
static const char * typestr (BObjectType typ)
 
static BObjectImpunpack (const char *pstr)
 
static BObjectImpunpack (std::istream &is)
 
- Protected Member Functions inherited from ref_counted
 ref_counted ()
 
- Protected Attributes inherited from Pol::Bscript::BApplicObj< AccountPtrHolder >
AccountPtrHolder obj_
 
- Protected Attributes inherited from ref_counted
std::atomic< unsigned int > _count
 

Detailed Description

Definition at line 45 of file acscrobj.h.

Member Typedef Documentation

Constructor & Destructor Documentation

Pol::Accounts::AccountObjImp::AccountObjImp ( const AccountPtrHolder other)
inlineexplicit

Definition at line 50 of file acscrobj.h.

References POL_OVERRIDE.

Member Function Documentation

Bscript::BObjectImp * Pol::Accounts::AccountObjImp::call_method ( const char *  methodname,
Bscript::Executor ex 
)
virtual

[1] Account Scripting Object Methods

All methods except GetProp and GetCharacter return 1 on success All methods except GetProp and GetCharacter write the accounts.txt file on success. All methods return Error("Not enough parameters") if too few parameters were passed. All methods return Error("Invalid parameter type") if the wrong type was passed.

Reimplemented from Pol::Bscript::BObjectImp.

Definition at line 542 of file acscrobj.cpp.

References Pol::Bscript::getKnownObjMethod(), and Pol::Bscript::ObjMethod::id.

Bscript::BObjectImp * Pol::Accounts::AccountObjImp::call_method_id ( const int  id,
Bscript::Executor ex,
bool  forcebuiltin = false 
)
virtual

[1] Account Scripting Object Methods

All methods except GetProp and GetCharacter return 1 on success All methods except GetProp and GetCharacter write the accounts.txt file on success. All methods return Error("Not enough parameters") if too few parameters were passed. All methods return Error("Invalid parameter type") if the wrong type was passed.

account.Ban() : bans the account. Disconnects connected client if any.

account.Unban() : unbans the account.

account.Enable() : enables the account

account.Disable() : disables the account. Disconnects connected client if any.

account.SetPassword( newpassword : string ) : changes the password..

account.CheckPassword( password : string ) : checks if the password is valid

account.SetAcctName( newname : string ) : changes the account name

  • deprecated in favor of: account.SetName( newname : string ) : changes the account name ACK, bug - since account data is saved immediately, a crash w/o save will result in a server that can't start because account names in accounts.txt will refer to the old name

account.GetProp( propname : string ) : gets a custom account property returns Error( "Property not found" ) if property does not exist.

account.SetProp( propname : string, propval : packable ) : sets a custom account property

account.EraseProp( propname : string ) : erases a custom account property.

account.PropNames() : array of property names

account.GetCharacter( index : 1..5 ) : retrieve a reference to a character belonging to this account. This reference may be used even if the character is offline.

account.DeleteCharacter( index : 1..5 ) : delete a character character to be deleted cannot be logged in.

account.Set_UO_Expansion( string ) : recognized values: TOL, HSA, SA, ML, SE, AOS, LBR, T2A (default) this determines what flag is sent with packet 0xB9 during login.

account.Delete() : delete this account

account.Split( newacctname : string, index : 1..5 ) : create a new account and move character to it

account.Move_Char( destacctname : string, index : 1..5 ) : move character from this account to destaccount

Reimplemented from Pol::Bscript::BObjectImp.

Definition at line 80 of file acscrobj.cpp.

References Pol::Plib::SystemState::accounts_txt_dirty, Pol::Mobile::Character::acct, Pol::Core::call_ondelete_scripts(), Pol::Core::CallPropertyListMethod_id(), Pol::Core::can_delete_character(), Pol::Core::PolConfig::character_slots, Pol::Accounts::Account::clear_character(), Pol::Mobile::Character::client, Pol::Core::GameState::cmdlevels, Pol::Plib::SystemState::config, Pol::Core::createchar2(), Pol::Accounts::delete_account(), Pol::Core::DELETE_BY_SCRIPT, Pol::Core::delete_character(), Pol::Network::Client::Disconnect(), Pol::Accounts::duplicate_account(), Pol::Accounts::find_account(), Pol::Core::gamestate, Pol::Accounts::Account::getnextfreeslot(), Pol::Bscript::Executor::getParam(), Pol::Bscript::Executor::getStringParam(), Pol::Mobile::Character::has_active_client(), Pol::Bscript::Executor::hasParams(), Pol::Mobile::Character::logged_in(), Pol::Clib::MD5_Compare(), Pol::Clib::MD5_Encrypt(), Pol::Bscript::MTH_ADD_CHARACTER, Pol::Bscript::MTH_BAN, Pol::Bscript::MTH_CHECKPASSWORD, Pol::Bscript::MTH_DELETE, Pol::Bscript::MTH_DELETECHARACTER, Pol::Bscript::MTH_DISABLE, Pol::Bscript::MTH_ENABLE, Pol::Bscript::MTH_ERASEPROP, Pol::Bscript::MTH_GET_MEMBER, Pol::Bscript::MTH_GETCHARACTER, Pol::Bscript::MTH_GETPROP, Pol::Bscript::MTH_MOVE_CHAR, Pol::Bscript::MTH_PROPNAMES, Pol::Bscript::MTH_SET_UO_EXPANSION, Pol::Bscript::MTH_SETDEFAULTCMDLEVEL, Pol::Bscript::MTH_SETNAME, Pol::Bscript::MTH_SETPASSWORD, Pol::Bscript::MTH_SETPROP, Pol::Bscript::MTH_SPLIT, Pol::Bscript::MTH_UNBAN, Pol::Bscript::Executor::numParams(), Pol::Core::send_feature_enable(), ref_ptr< T >::set(), Pol::Accounts::Account::set_character(), Pol::Plib::systemstate, and Pol::Accounts::write_account_data().

Bscript::BObjectImp * Pol::Accounts::AccountObjImp::copy ( void  ) const
virtual

Implements Pol::Bscript::BApplicObj< AccountPtrHolder >.

Definition at line 67 of file acscrobj.cpp.

Bscript::BObjectRef Pol::Accounts::AccountObjImp::get_member ( const char *  membername)
virtual
Bscript::BObjectRef Pol::Accounts::AccountObjImp::get_member_id ( const int  id)
virtual

[2] Account Scripting Object Members MemberName Type Access name string read-only enabled boolean read-only banned boolean read-only

Reimplemented from Pol::Bscript::BObjectImp.

Definition at line 559 of file acscrobj.cpp.

References Pol::Bscript::UninitObject::create(), Pol::Bscript::MBR_BANNED, Pol::Bscript::MBR_DEFAULTCMDLEVEL, Pol::Bscript::MBR_ENABLED, Pol::Bscript::MBR_NAME, Pol::Bscript::MBR_UO_EXPANSION, and Pol::Bscript::MBR_USERNAMEPASSWORDHASH.

const char * Pol::Accounts::AccountObjImp::typeOf ( ) const
virtual

Implements Pol::Bscript::BApplicObj< AccountPtrHolder >.

Definition at line 58 of file acscrobj.cpp.

u8 Pol::Accounts::AccountObjImp::typeOfInt ( ) const
virtual

Implements Pol::Bscript::BApplicObj< AccountPtrHolder >.

Definition at line 62 of file acscrobj.cpp.


The documentation for this class was generated from the following files: