mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-20 01:18:21 +00:00
Switch random function to std::mt19937
Added class EQEmu::Random Functions: EQEmu::Random::Int(int low, int high) EQEmu::Random::Real(double low, double high) EQEmu::Random::Roll(int required) EQEmu::Random::Roll(double required) EQEmu::Random::Reseed() For zone, you will access the random object through the zone object ex. zone->random.Int(0, 100); Int returns a random int between low and high Real returns a random double between low and high Roll(int) returns true if Int(0, 99) < required is true Roll(double) returns true if Real(0.0, 1.0) <= required is true
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
#include "../common/opcodemgr.h"
|
||||
#include "../common/eq_stream_type.h"
|
||||
#include "../common/eq_stream_factory.h"
|
||||
#include "../common/random.h"
|
||||
#ifndef WIN32
|
||||
#include "eq_crypto_api.h"
|
||||
#endif
|
||||
@@ -129,6 +130,8 @@ public:
|
||||
* Gets the connection for this client.
|
||||
*/
|
||||
EQStream *GetConnection() { return connection; }
|
||||
|
||||
EQEmu::Random random;
|
||||
private:
|
||||
EQStream *connection;
|
||||
ClientVersion version;
|
||||
|
||||
Reference in New Issue
Block a user