0 registered members (),
17,416
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Anything wrong with "send_var" ???
#142475
07/20/07 23:31
07/20/07 23:31
|
Joined: Jul 2004
Posts: 38 Germany, NRW
Black_Sheep
OP
Newbie
|
OP
Newbie
Joined: Jul 2004
Posts: 38
Germany, NRW
|
Hi, its me again. Iam converting LocosMPTut. Iam at the point, where i should do the first testrun. But my client always crashed, wenn he gets the updated Var from server! Something with this statement from jcl? Quote:
It is just a different function for accessing lite-C variables instead of C-Script variables. send_var and send_skill currently only support C-Script variables. Lite-C variables and structs will be implemented in a future version.
Code:
var people_connected = 0;
function server_called() { // if new player connected, increment people connected if ((event_type == EVENT_JOIN) && (people_connected <= MAX_CONNECTIONS)) { people_connected += 1; // another person connected wait(-5); // wait for the client to load the lvl send_var(people_connected); // send number of people connected } ... }
function startup() { on_server = server_called; // on server event, call server_called() }
function main() { ... startup(); ... }
Last edited by Black_Sheep; 07/20/07 23:32.
A7 Commercial.
|
|
|
Re: Anything wrong with "send_var" ???
[Re: Shadow969]
#142477
07/22/07 15:21
07/22/07 15:21
|
Joined: Jul 2004
Posts: 38 Germany, NRW
Black_Sheep
OP
Newbie
|
OP
Newbie
Joined: Jul 2004
Posts: 38
Germany, NRW
|
this doesnt work too! The Client crushed at the same point. I can setup my watch at this. At the point he find the server in the engine window, i can count the 5 secounds of the wait(-5) and than the client crash. I own a A7 Com btw (eddited my signature for this). Any other ideas? Or do u need more code?
A7 Commercial.
|
|
|
Re: Anything wrong with "send_var" ???
[Re: D3D]
#142479
07/22/07 16:04
07/22/07 16:04
|
Joined: Jul 2004
Posts: 38 Germany, NRW
Black_Sheep
OP
Newbie
|
OP
Newbie
Joined: Jul 2004
Posts: 38
Germany, NRW
|
no, this is not right here. I had published the program and it happens too. its very strange... the original code of the tutoriall (all is coded in C-Script) works fine.
A7 Commercial.
|
|
|
Re: Anything wrong with "send_var" ???
[Re: Black_Sheep]
#142480
07/22/07 17:00
07/22/07 17:00
|
Joined: Apr 2006
Posts: 1,551 Netherlands
D3D
Serious User
|
Serious User
Joined: Apr 2006
Posts: 1,551
Netherlands
|
From SED prefs / XP ConsoleSERVER -sv -cl -pl Observer -diag CLIENT -cl -pl ThePlayer -diag downloadCode:
#include <acknex.h> #include <default.c>
#define MAX_CONNECTIONS 8
FONT* arial_font = "Arial#20b";
var people_connected = 0;
function server_called() { // if new player connected, increment people connected if ((event_type == EVENT_JOIN) && (people_connected <= MAX_CONNECTIONS)) { people_connected += 1; // another person connected wait(-5); // wait for the client to load the lvl send_var(people_connected); // send number of people connected } }
function startup() { on_server = server_called; // on server event, call server_called() }
PANEL* pConnectDisplay = { digits(25,25,2,arial_font,1,people_connected); flags = VISIBLE; }
function main() { fps_max=60; screen_color.blue=125; startup(); }
|
|
|
Re: Anything wrong with "send_var" ???
[Re: D3D]
#142481
07/22/07 17:19
07/22/07 17:19
|
Joined: Jul 2004
Posts: 38 Germany, NRW
Black_Sheep
OP
Newbie
|
OP
Newbie
Joined: Jul 2004
Posts: 38
Germany, NRW
|
This test code dont work! Its the same as my own code. After several restarts of the host and the server, there is someting new... Sometimes the Client didnt crushed after the 5 secounds, but he didnt get the actual var from the server. Ive started a secound client and the first client didnt get the var here too (the secound client crashed but the server count the var upwards). Hmm whats up with my Engine? Iam beleaving it depends on Vista... grml... "Run it as Administrator" dont solve the problem. Disabling the Windows Firewall dont solve it too.
Any new ideas? Btw, thx for your help.
Last edited by Black_Sheep; 07/22/07 17:28.
A7 Commercial.
|
|
|
Re: Anything wrong with "send_var" ???
[Re: D3D]
#142483
07/22/07 19:27
07/22/07 19:27
|
Joined: Jul 2004
Posts: 38 Germany, NRW
Black_Sheep
OP
Newbie
|
OP
Newbie
Joined: Jul 2004
Posts: 38
Germany, NRW
|
All right... my might with WinXP tested it and it works as u said... hmm.. maybee i ask conitec for vista support.
A7 Commercial.
|
|
|
|