重构Steam网络管理,整合房间管理功能,添加多路复用支持,优化TCP服务器和消息处理

This commit is contained in:
Ayndpa
2025-11-19 16:49:36 +08:00
parent 0e65ecb8ca
commit f661b1d369
12 changed files with 217 additions and 192 deletions

13
steam/steam_utils.cpp Normal file
View File

@@ -0,0 +1,13 @@
#include "steam_utils.h"
#include <iostream>
std::vector<std::pair<CSteamID, std::string>> SteamUtils::getFriendsList() {
std::vector<std::pair<CSteamID, std::string>> friendsList;
int friendCount = SteamFriends()->GetFriendCount(k_EFriendFlagAll);
for (int i = 0; i < friendCount; ++i) {
CSteamID friendID = SteamFriends()->GetFriendByIndex(i, k_EFriendFlagAll);
const char* name = SteamFriends()->GetFriendPersonaName(friendID);
friendsList.push_back({friendID, name});
}
return friendsList;
}