Compare commits

..

No commits in common. "a0e558ed4c77ee49cb89b1dc2759c015e4fb10c7" and "95fc8ac687bde58a74a6bc269d1a5cf2ca501819" have entirely different histories.

6 changed files with 10 additions and 48 deletions

View File

@ -24,9 +24,9 @@ You can download the latest git builds for Linux and Windows on [the Gitlab page
One of the reasons I made this code open source is because I want contributions. Unless your code is related to the experimental stuff it needs to work on both Linux and Windows. Having accurate behavior is more important than making games work. Having inaccurate behavior might fix one game but it will break others.
## Matrix Channel
## IRC Channel
[#goldberg:matrix.org](https://matrix.to/#/#goldberg:matrix.org)
[#goldberg_emulator@freenode](https://webchat.freenode.net/?channels=goldberg_emulator)
## Building

View File

@ -138,7 +138,7 @@ CSteamID generate_steam_id_anonserver()
CSteamID generate_steam_id_lobby()
{
return CSteamID(generate_account_id(), k_EChatInstanceFlagLobby | k_EChatInstanceFlagMMSLobby, k_EUniversePublic, k_EAccountTypeChat);
return CSteamID(generate_account_id(), k_unSteamUserDefaultInstance | k_EChatInstanceFlagLobby, k_EUniversePublic, k_EAccountTypeChat);
}
bool check_timedout(std::chrono::high_resolution_clock::time_point old, double timeout)

View File

@ -107,10 +107,7 @@ google::protobuf::Map<std::string,std::string>::const_iterator caseinsensitive_f
Lobby *get_lobby(CSteamID id)
{
if (!id.IsLobby())
return NULL;
auto lobby = std::find_if(lobbies.begin(), lobbies.end(), [&id](Lobby const& item) { return (item.room_id() & 0xFFFFFFFF) == (id.GetAccountID()); });
auto lobby = std::find_if(lobbies.begin(), lobbies.end(), [&id](Lobby const& item) { return item.room_id() == id.ConvertToUint64(); });
if (lobbies.end() == lobby)
return NULL;
@ -656,8 +653,8 @@ void LeaveLobby( CSteamID steamIDLobby )
PRINT_DEBUG("LeaveLobby\n");
std::lock_guard<std::recursive_mutex> lock(global_mutex);
PRINT_DEBUG("LeaveLobby pass mutex\n");
Lobby *lobby = get_lobby(steamIDLobby);
if (lobby) {
auto lobby = std::find_if(lobbies.begin(), lobbies.end(), [&steamIDLobby](Lobby const& item) { return item.room_id() == steamIDLobby.ConvertToUint64(); });
if (lobbies.end() != lobby) {
if (!lobby->deleted()) {
on_self_enter_leave_lobby((uint64)lobby->room_id(), lobby->type(), true);
self_lobby_member_data.erase(lobby->room_id());
@ -680,6 +677,7 @@ void LeaveLobby( CSteamID steamIDLobby )
send_clients_packet(steamIDLobby, message);
lobby->set_deleted(true);
lobby->set_time_deleted(std::chrono::duration_cast<std::chrono::duration<uint64>>(std::chrono::system_clock::now().time_since_epoch()).count());
//lobbies.erase(lobby);
}
}
}

View File

@ -755,7 +755,6 @@ EResult SendMessageToConnection( HSteamNetConnection hConn, const void *pData, u
bool reliable = false;
if (nSendFlags & k_nSteamNetworkingSend_Reliable) reliable = true;
if (pOutMessageNumber) *pOutMessageNumber = 1; //TODO
if (network->sendTo(&msg, reliable)) return k_EResultOK;
return k_EResultFail;
}
@ -801,20 +800,6 @@ EResult SendMessageToConnection( HSteamNetConnection hConn, const void *pData, u
void SendMessages( int nMessages, SteamNetworkingMessage_t *const *pMessages, int64 *pOutMessageNumberOrResult )
{
PRINT_DEBUG("Steam_Networking_Sockets::SendMessages\n");
for (int i = 0; i < nMessages; ++i) {
int64 out_number = 0;
int result = SendMessageToConnection(pMessages[i]->m_conn, pMessages[i]->m_pData, pMessages[i]->m_cbSize, pMessages[i]->m_nFlags, &out_number);
if (pOutMessageNumberOrResult) {
if (result == k_EResultOK) {
pOutMessageNumberOrResult[i] = out_number;
} else {
pOutMessageNumberOrResult[i] = -result;
}
}
pMessages[i]->m_pfnFreeData(pMessages[i]);
pMessages[i]->Release();
}
}

View File

@ -68,18 +68,6 @@ Steam_Networking_Utils(class Settings *settings, class Networking *network, clas
this->run_every_runcb->remove(&Steam_Networking_Utils::steam_run_every_runcb, this);
}
static void free_steam_message_data(SteamNetworkingMessage_t *pMsg)
{
free(pMsg->m_pData);
pMsg->m_pData = NULL;
}
static void delete_steam_message(SteamNetworkingMessage_t *pMsg)
{
if (pMsg->m_pfnFreeData) pMsg->m_pfnFreeData(pMsg);
delete pMsg;
}
/// Allocate and initialize a message object. Usually the reason
/// you call this is to pass it to ISteamNetworkingSockets::SendMessages.
/// The returned object will have all of the relevant fields cleared to zero.
@ -102,17 +90,8 @@ static void delete_steam_message(SteamNetworkingMessage_t *pMsg)
SteamNetworkingMessage_t *AllocateMessage( int cbAllocateBuffer )
{
PRINT_DEBUG("Steam_Networking_Utils::AllocateMessage\n");
SteamNetworkingMessage_t *pMsg = new SteamNetworkingMessage_t();
pMsg->m_pfnFreeData = &free_steam_message_data;
pMsg->m_pfnRelease = &delete_steam_message;
if (cbAllocateBuffer < 0)
cbAllocateBuffer = 0;
if (cbAllocateBuffer)
pMsg->m_pData = malloc(cbAllocateBuffer);
pMsg->m_cbSize = cbAllocateBuffer;
return pMsg;
//TODO
return NULL;
}
bool InitializeRelayAccess()

View File

@ -17,7 +17,7 @@
<div>There's also a Readme in the zip that you download. Most issues can be easily resolved by reading it (The first few lines are the most important). </div>
<h3>Chatroom</h3>
<div>Matrix room: <a href="https://matrix.to/#/#goldberg:matrix.org">#goldberg:matrix.org</a></div>
<div>Matrix room: <a href="https://element.io/app/#/room/#goldberg:matrix.org">Element</a></div>
<h3>Other Links</h3>
<div><a href="https://www.reddit.com/r/GoldbergEmu/">Subreddit</a></div>