Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Problems with chatting in my game.

Author
Message
Mussi
21
Years of Service
User Offline
Joined: 27th Jan 2003
Location: Netherlands
Posted: 12th Aug 2003 17:42
I attached my chat code. When I input a message it doesn't appears on the screen and other players can't see it to, can some one tell me whats the prob?
Specs: AMD Athlon 1800, 256 DDRRam 266mhz, 80GB HD 7200rmp U133, Geforce 4 Ti4400 128mb ddr sdram
Mussi
21
Years of Service
User Offline
Joined: 27th Jan 2003
Location: Netherlands
Posted: 13th Aug 2003 00:08
I know nobody wants to go throug that code but PLZ HELP ME!!!!

Specs: AMD Athlon 1800, 256 DDRRam 266mhz, 80GB HD 7200rmp U133, Geforce 4 Ti4400 128mb ddr sdram
Attreid
21
Years of Service
User Offline
Joined: 27th Nov 2002
Location:
Posted: 13th Aug 2003 18:13
the problem with this code is that you need to be several for the test ...
you should try it with your contacts .. I'm sure you know people who has DBP

"He will come...the voice from the outer world,
bringing the holy war, the Jihad, which will cleanse the Universe and bring us out of darkness."
Mussi
21
Years of Service
User Offline
Joined: 27th Jan 2003
Location: Netherlands
Posted: 13th Aug 2003 18:58
I tried but it didn't work
maybe some1 can see whats the prob...
I'M IN DESPERATE NEED OF HELP!!! PLZ HELP ME!!!

Specs: AMD Athlon 1800, 256 DDRRam 266mhz, 80GB HD 7200rmp U133, Geforce 4 Ti4400 128mb ddr sdram
waffle
22
Years of Service
User Offline
Joined: 9th Sep 2002
Location: Western USA
Posted: 13th Aug 2003 20:53 Edited at: 13th Aug 2003 21:02
i looked at it, i do not have time to test today though. What I would do is add some debugging code to see whats happening....

example:
1 - when you send network string, print that string on the screen.
it doesn't need to be neat, you just need to actually see what your
raw data looks like.

2 - when you recieve the data, print that out too. Examine the raw incoming data and verify its the same data you sent. Sounds stupid,
but you'll be surprised how this helps when things begin to get a
little complicated because you will eventually have many dif types
of messages....
chat
ping
pong
target-moves
weapon-moves
and so on

3 - verify your code is dividing the data correctly. You know, mixing
the position data with chat data. Print each part to the screen.

4 - another problem is ensure that you are not sending data too often. I normally place a timer variable that checks to see how long
it has been since the last transmition. Any time over 500 should be fine... 500 is based upon the Timer() function... 1000=1 sec.

5 - be on the lookout for lost data packets. If running in a "slow" mode, this will become a real problem. If running in exclusive mode, having a second program on your PC trying to talk, will not work because it will be on hold. Thats why 2 PC not behind a firewall are required for early testing.

see if this gets you going in the right direction. Sometimes, learning new ways to debug is better than having code work right the first time.I looked at the code some more.... i think there is something missing..... where is the code you used to create the game?
You'll never recieve any messages unless you create a network game.
Mussi
21
Years of Service
User Offline
Joined: 27th Jan 2003
Location: Netherlands
Posted: 13th Aug 2003 23:20
the create game and stuff are basic things, I left them out so it would be less complicated. thanks for the tip

Specs: AMD Athlon 1800, 256 DDRRam 266mhz, 80GB HD 7200rmp U133, Geforce 4 Ti4400 128mb ddr sdram
Mussi
21
Years of Service
User Offline
Joined: 27th Jan 2003
Location: Netherlands
Posted: 14th Aug 2003 00:13
done that, it recieves the data but doesn't put it in the variables, and iI can't figure out why... now I really need some help

Specs: AMD Athlon 1800, 256 DDRRam 266mhz, 80GB HD 7200rmp U133, Geforce 4 Ti4400 128mb ddr sdram
waffle
22
Years of Service
User Offline
Joined: 9th Sep 2002
Location: Western USA
Posted: 15th Aug 2003 21:39
have you stepped through

readmpdata:

and verified that you are parsing your data properly?
and of course print or show all variables as your parse your data.
Perhaps, create a small test app that just parses the same text only. Basically, an app that only has your parsing code, so its not multiplayer. Then, you can give it some text to parse, and see how it does. Your parsing method seems complicated too me. I tend to use fixed lenght strings so all data is the same size. Example:

position data from 0-9999 in value (4 bytes as text)
PosX=37
PosY=907
PosZ=1509

Convert to fixed length strings
PX_S=right("00000"+trim(str(PosX)),4)
PY_S=right("00000"+trim(str(PosY)),4)
PZ_S=right("00000"+trim(str(PosZ)),4)

create your message
use a * to identify data to follow
msg="*"+PX_S+PY_S+PZ_S

parse the text on the return side
if left(msg,1)="*"
data to follow
msg=right(msg,12)
PX_S=Left(msg,4)
msg=Right(msg,8)
PY_S=Left(msg,4)
PZ_S=right(msg,4)

Get the actual value
PosX=Val(PX_S)
PosY=Val(PY_S)
PosZ=Val(PZ_S)
else
this is a chat message
endif

this technic can be used with memblocks too, but thats a bit more advanced as position data can be done as floating point and still only take up 4 bytes per position.

Login to post a reply

Server time is: 2024-09-20 19:34:28
Your offset time is: 2024-09-20 19:34:28