MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / update

Method update

source/game/StarTeamClient.cpp:117–147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115}
116
117void TeamClient::update() {
118 handleRpcResponses();
119
120 if (!m_hasPendingInvitation) {
121 if (Time::monotonicTime() - m_pollInvitationsTimer > Root::singleton().assets()->json("/interface.config:invitationPollInterval").toFloat()) {
122 m_pollInvitationsTimer = Time::monotonicTime();
123 JsonObject request;
124 request["playerUuid"] = m_clientContext->playerUuid().hex();
125 invokeRemote("team.pollInvitation", request, [this](Json response) {
126 if (response.isNull())
127 return;
128 if (m_hasPendingInvitation)
129 return;
130 m_pendingInvitation = {Uuid(response.getString("inviterUuid")), response.getString("inviterName")};
131 m_hasPendingInvitation = true;
132 });
133 }
134 }
135 if (!m_fullUpdateRunning) {
136 if (Time::monotonicTime() - m_fullUpdateTimer > Root::singleton().assets()->json("/interface.config:fullUpdateInterval").toFloat()) {
137 m_fullUpdateTimer = Time::monotonicTime();
138 pullFullUpdate();
139 }
140 }
141 if (!m_statusUpdateRunning) {
142 if (Time::monotonicTime() - m_statusUpdateTimer > Root::singleton().assets()->json("/interface.config:statusUpdateInterval").toFloat()) {
143 m_statusUpdateTimer = Time::monotonicTime();
144 statusUpdate();
145 }
146 }
147}
148
149void TeamClient::pullFullUpdate() {
150 if (m_fullUpdateRunning)

Callers

nothing calls this directly

Calls 9

singletonClass · 0.85
UuidClass · 0.85
toFloatMethod · 0.80
jsonMethod · 0.80
assetsMethod · 0.80
hexMethod · 0.80
playerUuidMethod · 0.80
getStringMethod · 0.80
isNullMethod · 0.45

Tested by

no test coverage detected