|
|
functions server side or client
#94557
10/15/06 10:52
10/15/06 10:52
|
Joined: Sep 2006
Posts: 108
Jered
OP
Member
|
OP
Member
Joined: Sep 2006
Posts: 108
|
ok I got a question. by default is a function executed on the server side or the client side if not put in a ifdef server or else ifdef client part.
I mean if you had nothing but two scripts that only had the code needed to connect then added a function without saying where to execute it, does the server and the client both automatically execute it, or just the server or just the client? what?
3DGS (6.4) Commercial
|
|
|
Re: functions server side or client
[Re: Excessus]
#94559
10/15/06 12:14
10/15/06 12:14
|
Joined: Sep 2006
Posts: 108
Jered
OP
Member
|
OP
Member
Joined: Sep 2006
Posts: 108
|
ok, so if there is a function being called from main it is ran on both the server and the client if it is not set aside to just the server or just the client.
if I am getting this correctly, then main should really be set up in two sections....everything I want the server to perform in a ifdef server, or esle if (connection == 1); and anything i want the client to do without the server doing it has to be put in the ifedf client; or else if (connection == 2)....as far as the "main" function is concerned?
Looks to me if you do not split it up that way, hten you have the same function running on both the client and the server, when that is not always nessasry...is this all correct? if not I am trying to learn, so any help would be aprreciated.
3DGS (6.4) Commercial
|
|
|
Re: functions server side or client
[Re: Excessus]
#94561
10/15/06 12:31
10/15/06 12:31
|
Joined: Sep 2006
Posts: 108
Jered
OP
Member
|
OP
Member
Joined: Sep 2006
Posts: 108
|
ok so would you set the code inside ifdef in a while(1) wait(1) or would the function main itself take care of it, or does it matter where you put it? like for me the first thing I do is use a ifdef to wait on a connection, after that I want to do another ifdef and do what you are doing. The function main would take care of going back through it time and time again or would I have to put everything in a while(1) wait (1)?
3DGS (6.4) Commercial
|
|
|
Re: functions server side or client
[Re: Excessus]
#94563
10/15/06 12:38
10/15/06 12:38
|
Joined: Sep 2006
Posts: 108
Jered
OP
Member
|
OP
Member
Joined: Sep 2006
Posts: 108
|
okey, I think I get it all now, thank you so much Excessus, very much aprreciated...if i have further questions i will post them back to this thread.
3DGS (6.4) Commercial
|
|
|
|
|
|