summaryrefslogtreecommitdiff
path: root/doc/devel/netplay/notes
blob: afac62808e078d1e8f2800f2d1998d38395043a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
As the game currently unfortunately works with polling, this is how
to integrate network handling with the game.

In the function called periodically by DoInput(), there should be a call
to netInput() somewhere at the beginning, and a call to flushPacketQueues()
somewhere at the end.

netInput() checks all connections for incoming packets, and calls
the appropriate packet handlers.

flushPacketQueues() sends all pending packets on their way, for all
connections.

In between, you can call functions that enqueue packets.
You would also check the network state here to determine whether you need to
act on some packet that has been delivered to the local party.