Raised This Month: $12 Target: $400
 3% 

Advertisements - MySQL Updated 2/5/09


Post New Thread Reply   
 
Thread Tools Display Modes
BeG
Senior Member
Join Date: Jan 2009
Location: Germany
Old 04-07-2010 , 19:35   Re: Advertisements - MySQL Updated 2/5/09
Reply With Quote #301

can u include an funktion to set the adverts for each server? i register server 1 2 and 3 in the webinterface and when i add an ad (lol) i have to check boxex on wich server the advert should come... you know what i mean ?

sry for that bad english =P
__________________
!!!SRY FOR BAD ENGLISH!!!
Our Clanhomepage:

Visit Us!
BeG is offline
XxDragoNxX
Junior Member
Join Date: Mar 2010
Old 04-09-2010 , 19:34   Re: Advertisements - MySQL Updated 2/5/09
Reply With Quote #302

I fixed my other issue, thank's.

However I have a new issue.

The ad's dont appear at the time's I have set, I set it for every 30 second's. But it's randomlly spamming them are anytime it want's :\

Any idea's on this one?
XxDragoNxX is offline
BeG
Senior Member
Join Date: Jan 2009
Location: Germany
Old 04-10-2010 , 05:33   Re: Advertisements - MySQL Updated 2/5/09
Reply With Quote #303

hey together i have problems with this addon i have 4 servers 2 buyed at gc-server.de and 2 on my private root on the 2 buyed server the plugin works perfect but on the server on my root it dont work in the sm errorlog is that:

Code:
L 04/08/2010 - 11:29:16: [SM] Native "SQL_TQuery" reported: Invalid database Handle 0 (error: 4)
L 04/08/2010 - 11:29:16: [SM] Displaying call stack trace for plugin "sm_adsmysql.smx":
L 04/08/2010 - 11:29:16: [SM]   [0]  Line 124, /home/groups/alliedmodders/forums/files/2/4/5/7/3/38158.attach::SetupAds()
someone can help me?? mysql is installed on the root... i dont know why he has problems sourcebans works perfect too on this server it says a connection to external mysql´s is not the problem =(

i run metamod 1.8 and sm 1.3.1

pls pls pls

my root is an 32 bit debian 5.x root

i have an featurerequest too:

can u include an funktion to set the adverts for each server? i register server 1 2 and 3 in the webinterface and when i add an ad (lol) i have to check boxex on wich server the advert should come... you know what i mean ?


it would be nice if that will be includet or someone can help me that i can run this wonderful plugin

__________________
!!!SRY FOR BAD ENGLISH!!!
Our Clanhomepage:

Visit Us!
BeG is offline
alinayg
Senior Member
Join Date: Apr 2009
Location: USA, RI
Old 04-11-2010 , 23:15   Re: Advertisements - MySQL Updated 2/5/09
Reply With Quote #304

What are the differences between every level in the admin system of this web layout?
__________________
alinayg is offline
ojmdk476oj
AlliedModders Donor
Join Date: Dec 2009
Old 04-16-2010 , 01:51   Re: Advertisements - MySQL Updated 2/5/09
Reply With Quote #305

I have run into and isue the adverts run to fast -.-''
i have set the adverts on 30 but they come like 7 and 17 after the other?
ojmdk476oj is offline
Wolve-Hunter
Junior Member
Join Date: Mar 2010
Old 04-22-2010 , 06:01   Re: Advertisements - MySQL Updated 2/5/09
Reply With Quote #306

Hi,

i use this plugin since yesterday, but i have the problem, that only spectators can see the ads. What can i do that all players can see the ads? => CS:S Server

What can i do?!? Help plz ...
Wolve-Hunter is offline
daleGEND
AlliedModders Donor
Join Date: Feb 2005
Location: USA
Old 04-23-2010 , 10:50   Re: Advertisements - MySQL Updated 2/5/09
Reply With Quote #307

If anyone is interested in making a better looking GUI for this plugin and enhancing it with me, please PM me and let me know. I'm an accomplished web designer and would help make this plugin work nicely.
__________________
Bor3d Gaming - A Mature Online Gaming Community

Feel free to add me on STEAM as well: https://steamcommunity.com/id/b0r3d
daleGEND is offline
Rikaelus
Junior Member
Join Date: Aug 2004
Old 05-08-2010 , 20:20   Re: Advertisements - MySQL Updated 2/5/09
Reply With Quote #308

Awesome plugin, this is.
I made a couple small improvements to it and I can share them with the author if he'd like to merge it in with the official package.

Addition:
Basically I added another field named "servers" that, through the GUI, you can specify server IPort(s) you'd specifically like the advertisement for. So, for instance, one TF2 server can advertise another but would never advertise itself. If left blank then there's no filtering.

Bug fix/optimization:
Through testing my addition I discovered that the ad displaying function runs at whatever increment is set (such as 30 seconds) but if the next ad up doesn't qualify (different game, different server) then no ad will show that round, and it doesn't try the next ad for another increment. This effectively means you might not get an ad at the schedule you want.

My fix and optimization was to have it only load the ads that are valid for the server. While technically this could maybe be done in the MySQL query itself, I opted to have the logic run as it iterates through the MySQL response. This way there's output to the console of which were accepted and which were rejected.

With only valid ads being added to the array, the array doesn't store unneeded data (optimization) and only valid ads would come up in the display function, removing the need for the conditional that was there and ensuring there's an ad every X seconds (bug fix).


P.S. Also just found a bug in the GUI in which text strings aren't run through any special character escaping, which lead to failed MySQL calls when using apostrophes.

Last edited by Rikaelus; 05-08-2010 at 20:31.
Rikaelus is offline
Rikaelus
Junior Member
Join Date: Aug 2004
Old 05-08-2010 , 21:47   Re: Advertisements - MySQL Updated 2/5/09
Reply With Quote #309

Sigh.. some more problems now, too.
It's working great for TF2 so far but it's dying on Left4Dead2. I've copied over the identical plugins (this and advertisements), the identical server.cfg settings, and the identical database information.

Restarted the server, and nada.

A possible sign of the problem during startup:
Unknown command "sm_advertisements_enabled"
Unknown command "sm_advertisements_interval"

Output of sm_reloadads:
L 05/08/2010 - 18:452: [SM] Native "SQL_TQuery" reported: Invalid database Handle 0 (error: 4)
L 05/08/2010 - 18:452: [SM] Displaying call stack trace for plugin "sm_adsmysql.smx":
L 05/08/2010 - 18:452: [SM] [0] Line 562, /groups/sourcemod/upload_tmp/textMVbAOF.sp::Admin_ReloadAds()

Output of "sm plugins reload":
AdsMYSQL - Connected Successfully to Database
L 05/08/2010 - 18:46:08: [sm_adsmysql.smx] AdsMYSQL - Connected Successfully to Database
[SM] Plugin Advertisements from Database reloaded successfully.

Restarted the servers multiple times now to no avail.

Same versions of SouceMod and MetaMod in both TF2 and L4D2.

I just don't get why it's failing on just one of them...

Edit:
Some new info...
- Happens even if I recompile the plugin to use the "default" DB which I know works from other plugins
- Happens with the unedited plugin (as opposed to the one with my tweaks, just to be sure)

I'll keep digging...

Edit 2:
Okay.. seems to be a false alarm, sort of. Everything works once a player enters the game- just not from the console immediately after start up. So.. this must be an odd side-effect of hibernation mode. Now I think I just need to add Left4Dead2 support... heh...

Last edited by Rikaelus; 05-09-2010 at 05:11.
Rikaelus is offline
Rikaelus
Junior Member
Join Date: Aug 2004
Old 05-09-2010 , 06:29   Re: Advertisements - MySQL Updated 2/5/09
Reply With Quote #310

Found another minor bug causing periodic double messages, but easily fixed. I believe it's caused by OnMapStart/SetupAds periodically being called after ConVarChange_Interval, if a custom time interval is set in a conf file.

Because SetupAds doesn't check to see if hTimer has been set already, it sets it a second time, causing two timer rotations to live simultaneously.

Simply adding the following code to SetupAds avoids the doubling.

if (hTimer != INVALID_HANDLE)
{
KillTimer(hTimer)
}

EDIT:
Okay... don't do this. I'm not sure why but... while this fixes the problem listed above... for some reason the timer breaks when the map changes. No idea why. For now I've disabled it in my code rather than try to fix it, since the original problem was minor, anyway.

Last edited by Rikaelus; 05-16-2010 at 03:23.
Rikaelus 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 13:39.


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