Page 3 of 4

PostPosted: Mon Dec 08, 2008 5:30 pm
by Warren
PPG_Paula, your special characters are not being displayed due to some issue on your website. Compare your winner page to the default winner page.

I suggest just using the default.

Re: gg_winner_display

PostPosted: Mon Dec 08, 2008 5:36 pm
by PPG_Paula
i´ve done it just one min ago and your links shoes me now a right display.....
dont know why because i had use the default winner.php but now everything is working!
thanx a lot......

!! Edit!!
In game the display shows me the same error......
Maybe server config mistake?
Because the display down the middle wich level and how is leder shows have an error too.... look my screen....
But i think there are only errors with very special letters

!!Edit 2 !!!
I have selected the gungame5.com winner.php and everything is working!
Scope could you upload your gg5_win.php here so that i can test your file on our serv?
Or its our webspace where i have to change some settings....

Thanx for first time


Screen 1 names with special letter will be correctly shown !
gg5.jpg

Screen 2 display with error
gg52.jpg

Screen 3 winner name from screen 2
gg3.jpg

Re: gg_winner_display

PostPosted: Tue Dec 09, 2008 10:42 pm
by PPG_Paula
I´ve fixed my prob!!!
For all other with the same problem....

The broken display comes from the wrong charset on the webserver
you can fix it with the following code!
create an file (notepad etc) an put this code in it
AddDefaultCharset utf-8

# evtl. auch noch:
AddCharset utf-8 .php .html .xhtml


upload it on to your webspace (same folder as gg5_win.php)
and rename it to ".htaccess

Now all special letters will be shown!

Thx all others for help ^^

PostPosted: Wed Dec 31, 2008 3:40 am
by Cheebs
Great work Scope, I think this should be an included add-on.
Could you also display the next map on the page? Would be very useful.

Thanks

Re: gg_winner_display

PostPosted: Thu Jan 29, 2009 6:43 am
by BombTrak
Hey everyone. I noticed that the script does not handle names with < or > in them properly. The web page would not display my tag because it is sandwiched between those brackets.

I am sure that this isn't the most elegant solution as I am new to EventScripts/GunGame/Python but it does work:
# ==============================================================================
#   GAME EVENTS
# ==============================================================================
def gg_win(event_var):
    # Format variables
    attacker = event_var['attacker']
    attackername = es.getplayername(attacker).replace('<','%26lt;')
    attackername = attackername.replace('>','%26gt;')
    username = es.getplayername(event_var['userid']).replace('<','%26lt;')
    username = username.replace('>','%26gt;')
    steamid = es.getplayersteamid(attacker)
    wins = gungamelib.getWins(steamid)
    place = gungamelib.getWinnerRank(steamid) if steamid != 'BOT' else 'BOT'
    totalPlaces = gungamelib.getTotalWinners()

All I changed/added were the attackername/username replace expressions and tested it on my server to confirm that it works.

Hope this is helpful!!
:D

PostPosted: Thu Jan 29, 2009 10:43 pm
by Warren
< and > work fine for me. What version are you running?

Re: gg_winner_display

PostPosted: Fri Jan 30, 2009 1:00 am
by BombTrak
Well, here's all the info I can find.

Gungame Version: 5.0.577
gg_winner_display Version: 1.0.3

I use the default php setting running off of the gungame5 server.

These screenshots show what I am talking about:
PlayerList.jpg

Winner.jpg


It looks like the web page is treating the <OC> tag as an html tag and that is why I threw in the replace statements.
Here is a copy of the gg_winner_display.py file that I was using when I took the screenshots:
''' (c) 2008 by the GunGame Coding Team

    Title: gg_winner_display
    Version: 1.0.3
    Description: Custom addon.
    '
''

# ==============================================================================
#   IMPORTS
# ==============================================================================
# Python imports

# EventScripts imports
import es
import gamethread
import usermsg

# GunGame imports
import gungamelib

# ==============================================================================
#   ADDON REGISTRATION
# ==============================================================================
# Register this addon with EventScripts
info = es.AddonInfo()
info.name     = 'Winner Display Addon for GunGame 5'
info.version  = '1.0.3'
info.url      = 'http://forums.gungame5.com/viewtopic.php?f=17&t=162'
info.basename = 'gungame/custom_addons/gg_winner_display'
info.author   = 'Sc0pE'

es.ServerVar('gg_winner_display_ver', info.version).makepublic()

# ==============================================================================
#   GAME EVENTS
# ==============================================================================
def gg_win(event_var):
    # Format variables
    attacker = event_var['attacker']
    attackername = es.getplayername(attacker).replace('&','%26')
    username = es.getplayername(event_var['userid']).replace('&','%26')
    steamid = es.getplayersteamid(attacker)
    wins = gungamelib.getWins(steamid)
    place = gungamelib.getWinnerRank(steamid) if steamid != 'BOT' else 'BOT'
    totalPlaces = gungamelib.getTotalWinners()
   
    # Send MOTD
    gamethread.delayed(0.5, sendDisplay, (attackername, username, wins, place, totalPlaces))

# ==============================================================================
#   HELPER FUNCTIONS
# ==============================================================================
def sendDisplay(attackername, username, wins, place, totalPlaces):
    for userid in es.getUseridList():
        usermsg.motd(userid, 2, 'GunGame Winner', '%s?winnerName=%s&loserName=%s&wins=%s&place=%s&totalPlaces=%s' % (gungamelib.getVariableValue('gg_winner_display_page'), attackername, username, wins, place, totalPlaces))

Re: gg_winner_display

PostPosted: Fri Jan 30, 2009 12:01 pm
by cyberkrypta
Mein englisch ist leider zu schlecht, um diese Frage schreiben zu können ;). Darum hoffe ich ihr versteht mich trotzdem oder es kann wer dann übersetzt rein stellen;).

Also hier noch eine Frage von mir: Kann man dies zufälliger wenise nicht auch ohne hlstats machen bzw. es nicht auch für GG5 mchen? Wenn ja, dann bitte ich um hilfe, denn ich denke mir, ich werde nicht der einzigste sein, den dies interessiert!!
Hier mal der Link, bei dem ich auch schon angefragt habe und aus dem alles weitere hervor geht!


http://forum.css-community.de/viewtopic.php?f=8&t=557


Danke schon mal!!!

Cyberkrypta

P.S.: Bin dort Hr.Rossi >:)

Re: gg_winner_display

PostPosted: Thu Feb 05, 2009 1:08 am
by onslaught
BombTrak wrote:Well, here's all the info I can find.

Gungame Version: 5.0.577
gg_winner_display Version: 1.0.3

I use the default php setting running off of the gungame5 server.

These screenshots show what I am talking about:
PlayerList.jpg

Winner.jpg


It looks like the web page is treating the <OC> tag as an html tag and that is why I threw in the replace statements.
Here is a copy of the gg_winner_display.py file that I was using when I took the screenshots:
''' (c) 2008 by the GunGame Coding Team

    Title: gg_winner_display
    Version: 1.0.3
    Description: Custom addon.
    '
''

# ==============================================================================
#   IMPORTS
# ==============================================================================
# Python imports

# EventScripts imports
import es
import gamethread
import usermsg

# GunGame imports
import gungamelib

# ==============================================================================
#   ADDON REGISTRATION
# ==============================================================================
# Register this addon with EventScripts
info = es.AddonInfo()
info.name     = 'Winner Display Addon for GunGame 5'
info.version  = '1.0.3'
info.url      = 'http://forums.gungame5.com/viewtopic.php?f=17&t=162'
info.basename = 'gungame/custom_addons/gg_winner_display'
info.author   = 'Sc0pE'

es.ServerVar('gg_winner_display_ver', info.version).makepublic()

# ==============================================================================
#   GAME EVENTS
# ==============================================================================
def gg_win(event_var):
    # Format variables
    attacker = event_var['attacker']
    attackername = es.getplayername(attacker).replace('&','%26')
    username = es.getplayername(event_var['userid']).replace('&','%26')
    steamid = es.getplayersteamid(attacker)
    wins = gungamelib.getWins(steamid)
    place = gungamelib.getWinnerRank(steamid) if steamid != 'BOT' else 'BOT'
    totalPlaces = gungamelib.getTotalWinners()
   
    # Send MOTD
    gamethread.delayed(0.5, sendDisplay, (attackername, username, wins, place, totalPlaces))

# ==============================================================================
#   HELPER FUNCTIONS
# ==============================================================================
def sendDisplay(attackername, username, wins, place, totalPlaces):
    for userid in es.getUseridList():
        usermsg.motd(userid, 2, 'GunGame Winner', '%s?winnerName=%s&loserName=%s&wins=%s&place=%s&totalPlaces=%s' % (gungamelib.getVariableValue('gg_winner_display_page'), attackername, username, wins, place, totalPlaces))



I am getting the same error after transfering my gg server to gameservers.com, it worked on the other provider. Gungame works, as well as the !ranks commands and all other es scripts, but the winner display is always showing 0 wins, and -1 rank of 0.

Something to do with gungamelib?

PostPosted: Thu Feb 05, 2009 10:51 am
by onslaught
hate to bump so early, but this is the only thing stopping my gameserver from being opened, would really like to fix it now before the server gets people and i have to constantly reload...

If anyone knows a solution, i would greatly appreciate it, thanks

Re: gg_winner_display

PostPosted: Thu May 28, 2009 9:20 pm
by fdgbowser
I'm having a bit of trouble getting this to work on my server

Image

My gg_winner_display.cfg
// Enable / Disable gg_winner_display
// Enable = 1 / Disable = 0
gg_winner_display 1

// Custom web page
// Leave this as default unless you want to have a customised winner page (hosted on your own web server).
// If you want to host the file on your web server, the file is here: viewtopic.php?f=17&t=162
//
// Default = http://gungame5.com/gg5_win.php
gg_winner_display_page "http://fdgaming.com/Wonder/gg5_win.php"


And, the link to our custom layout

http://fdgaming.com/Wonder/gg5_win.php

I have tried re-installing several times, I get the same error with the default page you have provided. I have updated my usermsg (I think I have, I downloaded the file and renamed it to replace my previous usermsg). I have no idea whats wrong, I remember installing this same addon on another server a few months ago and it worked perfectly on the first go. Can anyone help?

PostPosted: Fri May 29, 2009 3:48 am
by Warren
What is your server IP?

PostPosted: Fri May 29, 2009 4:07 am
by fdgbowser
63.251.20.35:27015

PostPosted: Fri May 29, 2009 5:17 am
by Warren
The link on your server:
http://fdgaming.com/wonder/gg5_win.php

The link you mentioned:
http://fdgaming.com/Wonder/gg5_win.php

It appears your website is case sensitive.

PostPosted: Fri May 29, 2009 5:46 am
by fdgbowser
Well, now I feel a little silly.

It works now, thanks for taking a look at it Warren.

PostPosted: Fri May 29, 2009 5:49 am
by Warren
No problem.

I like the way you styled the display page by the way.

PostPosted: Fri May 29, 2009 6:02 am
by fdgbowser
Yep, Wonder did a good job with it.

The darker background makes it easier on the eyes, then we just had slap our logo on there. =)

Now we just have to smooth out some minor sound issues and the server will be good to go.

Re: gg_winner_display

PostPosted: Tue Jul 21, 2009 11:27 pm
by BucKeT
Just out of curiosity, If I wanted to edit this and host it on my web server, where would I place it? In what directory on my web server? Thanks

PostPosted: Tue Jul 21, 2009 11:45 pm
by Warren
You can choose in ../cfg/gungame5/custom_addon_configs/gg_winner_display.cfg
gg_winner_display.cfg wrote:// Default = http://gungame5.com/gg5_win.php
gg_winner_display_page "http://gungame5.com/gg5_win.php"

Re:

PostPosted: Wed Jul 22, 2009 2:08 am
by BucKeT
Warren wrote:You can choose in ../cfg/gungame5/custom_addon_configs/gg_winner_display.cfg
gg_winner_display.cfg wrote:// Default = http://gungame5.com/gg5_win.php
gg_winner_display_page "http://gungame5.com/gg5_win.php"

Thanks for the reply Warren. So if I put my sites url in place of "http://gungame5.com/gg5_win.php" will I need to add anything to my web server for it to work? Below is what I wanted to change it to.

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>GunGame Winner</title>
<style type="text/css">
body {
background:#98AFC7;
font-family:Verdana,Tahoma;
color:#000000;
vertical-align:middle;
}
</style>
</head>
<body>
<table height="100%" topmargin="0" bottommargin="0" align="center" cellpadding="0" cellspacing="0">
<tr align="center" valign="middle">
<td valign="middle">
<table><tr><td>
<img src="http://www.gungame5.com/images/gungame5_logo.png">&nbsp;&nbsp;</td><td>
<b><?php print ($_GET["winnerName"]); ?></b> Won!<hr><br />
<b><?php print ($_GET["winnerName"]); ?></b> won the game by killing <b><?php print ($_GET["loserName"]); ?></b><br /><br />
<b>Stats:</b><br />
Wins: <b><?php print ($_GET["wins"]); ?></b><br />
Place: <b><?php print ($_GET["place"]); ?></b> of <b><?php print ($_GET["totalPlaces"]); ?></b></td></tr><tr><td colspan="2" align="center"><br><br><b>Visit our forums at <a href="http://thebucketsplace.com">http://www.thebucketsplace.com</b></a></td></tr></table></td></tr></table>
</body>
</html>