| 138 | } |
| 139 | LOG_WARN(Network, "[PrepareGame] skipped: role={} island='{}'", GetMyPlayerRole() != nullptr, |
| 140 | (const char*)_missionHeader.island); |
| 141 | return false; |
| 142 | } |
| 143 | |
| 144 | NetworkId NetworkClient::CreateLocalObject(NetworkObject* object) |
| 145 | { |
| 146 | NET_ERROR(object); |
| 147 | |
| 148 | // set network id |
| 149 | NetworkId id(_player, _nextId++); |
| 150 | object->SetNetworkId(id); |
| 151 | |
| 152 | // add to local objects |
| 153 | #if CHECK_MSG |
| 154 | CheckLocalObjects(); |
| 155 | #endif |
| 156 | |
| 157 | int index = _localObjects.Add(); |
| 158 | NetworkLocalObjectInfo& localObject = _localObjects[index]; |
| 159 | localObject.id = id; |
| 160 | localObject.object = object; |
| 161 | for (int j = NMCUpdateFirst; j < NMCUpdateN; j++) |
| 162 | { |
| 163 | NetworkUpdateInfo& info = localObject.updates[j]; |
| 164 | info.lastCreatedMsg = nullptr; |
| 165 | info.lastCreatedMsgId = 0xFFFFFFFF; |
| 166 | info.lastCreatedMsgTime = 0; |
| 167 | } |
| 168 | |
| 169 | if (DiagLevel >= 1) |
| 170 | { |
| 171 | NetworkMessageType type = object->GetNMType(); |
| 172 | DiagLogF("Client: local object created %d:%d (type %s)", id.creator, id.id, |
| 173 | (const char*)NetworkMessageTypeNames[type]); |
| 174 | } |
| 175 | |
| 176 | #if CHECK_MSG |
| 177 | CheckLocalObjects(); |
| 178 | #endif |
| 179 | |
| 180 | return id; |
nothing calls this directly
no test coverage detected