Solved

Create a Multiplayer Game Using Delphi TCP/IP Socket Object

Posted on 2000-03-17
18
715 Views
Last Modified: 2010-04-04
How to send a broadcast data using Delphi TCP/IP Socket. Anybody can tell me or give me a reference on web, pls?
0
Comment
Question by:eddie_kho
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
  • 2
  • +4
18 Comments
 
LVL 17

Expert Comment

by:inthe
ID: 2631069
hi,
look at the examples (chat etc ) of the internet component suite here:
http://www.rtfm.be/fpiette/indexuk.htm
particularly te examples using wsocket .
0
 
LVL 17

Expert Comment

by:inthe
ID: 2631071
same for the winshoes comps:
http://www.pbe.com/Winshoes/
0
 
LVL 1

Expert Comment

by:ichen
ID: 2631378
i have a chat program, using serversocket and clientsocket. If you need it you can send an email to cool17@geocities.com
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Expert Comment

by:crazydragonx
ID: 2634815
For Server(Send):
ServerSocket1.Socket.Connections[index].SendText([TEXT as String])

For Client(Send):
ClientSocket1.Socket.SendText([Text as String]);

To get the sent string:
see the event onclientwrite or onwrite:
use the function socket.receivetext to get the sent string.
0
 

Author Comment

by:eddie_kho
ID: 2635607
i meant to send a broadcast message not a point to point message, sorry, u don't understand the question maybe... pls try again thanks...
0
 
LVL 4

Expert Comment

by:jeurk
ID: 2636246
May I suggest you use something done for games
like directX. Yes I know this is not easy to use. But they is a good and easy
component suite for delphi called delphiX.
You can get it here :
http://www.multimania.com/trident/informatique/delphix/delphix/delphix02-2000.zip

Believe me : you get the sources and it's really easy to use.
Why should you use that ? Because
DirectX is done for games. DelphiX does
all for you, they is a sample using directConnect.
And what more ? You can use tcp/ip but
also null modem, ipx workless for you.
The component is doing everything for
you. I can send you a small game using
directconnect working with for players
to show you.

Regards.

-John.
0
 

Expert Comment

by:crazydragonx
ID: 2638401
Ok, if you want to broadcast the message, just run the statement in the looping.
like:

For I := 0 To ServerSocket1.Socket.ActiveConnections -1 Do
Begin
   ServerSocket1.Socket.Connections[I].SendText('Something to broadcast');
End;

Please tell me again if this one cannot answer your question too.
0
 

Author Comment

by:eddie_kho
ID: 2652127
Adjusted points from 50 to 200
0
 

Author Comment

by:eddie_kho
ID: 2652128
As we know, TCP/IP is connection oriented protocol. Your answer can be implemented in one condition that all the computer on network connected to my program (as a server) in a computer. This not actually a answer i want to hear about, what i meant is i want to send a package to all the computer in my network without connection required. If i use IPX/SPX that does not a big matter, the problem is i want implemented the same method as i use on IPX/SPX to TCP/IP. OK, if that's couldn't be possible, could you please tell me another method i can use to make a multiplayer game on TCP/IP? thanks
0
 
LVL 4

Expert Comment

by:jeurk
ID: 2652557
What about my comment Eddie ?
0
 
LVL 2

Expert Comment

by:ray_leach
ID: 2653111
Eddie,

There is a protocol which is called UDP which is a subset of the TCP/IP protocol. It is used by games like Quake3 to communicate between client and server. It is described as a connectionless protocol because it is a broadcast protocol.

You should try to find a socket component that allows UDP broadcasting.

Try the Crescent tools set.
0
 

Author Comment

by:eddie_kho
ID: 2656399
jeurk>

i'm sorry, but i still can not download the file yet, it's never downloaded completely. would you please attached it to a mail and send to me? i will learning to use it as soon as i receive it. my address: eddie_kho@hotmail.com
thank you very much
0
 
LVL 4

Expert Comment

by:jeurk
ID: 2660013
I sent it.
0
 
LVL 4

Accepted Solution

by:
jeurk earned 200 total points
ID: 2660019
  ----- The following addresses had permanent fatal errors -----
<eddie_kho@hotmail.com>

   ----- Transcript of session follows -----
.... while talking to mc5.law5.hotmail.com.:
>>> MAIL From:<jeurk> SIZE=1119966
<<< 552 Requested mail action aborted: exceeded storage allocation

It's 808 kb, make some room for it
or give me another email : knipjo@hotmail.com
Thanks
0
 
LVL 1

Expert Comment

by:nrico
ID: 2726512
Broadcasting cannot be done, but you can EASILY implement client/server games.

Just have a single server, and clients connect to it.
In the OnClientRead event, the server enumerates through all connections and sends the data it received to all connected clients.

It's what I used to write a multi-user chat program, and it worked fine. Let me know if you want the source or something else is not clear.
0
 
LVL 4

Expert Comment

by:jeurk
ID: 2726580
what's going on eddie ?
0
 

Author Comment

by:eddie_kho
ID: 2733506
jeurk>
really sorry jeurk, that recently i have not much time to explore your delphiX document, but i think i will receive it as the answer, thanks
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question