Client - PLEASE HELP!

Ask for help with your homework/assignments in this forum!

Moderators: Darobat, RecursiveS, Dante Shamest, Bugdude, Wizard

Client - PLEASE HELP!

Postby markpratt » Sat Dec 13, 2003 11:05 pm

Hi Everyone,
I have a group assignment to do and I need to basically get a simple blackjack game working over a network. So basically we have to make a Client and a server. My job is to make the game and a Client. This has to be done for next Thursday and I have been dropped in the deep end and have NEVER programmed in C++ before! :cry:
I know that I am never going to get it fully working but to at least pass I need to at least get a little Client together that at least can pass messages over the network. So what I want to do is just at least get a little chat Client working or something. We have to be able to show we can create sockets. I know that some of the processes I should need to use are: Socket(), bind(), connect() and close().
The Socket type I am using is TCP. As you can probably guess I'm really stressing about this now because I have no idea how to go about it. I'm sorry but I don't have any code to post up here.
I'm not expecting anyone to do this for me but any help that anybody is willing to give me will be more than appreciated. Any code, examples or anything that might help me at least get a simple Client set up will be of great help. Or if somebody has the time to do a little more than that feel free.
PLEASE HELP!!!

Thank you for any help, Mark.

P.S. If anybody does want to help but needs more information on what I have to do just ask.

(The reason I have never used C++ before is because I took a year out at uni and then when I came back they had changed the programming we are using from Java to C++ so it's my supid Uni's fault that I can't do this!)
markpratt
 
Posts: 2
Joined: Sat Dec 13, 2003 11:01 pm

Postby omnius » Sun Dec 14, 2003 3:41 am

Looks like you're going to flunk your course. Oh well.
omnius
 
Posts: 496
Joined: Wed Sep 24, 2003 12:03 pm

It's Not My Fault!

Postby markpratt » Sun Dec 14, 2003 9:36 am

Look, it's not my fault I have an assignment to do on C++ but don't know C++ (as I explained before) but I asked for help, not little comments that are no use to anybody! If you don't want to help then don't :cry:
markpratt
 
Posts: 2
Joined: Sat Dec 13, 2003 11:01 pm

Re: It's Not My Fault!

Postby omnius » Sun Dec 14, 2003 9:39 am

markpratt wrote:If you don't want to help then don't :cry:

I already didn't ;)

You haven't a hope in hell of doing this in the time scale you're after with no previous experience of C++, and if somehow you get so much help that it's practically done for you, how will that really help you?

You need to go back to your tutor.
omnius
 
Posts: 496
Joined: Wed Sep 24, 2003 12:03 pm

Postby raimo » Sun Dec 14, 2003 10:04 am

Why didn't you tell them that you code the client in Java? ;)
Maybe you did but you were just too lazy to code it(just guessing, I know I'm wrong). One thing is sure: no one here is going to code the client for you.

If you really think you want to try, the most efficient way to do your assigment is not posting to a forum but rather go and find information on sockets and c++.
User avatar
raimo
 
Posts: 372
Joined: Fri Sep 26, 2003 6:50 am
Location: Finland

Postby ADnova » Mon Dec 15, 2003 12:14 am

First thing, just relax. Bigger projects have been done in less time (probably :D ). You still have what, 4 days? Well, you can forget developing a deep understanding of networking and C++. Just focus on getting something done and then do it.

Here are two pages you should start looking at (look at, not just copy and paste - not that you would do that, of course) :
One - for sockets, networking, etc.
http://www.gametutorials.com/Tutorials/Networking/Networking_Pg1.htm

Two - Blackjack
http://www.gametutorials.com/Tutorials/GT/GT_Pg1.htm


As for not knowing C++ well... it's going to be tough! But you said it was a group assignment so let them know you need help before the night before.
ADnova
 
Posts: 86
Joined: Tue Dec 09, 2003 6:04 pm
Location: Canada

Postby _XTREME_ » Wed Dec 17, 2003 3:56 am

First, there are several things that you need to do. After doing them you get connected to the server.

Code: Select all
#define itdnet "212.116.128.10"
...
//WinSock init
WORD wVersionRequested;
WSADATA wsaData;
wVersionRequested = MAKEWORD( 1, 1 );
WSAStartup( wVersionRequested, &wsaData);
...
//creation
SOCKET MySocket;
MySocket=socket(AF_INET, SOCK_STREAM, 0);SOCKADDR_IN SockAddr;                              
SockAddr.sin_port = htons(6667);//port 6667 (irc server)
SockAddr.sin_family = AF_INET;
SockAddr.sin_addr.s_addr = inet_addr(itdnet);
...
//connection
while(connect(MySocket, (SOCKADDR *)(&SockAddr), sizeof(SockAddr)) !=0 )
{   
};


You are now connected to the IP defined in the first row. btw the server-side is harder and you can not pass it without multithreading :)))))
PostQuitMessage(0);
/* Join the Dark Forces! */
User avatar
_XTREME_
 
Posts: 102
Joined: Tue Dec 16, 2003 2:54 pm
Location: V. Tyrnovo, Bulgaria, Europe :)


Return to Homeworks

Who is online

Users browsing this forum: No registered users and 0 guests