Rotation notifier app
Moderators: RTCW Admins, Super Moderators, vB3 - Administrators
25 posts
• Page 1 of 2 • 1, 2
Rotation notifier app
Would it be possible to write a small program that notifies people in Windows the map has been changed? I think it could be useful for a lot of players. I'm so sick of beach that I just want to play different maps only. I know there are other players in the same boat. So I think a simple program that alerts you in Windows whenever the server changes from mp_beach is a good idea.
Thoughts?
Thoughts?
Re: Rotation notifier app
+1
I might do it for linux when I'm bored :) On the ecgnetwork main page there's a part where you can see the actual map, a little script could check the page, filter it, and alert somehow if it's not beach :) Love your idea, but never wrote a line for windows sry :D
I'm sure there are smarter ways to do it (by querying the rtcw server itself), but have no clue how it is done. Ask a pro and do it, won't be longer than two lines and it's useful imo!
J.
I might do it for linux when I'm bored :) On the ecgnetwork main page there's a part where you can see the actual map, a little script could check the page, filter it, and alert somehow if it's not beach :) Love your idea, but never wrote a line for windows sry :D
I'm sure there are smarter ways to do it (by querying the rtcw server itself), but have no clue how it is done. Ask a pro and do it, won't be longer than two lines and it's useful imo!
J.
Re: Rotation notifier app
Half the players on ECGN want maps and the other half want beach. It's best to keep it the way it is because no matter which direction we go we will lose the support of half the players.
You could probably write a script to email users when the map changes and set it as a cron job to check every 5 minutes or so. Here is the PHP code for getting just basic info from the server and putting it into an array called "serverInfo" in case anyone is interested.
You could probably write a script to email users when the map changes and set it as a cron job to check every 5 minutes or so. Here is the PHP code for getting just basic info from the server and putting it into an array called "serverInfo" in case anyone is interested.
- Code: Select all
$ip= "64.237.36.250";
$host="udp://".$ip; // udp://ipserver
$port=27960;
// SOCKET CONNECTION
$fp = fsockopen($host, $port, $errno, $errstr, 20);
if (!$fp) {
die("Unable to create socket: ".$host.":".$port." $errstr<br />");
} else {
//fwrite($fp, "\xFF\xFF\xFF\xFFgetinfo");
//$data = fread($fp, 350);
fwrite($fp, "\xFF\xFF\xFF\xFFgetstatus");
$data = fread($fp, 4096);
fclose($fp);
}
// EXTRACTING SERVER INFORMATION
// divided by lines
$serverdata = explode("\n", $data);
// share infos
$setting = explode("\\", $serverdata[1]);
$infoserver = array();
for ($i=1; $i<count($setting); $i+=2) $infoserver[$setting[$i]] = $setting[$i+1];
foreach ($infoserver AS $name => $value) {
if ($name!=="sv_hostname") {
$value = preg_replace('/\^([0-9]){1}/', '', $value);
$serverInfo[trim($name)] = trim($value);
}
}
Re: Rotation notifier app
There's a serious problem with this solution. It's longer than two lines!
Thanks for the nice description, it's a crossplatform solution for everyone.
If enough ppl are interested maybe even ecgnetwork could host something (causing less traffic on the rtcw server when tens of thousands are interested :X), where ppl could sign up for mapchange notifications using their existing accounts. It's just a first idea, could be implemented many ways, by many ppl. Pls share your opinions. I'll implement my private version tonight imo (playing some sound locally instead of sending mail) :)
Rotation itself: I never understood why ppl stick to beach so much, but I accept it, that's how things are going here, wolfys idea is a great solution for lots I'm sure. Bravo!
J.
Thanks for the nice description, it's a crossplatform solution for everyone.
If enough ppl are interested maybe even ecgnetwork could host something (causing less traffic on the rtcw server when tens of thousands are interested :X), where ppl could sign up for mapchange notifications using their existing accounts. It's just a first idea, could be implemented many ways, by many ppl. Pls share your opinions. I'll implement my private version tonight imo (playing some sound locally instead of sending mail) :)
Rotation itself: I never understood why ppl stick to beach so much, but I accept it, that's how things are going here, wolfys idea is a great solution for lots I'm sure. Bravo!
J.
Re: Rotation notifier app
I guess if enough people showed an interest in this and it was ok with MAA I would implement this into the web site since I already wrote most of it while eating breakfast. I personally think its a waste of CPU and would probably just cause the server to be less full since some players will only join when notified instead of playing beach and waiting for a new map.
Re: Rotation notifier app
Maybe you're right. Anyhow, I would vote for including the feature, I believe less motivated ppl are better than more unmotivated. It's not my responsibility, you deal with the community, you know better.
J.
J.
Re: Rotation notifier app
Here I finished the script and attached it below. Make sure you edit the array for $users_email and the directory that the script is located in is writable by the cron user.
*NOTE* I haven't tested the script. Also if you have SSH access then it's probably better to do this with Perl or something other than PHP.
I will add this to the web server, so if you want to be notified of map changes you can PM me your email address for an email message or your cell phone number and carrier for a text message and I will add it to the list. I wont be doing subscribed and unsubscribe forms for this feature.
*NOTE* I haven't tested the script. Also if you have SSH access then it's probably better to do this with Perl or something other than PHP.
I will add this to the web server, so if you want to be notified of map changes you can PM me your email address for an email message or your cell phone number and carrier for a text message and I will add it to the list. I wont be doing subscribed and unsubscribe forms for this feature.
You do not have the required permissions to view the files attached to this post.
Re: Rotation notifier app
Jun1oR wrote:Here I finished the script and attached it below. Make sure you edit the array for $users_email and the directory that the script is located in is writable by the cron user.
*NOTE* I haven't tested the script. Also if you have SSH access then it's probably better to do this with Perl or something other than PHP.
I will add this to the web server, so if you want to be notified of map changes you can PM me your email address for an email message or your cell phone number and carrier for a text message and I will add it to the list. I wont be doing subscribed and unsubscribe forms for this feature.
Nice! Can't wait for this script to work flawlessly! No more Beach. :)
Re: Rotation notifier app
It's finished I have tested it with both email and text messages. Both ways work fine but for the email version you might need to allow the sender so the message doesn't go to your spam box. Check my previous post about PM'ing me your info.
One of you Nazi bastards tell me how to spell "Los los" correctly please!
One of you Nazi bastards tell me how to spell "Los los" correctly please!
You do not have the required permissions to view the files attached to this post.
Re: Rotation notifier app
PHP script is useless for most of users. Doubt many have environment set and windows users in particular will have hard time dealing with mail functions as winblows has many bundles with email (xampp etc) functionality but wont work out of the box - that's the reason many developers rather hook mail under gmail or other actual mail server then waste time with configuring mail on regular os.
If you're willing to generate a random token and put it in thread that's viewable only by registered members, I may be willing to create a simple subscribe script, so anyone can subscribe using token and get notified on mail provided when there's a change. Although, I would have time for that somewhere next week or so.
Ideally, a simple mod could be written and applied to forum here, which would probably make more sense but personally, have no time nor desire to meddle with phpbb atm.
If you're willing to generate a random token and put it in thread that's viewable only by registered members, I may be willing to create a simple subscribe script, so anyone can subscribe using token and get notified on mail provided when there's a change. Although, I would have time for that somewhere next week or so.
Ideally, a simple mod could be written and applied to forum here, which would probably make more sense but personally, have no time nor desire to meddle with phpbb atm.
Re: Rotation notifier app
Actually I think PHP is the easiest way for most users since its easy to understand and the script will run by just uploading it to their web host via ftp as long as they are able to use sendmail. As for Winblows I never used it for a server environment and never will.
I am currently running the script via a CGI wrapper with Cron and I use the PEAR Mail package to send my mail using Postfix and SMTP Authentication. The script I posted uses the mail() function instead but I can attach another version that uses the PEAR Mail package so you can just edit your SMTP server, username, and password but this would require you to install the PEAR Mail package obviously.
This is as far as I am willing to go with this script and I have provided a working foundation for others to improve on. Like I said in my previous post this would be better written using a PERL bash script and if I was serious about this feature then that's what I would use.
I am currently running the script via a CGI wrapper with Cron and I use the PEAR Mail package to send my mail using Postfix and SMTP Authentication. The script I posted uses the mail() function instead but I can attach another version that uses the PEAR Mail package so you can just edit your SMTP server, username, and password but this would require you to install the PEAR Mail package obviously.
This is as far as I am willing to go with this script and I have provided a working foundation for others to improve on. Like I said in my previous post this would be better written using a PERL bash script and if I was serious about this feature then that's what I would use.
Re: Rotation notifier app
Considering I'm outside of the US, as well as many others. Will this feature cost us anything from text messaging?
Re: Rotation notifier app
Tragic wrote:Considering I'm outside of the US, as well as many others. Will this feature cost us anything from text messaging?
It shouldn't as long as you have text messaging included in your plan since I am using your carriers SMS gateway via email. For example: I send an email to number@txt.att.net and AT&T's SMS gateway receives the message and forwards it to you via text message.
http://en.wikipedia.org/wiki/List_of_SMS_gateways
Re: Rotation notifier app
Most of users don't even have a server so they can't upload it nowhere but use it locally and majority of those people are on winblows. PHP is one of the simplest and easiest forms to maintain a script for non-coders but serves no purpose if they can't utilize it. Some of the web hosting companies don't even allow socket so that may pose a problem as well.
In linux you can easily utilize mail function by installing postfix &| dovecot if they want to route it as well, on windows getting a mail server to work almost equals nightmare. Alternative is installing pear package as you mention it, but xampp or alike aren't really a role model of simplicity when it comes to it.
Don't get me wrong, I totally understand where you're coming from, I just think that PHP option would serve better on a centralized server instead of forcing users to deal with it them self. Solution in my opinion is really simple, writing a simple subscription list, provide token to get rid of spam bots and crap, and let server do all the work while users simply un/subscribe to it.
Tragic, sms is payable in eu but if you provide simple mail functionality (being posted on mail) then no, it's free as any other mail you get (when registering, resetting pass etc etc).
In linux you can easily utilize mail function by installing postfix &| dovecot if they want to route it as well, on windows getting a mail server to work almost equals nightmare. Alternative is installing pear package as you mention it, but xampp or alike aren't really a role model of simplicity when it comes to it.
Don't get me wrong, I totally understand where you're coming from, I just think that PHP option would serve better on a centralized server instead of forcing users to deal with it them self. Solution in my opinion is really simple, writing a simple subscription list, provide token to get rid of spam bots and crap, and let server do all the work while users simply un/subscribe to it.
Tragic, sms is payable in eu but if you provide simple mail functionality (being posted on mail) then no, it's free as any other mail you get (when registering, resetting pass etc etc).
Re: Rotation notifier app
I'm not forcing anyone to do anything and I only provided the script for anyone to improve on if they wish to take it further. If they don't have a server then they have no business using this script and like I said in one of my previous posts they can simply PM me either their email address or phone number and carrier and I will add it to the ECGN list. They will then receive notifications from the ECGN web server by email or text depending which route they choose. I can't make it much easier than that without making a web form for them to submit their info themselves which I won't be doing.
I hope I don't sound angry or upset in this post because I'm not.
Jun1oR wrote:I will add this to the web server, so if you want to be notified of map changes you can PM me your email address for an email message or your cell phone number and carrier for a text message and I will add it to the list. I wont be doing subscribed and unsubscribe forms for this feature.
I hope I don't sound angry or upset in this post because I'm not.
25 posts
• Page 1 of 2 • 1, 2
Return to Return To Castle Wolfenstein
Who is online
Users browsing this forum: No registered users and 4 guests