天行健 君子当自强而不息

     摘要: 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.  阅读全文
posted @ 2007-12-19 17:53 lovedday 阅读(295) | 评论 (0)编辑 收藏
     摘要: 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.  阅读全文
posted @ 2007-12-19 17:22 lovedday 阅读(211) | 评论 (0)编辑 收藏
     摘要: 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.  阅读全文
posted @ 2007-12-19 16:44 lovedday 阅读(231) | 评论 (0)编辑 收藏
     摘要: 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.  阅读全文
posted @ 2007-12-19 16:21 lovedday 阅读(121) | 评论 (0)编辑 收藏
     摘要: 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.  阅读全文
posted @ 2007-12-19 14:55 lovedday 阅读(283) | 评论 (0)编辑 收藏
     摘要: 庄子哲学是生命哲学。

  他以人的完整生命为起点来思考人应当度过一个怎样的生活旅程。他超越了任何知识体系和意识形态的限制,站在天道的环中和人生边上来反思人生。因此,他的思考具有终极意义。那些从某种意识形态立场出发的批评家们必然缺乏与他对话的基础,更没有无端攻击他的权利。

  人活着,这是第一个无可怀疑的存在论意义上的基本事实,没有比它更优先的。

  人活着,是为了追求一个更幸福的生活,更欢乐的人生,这是最高目的,没有比它更重要了。
  阅读全文
posted @ 2007-12-19 01:15 lovedday 阅读(316) | 评论 (1)编辑 收藏
     摘要: 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.  阅读全文
posted @ 2007-12-18 23:20 lovedday 阅读(204) | 评论 (0)编辑 收藏
     摘要: 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  阅读全文
posted @ 2007-12-18 22:39 lovedday 阅读(230) | 评论 (0)编辑 收藏
     摘要: 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).  阅读全文
posted @ 2007-12-18 22:00 lovedday 阅读(180) | 评论 (0)编辑 收藏
     摘要: 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.  阅读全文
posted @ 2007-12-18 21:25 lovedday 阅读(157) | 评论 (0)编辑 收藏
仅列出标题
共136页: First 36 37 38 39 40 41 42 43 44 Last 

公告

导航

统计

常用链接

随笔分类(178)

3D游戏编程相关链接

搜索

最新评论