Roster 2.0 port of VentStatus addon?

Provides Ventrilo status information.

Moderator: Rabbitbunny

Roster 2.0 port of VentStatus addon?

Postby AnthonyB » Sun Jul 05, 2009 2:29 am

Don't suppose anyone would consider taking this on to convert it to be compatible with Roster 2.0? Sounds like a handy addon...
Roster 2.0.2 svn [latest] latest trunk SVN svn [latest] running on IIS7/Windows Server 2008 SP2 | MySQL 5.0.85 | PHP 5.2.10 | Yes, Roster and PHP rocks on IIS! Even run as FastCGI extension!
User avatar
AnthonyB
Gimpy Developer
Gimpy Developer
 
Posts: 346
Joined: Tue Jul 04, 2006 2:44 pm
Location: Sydney, Australia

Re: Roster 2.0 port of VentStatus addon?

Postby tuigii » Mon Jul 06, 2009 12:59 pm

Link ?
User avatar
tuigii
WR.net Master
WR.net Master
 
Posts: 891
Joined: Wed Dec 27, 2006 12:57 pm
Location: Somewhere in the South Ouest of France

Re: Roster 2.0 port of VentStatus addon?

Postby zanix » Tue Jul 07, 2009 4:02 am

Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5546
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Re: Roster 2.0 port of VentStatus addon?

Postby AnthonyB » Fri Jul 10, 2009 11:04 am

Yep, that's the one.
Roster 2.0.2 svn [latest] latest trunk SVN svn [latest] running on IIS7/Windows Server 2008 SP2 | MySQL 5.0.85 | PHP 5.2.10 | Yes, Roster and PHP rocks on IIS! Even run as FastCGI extension!
User avatar
AnthonyB
Gimpy Developer
Gimpy Developer
 
Posts: 346
Joined: Tue Jul 04, 2006 2:44 pm
Location: Sydney, Australia

Re: Roster 2.0 port of VentStatus addon?

Postby Ulminia » Sat Jul 11, 2009 8:29 pm

yup it is .... yup here you go ... i rock... any errors letme know i dont have a vent server to test on this was a stright port...

ventstatus.zip
port R 2.0 v0.0.4
(275.85 KiB) Downloaded 411 times
Ulminia of Zangarmarsh
Zonous of Zangarmarsh
Author of Roster Gallery
WoWRoster-Profiler Redesigner
User avatar
Ulminia
WoWRoster.net Dev Team
WoWRoster.net Dev Team
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 1223
Joined: Tue Jul 04, 2006 4:41 pm
Location: New Brunswick, Canada
Realm: Zangarmarsh (PvE) - US
gmail/gtalk: ulminia@gmail.com

Re: Roster 2.0 port of VentStatus addon?

Postby AnthonyB » Mon Aug 17, 2009 4:09 am

Thanks Ulminia!

Got an error on installation:

Code: Select all
Install error in query 6. MySQL said:
1364: Field 'conf_desc' doesn't have a default value
The query was:
INSERT INTO `roster_addons_ventstatus_config` (`conf_name`, `conf_data`) VALUES ('admin', 'password'), ('version', '0.0.4'), ('cmdprog', 'ventrilo_status'), ('cmdcode', '2'), ('cmdhost', '127.0.0.1'), ('cmdport', '3784'), ('cmdpass', ''), ('info1', '1'), ('display1', '1'), ('display2', '1'), ('display3', '1'), ('lobby', '1');


I assume this is because in the install you define it as NOT NULL:

Code: Select all
$installer->add_query("CREATE TABLE `" . $installer->table('config') . "` (
            `conf_id` int(11) unsigned NOT NULL auto_increment,
        `conf_name` varchar(64) NOT NULL,
        `conf_data` varchar(64) NOT NULL,
        `conf_desc` text NOT NULL,
        PRIMARY KEY  (`conf_id`)
      ) TYPE=MyISAM AUTO_INCREMENT=1 ;");


Quick fix was to delete line 55 from the inc\install.def.php
Code: Select all
`conf_desc` text NOT NULL,

to get the install to complete successfully.
Roster 2.0.2 svn [latest] latest trunk SVN svn [latest] running on IIS7/Windows Server 2008 SP2 | MySQL 5.0.85 | PHP 5.2.10 | Yes, Roster and PHP rocks on IIS! Even run as FastCGI extension!
User avatar
AnthonyB
Gimpy Developer
Gimpy Developer
 
Posts: 346
Joined: Tue Jul 04, 2006 2:44 pm
Location: Sydney, Australia

Re: Roster 2.0 port of VentStatus addon?

Postby zanix » Mon Aug 17, 2009 4:28 am

Each of those sets need 3 values

If the sql create code had default values set, or if you passed default values, it would be fixed
Code: Select all
INSERT INTO `roster_addons_ventstatus_config` (`conf_name`, `conf_data`, `conf_desc`) VALUES ('admin', 'password', 'blank'), ('version', '0.0.4','some val'), ('cmdprog', 'ventrilo_status','some val'), ('cmdcode', '2','some val'), ('cmdhost', '127.0.0.1','some val'), ('cmdport', '3784','some val'), ('cmdpass', '','some val'), ('info1', '1','some val'), ('display1', '1','some val'), ('display2', '1','some val'), ('display3', '1','some val'), ('lobby', '1','some val');
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5546
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Re: Roster 2.0 port of VentStatus addon?

Postby AnthonyB » Mon Aug 17, 2009 4:35 am

Oh, btw, I've put this up in SVN to allow easier maintenance - hope that's OK?!
Roster 2.0.2 svn [latest] latest trunk SVN svn [latest] running on IIS7/Windows Server 2008 SP2 | MySQL 5.0.85 | PHP 5.2.10 | Yes, Roster and PHP rocks on IIS! Even run as FastCGI extension!
User avatar
AnthonyB
Gimpy Developer
Gimpy Developer
 
Posts: 346
Joined: Tue Jul 04, 2006 2:44 pm
Location: Sydney, Australia

Re: Roster 2.0 port of VentStatus addon?

Postby AnthonyB » Mon Aug 17, 2009 5:18 am

Any chance of adding some debug options to this? I just get an error:
CVentriloStatus->Request() failed. PHP Unable to start external status process.


hmmm... after not being able to get it running I delved a bit further...

So I get that you're using the "PHP Ventrilo Status Scripts (Version 2.3.0)" that are available for download on the Vent site (http://www.ventrilo.com/download.php).

Wow, there's a lot of things that can go wrong here... not your fault, just the way they've designed this 'script'.

First really big issue is that the scripts seem to rely on the ventrillo_status.exe to be able to launch? Speaking from a Windows perspective, the security implications of allowing the script to launch an an .exe are significant:
Give the IUSR_<computer name> account read and execute
permission to C:\Windows\System32\cmd.exe

The reason for this is because PHP doesn't start the
ventrilo_status.exe program directly. Instead it spawns a
command shell (the cmd.exe program) and it will then spawn
the ventrilo_status.exe program.


Windows Server 2008 won't even let you try and change the perms on cmd.exe given the security risks.

Another gotcha is that you need to make sure the script is picking up the correct compile of the .exe based on the OS platform. Not sure whether the plan here is just to make sure the correct one is copied into the roster\addons\ventstatus or whether it's worth putting each copy in a subfolder and building into the admin page a list box to choose your webserver OS so it grabs the right .exe


Then there's all this mention of editing the [Status] section of the ventrilo_srv.ini:

In the ventrilo_srv.ini file and under the [Status] section
you should:


Is this still necessary? My .ini file doesn't even have this section...

I'm wondering if there's a safer/neater way of doing this.. there's a lot of website that will probe your Vent server and display the info so I'm wondering if they are all using an .exe or someone has devised a neater 'script-only' way of getting this data..?
Roster 2.0.2 svn [latest] latest trunk SVN svn [latest] running on IIS7/Windows Server 2008 SP2 | MySQL 5.0.85 | PHP 5.2.10 | Yes, Roster and PHP rocks on IIS! Even run as FastCGI extension!
User avatar
AnthonyB
Gimpy Developer
Gimpy Developer
 
Posts: 346
Joined: Tue Jul 04, 2006 2:44 pm
Location: Sydney, Australia

Re: Roster 2.0 port of VentStatus addon?

Postby AnthonyB » Mon Aug 17, 2009 5:50 am

Further to this, I went back to that downloadable script package to see if I could get it to work 'as is' to ensure I could at least launch the .exe and found that there seems to be flaws in the script, e.g.

When I set
Code: Select all
$stat->m_cmdprog   = "c:\inetpub\wwwroot\ventrilostatus\ventrilo_status.exe";   // Adjust accordingly.

and added "print $cmdline;" into line 361 of the ventrilostatus.php so I could check the path being parsed to launch the .exe, I found that it wasn't handing it correctly. It was munging the \v instances in the path so I had to double escape them;
Code: Select all
$stat->m_cmdprog   = "c:\inetpub\wwwroot\\ventrilostatus\\ventrilo_status.exe";   // Adjust accordingly.

to at least get it to run the .exe from the correct path.

Unfortunately, that's as far as I've managed to get. Results here:

http://anthonyb.dyndns.org/ventrilostat ... lotest.php

Running ventrilo_status.exe -c2 -t127.0.0.1 from the server works just fine.
Running ventrilo_status.exe -c2 -tanthonyb.dyndns.org from another machine works just fine.

If I'm not mistaken, the problem still appears to be having PHP launch the .exe and parse the results.
Roster 2.0.2 svn [latest] latest trunk SVN svn [latest] running on IIS7/Windows Server 2008 SP2 | MySQL 5.0.85 | PHP 5.2.10 | Yes, Roster and PHP rocks on IIS! Even run as FastCGI extension!
User avatar
AnthonyB
Gimpy Developer
Gimpy Developer
 
Posts: 346
Joined: Tue Jul 04, 2006 2:44 pm
Location: Sydney, Australia

Re: Roster 2.0 port of VentStatus addon?

Postby PleegWat » Mon Aug 17, 2009 11:26 am

Sounds promising...

In PHP (and many other languages) a backslash (\) in a string literal needs to be doubled.

You want to double all of them, since a future PHP version may allow more escape sequences. I think \v is vertical tab.
I <3 /bin/bash
User avatar
PleegWat
WoWRoster.net Dev Team
WoWRoster.net Dev Team
 
Posts: 1636
Joined: Tue Jul 04, 2006 1:43 pm


Return to VentStatus

Who is online

Users browsing this forum: No registered users and 0 guests

cron