MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / onUpdate

Method onUpdate

src/OpenLoco/src/Network/NetworkClient.cpp:69–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67}
68
69void NetworkClient::onUpdate()
70{
71 processReceivedPackets();
72 if (_status == NetworkClientStatus::connecting)
73 {
74 if (Platform::getTime() >= _timeout)
75 {
76 close();
77 Logging::info("Failed to connect to server");
78 endStatus("Failed to connect to server");
79 }
80 }
81 else
82 {
83 if (hasTimedOut())
84 {
85 Logging::info("Connection with server timed out");
86 close();
87 }
88 else
89 {
90 switch (_status)
91 {
92 case NetworkClientStatus::connectedSuccessfully:
93 sendRequestStatePacket();
94 _status = NetworkClientStatus::waitingForState;
95 break;
96 case NetworkClientStatus::waitingForState:
97 break;
98 default:
99 break;
100 }
101 }
102 }
103}
104
105void NetworkClient::processReceivedPackets()
106{

Callers

nothing calls this directly

Calls 3

infoFunction · 0.85
closeFunction · 0.70
getTimeFunction · 0.50

Tested by

no test coverage detected