Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 08-15-2008, 01:26 AM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
serverwarp() doesn't work serverside

So I was testing some stuff on jothegreat55555's server, and I tried to make a relog/disconnector (to work on other people), and it doesn't work serversided.

This is the errors in RC that I get
PHP Code:
Script: Function serverwarp not found at line 4 in script of SwitchTest (in level lc_a1.nw at pos (00))
Script: Function serverwarp not found at line 8 in script of SwitchTest (in level lc_a1.nw at pos (00)) 
The first line is using "/relog", the second is using "/disconnect" (obviously).

This is the script I'm using
PHP Code:
function onActionServerSide() {
  if (
params[0] == "/relog") {
    
with (findPlayer(params[1]))
      
serverwarp(servername);
  }
  if (
params[0] == "/disconnect") {
    
with (findPlayer(params[1]))
      
serverwarp("Login");
  }
}

//#CLIENTSIDE
function onPlayerChats() {
  
temp.token player.chat.tokenize();
  if (
player.chat.starts("/relog"))
    
triggerserver("gui",this.name,temp.token[0],temp.token[1]);
  if (
player.chat.starts("/disconnect"))
    
triggerserver("gui",this.name,temp.token[0],temp.token[1]);

My question is, is there any way that it will work serversided, or can it be implemented to be serversided?

Not really necassery, I just think it's kind of odd how switching servers seems to be more like something serversided, not clientsided.
__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.
Reply With Quote
  #2  
Old 08-15-2008, 01:38 AM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Have a clientsided timeout read a random variable, say client.reconnect, then if its true - first unset the variable, then serverwarp. Piece a cake.

EDIT: And it's obviously the client that handles server changes, since it's the client that manually change servers - why would that ever be serversided?
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #3  
Old 08-15-2008, 01:40 AM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
Quote:
Originally Posted by Switch View Post
Not really necassery, I just think it's kind of odd how switching servers seems to be more like something serversided, not clientsided.
just put something like this in a system weapon:

PHP Code:
//#CLIENTSIDE
function onActionclientside() {
  switch(
params[0]) {
    case 
"reconnect":
      
serverwarp(servername);
     break;
  }

then serverside just do
PHP Code:
with (findPlayer(params[1])) 
  
triggerclient("gui"systemweaponnpcname"reconnect"); 
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”

Last edited by Tigairius; 08-15-2008 at 01:54 AM.. Reason: triggerserver -> triggerclient (thanks cbk)
Reply With Quote
  #4  
Old 08-15-2008, 01:44 AM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
Quote:
Originally Posted by xXziroXx View Post
Have a clientsided timeout read a random variable, say client.reconnect, then if its true - first unset the variable, then serverwarp. Piece a cake.

EDIT: And it's obviously the client that handles server changes, since it's the client that manually change servers - why would that ever be serversided?
heh, dont wanna mess with that
And also, it's SERVER changing.
Quote:
Originally Posted by Tigairius View Post
just put something like this in a system weapon:
PHP Code:
function onActionclientside() {
  switch(
params[0]) {
    case 
"reconnect":
      
serverwarp(servername);
     break;
  }

then serverside just do
PHP Code:
with (findPlayer(params[1])) 
  
triggerserver("gui"systemweaponnpcname"reconnect"); 
Was gonna do that, but not sure they want me to
__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.
Reply With Quote
  #5  
Old 08-15-2008, 01:54 AM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Quote:
Originally Posted by cbk1994 View Post
For that script, just keep it clientside anyway.
It's a script to reconnect and disconnect other players. ;p
__________________
Reply With Quote
  #6  
Old 08-15-2008, 02:09 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Chompy View Post
It's a script to reconnect and disconnect other players. ;p
Oh, I read over it too fast :P
__________________
Reply With Quote
  #7  
Old 08-15-2008, 03:06 AM
Tolnaftate2004 Tolnaftate2004 is offline
penguin.
Join Date: Jul 2004
Location: Berkeley, CA
Posts: 534
Tolnaftate2004 is a jewel in the roughTolnaftate2004 is a jewel in the rough
Send a message via AIM to Tolnaftate2004
You guys really win the obfuscation award.

PHP Code:
addweapon("disc or rec"); 
PHP Code:
//#CLIENTSIDE
function onCreated() { serverwarp("Login or Your-Server"); destroy(); } 
__________________
◕‿‿◕ · pfa · check yer syntax! · src

Killa Be: when i got that locker in 6th grade the only thing in it was a picture of a midget useing a firehose :/
Reply With Quote
  #8  
Old 08-15-2008, 04:01 AM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
That destroy() won't be called since the player no longer is on the server.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #9  
Old 08-15-2008, 04:02 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by xXziroXx View Post
That destroy() won't be called since the player no longer is on the server.
Yes it would, it lags a bit. But, it's not a good practice in my opinion.
__________________
Reply With Quote
  #10  
Old 08-15-2008, 04:08 AM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
Quote:
Originally Posted by Tolnaftate2004 View Post
You guys really win the obfuscation award.

PHP Code:
addweapon("disc or rec"); 
PHP Code:
//#CLIENTSIDE
function onCreated() { serverwarp("Login or Your-Server"); destroy(); } 
I don't like to use an entire weapon for the sake of doing a temporary task.
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
  #11  
Old 08-15-2008, 04:57 AM
Tolnaftate2004 Tolnaftate2004 is offline
penguin.
Join Date: Jul 2004
Location: Berkeley, CA
Posts: 534
Tolnaftate2004 is a jewel in the roughTolnaftate2004 is a jewel in the rough
Send a message via AIM to Tolnaftate2004
Quote:
Originally Posted by xXziroXx View Post
That destroy() won't be called since the player no longer is on the server.
The player object still exists for a while after logoff.

Quote:
Originally Posted by cbk1994 View Post
Yes it would, it lags a bit. But, it's not a good practice in my opinion.
And this lag is of no harm to a player who is not really playing the game....

Quote:
Originally Posted by Tigairius View Post
I don't like to use an entire weapon for the sake of doing a temporary task.
And I don't like insecure triggers!
__________________
◕‿‿◕ · pfa · check yer syntax! · src

Killa Be: when i got that locker in 6th grade the only thing in it was a picture of a midget useing a firehose :/
Reply With Quote
  #12  
Old 08-15-2008, 05:02 AM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Quote:
Originally Posted by Tolnaftate2004 View Post
And I don't like insecure triggers!
So how come you and everyone else ignored my suggestion? Just cram it into a script that already uses a .05 timeout and check for client.reconnect there.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #13  
Old 08-15-2008, 05:07 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Tolnaftate2004 View Post
And this lag is of no harm to a player who is not really playing the game....
I basically meant that once calling serverwarp(), the player stays on the server for a few seconds.
__________________
Reply With Quote
  #14  
Old 08-15-2008, 05:07 AM
Tolnaftate2004 Tolnaftate2004 is offline
penguin.
Join Date: Jul 2004
Location: Berkeley, CA
Posts: 534
Tolnaftate2004 is a jewel in the roughTolnaftate2004 is a jewel in the rough
Send a message via AIM to Tolnaftate2004
Quote:
Originally Posted by xXziroXx View Post
So how come you and everyone else ignored my suggestion? Just cram it into a script that already uses a .05 timeout and check for client.reconnect there.
Because... client. variables can be set by a... client...
I could kick you off indefinitely, I guess maybe that's why.

Also, I was not arguing with you cbk, just statin' facts.
__________________
◕‿‿◕ · pfa · check yer syntax! · src

Killa Be: when i got that locker in 6th grade the only thing in it was a picture of a midget useing a firehose :/
Reply With Quote
  #15  
Old 08-15-2008, 05:08 AM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Quote:
Originally Posted by Tolnaftate2004 View Post
Because... client. variables can be set by a... client...
I could kick you off indefinitely, I guess maybe that's why.
Yeah, but it's a such a likely scenario.


Then how about checking for clientr.reconnect, and if it is true, reconnect the player. Then, have it set to false upon login in the Control-NPC? Happy now?
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 04:55 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.