Create a Multiplayer Game Using Delphi TCP/IP Socket Object

How to send a broadcast data using Delphi TCP/IP Socket. Anybody can tell me or give me a reference on web, pls?
eddie_khoAsked:
Who is Participating?
 
jeurkCommented:
  ----- 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
 
intheCommented:
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
 
intheCommented:
same for the winshoes comps:
http://www.pbe.com/Winshoes/
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
ichenCommented:
i have a chat program, using serversocket and clientsocket. If you need it you can send an email to cool17@geocities.com
0
 
crazydragonxCommented:
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
 
eddie_khoAuthor Commented:
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
 
jeurkCommented:
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
 
crazydragonxCommented:
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
 
eddie_khoAuthor Commented:
Adjusted points from 50 to 200
0
 
eddie_khoAuthor Commented:
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
 
jeurkCommented:
What about my comment Eddie ?
0
 
ray_leachCommented:
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
 
eddie_khoAuthor Commented:
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
 
jeurkCommented:
I sent it.
0
 
nricoCommented:
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
 
jeurkCommented:
what's going on eddie ?
0
 
eddie_khoAuthor Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.