xboxscene.org forums

Author Topic: Any Homebrew Game With Network Support?  (Read 122 times)

The unProfessional

  • Archived User
  • Hero Member
  • *
  • Posts: 679
Any Homebrew Game With Network Support?
« on: June 30, 2003, 08:59:00 AM »

Hey Jippie.  I'll be releasing network support in the game I'm working on.  I haven't begun the network-specific code for this engine yet, but I've done small networkable games in the past.  Study UDP and TCP/IP networking.  There are plenty of great books out there.  Also, study Directplay in the Dx/Xdk docs.

Logged

^Blazed^

  • Archived User
  • Full Member
  • *
  • Posts: 168
Any Homebrew Game With Network Support?
« Reply #1 on: July 01, 2003, 01:26:00 AM »

QUOTE (jippie @ Jul 1 2003, 10:00 AM)
QUOTE (The unProfessional @ Jun 30 2003, 05:59 PM)
Hey Jippie.  I'll be releasing network support in the game I'm working on.  I haven't begun the network-specific code for this engine yet, but I've done small networkable games in the past.  Study UDP and TCP/IP networking.  There are plenty of great books out there.  Also, study Directplay in the Dx/Xdk docs.


Thx for the advice, some one mention winsocks in a different mail.
Could you tell me if the code is sort of the same on both PC and Xbox.
As I only have one XBOX and a PC to test..

Jippie

The socket implementation on the XBox is almost the same as in Windows.

Holler when you get into trouble...

smile.gif
Logged

jippie

  • Archived User
  • Jr. Member
  • *
  • Posts: 95
Any Homebrew Game With Network Support?
« Reply #2 on: July 04, 2003, 09:58:00 AM »

QUOTE (^Blazed^ @ Jul 1 2003, 10:26 AM)

Holler when you get into trouble...

That went easy...
But I do have some questions.

First is that is works but why!!
I don't understand what the xbox's IP address.
Next I am using send & recv are good enough for a game??



CODE
void Client(char *ret)
{
   if( false == SetupNetwork() )
 return;

   sockaddr_in target;
   target.sin_family = AF_INET;
   target.sin_addr.s_addr = inet_addr("192.168.100.66");
   target.sin_port = htons(5003);

   
   if( SOCKET_ERROR == connect(m_socket,(sockaddr*) &target, sizeof(target)) )
   {
 debug("connect() Error");
 char tmp[5000];
 wsprintf(tmp, "LastError= %ldn", WSAGetLastError());
 debug(tmp);
 WSACleanup ();
 return;
   }
   else
   {
 debug("connect()");
   }

   char tmp[500];
   if( SOCKET_ERROR == recv(m_socket, tmp, 500, 0) )
   {
 debug("connect() Error");
 char tmpp[5000];
 wsprintf(tmp, "LastError= %ldn", WSAGetLastError());
 debug(tmpp);
 WSACleanup ();
 return;
   }
   else
   {
 debug("recv from PC");
 debug(tmp);
 strncpy(ret,tmp,10);
 ret[9]='00';
   }
}


CODE

bool SetupNetwork()
{
   WSADATA WsaData;
   int iResult = WSAStartup( 0x0202, &WsaData );
   if( iResult != NO_ERROR )
   {
 debug("WSAStartup Error");
   }

   char tmp[5000];
   m_socket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);

   if( INVALID_SOCKET == m_socket)
   {
 wsprintf(tmp, "LastError= %ldn", WSAGetLastError());
 debug(tmp);
 WSACleanup();
 return false;
   }

   wsprintf(tmp, "SOCKET = %ldn", m_socket);
   debug(tmp);
   return true;
}
Logged

flat235

  • Archived User
  • Sr. Member
  • *
  • Posts: 292
Any Homebrew Game With Network Support?
« Reply #3 on: July 13, 2003, 05:26:00 AM »

biggrin.gif

Cheers

TheDadddy
Logged

derre

  • Archived User
  • Newbie
  • *
  • Posts: 6
Any Homebrew Game With Network Support?
« Reply #4 on: July 13, 2003, 05:35:00 AM »

would it be possible to play homebrew games over the net WITHOUT live and/or tunneling?
Would be cool!
Logged

jippie

  • Archived User
  • Jr. Member
  • *
  • Posts: 95
Any Homebrew Game With Network Support?
« Reply #5 on: July 13, 2003, 07:46:00 AM »

QUOTE (derre @ Jul 13 2003, 02:35 PM)
would it be possible to play homebrew games over the net WITHOUT live and/or tunneling?
Would be cool!

Yes that is what I just did smile.gif

It is being tested and I'm hoping a release within 2/3 days.

jippie
Logged

chilin_dude

  • Archived User
  • Hero Member
  • *
  • Posts: 3068
Any Homebrew Game With Network Support?
« Reply #6 on: July 13, 2003, 08:10:00 AM »

QUOTE (jippie @ Jul 13 2003, 04:46 PM)
QUOTE (derre @ Jul 13 2003, 02:35 PM)
would it be possible to play homebrew games over the net WITHOUT live and/or tunneling?
Would be cool!

Yes that is what I just did smile.gif

It has been test and I'm hoping a release within 2/3 days.

jippie

Yes another homebrew game...is it one of the ones on you're site?
I'm so exited! I loved the other 2games...you need a tester for pal 1.0 or anything then i'd love to!
Logged

Wishi

  • Archived User
  • Full Member
  • *
  • Posts: 191
Any Homebrew Game With Network Support?
« Reply #7 on: July 13, 2003, 08:28:00 AM »

biggrin.gif
Logged

jippie

  • Archived User
  • Jr. Member
  • *
  • Posts: 95
Any Homebrew Game With Network Support?
« Reply #8 on: July 14, 2003, 12:49:00 AM »

QUOTE (chilin_dude @ Jul 13 2003, 05:10 PM)
Yes another homebrew game...is it one of the ones on you're site?
I'm so exited! I loved the other 2games...you need a tester for pal 1.0 or anything then i'd love to!


I just want to learn about network not write a new game, so it's a hacked version of connect4.

Jippie
Logged

t_rex

  • Archived User
  • Jr. Member
  • *
  • Posts: 88
Any Homebrew Game With Network Support?
« Reply #9 on: July 14, 2003, 02:31:00 AM »

What sort of speed's would you need for connect 4 over the net?
Logged

jippie

  • Archived User
  • Jr. Member
  • *
  • Posts: 95
Any Homebrew Game With Network Support?
« Reply #10 on: July 14, 2003, 02:40:00 AM »

QUOTE (t_rex @ Jul 14 2003, 11:31 AM)
What sort of speed's would you need for connect 4 over the net?

2 bytes an hour :-)

Because the game is of type make move and wait.

if you have a 56K modem I think it would be fine.
Do you use a modem and share internet with the xbox?

jippie
Logged