Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Donald Haase
Cockatrice
Commits
7d715113
Commit
7d715113
authored
Sep 26, 2015
by
woogerboy21
Browse files
Removed mod notification code that causes crashes
parent
c1663d57
Changes
3
Hide whitespace changes
Inline
Side-by-side
common/server.cpp
View file @
7d715113
...
@@ -262,18 +262,6 @@ void Server::removeClient(Server_ProtocolHandler *client)
...
@@ -262,18 +262,6 @@ void Server::removeClient(Server_ProtocolHandler *client)
qDebug
()
<<
"Server::removeClient: removed"
<<
(
void
*
)
client
<<
";"
<<
clients
.
size
()
<<
"clients; "
<<
users
.
size
()
<<
"users left"
;
qDebug
()
<<
"Server::removeClient: removed"
<<
(
void
*
)
client
<<
";"
<<
clients
.
size
()
<<
"clients; "
<<
users
.
size
()
<<
"users left"
;
}
}
QList
<
QString
>
Server
::
getOnlineModeratorList
()
{
QList
<
QString
>
results
;
QReadLocker
clientsLocker
(
&
clientsLock
);
for
(
int
i
=
0
;
i
<
clients
.
size
();
++
i
)
{
ServerInfo_User
*
data
=
clients
[
i
]
->
getUserInfo
();
if
(
data
->
user_level
()
&
ServerInfo_User
::
IsModerator
||
data
->
user_level
()
&
ServerInfo_User
::
IsAdmin
)
//TODO: this line should be updated in the event there is any type of new user level created
results
<<
QString
::
fromStdString
(
data
->
name
()).
simplified
();
}
return
results
;
}
void
Server
::
externalUserJoined
(
const
ServerInfo_User
&
userInfo
)
void
Server
::
externalUserJoined
(
const
ServerInfo_User
&
userInfo
)
{
{
// This function is always called from the main thread via signal/slot.
// This function is always called from the main thread via signal/slot.
...
...
common/server.h
View file @
7d715113
...
@@ -57,7 +57,6 @@ public:
...
@@ -57,7 +57,6 @@ public:
virtual
QMap
<
QString
,
bool
>
getServerRequiredFeatureList
()
const
{
return
QMap
<
QString
,
bool
>
();
}
virtual
QMap
<
QString
,
bool
>
getServerRequiredFeatureList
()
const
{
return
QMap
<
QString
,
bool
>
();
}
void
addClient
(
Server_ProtocolHandler
*
player
);
void
addClient
(
Server_ProtocolHandler
*
player
);
void
removeClient
(
Server_ProtocolHandler
*
player
);
void
removeClient
(
Server_ProtocolHandler
*
player
);
QList
<
QString
>
getOnlineModeratorList
();
virtual
QString
getLoginMessage
()
const
{
return
QString
();
}
virtual
QString
getLoginMessage
()
const
{
return
QString
();
}
virtual
bool
permitUnregisteredUsers
()
const
{
return
true
;
}
virtual
bool
permitUnregisteredUsers
()
const
{
return
true
;
}
virtual
bool
getGameShouldPing
()
const
{
return
false
;
}
virtual
bool
getGameShouldPing
()
const
{
return
false
;
}
...
...
servatrice/src/serversocketinterface.cpp
View file @
7d715113
...
@@ -868,14 +868,6 @@ Response::ResponseCode ServerSocketInterface::cmdWarnUser(const Command_WarnUser
...
@@ -868,14 +868,6 @@ Response::ResponseCode ServerSocketInterface::cmdWarnUser(const Command_WarnUser
delete
se
;
delete
se
;
}
}
QList
<
QString
>
moderatorList
=
server
->
getOnlineModeratorList
();
QListIterator
<
QString
>
modIterator
(
moderatorList
);
foreach
(
QString
moderator
,
moderatorList
)
{
QString
notificationMessage
=
sendingModerator
+
" has sent a warning with the following information"
;
notificationMessage
.
append
(
"
\n
Username: "
+
userName
);
notificationMessage
.
append
(
"
\n
Reason: "
+
warningReason
);
sendServerMessage
(
moderator
.
simplified
(),
notificationMessage
);
}
return
Response
::
RespOk
;
return
Response
::
RespOk
;
}
else
{
}
else
{
...
@@ -951,23 +943,6 @@ Response::ResponseCode ServerSocketInterface::cmdBanFromServer(const Command_Ban
...
@@ -951,23 +943,6 @@ Response::ResponseCode ServerSocketInterface::cmdBanFromServer(const Command_Ban
}
}
servatrice
->
clientsLock
.
unlock
();
servatrice
->
clientsLock
.
unlock
();
QList
<
QString
>
moderatorList
=
server
->
getOnlineModeratorList
();
QListIterator
<
QString
>
modIterator
(
moderatorList
);
foreach
(
QString
moderator
,
moderatorList
)
{
QString
notificationMessage
=
QString
::
fromStdString
(
userInfo
->
name
()).
simplified
()
+
" has placed a ban with the following information"
;
if
(
!
userName
.
isEmpty
())
notificationMessage
.
append
(
"
\n
Username: "
+
userName
);
if
(
!
address
.
isEmpty
())
notificationMessage
.
append
(
"
\n
IP Address: "
+
address
);
if
(
!
clientID
.
isEmpty
())
notificationMessage
.
append
(
"
\n
Client ID: "
+
clientID
);
notificationMessage
.
append
(
"
\n
Length: "
+
QString
::
number
(
minutes
)
+
" minute(s)"
);
notificationMessage
.
append
(
"
\n
Internal Reason: "
+
QString
::
fromStdString
(
cmd
.
reason
()));
notificationMessage
.
append
(
"
\n
Visible Reason: "
+
QString
::
fromStdString
(
cmd
.
visible_reason
()));
sendServerMessage
(
moderator
.
simplified
(),
notificationMessage
);
}
return
Response
::
RespOk
;
return
Response
::
RespOk
;
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment