mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-28 07:07:45 +00:00
using instead of typedef where possible
This commit is contained in:
parent
bf4ba68be4
commit
bcb07e6b26
12 changed files with 17 additions and 18 deletions
|
@ -1 +1 @@
|
||||||
Subproject commit de7eb2392d3bf9dceb84ba7893c232efb06ced63
|
Subproject commit 2d0e1a962d13c8e07d1131789642e044eb489579
|
|
@ -7,13 +7,12 @@ namespace Core
|
||||||
{
|
{
|
||||||
namespace Util
|
namespace Util
|
||||||
{
|
{
|
||||||
typedef struct
|
using md5_context = struct
|
||||||
{
|
{
|
||||||
uint32_t total[2];
|
uint32_t total[2];
|
||||||
uint32_t state[4];
|
uint32_t state[4];
|
||||||
uint8_t buffer[64];
|
uint8_t buffer[64];
|
||||||
}
|
};
|
||||||
md5_context;
|
|
||||||
|
|
||||||
|
|
||||||
void md5( uint8_t *text, uint8_t *hash, int32_t size );
|
void md5( uint8_t *text, uint8_t *hash, int32_t size );
|
||||||
|
|
|
@ -81,7 +81,7 @@ enum CharaDbStatements : uint32_t
|
||||||
class CharaDbConnection : public DbConnection
|
class CharaDbConnection : public DbConnection
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef CharaDbStatements Statements;
|
using Statements = CharaDbStatements;
|
||||||
|
|
||||||
CharaDbConnection( ConnectionInfo& connInfo );
|
CharaDbConnection( ConnectionInfo& connInfo );
|
||||||
CharaDbConnection( Core::LockedWaitQueue< boost::shared_ptr< Operation > >* q, ConnectionInfo &connInfo );
|
CharaDbConnection( Core::LockedWaitQueue< boost::shared_ptr< Operation > >* q, ConnectionInfo &connInfo );
|
||||||
|
|
|
@ -28,7 +28,7 @@ namespace Db
|
||||||
class Operation;
|
class Operation;
|
||||||
class DbWorker;
|
class DbWorker;
|
||||||
|
|
||||||
typedef boost::scoped_ptr< PreparedStatement > PreparedStmtScopedPtr;
|
using PreparedStmtScopedPtr = boost::scoped_ptr< PreparedStatement >;
|
||||||
|
|
||||||
enum ConnectionFlags
|
enum ConnectionFlags
|
||||||
{
|
{
|
||||||
|
@ -48,7 +48,7 @@ namespace Db
|
||||||
uint8_t asyncThreads;
|
uint8_t asyncThreads;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef std::map< uint32_t, std::pair< std::string, ConnectionFlags > > PreparedStatementMap;
|
using PreparedStatementMap = std::map< uint32_t, std::pair< std::string, ConnectionFlags > >;
|
||||||
|
|
||||||
class DbConnection : public boost::enable_shared_from_this< DbConnection >
|
class DbConnection : public boost::enable_shared_from_this< DbConnection >
|
||||||
{
|
{
|
||||||
|
|
|
@ -57,7 +57,7 @@ public:
|
||||||
boost::shared_ptr< Mysql::ResultSet > query( const std::string& sql, boost::shared_ptr< T > connection = nullptr );
|
boost::shared_ptr< Mysql::ResultSet > query( const std::string& sql, boost::shared_ptr< T > connection = nullptr );
|
||||||
boost::shared_ptr< Mysql::PreparedResultSet > query( boost::shared_ptr< PreparedStatement > stmt );
|
boost::shared_ptr< Mysql::PreparedResultSet > query( boost::shared_ptr< PreparedStatement > stmt );
|
||||||
|
|
||||||
typedef typename T::Statements PreparedStatementIndex;
|
using PreparedStatementIndex = typename T::Statements;
|
||||||
|
|
||||||
boost::shared_ptr< PreparedStatement > getPreparedStatement( PreparedStatementIndex index );
|
boost::shared_ptr< PreparedStatement > getPreparedStatement( PreparedStatementIndex index );
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ namespace Core
|
||||||
SapphireAPI();
|
SapphireAPI();
|
||||||
~SapphireAPI();
|
~SapphireAPI();
|
||||||
|
|
||||||
typedef std::map< std::string, boost::shared_ptr< Session > > SessionMap;
|
using SessionMap = std::map< std::string, boost::shared_ptr< Session > >;
|
||||||
|
|
||||||
bool login( const std::string& username, const std::string& pass, std::string& sId );
|
bool login( const std::string& username, const std::string& pass, std::string& sId );
|
||||||
|
|
||||||
|
|
|
@ -42,8 +42,8 @@ Core::Network::SapphireAPI g_sapphireAPI;
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace boost::property_tree;
|
using namespace boost::property_tree;
|
||||||
|
|
||||||
typedef SimpleWeb::Server< SimpleWeb::HTTP > HttpServer;
|
using HttpServer = SimpleWeb::Server< SimpleWeb::HTTP >;
|
||||||
typedef SimpleWeb::Client< SimpleWeb::HTTP > HttpClient;
|
using HttpClient = SimpleWeb::Client< SimpleWeb::HTTP >;
|
||||||
|
|
||||||
//Added for the default_resource example
|
//Added for the default_resource example
|
||||||
void default_resource_send( const HttpServer &server, const shared_ptr< HttpServer::Response > &response,
|
void default_resource_send( const HttpServer &server, const shared_ptr< HttpServer::Response > &response,
|
||||||
|
|
|
@ -17,7 +17,7 @@ namespace Core {
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
typedef void ( DebugCommandHandler::*pFunc )( char *, Entity::PlayerPtr, boost::shared_ptr< DebugCommand > );
|
using pFunc = void ( DebugCommandHandler::* )( char *, Entity::PlayerPtr, boost::shared_ptr< DebugCommand > );
|
||||||
|
|
||||||
// String for the command
|
// String for the command
|
||||||
std::string m_commandName;
|
std::string m_commandName;
|
||||||
|
|
|
@ -9,7 +9,7 @@ namespace Core
|
||||||
|
|
||||||
class ItemContainer;
|
class ItemContainer;
|
||||||
|
|
||||||
typedef std::map< uint16_t, ItemContainerPtr > InventoryMap;
|
using InventoryMap = std::map< uint16_t, ItemContainerPtr >;
|
||||||
class Inventory
|
class Inventory
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -135,7 +135,7 @@ public:
|
||||||
Ring2 = 12,
|
Ring2 = 12,
|
||||||
SoulCrystal = 13,
|
SoulCrystal = 13,
|
||||||
};
|
};
|
||||||
typedef std::pair< uint16_t, int8_t > InvSlotPair;
|
using InvSlotPair = std::pair< uint16_t, int8_t >;
|
||||||
typedef std::vector< InvSlotPair > InvSlotPairVec;
|
typedef std::vector< InvSlotPair > InvSlotPairVec;
|
||||||
|
|
||||||
InvSlotPairVec getSlotsOfItemsInInventory( uint32_t catalogId );
|
InvSlotPairVec getSlotsOfItemsInInventory( uint32_t catalogId );
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
namespace Core
|
namespace Core
|
||||||
{
|
{
|
||||||
class Linkshell;
|
class Linkshell;
|
||||||
typedef boost::shared_ptr< Linkshell > LinkshellPtr;
|
using LinkshellPtr = boost::shared_ptr< Linkshell >;
|
||||||
|
|
||||||
class LinkshellMgr
|
class LinkshellMgr
|
||||||
{
|
{
|
||||||
|
|
|
@ -31,8 +31,8 @@ class GameConnection : public Connection
|
||||||
private:
|
private:
|
||||||
typedef void ( GameConnection::* Handler )( const Packets::GamePacket& inPacket, Entity::PlayerPtr pPlayer );
|
typedef void ( GameConnection::* Handler )( const Packets::GamePacket& inPacket, Entity::PlayerPtr pPlayer );
|
||||||
|
|
||||||
typedef std::map< uint16_t, Handler > HandlerMap;
|
using HandlerMap = std::map< uint16_t, Handler >;
|
||||||
typedef std::map< uint16_t, std::string > HandlerStrMap;
|
using HandlerStrMap = std::map< uint16_t, std::string >;
|
||||||
|
|
||||||
AcceptorPtr m_pAcceptor;
|
AcceptorPtr m_pAcceptor;
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
namespace Core {
|
namespace Core {
|
||||||
|
|
||||||
typedef std::unordered_map<uint32_t, ZonePtr> ZoneMap;
|
using ZoneMap = std::unordered_map< uint32_t, ZonePtr >;
|
||||||
|
|
||||||
class ZoneMgr
|
class ZoneMgr
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue