mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-01-22 01:18:57 -08:00
renamed servernetwork to ISL (inter-server link), join/leave is working
This commit is contained in:
@@ -25,6 +25,8 @@
|
||||
#include "pb/event_user_joined.pb.h"
|
||||
#include "pb/event_user_left.pb.h"
|
||||
#include "pb/event_list_rooms.pb.h"
|
||||
#include "pb/session_event.pb.h"
|
||||
#include "pb/isl_message.pb.h"
|
||||
#include <QCoreApplication>
|
||||
#include <QDebug>
|
||||
|
||||
@@ -98,6 +100,9 @@ AuthenticationResult Server::loginUser(Server_ProtocolHandler *session, QString
|
||||
for (int i = 0; i < clients.size(); ++i)
|
||||
if (clients[i]->getAcceptsUserListChanges())
|
||||
clients[i]->sendProtocolItem(*se);
|
||||
serverMutex.unlock();
|
||||
|
||||
sendIslMessage(*se);
|
||||
delete se;
|
||||
|
||||
return authState;
|
||||
@@ -121,6 +126,7 @@ void Server::removeClient(Server_ProtocolHandler *client)
|
||||
for (int i = 0; i < clients.size(); ++i)
|
||||
if (clients[i]->getAcceptsUserListChanges())
|
||||
clients[i]->sendProtocolItem(*se);
|
||||
sendIslMessage(*se);
|
||||
delete se;
|
||||
|
||||
users.remove(QString::fromStdString(data->name()));
|
||||
@@ -177,3 +183,12 @@ int Server::getGamesCount() const
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void Server::sendIslMessage(const SessionEvent &item, int serverId)
|
||||
{
|
||||
IslMessage msg;
|
||||
msg.set_message_type(IslMessage::SESSION_EVENT);
|
||||
msg.mutable_session_event()->CopyFrom(item);
|
||||
|
||||
doSendIslMessage(msg, serverId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user