Programming Multiplayer Games (Wordware Game Developer's Library)
معرفی کتاب «Programming Multiplayer Games (Wordware Game Developer's Library)» نوشتهٔ Andrew Mulholland; Teijo Hakala; NetLibrary, Inc، منتشرشده توسط نشر Plano در سال 2004. این کتاب در فرمت pdf، زبان انگلیسی ارائه شده است. «Programming Multiplayer Games (Wordware Game Developer's Library)» در دستهٔ بدون دستهبندی قرار دارد.
I need to counter the ridiculous 1-star ratings given by reviewers who don't know what they're talking about. A 1-star review is for a computer book that has completely broken code that will not compile, numerous typos and grammatical errors, and/or out of date material--none of which describes this book. A 1-star rating is for a door stop, which this book is not. Unfortunately, the bad reviews (written by people who are demanding "Create your own MMO in 7 easy steps") led to weak sales and the book going out of print, just when I need it to teach a course on this subject. This book, which I found from a used reseller, thoroughly teaches low level socket programming using the Winsock library, which is the basis for all networked Windows games on the market (including MMOs like World of Warcraft). You need to know how to program Winsock at the lowest level, and how to handle multithreading, in order to get a job in the field doing this sort of work. There is no other book on the market that covers this subject, and poor sales means there is not likely to be any in the future (at least that cover programming in this much detail). The content has been greatly strengthened from the first edition, with very focused chapters on SQL and PHP without taking up too many pages. The authors do try to show how to build a portal for a multiplayer game, which would be used to launch the game itself. What they're doing here is trying to show how a service like Battle.net works, by hosting live chat, account management, and launching game sessions. The chapters on low-level socket programming are exactly what I need. The 2DLib was not very useful since I focus on DirectX, so I ignored the sample game altogether. As an instructor who needs this out of print book, I've had to use an e-book service in order to support it through the campus bookstore. I'm sorry that Wordware has such a bad habit of canning books too soon (a common practice for this publisher), while academia needs books to remain viable for several years in order to consider them for adoption. This is a tough subject for a niche course. Team DDU......Page 1 Contents......Page 4 About the Authors......Page 15 Introduction......Page 16 Part I - Theory......Page 18 Windows Messaging System......Page 20 Creating a Window......Page 21 Sending Information to Your Window......Page 25 Static Link Libraries......Page 26 Creating a Static Link Library......Page 27 Using a Static Link Library......Page 30 Summary......Page 31 What Is MySQL?......Page 32 Installing MySQL......Page 33 Creating and Dropping Databases......Page 36 Creating a Database......Page 37 Dropping a Database......Page 38 Column (Field) Types in MySQL......Page 39 Creating Tables......Page 41 Modifying Tables......Page 43 Dropping (Removing) Tables......Page 45 Data Manipulation Language (DML)......Page 46 Inserting Data......Page 47 Modifying Data......Page 49 Removing (Deleting) Data......Page 51 Using Select Statements......Page 52 Relational Databases......Page 57 Importing from a Text File......Page 61 Importing from a Native Source......Page 62 Backing up a Database to a File......Page 64 Restoring a Backed-Up Database......Page 66 Example 1 - Connecting and Retrieving Data from MySQL......Page 67 Example 2 - Updating Data in MySQL from an Application......Page 70 Summary......Page 72 Setting Up an Apache 1.3.x Web Server......Page 74 Installing PHP4 for Apache 1.3.x......Page 77 Using PHP: Hypertext Preprocessor......Page 80 Example 1 - index.php......Page 81 Example 2 - index2.php......Page 82 Example 3 - index3.php......Page 84 Example 4 - index4.php......Page 85 Example 5 - index5.php......Page 87 Example 6a - input.php......Page 88 Example 6b - output.php......Page 89 The "Command" System......Page 90 Example 7b - welcome.php......Page 91 Example 8b - welcome.php......Page 93 Example 8d - page2.php......Page 94 MySQL Example 1 - Connecting and Disconnecting......Page 95 MySQL Example 2 - Storing and Retrieving Data......Page 96 MySQL Example 3 - Updating and Removing Data......Page 101 Using FastTemplate......Page 107 Multiple Templates......Page 110 Converting the Command Parser Example to FastTemplate......Page 112 Summary......Page 118 What Is a Protocol?......Page 120 OSI Model Layers......Page 121 Internet Protocol......Page 123 Transmission Control Protocol......Page 125 Ports......Page 126 Introduction to Sockets......Page 127 Socket Types......Page 128 Platforms......Page 129 Summary......Page 130 WSAStartup Function (Win32)......Page 132 WSACleanup Function (Win32)......Page 133 WinSock Initialization Function......Page 134 WSAGetLastError Function (Win32)......Page 137 IPv4 Address Structure......Page 138 IPv6 Address Structure......Page 139 Generic Address Structure......Page 140 socket Function (Unix, Win32)......Page 141 bind Function (Unix, Win32)......Page 142 connect Function (Unix, Win32)......Page 143 listen Function (Unix, Win32)......Page 144 accept Function (Unix, Win32)......Page 145 send Function (Unix, Win32)......Page 146 recv Function (Unix, Win32)......Page 148 sendto Function (Unix, Win32)......Page 149 Address Data Conversion Functions......Page 150 Server Methods......Page 151 Clients......Page 152 Creating a Server......Page 153 TCP......Page 154 UDP......Page 155 Simple Echo TCP Server......Page 156 InitSockets Function......Page 159 ServerProcess Function......Page 162 Simple Echo UDP Server......Page 163 InitSockets Function......Page 165 ServerProcess Function......Page 166 TCP......Page 167 Simple Echo TCP Client......Page 168 main Function......Page 170 InitSockets Function......Page 171 ClientProcess Function......Page 172 Simple Echo UDP Client......Page 174 ClientProcess Function......Page 176 Running the Simple Echo Application......Page 177 Summary......Page 178 select (Unix, Win32)......Page 180 Macros......Page 181 WSAEventSelect (Win32)......Page 182 Event Object......Page 183 What Is Multithreading?......Page 184 CreateThread (Win32)......Page 185 Blocking I/O......Page 186 Signal-driven I/O......Page 187 Multiplexing I/O......Page 188 ioctl (Unix)/ioctlsocket (Win32)......Page 189 setsockopt/getsockopt (Unix, Win32)......Page 190 shutdown (Unix, Win32)......Page 191 Searching for Servers......Page 192 Broadcast Function......Page 193 Summary......Page 194 Part II - Tutorials......Page 196 Configuring Visual Studio......Page 198 Creating the Workspace......Page 199 Adding the Source File......Page 200 The WinMain Function......Page 201 The Windows Procedure......Page 202 The Complete Code......Page 204 Use of Colors......Page 207 Drawing a Triangle/Filled Triangle......Page 208 Graphics Display (Blitting) Function......Page 209 Keyboard Input Method......Page 210 2DLIB Example 1 - Moving Primitives with the Cursor Keys......Page 212 Complete Code Listing for Example 1......Page 214 2DLIB Example 2 - Loading and Rotating Graphics......Page 217 Complete Code Listing for Example 2......Page 218 Summary......Page 220 Introduction......Page 222 Planning the Structure......Page 223 Identifying Hosts......Page 224 Sending Data to Hosts......Page 225 Building the Library......Page 226 Windows......Page 227 Unix/Linux......Page 228 Creating Definitions for Data Types......Page 229 Log System......Page 230 StartLogConsole Function......Page 231 println Function......Page 232 StartLog Function......Page 233 LogString Function......Page 234 StopLog Function......Page 235 Setting Up Source and Header Files......Page 236 dreamSock.h File......Page 237 dreamMessage Class......Page 242 dreamClient Class......Page 243 dreamServer Class......Page 245 dreamSock_Initialize......Page 246 dreamSock_InitializeWinSock......Page 247 dreamSock_Shutdown......Page 248 Global Socket Functions......Page 249 dreamSock_Socket Function......Page 255 dreamSock_SetBroadcasting Function......Page 256 dreamSock_StringToSockaddr Function......Page 257 dreamSock_OpenUDPSocket Function......Page 258 dreamSock_GetPacket Function......Page 260 dreamSock_SendPacket Function......Page 261 dreamSock_Broadcast Function......Page 262 dreamSock_Linux_GetCurrentSystemTime Function......Page 263 dreamSock_Win_GetCurrentSystemTime Function......Page 264 Creating dreamSock Network Library......Page 265 dreamMessage Class Functionality......Page 266 Clear Function......Page 270 GetNewPoint Function......Page 271 WriteByte Function......Page 272 WriteFloat Function......Page 273 Read Function......Page 274 ReadShort Function......Page 275 ReadString Function......Page 276 dreamClient Class Member Variables......Page 277 dreamClient Class Functionality......Page 279 Initialize Function......Page 285 Uninitialize Function......Page 286 System Messages vs User Messages......Page 287 SendConnect Function......Page 288 SendPing Function......Page 289 ParsePacket Function......Page 290 GetPacket Function......Page 292 SendPacket Function (Internal Message)......Page 293 SendPacket Function (External Message)......Page 295 dreamClient Summary......Page 296 dreamServer Class Functionality......Page 297 dreamServer Destructor......Page 306 SendAddClient Function......Page 307 SendRemoveClient Function......Page 309 AddClient Function......Page 310 RemoveClient Function......Page 312 ParsePacket Function......Page 314 CheckForTimeout Function......Page 316 GetPacket Function......Page 318 SendPackets Function......Page 320 Summary......Page 321 Introduction......Page 322 Creating a Basic Client Application......Page 323 signin.h File......Page 324 CSignin Class......Page 325 main.h File......Page 326 main.cpp File......Page 327 CreateAccountDialogProc Function......Page 333 WinMain Function......Page 336 signin.cpp File - CSignin Class Methods......Page 340 ReadPackets Function......Page 346 AddClient Function......Page 350 RemoveClient Function......Page 351 RemoveClients Function......Page 352 SendKeepAlive Function......Page 353 RunNetwork Function......Page 354 signin.h File......Page 355 CSigninServer Class......Page 356 common.h File......Page 357 main.cpp File......Page 358 WinMain Function......Page 364 daemonInit Function......Page 368 keyPress Function......Page 369 main Function......Page 370 signin.cpp File - CSigninServer Class Methods......Page 372 CSigninServer Destructor......Page 378 ReadPackets Function......Page 379 AddClient Function......Page 383 RemoveClient Function......Page 384 RemoveClients Function......Page 385 Summary......Page 386 Creating the Lobby Client Application......Page 388 Lobby Dialog......Page 389 Create Game Dialog......Page 392 Join Game Dialog......Page 393 lobby.h File......Page 394 main.h File......Page 396 CreateGameDialogProc Function......Page 397 LoginDialogProc Function......Page 399 LobbyDialogProc Function......Page 401 WinMain Function......Page 403 lobby.cpp File - CLobby Class Methods......Page 406 RefreshPlayerList Function......Page 415 ReadPackets Function......Page 416 RequestGameData Function......Page 418 SendRemoveGame Function......Page 419 Disconnect Function......Page 420 RunNetwork Function......Page 421 Unimplemented Functions......Page 422 lobby.h File......Page 423 main.cpp File......Page 424 lobby.cpp File - CLobbyServer Class Methods......Page 425 ReadPackets Function......Page 435 Summary......Page 442 Introduction......Page 444 Compressing Messages......Page 445 Dead Reckoning......Page 446 Game Server Code......Page 447 server.hFile......Page 448 main.cpp File......Page 453 network.cpp File - CArmyWarServer Class Part 1......Page 454 ReadPackets Function......Page 466 SendCommand Function......Page 468 ReadDeltaMoveCommand Function......Page 469 BuildMoveCommand Function......Page 470 BuildDeltaMoveCommand Function......Page 471 server.cpp File - CArmyWarServer Class Part 2......Page 475 GenerateRandomMap Function......Page 484 CalculateVelocity Function......Page 485 CalculateHeading Function......Page 486 CalculateBulletVelocity Function......Page 487 MovePlayer Function......Page 489 CheckFlagCollisions Function......Page 492 Frame Function......Page 494 AddGame Function......Page 495 RemoveGame Function......Page 496 Game Client Code......Page 498 client.h File......Page 499 network.h File......Page 504 VectorLength and VectorSubtract Functions......Page 505 Main Loop......Page 506 network.cpp File......Page 507 SendCommand Function......Page 519 Connect Function......Page 521 ReadMoveCommand Function......Page 522 ReadDeltaMoveCommand Function......Page 523 BuildDeltaMoveCommand Function......Page 525 RunNetwork Function......Page 526 client.cpp File......Page 528 CArmyWar Constructor and Destructor Functions......Page 542 InitializeEngine Function......Page 543 Shutdown Function......Page 544 DrawMap Function......Page 545 Frame Function......Page 547 CheckVictory Function......Page 548 CheckKeys Function......Page 549 CheckPredictionError Function......Page 550 CheckBulletPredictionError Function......Page 551 CalculateVelocity Function......Page 552 CalculateHeading Function......Page 553 PredictMovement Function......Page 554 MoveObjects Function......Page 556 RefreshJoinedPlayersList Function......Page 558 Summary......Page 559 Index......Page 560 Programming Multiplayer Games provides in-depth coverage of all the major topics associated with online game programming, and gives the programmer easy to follow, step-by-step tutorials on how to create a fully functional network library, back-end MySQL database, and complete working online game. The first part of the book explains the basics of dialog-based Windows programming, covers the use of MySQL and PHP4, and introduces sockets programming. The second part consists of five extensive tutorials that lead the reader through the stages of creating an online game. This book covers all the major aspects and theory behind creating a fully functional network game, from setting up a stable MySQL backed-end database for storing player information to developing a reusable TCP/IP network library for online games as well as developing web-based server interfaces.
دانلود کتاب Programming Multiplayer Games (Wordware Game Developer's Library)