摘要: Whereas the local player’s input is processed in the cApp::frame function, the
update_players (which you saw in the code in the previous section) processes the
players according to their respective states.
閱讀全文
摘要: Between updates from the server, the clients need to update all players to keep the
game running smoothly. The client application limits updates to every 33ms (30 times
a second), which matches the server update rate. Between these player updates, the
client is allowed to collect input from the player who is used to change their actions.
閱讀全文
摘要: The client application uses the same message structures as the server, but the client
has no need for queuing messages. As Figure 19.16 demonstrates, incoming messages
are immediately parsed by the client.
閱讀全文
摘要: To use a client component, you have to derive a class from it and, in that derived
class, override the necessary functions. Those functions are few and are needed
only to convey when a connection to the server is achieved or to receive incoming
game messages.
閱讀全文
摘要: The client application (referred to as the client) is the conduit between the gaming
server and the player. The client accepts the user’s input and forwards it to the server.
Between updates from the server, the client updates itself based on what little information
it has—the player’s movement, other players’ movements, NPC actions, and so on.
閱讀全文
摘要: 莊子哲學是生命哲學。
他以人的完整生命為起點來思考人應當度過一個怎樣的生活旅程。他超越了任何知識體系和意識形態的限制,站在天道的環中和人生邊上來反思人生。因此,他的思考具有終極意義。那些從某種意識形態立場出發的批評家們必然缺乏與他對話的基礎,更沒有無端攻擊他的權利。
人活著,這是第一個無可懷疑的存在論意義上的基本事實,沒有比它更優先的。
人活著,是為了追求一個更幸福的生活,更歡樂的人生,這是最高目的,沒有比它更重要了。
閱讀全文
摘要: In order to synchronize itself with clients, the server needs to maintain a simplified
version of the game running internally. This version of the game doesn’t include
graphics, sound, or any other fancy features; it only needs to track player’s actions.
閱讀全文
摘要: Just as players join the game, so do players quit, and that’s the purpose of the
remove_player function. In the remove_player function, the server will scan the list of
connected players for a match of a DirectPlay identification number (from the disconnecting
player) and remove that player from the list. After the scan is complete
and the appropriate player is removed from the list, all clients are notified of the
disconnecting player, and the server rebuilds a list of exist
閱讀全文
摘要: Now that the game messages have made their way into the message queue, the next
step is to remove the messages at each frame and process them. To keep things
running quickly, only 64 messages at a time are processed (as defined by the
MESSAGE_PER_FRAME macro in the server source code).
閱讀全文
摘要: The server never deals directly with incoming messages; instead, the server pulls
messages from the queue. If a message needs to be processed, it must be inserted
into the queue. Using a queue ensures that the server never gets bogged down with
processing incoming network data.
閱讀全文