Allegro.cc - Online Community

Allegro.cc Forums » Off-Topic Ordeals » Can you help me test a chat test program?

This thread is locked; no one can reply to it. rss feed Print
Can you help me test a chat test program?
Richard Phipps
Member #1,632
November 2001
avatar

Hi Guys,

This is the second net 'chat' application I have written, this time it uses OpenGL and the Raknet library. It's still pretty simple, but I hope to build on it to allow internet play in future fames. It works well with using the 'local loop' to connect to my PC, but I suspect connecting via the Net will be more problematic. Can anyone out there help me test it?

Download:
http://www.reflectedgames.com/Chat_Test.zip

My IP is:
81.104.225.193

Press 'n' and enter when asked for server y/n?
Enter your username
Enter the IP..

Thanks!
Rich

GullRaDriel
Member #3,861
September 2003
avatar

It's working for me for the local part. As I am at work I can not test the internet part.

The main problem for me is that you send a message even when it is an empty one, and that à,ë,ï,é,è... are not supported.

EDIT: Even ê,ô,û,â and others are not.

Hmm ha, and the just the server is consumming 27% of my Athlon64 X2 .

For the internet thing, I can say that you will not have any other problem than a bigger latency. As a chat is not necessary a time critical app, you do not need to worry.

"Code is like shit - it only smells if it is not yours"
Allegro Wiki, full of examples and articles !!

Richard Phipps
Member #1,632
November 2001
avatar

Hi Gull,

Sorry, I'm only really checking for english language specific keys at the moment.
I'm also doing sleep(1) every frame, so I'm surprised it is using 27%..

Quote:

For the internet thing, I can say that you will not have any other problem than a bigger latency. As a chat is not necessary a time critical app, you do not need to worry.

I only intend to use it for turn-based games, so I'm hoping I won't have too many problems. But I'd imagine there are some issues I'm not aware of yet with doing this kind of thing.

DanielH
Member #934
January 2001
avatar

You know my results.

I would type 'typing' and this would show up 'typiping'. Where'd that extra p come from?

Mine is a 600MHz PCIII.

What network lib are you using?
What does your input look like?

Richard Phipps
Member #1,632
November 2001
avatar

I have no idea! It doesn't do this for me or for a few other people who have tested.

There shouldn't be a difference between the text you enter at the bottom and your text that appears on the screen as it is printed 'locally'..

DanielH
Member #934
January 2001
avatar

Here is what I used for my networked connect four game (attached)

I'm using gamecom for the net lib.

1if ( keypressed() )
2{
3 // if mouse lies inside chat box
4 if ( mouse_x >= 128 && mouse_x <= SCREEN_W - 129 &&
5 mouse_y >= SCREEN_H - 108 && mouse_y <= SCREEN_H - 92 )
6 {
7 ch = readkey() & 0xff;
8 
9 // if backspace is pressed and length is > 0
10 if ( ch == 8 && strlen( chat_string ) > 0 )
11 {
12 strcpy( buf,"" );
13 strncat( buf, chat_string, strlen( chat_string ) - 1 );
14 strcpy( chat_string, buf );
15 }
16 
17 // if can add another character to string
18 if ( strlen( chat_string ) < 39 )
19 {
20 if ( ch >= ' ' && ch <= '~' )
21 {
22 sprintf( chat_string, "%s%c", chat_string, ch );
23 }
24 }
25 
26 // if enter is pressed
27 if ( ch == 13 )
28 {
29 chat_list[ p_local ].addMessage( chat_string );
30 
31 if ( type == TYPE_PEER )
32 {
33 // add message to message queue
34 gc->QueueMessage(peer,GCOM_SEND_CHAT,chat_string);
35 }
36 strcpy( chat_string, "" );
37 }
38 }
39 else
40 {
41 clear_keybuf();
42 }
43}

GullRaDriel
Member #3,861
September 2003
avatar

@Phipps: It is using 27% because I run both client & server from same host ! Yeah, I made a mistake on my first post: Just the server and one client are consumming 27% of my unit.

"Code is like shit - it only smells if it is not yours"
Allegro Wiki, full of examples and articles !!

Marco Radaelli
Member #3,028
December 2002
avatar

Quote:

I would type 'typing' and this would show up 'typiping'. Where'd that extra p come from?

I guess, key repeating is starting too early (and it repeats each key you are pressing, not just the last one).

I'm firewalled here in uni, I'll see if I have time to test it when I get home :)

Go to: