| 1411 | |
| 1412 | UpdateSessionDescription(); |
| 1413 | } |
| 1414 | |
| 1415 | NetworkGameState NetworkServer::GetPlayerState(int dpid) |
| 1416 | { |
| 1417 | NetworkPlayerInfo* info = GetPlayerInfo(dpid); |
| 1418 | if (info) |
| 1419 | { |
| 1420 | return info->state; |
| 1421 | } |
| 1422 | else |
| 1423 | { |
| 1424 | return NGSNone; |
| 1425 | } |
| 1426 | } |
| 1427 | |
| 1428 | RString NetworkServer::GetPlayerName(int dpid) |
| 1429 | { |
| 1430 | NetworkPlayerInfo* info = GetPlayerInfo(dpid); |
| 1431 | NET_ERROR(info); |
| 1432 | if (info) |
| 1433 | { |
| 1434 | return info->name; |
| 1435 | } |
| 1436 | else |
| 1437 | { |
| 1438 | return "Unknown player"; |
| 1439 | } |
| 1440 | } |
| 1441 | |
| 1442 | Vector3 NetworkServer::GetCameraPosition(int dpid) |
| 1443 | { |
| 1444 | NetworkPlayerInfo* info = GetPlayerInfo(dpid); |
| 1445 | NET_ERROR(info); |
| 1446 | if (info) |
| 1447 | { |
| 1448 | return info->cameraPosition; |
| 1449 | } |
| 1450 | else |
| 1451 | { |
| 1452 | return VZero; |
| 1453 | } |
| 1454 | } |
| 1455 | |
| 1456 | NetworkObject* NetworkServer::GetObject(NetworkId& id) |
| 1457 | { |
| 1458 | Fail("Server: GetObject is not implemented"); |
| 1459 | return nullptr; |
| 1460 | } |
| 1461 | |
| 1462 | // Subsidiary structure for sorting messages by error |
| 1463 | struct UpdateObjectInfo |
| 1464 | { |
| 1465 | // Object info |
| 1466 | NetworkObjectInfo* oInfo; |
| 1467 | // Player object info |
| 1468 | NetworkPlayerObjectInfo* poInfo; |
| 1469 | // Message class type |
| 1470 | NetworkMessageClass cls; |
no test coverage detected