This commit is contained in:
aozhiwei 2023-04-23 19:05:03 +08:00
parent 5447397c21
commit 8e251100d2
3 changed files with 7 additions and 0 deletions

View File

@ -606,3 +606,8 @@ void App::DispatchUdpMsg()
working_msgnode_size_ = 0;
}
}
long long App::NewUuid()
{
return uuid.Generate();
}

View File

@ -35,6 +35,7 @@ class App : public a8::Singleton<App>
void NotifyLoopCond();
bool HasFlag(int flag);
long long NewUuid();
private:
void QuickExecute();

View File

@ -36,6 +36,7 @@ KcpSession::~KcpSession()
void KcpSession::Init(int socket_handle)
{
socket_handle_ = socket_handle;
secret_key_ = App::Instance()->NewUuid();
kcp_ = ikcp_create(socket_handle_, (void*)this);
ikcp_wndsize(kcp_, 128, 128);
ikcp_nodelay(kcp_, 2, 10, 2, 1);