MCPcopy Create free account
hub / github.com/Segs/Segs / toggleLFG

Function toggleLFG

Projects/CoX/Servers/MapServer/DataHelpers.cpp:50–71  ·  view source on GitHub ↗

toggleLFG must be here because it relies on sendInfoMessage()

Source from the content-addressed store, hash-verified

48
49// toggleLFG must be here because it relies on sendInfoMessage()
50void toggleLFG(Entity &e)
51{
52 CharacterData *cd = &e.m_char->m_char_data;
53
54 if(e.m_has_team)
55 {
56 QString errormsg = "You're already on a team! You cannot toggle LFG.";
57 sendInfoMessage(MessageChannel::USER_ERROR, errormsg, *e.m_client);
58 errormsg = e.name() + "is already on a team and cannot toggle LFG.";
59 qCDebug(logTeams) << errormsg;
60 removeLFG(e); // just in-case
61 return;
62 }
63
64 if(cd->m_lfg)
65 removeLFG(e);
66 else
67 {
68 addLFG(e);
69 sendTeamLooking(*e.m_client);
70 }
71}
72
73// Poll EntityManager to return Entity by Name or IDX
74Entity * getEntity(MapClientSession *src, const QString &name)

Callers 1

cmdHandler_LFGFunction · 0.85

Calls 5

sendInfoMessageFunction · 0.85
removeLFGFunction · 0.85
addLFGFunction · 0.85
sendTeamLookingFunction · 0.85
nameMethod · 0.45

Tested by

no test coverage detected