Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Save to My Library
Look up keyword or section
Like this
2Activity

Table Of Contents

Introduction
Windows Messaging System
Creating a Window
Sending Information to Your Window
Static Link Libraries
Creating a Static Link Library
Using a Static Link Library
Summary
What Is MySQL?
Installing MySQL
SQL Statements
Data Definition Language
Creating and Dropping Databases
Creating a Database
Dropping a Database
Column (Field) Types in MySQL
Adding, Modifying, and Dropping Tables
Creating Tables
Modifying Tables
Dropping (Removing) Tables
Data Manipulation Language (DML)
Inserting Data
Modifying Data
Removing (Deleting) Data
Using SELECT Statements
Relational Databases
Data Import Methods
Importing from a Text File
Importing from a Native Source
Backing Up and Restoring Data
Backing up a Database to a File
Restoring a Backed-Up Database
MySQL C++ Interface
Example 1 — Connecting and Retrieving Data from MySQL
Example 2 — Updating Data in MySQL from an Application
Setting Up an Apache 1.3.x Web Server
Installing PHP4 for Apache 1.3.x
Using PHP: Hypertext Preprocessor
The Basics
Example 1 — index.php
Variables
Example 2 — index2.php
Operators and Loops
Example 3 — index3.php
Conditional Statements
Example 4 — index4.php
Arrays
Functions
Example 5 — index5.php
User Input
Example 6a — input.php
Example 6b — output.php
The “Command” System
Example 7a — core.php
Example 7b — welcome.php
Example 8a — core.php
Example 8b — welcome.php
Example 8c — page1.php
Example 8d — page2.php
Accessing MySQL
MySQL Example 1 — Connecting and Disconnecting
MySQL Example 2 — Storing and Retrieving Data
MySQL Example 3 — Updating and Removing Data
Using FastTemplate
Multiple Templates
Converting the Command Parser Example to FastTemplate
What Is a Protocol?
OSI Model
OSI Model Layers
OSI model
Internet Protocol
Introduction to the Transport Layer
Transmission Control Protocol
User Datagram Protocol
Ports
Introduction to Sockets
Socket Types
Address
Platforms
History of WinSock
WinSock Initialization
WSAStartup Function (Win32)
WSACleanup Function (Win32)
WSAEnumProtocols Function (Win32)
WinSock Initialization Function
Error Handling
WSAGetLastError Function (Win32)
Sockets Data Types
Platform-specific Data Types
Address Structures
IPv4 Address Structure
IPv6 Address Structure
Generic Address Structure
Basic Sockets Functions
socket Function (Unix, Win32)
bind Function (Unix, Win32)
connect Function (Unix, Win32)
listen Function (Unix, Win32)
accept Function (Unix, Win32)
close Function (Unix)/closesocket Function (Win32)
Input/Output Functions
send Function (Unix, Win32)
recv Function (Unix, Win32)
sendto Function (Unix, Win32)
recvfrom Function (Unix, Win32)
Address Data Conversion Functions
inet_aton Function (Unix, Win32)
Client/Server Programming
Server Methods
Clients
Byte Ordering
Creating a Server
Byte ordering
Simple Echo TCP Server
main Function
InitSockets Function
ServerProcess Function
Simple Echo UDP Server
Creating a Client
Simple Echo TCP Client
ClientProcess Function
Simple Echo UDP Client
Running the Simple Echo Application
Detecting Network Events
select (Unix, Win32)
Macros
WSAAsyncSelect (Win32)
WSAEventSelect (Win32)
WSAWaitForMultipleEvents (Win32)
Event Object
Multithreading
What Is Multithreading?
CreateThread (Win32)
The Windows Procedure
The Complete Code
Using the 2DLIB Graphics Routines
2D Positions on the Screen
Use of Colors
Plotting a Single Pixel
Drawing a Line
Drawing a Rectangle/Filled Rectangle
Drawing a Triangle/Filled Triangle
Graphic Loading Functions
Graphics Display (Blitting) Function
Keyboard Input Method
2DLIB Example 1 — Moving Primitives with the Cursor Keys
Complete Code Listing for Example 1
2DLIB Example 2 — Loading and Rotating Graphics
Complete Code Listing for Example 2
Why Create a Network Library of Our Own?
Planning the Structure
Planning the Functionality
Identifying Hosts
Sending Data to Hosts
Pinging — Calculating Network Latency
Timing Out
Building the Library
Windows
Unix/Linux
Creating Independent Code
Creating Definitions for Data Types
Log System
StartLogConsole Function
dreamConsole Constructor
dreamConsole Destructor
println Function
StartLog Function
LogString Function
StopLog Function
Getting Started
Setting Up Source and Header Files
dreamSock.h File
dreamMessage Class
dreamClient Class
dreamServer Class
Global Setup Functions
dreamSock_Initialize
dreamSock_InitializeWinSock
dreamSock_Shutdown
dreamSock_OpenUDPSocket Function
dreamSock_CloseSocket Function
dreamSock_GetPacket Function
dreamSock_SendPacket Function
dreamSock_Broadcast Function
dreamSock_GetCurrentSystemTime Function
dreamSock_Linux_GetCurrentSystemTime Function
dreamSock_Win_GetCurrentSystemTime Function
Retrieving Error Values
Summary of Global Functions
Creating dreamSock Network Library
dreamMessage Class Member Variables
dreamMessage Class Functionality
Init Function
Clear Function
GetNewPoint Function
AddSequences Function
Write Function
WriteByte Function
WriteShort Function
WriteLong Function
WriteFloat Function
WriteString Function
BeginReading Function
Read Function
ReadByte Function
ReadShort Function
ReadLong Function
ReadFloat Function
ReadString Function
dreamMessage Summary
dreamClient Class Member Variables
dreamClient Class Functionality
dreamClient Constructor
dreamClient Destructor
Initialize Function
Uninitialize Function
Reset Function
DumpBuffer Function
System Messages vs. User Messages
SendConnect Function
SendDisconnect Function
SendPing Function
ParsePacket Function
GetPacket Function
SendPacket Function (Internal Message)
SendPacket Function (External Message)
dreamClient Summary
dreamServer Class Member Variables
dreamServer Class Functionality
dreamServer Constructor
dreamServer Destructor
SendAddClient Function
SendRemoveClient Function
AddClient Function
RemoveClient Function
CheckForTimeout Function
SendPackets Function
dreamServer Summary
Catching Exceptions
Creating a Basic Client Application
signin.h File
CSignin Class
network.h File
main.h File
common.h File
main.cpp File
Global Variables
CreateAccountDialogProc Function
signin.cpp File — CSignin Class Methods
CSignin Constructor
CSignin Destructor
ReadPackets Function
RemoveClients Function
SendSignIn Function
SendKeepAlive Function
Connect Function
Disconnect Function
RunNetwork Function
Creating a Basic Server Application
CSigninServer Class
WindowProc Function
daemonInit Function
keyPress Function
signin.cpp File — CSigninServer Class Methods
CSigninServer Constructor
CSigninServer Destructor
InitNetwork Function
ShutdownNetwork Function
SendExitNotification Function
Creating the Lobby Client Application
Creating the Dialogs
Lobby Dialog
Create Game Dialog
Create View Players Dialog
Join Game Dialog
Lobby System Code
Lobby Client Code
lobby.h File
CreateViewPlayersDialogProc Function
CreateGameDialogProc Function
JoinGameDialogProc Function
LoginDialogProc Function
LobbyDialogProc Function
WinMain Function
lobby.cpp File — CLobby Class Methods
RefreshPlayerList Function
RequestGameData Function
SendChat Function
SendCreateGame Function
SendRemoveGame Function
SendStartGame Function
Unimplemented Functions
Lobby Server Code
lobby.cpp File — CLobbyServer Class Methods
Designing the Functionality
Frame Time
Compressing Messages
Dead Reckoning
Frame History
Handling Messages
Game Server Code
server.h File
network.cpp File — CArmyWarServer Class Part 1
SendCommand Function
ReadDeltaMoveCommand Function
BuildMoveCommand Function
BuildDeltaMoveCommand Function
server.cpp File — CArmyWarServer Class Part 2
GenerateRandomMap Function
CalculateVelocity Function
CalculateHeading Function
CalculateBulletVelocity Function
MovePlayer Function
CheckFlagCollisions Function
Frame Function
lobby.cpp File
AddGame Function
RemoveGame Function
RemoveGames Function
Summary of Server Code
Game Client Code
client.h File
VectorLength and VectorSubtract Functions
ApplicationProc Function
Dialog Procedures
Main Loop
network.cpp File
StartConnection Function
SendRequestNonDeltaFrame Function
ReadMoveCommand Function
client.cpp File
CArmyWar Constructor and Destructor Functions
InitializeEngine Function
Shutdown Function
DrawMap Function
CheckVictory Function
KillPlayer Function
GetClientPointer Function
CheckKeys Function
CheckPredictionError Function
CheckBulletPredictionError Function
PredictMovement Function
MoveObjects Function
RefreshGameList Function
RefreshJoinedPlayersList Function
Other Unimplemented Functions
Index
0 of .
Results for:
No results containing your search query
P. 1
Programming Multi Player Games

Programming Multi Player Games

Ratings: (0)|Views: 250 |Likes:
Published by Tin Nguyen Trong

More info:

Published by: Tin Nguyen Trong on Mar 18, 2012
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

03/18/2012

pdf

text

original

You're Reading a Free Preview
Pages 12 to 186 are not shown in this preview.
You're Reading a Free Preview
Pages 205 to 249 are not shown in this preview.
You're Reading a Free Preview
Pages 261 to 452 are not shown in this preview.
You're Reading a Free Preview
Pages 464 to 578 are not shown in this preview.

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->