Computer Science Canada

help with net commands

Author:  bill_ion_boi [ Sun Dec 12, 2004 10:59 pm ]
Post subject:  help with net commands

In my program i can connect to another computer but for some reason after the connection the actual game doesnt run like the graphics etc. and the two computers cant play together....

Author:  pluckster [ Mon Dec 13, 2004 7:41 am ]
Post subject: 

yea i think i have a similar problem... or a least i have a problem with net commands. Im working on an IM of sorts right now im working on the connect list of users. it works fine on the scholls network and on my computer but when i send it to my friends to try it out, they cant even connect. if anyone can help us out thatd be awesome.

Author:  SuperGenius [ Mon Dec 13, 2004 4:34 pm ]
Post subject: 

You may not be able to connect to a friend's computer offsite because the Net.LocalAddress command which you will probably be using returns.. the local address, which can and probably will be different from your machine's public address. On how to fix the problem though, I'm not too sure.

Author:  pluckster [ Mon Dec 13, 2004 6:14 pm ]
Post subject: 

Well i guess it would be helpful if you guys could see my programs so ill put em here. The first is the server program and the second is the client

Author:  bill_ion_boi [ Mon Dec 13, 2004 7:28 pm ]
Post subject: 

I Know what the problem is, i can connect to another computer but data is not transfered between the two computers via
code:
if Net.LineAvailable (netStream) then

I know this because in that if statment i put else "data transfer problem" and that is what i get.

They question still remains as to why....PLEASE HELP


If you are looking in my code there are two procdeures called start1 and start2 and they have the "get" commands in them. I call on these procedures after the "if Net.LineAvailable (netStream) " after they make their choice. If choice 1 (server) is chosen then it runs start1 and for choice 2 (client) it runs start2

Author:  pluckster [ Mon Dec 13, 2004 8:12 pm ]
Post subject: 

EUREKA!!!

Quote:
...put "Connected to ", netAddress
delay (10000)
cls

if Net.CharAvailable (netStream) then

if choice = 1 then
player (1).x := 10
player (1).y := 10...


Where in either part of the program is there some sort of code to get the char needed by Net.CharAvailable. i sure can't find any.

Author:  bill_ion_boi [ Mon Dec 13, 2004 8:24 pm ]
Post subject: 

well in that bit of code u posted...after i assign height and width etc to the palyer variables i call on a procedure called start1 or start2 and it is those procedures that have "get" in them

Author:  SuperGenius [ Mon Dec 13, 2004 9:23 pm ]
Post subject: 

It would be helpfull to see those procedures.

Just guessing, did you remember to specify to get from "netStream' rather than the local user?

Author:  bill_ion_boi [ Tue Dec 14, 2004 3:43 pm ]
Post subject: 

I did post the code

Author:  DanShadow [ Tue Dec 14, 2004 5:50 pm ]
Post subject: 

Well...you guys could always just refer to the Turing .NET Tutorial Wink .

Turing .NET Tutorial
http://www.compsci.ca/v2/viewtopic.php?t=5795

Author:  bill_ion_boi [ Tue Dec 14, 2004 7:01 pm ]
Post subject: 

i have nothing there helped me..... Sad

Author:  pluckster [ Wed Dec 15, 2004 1:55 pm ]
Post subject: 

thats what i used. it does work on the schools network but as soon as the program is over the net, it cant connect.

Author:  bill_ion_boi [ Wed Dec 15, 2004 3:43 pm ]
Post subject: 

can someonle explain a little about the following two commands and when to use them?
put : netStream, varname
get : netStream, varname


: