• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

修訂780fe960ede67678a2fa69fe088577dcaa587709 (tree)
時間2012-09-28 19:02:24
作者h2so5 <h2so5@git....>
Commiterh2so5

Log Message

シーン遷移時の不具合を修正
公開鍵の受信が受信量制限に引っかかる不具合を修正

Change Summary

差異

--- a/client/scene/Base.cpp
+++ b/client/scene/Base.cpp
@@ -9,4 +9,11 @@ Base::~Base()
99 {
1010
1111 }
12+
13+BasePtr Base::NextScene() {
14+ BasePtr ptr;
15+ std::swap(ptr, next_scene_);
16+ return ptr;
17+}
18+
1219 }
--- a/client/scene/Base.hpp
+++ b/client/scene/Base.hpp
@@ -21,7 +21,7 @@ class Base : public std::enable_shared_from_this<Base> {
2121 virtual void ProcessInput(InputManager*) = 0;
2222 virtual void Draw() = 0;
2323 virtual void End() = 0;
24- virtual BasePtr NextScene() {return next_scene_;};
24+ BasePtr NextScene();
2525
2626 protected:
2727 BasePtr next_scene_;
--- a/common/network/Session.cpp
+++ b/common/network/Session.cpp
@@ -94,6 +94,18 @@ namespace network {
9494 }
9595 }
9696
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+
97109 void Session::EnableEncryption()
98110 {
99111 encryption_ = true;
--- a/common/network/Session.hpp
+++ b/common/network/Session.hpp
@@ -48,6 +48,9 @@ namespace network {
4848 double GetReadByteAverage() const;
4949 double GetWriteByteAverage() const;
5050
51+ void ResetReadByteAverage();
52+ void ResetWriteByteAverage();
53+
5154 tcp::socket& tcp_socket();
5255 Encrypter& encrypter();
5356
--- a/server/main.cpp
+++ b/server/main.cpp
@@ -187,6 +187,9 @@ int main(int argc, char* argv[])
187187 uint32_t user_id = account.RegisterPublicKey(c.body());
188188 assert(user_id > 0);
189189
190+ // 公開鍵で大量データを受信するので受信量制限をリセット
191+ session->ResetReadByteAverage();
192+
190193 // ログイン
191194 session->set_id(user_id);
192195 account.LogIn(user_id);