diff --git a/server/robotserver/coroutine.cc b/server/robotserver/coroutine.cc new file mode 100644 index 00000000..8ec2b649 --- /dev/null +++ b/server/robotserver/coroutine.cc @@ -0,0 +1,28 @@ +#include "precompile.h" + +#include "coroutine.h" + +Coroutine::Coroutine(std::function cb) +{ + cb_ = cb; +} + +void Coroutine::CoSuspend() +{ + +} + +void Coroutine::CoResume() +{ + +} + +void Coroutine::CoAwait(Awaiter& awaiter) +{ + +} + +void Coroutine::CoAwait(Awaiter* awaiter) +{ + +} diff --git a/server/robotserver/coroutine.h b/server/robotserver/coroutine.h new file mode 100644 index 00000000..954a7aab --- /dev/null +++ b/server/robotserver/coroutine.h @@ -0,0 +1,29 @@ +#pragma once + +#include + +class Awaiter +{ + +}; + +class Promise : public Awaiter +{ + +}; + +class Coroutine : public Awaiter +{ + public: + + Coroutine(std::function cb); + + void CoSuspend(); + void CoResume(); + void CoAwait(Awaiter& awaiter); + void CoAwait(Awaiter* awaiter); + + private: + boost::coroutines2::coroutine coro_; + std::function cb_; +}; diff --git a/server/robotserver/player.h b/server/robotserver/player.h index 2af508ad..5cf56e48 100644 --- a/server/robotserver/player.h +++ b/server/robotserver/player.h @@ -2,5 +2,8 @@ class Player { + public: + std::string account_id; + std::string session_id; }; diff --git a/server/robotserver/playermgr.cc b/server/robotserver/playermgr.cc index 8ab1ff56..58a6bdcf 100644 --- a/server/robotserver/playermgr.cc +++ b/server/robotserver/playermgr.cc @@ -1,5 +1,7 @@ #include "precompile.h" +#include + #include #include "playermgr.h" @@ -10,6 +12,9 @@ void PlayerMgr::Init() { + for (int i = 0; i < 10; i++) { + + } } void PlayerMgr::UnInit()