| 249 | msg._remove = true; |
| 250 | SendMsg(&msg, NMFGuaranteed); |
| 251 | |
| 252 | return true; |
| 253 | } |
| 254 | |
| 255 | int NetworkClient::UpdateObject(NetworkObject* object, NetworkMessageClass cls, NetMsgFlags dwFlags) |
| 256 | { |
| 257 | if (!object) |
| 258 | { |
| 259 | return -1; |
| 260 | } |
| 261 | if (_state < NGSLoadIsland) |
| 262 | { |
| 263 | return -1; |
| 264 | } |
| 265 | |
| 266 | // find local objects |
| 267 | NetworkId id = object->GetNetworkId(); |
| 268 | if (id.IsNull()) |
| 269 | { |
| 270 | RptF("Client: Nonnetwork object %x.", object); |
| 271 | return -1; |
| 272 | } |
| 273 | if (!object->IsLocal()) |
| 274 | { |
| 275 | RptF("Update of nonlocal object %d:%d called", id.creator, id.id); |
| 276 | return -1; |
| 277 | } |
| 278 | #if CHECK_MSG |
| 279 | CheckLocalObjects(); |
| 280 | #endif |
| 281 | NetworkLocalObjectInfo* localObject = GetLocalObjectInfo(id); |
| 282 | if (!localObject) |
| 283 | { |
| 284 | return -1; |
| 285 | } |
| 286 | |
| 287 | NetworkUpdateInfo& info = localObject->updates[cls]; |
| 288 | |
| 289 | // send message to center |
| 290 | NetworkMessageType msgType = object->GetNMType(cls); |
| 291 | if (msgType == NMTNone) |
| 292 | { |
| 293 | return -1; |
| 294 | } |
| 295 | |
| 296 | // FIX |
| 297 | bool IsDedicatedServer(); |
| 298 | if (msgType == NMTUpdateClientInfo && _parent->GetServer() && IsDedicatedServer()) |
| 299 | { |
| 300 | return -1; |
| 301 | } |
| 302 | |
| 303 | NetworkMessageFormatBase* format = GetFormat(/*LOCAL_PLAYER, */ msgType); |
| 304 | |
| 305 | // create message |
| 306 | Ref<NetworkMessage> msg = new NetworkMessage(); |
| 307 | // must be Ref - msg is stored |
| 308 | msg->time = Glob.time; |
nothing calls this directly
no test coverage detected