Monthly Target: $400 Donations: $299
 74% 

SSMS - Sourcemod Server Management System


Post New Thread Reply   
 
Thread Tools Display Modes
zeroibis
Veteran Member
Join Date: Jun 2007
Old 03-25-2012 , 01:11   Re: SSMS - Sourcemod Server Management System
Reply With Quote #131

OK so here is the deal, by default this program wants you to use the t=xxxxx for your thread id which is logical as this is the thread id. However, if you search for your plugins using the sm search page than you will want to be able to use p=yyyyy instead as that is the result you get. So for those that want to use p instead of t just follow the instructions below:

How to use p= instead of t=
dbplugins.php

Line 80 change to:
Code:
                        <tr  class=\"elements\"><td><img  src=images/new.png></td><td><a  href=\"http://forums.alliedmods.net/showthread.php?p=$threadid\">$filename</a></td><td>$dbvers</td><td>$modvers</td></tr>";
Line 83 to:
Code:
                        $message = "A update for $filename  ($dbdescr) seems to be out, $dbvers is the latest. We have $modvers  running....\nhttp://forums.alliedmods.net/showthread.php?p=$threadid";
This allows the link to always work instead of most of the time. This still does not fix the incorrect results though.

Line 98 to:
Code:
$html = file_get_contents("http://forums.alliedmods.net/showthread.php?p=$threadid&postcount=1");
Remember ONLY USE the above code if you find your plugins id via http://www.sourcemod.net/plugins.php

YOU MUST CONSISTENTLY USE EITHER the values for p= or t=


If you want to use t= and the forum search than DO NOT CHANGE ANYTHING. If you want to use p= and the SM plugins search then use the CODE POSTED ABOVE.


Hopefully this will clear things up.

NOTE THAT if you get p= and you hit the name of the thread it will change to t= and you can use the default code!
__________________

Last edited by zeroibis; 03-25-2012 at 01:17.
zeroibis is offline
zeroibis
Veteran Member
Join Date: Jun 2007
Old 03-25-2012 , 01:45   Re: SSMS - Sourcemod Server Management System
Reply With Quote #132

EDIT SEE NEXT POST FOR FINAL SOLUTION!

So far I have found it only shows the last plugin that needs an update. I think the issue is with ON DUPLICATE KEY UPDATE. I did at least get it to record the plugin id in there now:

Line 127 change to:
Code:
        $result = mysql_query( "INSERT INTO plugindb (pluginid,threadid,description,version) VALUES('$url[0]','$threadid','$description','$url[1]') ON DUPLICATE KEY UPDATE pluginid='$url[0]',threadid='$threadid',description='$description',version='$url[1]'") or die(mysql_error());
OK here is the issue. Instead of making a new database entry for the latest version we just need to update a part in the existing section about this. Basically eliminate plugindb and just use mods. I am going to try to reprogram it to work like this which should be more efficient and actually work correctly.
__________________

Last edited by zeroibis; 03-25-2012 at 03:13.
zeroibis is offline
zeroibis
Veteran Member
Join Date: Jun 2007
Old 03-25-2012 , 03:12   Re: SSMS - Sourcemod Server Management System
Reply With Quote #133

OK I have fixed it so that it works as intended! Now if you have multiple plugins that are outdated it will list all of them instead of just the last one. Also this fixes the glitch of listing no plugins as outdated if the last plugin checked is not outdated. This also fixes the glitch of listing all plugins as not outdated.

The only problem is that I have not resolved the ability to e-mail the admin if there is an update available. Previously that was triggered in a location where the user had to see it anyways so it is better to be placed in another section of the code (I will update that later).

So here is what you got to do:

  1. Change the sql structure of mods to include a new column called "latestversion" and give it the same settings as version but also give it a default value of 0
  2. Now open dbplugins.php and make the following changes:
Replace line 70 with:
Code:
        $result = mysql_query("select mods.latestversion as dbvers, mods.version as modvers, mods.filename, mods.threadid, plugindb.send from plugindb, mods where mods.version != mods.latestversion and mods.latestversion != '0' and plugindb.threadid != '0'") or die (mysql_error());

Replace line 127 with:
Code:
        $result = mysql_query( "UPDATE mods SET latestversion = '$url[1]' WHERE threadid = '$threadid'") or die(mysql_error());

Your all done!!!!


I have attached the new version of the file to this post to speed things up.
Attached Files
File Type: 7z dbplugins.7z (2.8 KB, 9 views)
__________________
zeroibis is offline
snelvuur
Veteran Member
Join Date: Jun 2008
Location: Netherlands
Old 03-25-2012 , 10:26   Re: SSMS - Sourcemod Server Management System
Reply With Quote #134

Appreciate the effort, if you can make a pull request on github that would be great.

Most of this all started as "hmm that would be fun" and most are tuned/fixed but in my eyes it might need a rewrite or something but i dont have the time for that. I do like the idea of adding graphs like http://www.fpsmeter.org/graph/graph.php?id=1&day=0 but that would require using rcon every +- 2 seconds which might be a bit over the top. But again, time is mostly the issue here.
__________________
Arguing with a fool only proves there are two
snelvuur is offline
zeroibis
Veteran Member
Join Date: Jun 2007
Old 03-25-2012 , 11:05   Re: SSMS - Sourcemod Server Management System
Reply With Quote #135

Quote:
Originally Posted by snelvuur View Post
Appreciate the effort, if you can make a pull request on github that would be great.

Most of this all started as "hmm that would be fun" and most are tuned/fixed but in my eyes it might need a rewrite or something but i dont have the time for that. I do like the idea of adding graphs like http://www.fpsmeter.org/graph/graph.php?id=1&day=0 but that would require using rcon every +- 2 seconds which might be a bit over the top. But again, time is mostly the issue here.

For that I was thinking something similar but did not want to request it right now b/c it would be low priority. However what I was thinking was to log the player numbers to make a graph and also let you break down server to server data better. This could then be used in public facing pages.

As far as pull speeds go I think it is fine with just running as often as the user has the cron job set to then the user can decide how often they want the data and thus the resolution of information.


Now as for a pull request how do I do that? I think it is tine I find out as I actually code fixes for a lot of different things around the internet but I have no knowledge of how to work these git hubs.

Even for the programing I am doing I do not actually have real php or sql knowledge. I was taught how to do html, css, java and Cisco API in high school but had learned some c++ for one week before then and then I learned php b/c I wanted my gaming website to be better. Then I learned sourcemod b/c I wanted to make some plugins. Then I learned sql b/c I wanted to fix an old script in my forums.

So unfortunately I do not have a great idea of what I am doing but I do have a good foundation in general practice coding so I am a lot better at fixing or modifying scripts than making them.


Oh I can try to do this git pull thing for the php file but how do I send the sql changes? I assume that I need to make a fresh database and then import the current one and make my changes and then export it again? Would that do the trick? The only way I know how to modify the database structure is via phpmyadmin rofl, see I told you I was a noob.

I am going to actually try to program the e-mail alert for plugins now and will update that today. The way it will work is it will send the e-mail every time it does the plugin update from the sm website. That cron should only run once a day max as it is so I do not see any issue with too many e-mails.
__________________
zeroibis is offline
snelvuur
Veteran Member
Join Date: Jun 2008
Location: Netherlands
Old 03-25-2012 , 14:11   Re: SSMS - Sourcemod Server Management System
Reply With Quote #136

Quote:
Originally Posted by zeroibis View Post
For that I was thinking something similar but did not want to request it right now b/c it would be low priority. However what I was thinking was to log the player numbers to make a graph and also let you break down server to server data better. This could then be used in public facing pages.
I already played with some .htaccess files and succesfully got a sub url to work, so for instance if you have ssms.yoursite.com you can have ssms.yoursite.com/graphs and make only graphs public (not having to need a password)

Quote:
Originally Posted by zeroibis View Post
As far as pull speeds go I think it is fine with just running as often as the user has the cron job set to then the user can decide how often they want the data and thus the resolution of information.
I have it per minute, this way it is also correct with the times it sends out for the emails (10x is 10 minutes) so if you do it quicker it will tell you the incorrect time.

Quote:
Originally Posted by zeroibis View Post
Now as for a pull request how do I do that? I think it is tine I find out as I actually code fixes for a lot of different things around the internet but I have no knowledge of how to work these git hubs.
Go make a account on github, then make a fork of my repository. Make your changes locally and then sort of speak send it back to me for approval. I get the request from you and simply click on "merge" or "ok" and it will be in the tree. I still want to make like a zip file which has all (since you can have download packages on github) not everybody knows about the submodules. Just read up on github a bit, its not that hard.

Quote:
Originally Posted by zeroibis View Post
Even for the programing I am doing I do not actually have real php or sql knowledge. I was taught how to do html, css, java and Cisco API in high school but had learned some c++ for one week before then and then I learned php b/c I wanted my gaming website to be better. Then I learned sourcemod b/c I wanted to make some plugins. Then I learned sql b/c I wanted to fix an old script in my forums.
I work in a environment rich of java/aix/hp/linux/etc this is just a side track for fun, we all started like that i presume and SSMS is my first big thing i bring out on the web. I am no expert either.

Quote:
Originally Posted by zeroibis View Post
So unfortunately I do not have a great idea of what I am doing but I do have a good foundation in general practice coding so I am a lot better at fixing or modifying scripts than making them.
My problem: i got too many ideas.

Quote:
Originally Posted by zeroibis View Post
Oh I can try to do this git pull thing for the php file but how do I send the sql changes? I assume that I need to make a fresh database and then import the current one and make my changes and then export it again? Would that do the trick? The only way I know how to modify the database structure is via phpmyadmin rofl, see I told you I was a noob.
You can checkout the current database.sql file and adjust the rows/query's but i created the installer so that people should be able to upgrade the db easier. So for now it would be handy to make a 1.0.1 release name and make a incremental db update so people can just download the tree, run the 1.0.0 db to 1.0.1 and be done.

Quote:
Originally Posted by zeroibis View Post
I am going to actually try to program the e-mail alert for plugins now and will update that today. The way it will work is it will send the e-mail every time it does the plugin update from the sm website. That cron should only run once a day max as it is so I do not see any issue with too many e-mails.
I have not read every single part on the last couple of pages but the crontab that you need to run the plugins versions for does send out a email alert already. Which runs once a day. Once it sends out the email it flags the plugin to not mail again when it runs the next day.
__________________
Arguing with a fool only proves there are two
snelvuur is offline
zeroibis
Veteran Member
Join Date: Jun 2007
Old 03-25-2012 , 21:37   Re: SSMS - Sourcemod Server Management System
Reply With Quote #137

Quote:
Originally Posted by snelvuur View Post
I have not read every single part on the last couple of pages but the crontab that you need to run the plugins versions for does send out a email alert already. Which runs once a day. Once it sends out the email it flags the plugin to not mail again when it runs the next day.
Yea I noticed that flag in the sql. However I may remove or make additional changes to it b/c I find that entire part of the database is not needed and should be eliminated and creates to many problems.

Also I found a bug where if you group plugins together and then update the plugin list they become ungrouped and lose their thread id data.

Sorry forgot to say that anyone looking for an update today I spent the day working on debugging an electrical problem with my car that took the entire day. Tomorrow my lil sis turns 21 so I will be busy then too. I will be still trying to get some patches out this week though!
__________________

Last edited by zeroibis; 03-25-2012 at 22:34.
zeroibis is offline
snelvuur
Veteran Member
Join Date: Jun 2008
Location: Netherlands
Old 03-26-2012 , 02:05   Re: SSMS - Sourcemod Server Management System
Reply With Quote #138

zero, all is done on the basis of free. So there is no deadline i did add in the experimental branch a api folder with a json.php. Its a easy way to give the data to other resources. Since its client facing it is availible to all. Perhaps i will use that to create the server status. That way you dont have to have userid/pwd in any client facing server lists. Just a idea though, but i think you know what i mean ;)
__________________
Arguing with a fool only proves there are two
snelvuur is offline
zeroibis
Veteran Member
Join Date: Jun 2007
Old 03-26-2012 , 15:33   Re: SSMS - Sourcemod Server Management System
Reply With Quote #139

What I intended for any client facing data would be to have it outside that folder as its own file that just queries the sql for the data it is hard coded to display. Users can adjust the code to fit their particualr needs. This makes it more flexible to implement so users can integrate it into their sites how they want. It also would be secure b/c there is no variables to exploit.
__________________
zeroibis is offline
snelvuur
Veteran Member
Join Date: Jun 2008
Location: Netherlands
Old 03-27-2012 , 03:18   Re: SSMS - Sourcemod Server Management System
Reply With Quote #140

Well by using a json api there is also no need to put in a username/pwd in any php scripts and you can make a call to your "ssms.url.something.com" because you dont want your clients to go to that website you want them to go to your "fancy.blog.com" or whatever. The json output holds everything you need i believe, except for the rcon password. (can still tweak that one too)
__________________
Arguing with a fool only proves there are two
snelvuur is offline
Reply


Thread Tools
Display Modes

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 -4. The time now is 01:57.


Powered by vBulletin®
Copyright ©2000 - 2015, vBulletin Solutions, Inc.
Theme made by Freecode