1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-25 22:17:45 +00:00

using instead of typedef where possible

This commit is contained in:
Mordred 2017-11-19 22:43:26 +01:00
parent bf4ba68be4
commit bcb07e6b26
12 changed files with 17 additions and 18 deletions

@ -1 +1 @@
Subproject commit de7eb2392d3bf9dceb84ba7893c232efb06ced63
Subproject commit 2d0e1a962d13c8e07d1131789642e044eb489579

View file

@ -7,13 +7,12 @@ namespace Core
{
namespace Util
{
typedef struct
using md5_context = struct
{
uint32_t total[2];
uint32_t state[4];
uint8_t buffer[64];
}
md5_context;
};
void md5( uint8_t *text, uint8_t *hash, int32_t size );

View file

@ -81,7 +81,7 @@ enum CharaDbStatements : uint32_t
class CharaDbConnection : public DbConnection
{
public:
typedef CharaDbStatements Statements;
using Statements = CharaDbStatements;
CharaDbConnection( ConnectionInfo& connInfo );
CharaDbConnection( Core::LockedWaitQueue< boost::shared_ptr< Operation > >* q, ConnectionInfo &connInfo );

View file

@ -28,7 +28,7 @@ namespace Db
class Operation;
class DbWorker;
typedef boost::scoped_ptr< PreparedStatement > PreparedStmtScopedPtr;
using PreparedStmtScopedPtr = boost::scoped_ptr< PreparedStatement >;
enum ConnectionFlags
{
@ -48,7 +48,7 @@ namespace Db
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 >
{

View file

@ -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::PreparedResultSet > query( boost::shared_ptr< PreparedStatement > stmt );
typedef typename T::Statements PreparedStatementIndex;
using PreparedStatementIndex = typename T::Statements;
boost::shared_ptr< PreparedStatement > getPreparedStatement( PreparedStatementIndex index );

View file

@ -21,7 +21,7 @@ namespace Core
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 );

View file

@ -42,8 +42,8 @@ Core::Network::SapphireAPI g_sapphireAPI;
using namespace std;
using namespace boost::property_tree;
typedef SimpleWeb::Server< SimpleWeb::HTTP > HttpServer;
typedef SimpleWeb::Client< SimpleWeb::HTTP > HttpClient;
using HttpServer = SimpleWeb::Server< SimpleWeb::HTTP >;
using HttpClient = SimpleWeb::Client< SimpleWeb::HTTP >;
//Added for the default_resource example
void default_resource_send( const HttpServer &server, const shared_ptr< HttpServer::Response > &response,

View file

@ -17,7 +17,7 @@ namespace Core {
{
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
std::string m_commandName;

View file

@ -9,7 +9,7 @@ namespace Core
class ItemContainer;
typedef std::map< uint16_t, ItemContainerPtr > InventoryMap;
using InventoryMap = std::map< uint16_t, ItemContainerPtr >;
class Inventory
{
public:
@ -135,7 +135,7 @@ public:
Ring2 = 12,
SoulCrystal = 13,
};
typedef std::pair< uint16_t, int8_t > InvSlotPair;
using InvSlotPair = std::pair< uint16_t, int8_t >;
typedef std::vector< InvSlotPair > InvSlotPairVec;
InvSlotPairVec getSlotsOfItemsInInventory( uint32_t catalogId );

View file

@ -7,7 +7,7 @@
namespace Core
{
class Linkshell;
typedef boost::shared_ptr< Linkshell > LinkshellPtr;
using LinkshellPtr = boost::shared_ptr< Linkshell >;
class LinkshellMgr
{

View file

@ -31,8 +31,8 @@ class GameConnection : public Connection
private:
typedef void ( GameConnection::* Handler )( const Packets::GamePacket& inPacket, Entity::PlayerPtr pPlayer );
typedef std::map< uint16_t, Handler > HandlerMap;
typedef std::map< uint16_t, std::string > HandlerStrMap;
using HandlerMap = std::map< uint16_t, Handler >;
using HandlerStrMap = std::map< uint16_t, std::string >;
AcceptorPtr m_pAcceptor;

View file

@ -8,7 +8,7 @@
namespace Core {
typedef std::unordered_map<uint32_t, ZonePtr> ZoneMap;
using ZoneMap = std::unordered_map< uint32_t, ZonePtr >;
class ZoneMgr
{