| 177 | CheckLocalObjects(); |
| 178 | #endif |
| 179 | |
| 180 | return id; |
| 181 | } |
| 182 | |
| 183 | bool NetworkClient::CreateObject(NetworkObject* object) |
| 184 | { |
| 185 | if (!object) |
| 186 | { |
| 187 | return false; |
| 188 | } |
| 189 | if (_state < NGSLoadIsland) |
| 190 | { |
| 191 | return false; |
| 192 | } |
| 193 | |
| 194 | NetworkId id = CreateLocalObject(object); |
| 195 | |
| 196 | // send message to center |
| 197 | NetworkMessageType msgType = object->GetNMType(NMCCreate); |
| 198 | NetworkMessageFormatBase* format = GetFormat(/*LOCAL_PLAYER, */ msgType); |
| 199 | |
| 200 | // create message |
| 201 | Ref<NetworkMessage> msg = new NetworkMessage(); |
| 202 | msg->time = Glob.time; |
| 203 | NetworkMessageContext ctx(msg, format, this, TO_SERVER, MSG_SEND); |
| 204 | ctx.SetClass(NMCCreate); |
| 205 | if (object->TransferMsg(ctx) != TMOK) |
| 206 | { |
| 207 | return false; |
| 208 | } |
| 209 | |
| 210 | // send message |
| 211 | DWORD dwMsgId = NetworkComponent::SendMsg(TO_SERVER, msg, msgType, NMFGuaranteed); |
| 212 | return dwMsgId != 0xFFFFFFFF; |
nothing calls this directly
no test coverage detected