Для пользователя, который подключился в guid добавляею counter (для того, чтобы один и тот же пользователь с таким же guid-ом мог 2 раза открыть на редактирование/просмотр документ)

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/nodeJSProjects@51098 954022d7-b5bf-4e40-9824-e11837661b57
This commit is contained in:
Alexander.Trofimov
2013-10-21 10:36:56 +00:00
parent e651ada58f
commit 2950ecaaba

View File

@ -499,8 +499,15 @@ exports.install = function (server, callbackFunction) {
//TODO: Send some shit back
}
// Увеличиваем индекс обращения к документу
if (!indexuser.hasOwnProperty(conn.docId)) {
indexuser[conn.docId] = 1;
} else {
indexuser[conn.docId] += 1;
}
conn.sessionState = 1;
conn.userId = data.user;
conn.userId = data.user + indexuser[conn.docId];
conn.userName = data.username;
conn.serverHost = data.serverHost;
conn.serverPath = data.serverPath;
@ -520,13 +527,6 @@ exports.install = function (server, callbackFunction) {
connections.push({connection:conn});
var participants = getParticipants(data.docid, data.user);
// Увеличиваем индекс обращения к документу
if (!indexuser.hasOwnProperty(conn.docId)) {
indexuser[conn.docId] = 1;
} else {
indexuser[conn.docId] += 1;
}
sendData(conn,
{
type:"auth",
@ -540,7 +540,7 @@ exports.install = function (server, callbackFunction) {
changes:objchanges[conn.docId],
indexuser:indexuser[conn.docId]
});//Or 0 if fails
sendParticipantsState(participants, true, data.user, data.username);
sendParticipantsState(participants, true, conn.userId, conn.userName);
}
}