Graal Forums  

Go Back   Graal Forums > Development Forums > Future Improvements
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-01-2012, 11:39 AM
Gunderak Gunderak is offline
Coder
Gunderak's Avatar
Join Date: Jun 2011
Location: Australia
Posts: 795
Gunderak is on a distinguished road
onRCPlayerLogin and onRCPlayerLogout

We already have onPlayerLogin and onPlayerLogout.
It would be really handy to have these functions.
__________________

Gund for president.

Remote PM {P*}x (Graal813044) from eraiphone -> Stefan: I hav 1 qustion
*Gunderak: he hav 1
*Gunderak: qustion
Reply With Quote
  #2  
Old 03-01-2012, 08:29 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Is this really necessary? You can already pretty much reproduce this behaviour when RCs log on by checking if the player.level.name == "", and I don't really know why your scripts should care if an RC logs off.
__________________
Skyld
Reply With Quote
  #3  
Old 03-02-2012, 12:06 AM
Gunderak Gunderak is offline
Coder
Gunderak's Avatar
Join Date: Jun 2011
Location: Australia
Posts: 795
Gunderak is on a distinguished road
I have one which exports the servers playercount to a external server and would like to be able to check when an RC logs off.
Checking onPlayerLogoff doesn't work for RC's as far as I'm aware.
__________________

Gund for president.

Remote PM {P*}x (Graal813044) from eraiphone -> Stefan: I hav 1 qustion
*Gunderak: he hav 1
*Gunderak: qustion
Reply With Quote
  #4  
Old 03-02-2012, 12:40 AM
Emera Emera is offline
Delterian Hybrid
Emera's Avatar
Join Date: Mar 2011
Location: Newcastle Upon-Tyne
Posts: 1,704
Emera is a jewel in the roughEmera is a jewel in the rough
Quote:
Originally Posted by Gunderak View Post
I have one which exports the servers playercount to a external server and would like to be able to check when an RC logs off.
Checking onPlayerLogoff doesn't work for RC's as far as I'm aware.
What's wrong with making your own function? It's easily done.
__________________
Reply With Quote
  #5  
Old 03-02-2012, 01:04 AM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by Gunderak View Post
I have one which exports the servers playercount to a external server and would like to be able to check when an RC logs off.
Checking onPlayerLogoff doesn't work for RC's as far as I'm aware.
If that's the case, why doesn't your external site report the number of players instead of the number of RCs? :v
__________________
Skyld
Reply With Quote
  #6  
Old 03-02-2012, 06:18 AM
Gunderak Gunderak is offline
Coder
Gunderak's Avatar
Join Date: Jun 2011
Location: Australia
Posts: 795
Gunderak is on a distinguished road
It shows both.
But it updates when players log on or off but not when RC's log on or off.
And Emera did you even read my post -.-?
__________________

Gund for president.

Remote PM {P*}x (Graal813044) from eraiphone -> Stefan: I hav 1 qustion
*Gunderak: he hav 1
*Gunderak: qustion
Reply With Quote
  #7  
Old 03-02-2012, 06:21 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
Why not just have a timeout update the count every few minutes? You don't need an exact count on your website.
__________________
Reply With Quote
  #8  
Old 03-02-2012, 06:34 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
You could also GET the xml file from statistic.graal.us and not have to setup a system at all.
__________________
Quote:
Reply With Quote
  #9  
Old 03-02-2012, 04:36 PM
Gunderak Gunderak is offline
Coder
Gunderak's Avatar
Join Date: Jun 2011
Location: Australia
Posts: 795
Gunderak is on a distinguished road
I know I could do that, but I wanted to make this as a challenge for myself.
Not just use an already existing system.
__________________

Gund for president.

Remote PM {P*}x (Graal813044) from eraiphone -> Stefan: I hav 1 qustion
*Gunderak: he hav 1
*Gunderak: qustion
Reply With Quote
  #10  
Old 03-02-2012, 04:41 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
PHP Code:
function onCreated() {
  
onTimeout(true);
}

function 
onTimeout(force_update) {
  for (
temp.aallplayers) {
    if (
temp.a.level == NULLtemp.count_rc++;
    else 
temp.count_players++;
  }
  if (
this.last_rc != temp.count_rc || this.last_players != temp.count_players || force_update) {
    
requesturl("http://yourhost.com/api.php?rc=" temp.count_rc "&players=" temp.count_players);
    
this.last_rc temp.count_rc;
    
this.last_players temp.count_players;
  }
  
setTimer(5);

some challenge huh?
__________________
Quote:
Reply With Quote
  #11  
Old 03-02-2012, 06:46 PM
Emera Emera is offline
Delterian Hybrid
Emera's Avatar
Join Date: Mar 2011
Location: Newcastle Upon-Tyne
Posts: 1,704
Emera is a jewel in the roughEmera is a jewel in the rough
Quote:
And Emera did you even read my post -.-?
From what has been posted by CBK and FowlPlay4, it is possible to script this. And yes, I read your post.
__________________
Reply With Quote
  #12  
Old 03-03-2012, 04:31 AM
Gunderak Gunderak is offline
Coder
Gunderak's Avatar
Join Date: Jun 2011
Location: Australia
Posts: 795
Gunderak is on a distinguished road
Jerret just because you are better than someone at something doesn't mean you should be a smart arse.
It was a challenge to make the PHP script to do it.
The GS2 was easy.
:P
__________________

Gund for president.

Remote PM {P*}x (Graal813044) from eraiphone -> Stefan: I hav 1 qustion
*Gunderak: he hav 1
*Gunderak: qustion
Reply With Quote
  #13  
Old 03-03-2012, 04:44 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 Gunderak View Post
Jerret just because you are better than someone at something doesn't mean you should be a smart arse.
It was a challenge to make the PHP script to do it.
The GS2 was easy.
:P
PHP Code:
<?php
$playerCount 
$_GET['players'];
file_put_contents("players.txt"$playerCount);
?>
?
__________________
Reply With Quote
  #14  
Old 03-03-2012, 05:27 AM
Gunderak Gunderak is offline
Coder
Gunderak's Avatar
Join Date: Jun 2011
Location: Australia
Posts: 795
Gunderak is on a distinguished road
Why would I want to save it in a text file?
I chose to write text to a template image and save it as an image so I can just display it in a signature or anything.
__________________

Gund for president.

Remote PM {P*}x (Graal813044) from eraiphone -> Stefan: I hav 1 qustion
*Gunderak: he hav 1
*Gunderak: qustion
Reply With Quote
  #15  
Old 03-03-2012, 01:25 PM
Emera Emera is offline
Delterian Hybrid
Emera's Avatar
Join Date: Mar 2011
Location: Newcastle Upon-Tyne
Posts: 1,704
Emera is a jewel in the roughEmera is a jewel in the rough
Quote:
Originally Posted by Gunderak View Post
Jerret just because you are better than someone at something doesn't mean you should be a smart arse.
It was a challenge to make the PHP script to do it.
The GS2 was easy.
:P
There's really no need to start raging, and there was really no need for childish negative reputation either. You're not going to get answers if you're flaring at people.
__________________
Reply With Quote
  #16  
Old 03-03-2012, 04:17 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by Gunderak View Post
Why would I want to save it in a text file?
I chose to write text to a template image and save it as an image so I can just display it in a signature or anything.
Using the GD library to throw some stuff onto a base image isn't exactly difficult either, you know..
Reply With Quote
  #17  
Old 03-04-2012, 09:40 AM
Gunderak Gunderak is offline
Coder
Gunderak's Avatar
Join Date: Jun 2011
Location: Australia
Posts: 795
Gunderak is on a distinguished road
For someone who has never experimented with it before it is.
__________________

Gund for president.

Remote PM {P*}x (Graal813044) from eraiphone -> Stefan: I hav 1 qustion
*Gunderak: he hav 1
*Gunderak: qustion
Reply With Quote
  #18  
Old 03-04-2012, 09:55 AM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by Gunderak View Post
For someone who has never experimented with it before it is.
Yes, I know. Starting off with something you never did before might not seem easy. But it's not a challenge. If you end up with just a couple lines of easy to understand code, it's not a challenge, no matter how long it took for you to understand it. And in this case, you could just use it elsewhere or write some dummy code to get familiar with that kind of stuff.
Reply With Quote
  #19  
Old 03-04-2012, 12:16 PM
Gunderak Gunderak is offline
Coder
Gunderak's Avatar
Join Date: Jun 2011
Location: Australia
Posts: 795
Gunderak is on a distinguished road
It was a challenge to me to make this whole system is what I meant.
I'm starting to ease off of GS2 as it will not help my career.
I would like to get into web development that's why I'm learning PHP.
Well some may consider it a project idk but it was fun making it.
__________________

Gund for president.

Remote PM {P*}x (Graal813044) from eraiphone -> Stefan: I hav 1 qustion
*Gunderak: he hav 1
*Gunderak: qustion
Reply With Quote
  #20  
Old 03-04-2012, 03:58 PM
BlueMelon BlueMelon is offline
asdfg
BlueMelon's Avatar
Join Date: Sep 2008
Posts: 1,481
BlueMelon is a splendid one to beholdBlueMelon is a splendid one to beholdBlueMelon is a splendid one to beholdBlueMelon is a splendid one to behold
Quote:
Originally Posted by Gunderak View Post
It was a challenge to me to make this whole system is what I meant.
I'm starting to ease off of GS2 as it will not help my career.
I would like to get into web development that's why I'm learning PHP.
Well some may consider it a project idk but it was fun making it.
If you want to get into web development, stop GS2 completely and make basic systems if PHP...

When I learnt PHP I challenged myself to make basic shop scripts and a basic CMS blog system.
__________________
http://i.imgur.com/OOJbW.jpg
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 08:38 AM.


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