修訂 | 780fe960ede67678a2fa69fe088577dcaa587709 (tree) |
---|---|
時間 | 2012-09-28 19:02:24 |
作者 | h2so5 <h2so5@git....> |
Commiter | h2so5 |
シーン遷移時の不具合を修正
公開鍵の受信が受信量制限に引っかかる不具合を修正
@@ -9,4 +9,11 @@ Base::~Base() | ||
9 | 9 | { |
10 | 10 | |
11 | 11 | } |
12 | + | |
13 | +BasePtr Base::NextScene() { | |
14 | + BasePtr ptr; | |
15 | + std::swap(ptr, next_scene_); | |
16 | + return ptr; | |
17 | +} | |
18 | + | |
12 | 19 | } |
@@ -21,7 +21,7 @@ class Base : public std::enable_shared_from_this<Base> { | ||
21 | 21 | virtual void ProcessInput(InputManager*) = 0; |
22 | 22 | virtual void Draw() = 0; |
23 | 23 | virtual void End() = 0; |
24 | - virtual BasePtr NextScene() {return next_scene_;}; | |
24 | + BasePtr NextScene(); | |
25 | 25 | |
26 | 26 | protected: |
27 | 27 | BasePtr next_scene_; |
@@ -94,6 +94,18 @@ namespace network { | ||
94 | 94 | } |
95 | 95 | } |
96 | 96 | |
97 | + void Session::ResetReadByteAverage() | |
98 | + { | |
99 | + read_start_time_ = time(nullptr); | |
100 | + read_byte_sum_ = 0; | |
101 | + } | |
102 | + | |
103 | + void Session::ResetWriteByteAverage() | |
104 | + { | |
105 | + write_start_time_ = time(nullptr); | |
106 | + write_byte_sum_ = 0; | |
107 | + } | |
108 | + | |
97 | 109 | void Session::EnableEncryption() |
98 | 110 | { |
99 | 111 | encryption_ = true; |
@@ -48,6 +48,9 @@ namespace network { | ||
48 | 48 | double GetReadByteAverage() const; |
49 | 49 | double GetWriteByteAverage() const; |
50 | 50 | |
51 | + void ResetReadByteAverage(); | |
52 | + void ResetWriteByteAverage(); | |
53 | + | |
51 | 54 | tcp::socket& tcp_socket(); |
52 | 55 | Encrypter& encrypter(); |
53 | 56 |
@@ -187,6 +187,9 @@ int main(int argc, char* argv[]) | ||
187 | 187 | uint32_t user_id = account.RegisterPublicKey(c.body()); |
188 | 188 | assert(user_id > 0); |
189 | 189 | |
190 | + // 公開鍵で大量データを受信するので受信量制限をリセット | |
191 | + session->ResetReadByteAverage(); | |
192 | + | |
190 | 193 | // ログイン |
191 | 194 | session->set_id(user_id); |
192 | 195 | account.LogIn(user_id); |