Crashes as of July 2nd, 2012

Discussion sur Custom Addons pour GunGame5.

Crashes as of July 2nd, 2012

Postby satoon101 » Tue Jul 03, 2012 3:07 am

Valve just updated CS:S with the same engine update that recently started causing crashes on TF2, DOD:S, and HL2:DM late last week. We know that es_emitsound and es_playsound are causing the crashing (though, there could also be other functionality as well that we haven't found yet). Until this issue is fixed within EventScripts, you will need to set gg_soundpack to no_sound. That variable can be found in your server's ../cfg/gungame51/gg_en_config.cfg file.

UPDATE!!!:
your-name-here has released an update for EventScripts (unofficially) that fixes the crashing that was caused by the update. That update can be found here:
http://forums.eventscripts.com/viewtopi ... 28&t=45806

Thank you, and sorry for the inconvenience,
Satoon
satoon101

Site Admin
Site Admin
 
Posts: 1055
Joined: Thu Oct 09, 2008 4:27 pm

Postby Corvette911 » Tue Jul 03, 2012 7:17 am

Hi Satoon,

That fix allowed gungame to get past the first problem...letting a player joining a team...Game would crash instantly on team join....The gungame addin <quake sounds> also uses es_playsound this caused a crash later on in the game..i simply removed it..only esthetic..

Thanks
Corvette911

Private
Private
 
Posts: 22
Joined: Sun Dec 18, 2011 7:41 pm
Steam Friends Name: Corvette911

Re:

Postby Monday » Tue Jul 03, 2012 7:37 pm

Corvette911 wrote:Hi Satoon,

That fix allowed gungame to get past the first problem...letting a player joining a team...Game would crash instantly on team join....The gungame addin <quake sounds> also uses es_playsound this caused a crash later on in the game..i simply removed it..only esthetic..

Thanks


Make sure you disable all other plugins/mods including mani, sm, and any other es addons. Then get back to us...
GunGame Developer

If you ask something stupid before reading the instructions that are likely included in the files, I will make fun of you for being a lazy idiot.
Monday

Site Admin
Site Admin
User avatar
 
Posts: 97
Joined: Sat Feb 14, 2009 1:51 am

Postby tnarocks » Tue Jul 03, 2012 10:18 pm

Thanks Satoon and Monday i did what you both said and it worked. I also had to disable assists and buylevel cause they were crashing the server also
tnarocks

Corporal
Corporal
 
Posts: 315
Joined: Mon Jan 25, 2010 3:56 pm
Location: Florida
Steam Friends Name: {TAG}TNA ROCKS(ENGAGED)

Postby satoon101 » Wed Jul 04, 2012 1:22 am

I believe those 2 addons will not crash if you just disable their sounds.

For Assists, just set gg_assist_sound to "" in its config file. This should disable its sound and eliminate its crashing issue.

Buylevel only uses the "levelup" sound, so as long as you are using no_sound, there should be no levelup sound. If it for some reason does crash, it would help us if you could just comment out the playsound line like the following:
   # ggPlayer.playsound("levelup")
Try that and see if the crash persists. If it does, then there is something else causing the crashing.

Satoon
satoon101

Site Admin
Site Admin
 
Posts: 1055
Joined: Thu Oct 09, 2008 4:27 pm

Postby tnarocks » Wed Jul 04, 2012 5:42 am

i changed the sound in both and it still crashes the server. not sure how to comment out the playsound line...
tnarocks

Corporal
Corporal
 
Posts: 315
Joined: Mon Jan 25, 2010 3:56 pm
Location: Florida
Steam Friends Name: {TAG}TNA ROCKS(ENGAGED)

Postby satoon101 » Wed Jul 04, 2012 5:44 am

Make it look like the line above ^^. Using the # character turns the remainder of that line into a comment. Make sure to keep the 4 spaces prior to it to not mess up the indentation, otherwise an error will occur.

Try with just gg_assist loaded with the sound set to "" and leave gg_buylevel set to 0 and see if it still crashes so we can narrow down the crash.

Satoon
satoon101

Site Admin
Site Admin
 
Posts: 1055
Joined: Thu Oct 09, 2008 4:27 pm

Postby tnarocks » Wed Jul 04, 2012 5:46 am

ok let me try that right now and see what happens
tnarocks

Corporal
Corporal
 
Posts: 315
Joined: Mon Jan 25, 2010 3:56 pm
Location: Florida
Steam Friends Name: {TAG}TNA ROCKS(ENGAGED)

Postby tnarocks » Wed Jul 04, 2012 5:50 am

ok i tried just the assist and it still crashed the server.
tnarocks

Corporal
Corporal
 
Posts: 315
Joined: Mon Jan 25, 2010 3:56 pm
Location: Florida
Steam Friends Name: {TAG}TNA ROCKS(ENGAGED)

Postby satoon101 » Wed Jul 04, 2012 5:56 am

Ahh, it seems that the addon sends sounds other than the gg_assist_sound. Try to comment out every line that starts with es.playsound. Again, make sure to leave the number of spaces prior to the code before the comment. The only exception to this is the one on line 241, you will need to add another line after it (with the same number of spaces prior to the code) that just says pass

Satoon
satoon101

Site Admin
Site Admin
 
Posts: 1055
Joined: Thu Oct 09, 2008 4:27 pm

Postby tnarocks » Wed Jul 04, 2012 6:01 am

im lost on how to comment out the line?
tnarocks

Corporal
Corporal
 
Posts: 315
Joined: Mon Jan 25, 2010 3:56 pm
Location: Florida
Steam Friends Name: {TAG}TNA ROCKS(ENGAGED)

Postby tnarocks » Wed Jul 04, 2012 6:02 am

i see this line


# Make sure there is a sound to play
if str(gg_assist_sound) and str(gg_assist_sound) != "0":
es.playsound(userid, str(gg_assist_sound), 1.0)

how do i edit it out?
tnarocks

Corporal
Corporal
 
Posts: 315
Joined: Mon Jan 25, 2010 3:56 pm
Location: Florida
Steam Friends Name: {TAG}TNA ROCKS(ENGAGED)

Postby satoon101 » Wed Jul 04, 2012 6:06 am

    # Make sure there is a sound to play
    if str(gg_assist_sound) and str(gg_assist_sound) != "0":
        # es.playsound(userid, str(gg_assist_sound), 1.0)
        pass
I had to add a space to each line so that the code only has 4 spaces when it is in the syntax blocks. So, copy it from the forum post instead of quoting and copying from the quote.

Satoon
satoon101

Site Admin
Site Admin
 
Posts: 1055
Joined: Thu Oct 09, 2008 4:27 pm

Postby tnarocks » Wed Jul 04, 2012 6:12 am

so kinda like this?



# Player error sound to the player
es.playsound(userid, "buttons/weapon_cant_buy.wav", 1.0)
return
tnarocks

Corporal
Corporal
 
Posts: 315
Joined: Mon Jan 25, 2010 3:56 pm
Location: Florida
Steam Friends Name: {TAG}TNA ROCKS(ENGAGED)

Postby satoon101 » Wed Jul 04, 2012 6:16 am

All the other instances (other than the one in the above post) you "just" need to add the comment character to. The only difference is that the first one needed "some" code after the "if" statement, which is why you needed to add "pass". So, for instance, the one in your newest post would look like:
        # Player error sound to the player
        # es.playsound(userid, "buttons/weapon_cant_buy.wav", 1.0)
        return
Satoon
satoon101

Site Admin
Site Admin
 
Posts: 1055
Joined: Thu Oct 09, 2008 4:27 pm

Postby tnarocks » Wed Jul 04, 2012 6:16 am

would you be able to edit the file for me and post it here. I dont think that i am editing it right.
tnarocks

Corporal
Corporal
 
Posts: 315
Joined: Mon Jan 25, 2010 3:56 pm
Location: Florida
Steam Friends Name: {TAG}TNA ROCKS(ENGAGED)

Postby tnarocks » Wed Jul 04, 2012 6:19 am

can you tell me if this is right?


# ../addons/eventscripts/gungame51/scripts/custom/gg_assist/gg_assist.py

# ============================================================================
# >> IMPORTS
# ============================================================================
# Python Imports
from random import randint

# Eventscripts Imports
import es
import cmdlib
import popuplib
from playerlib import getPlayer
from playerlib import getPlayerList

# GunGame Imports
from gungame51.core.addons.shortcuts import AddonInfo
from gungame51.core.players.shortcuts import Player
from gungame51.core.players.shortcuts import setAttribute
from gungame51.core.players.shortcuts import deleteAttribute
from gungame51.core.weapons.shortcuts import get_total_levels

# ============================================================================
# >> ADDON REGISTRATION/INFORMATION
# ============================================================================
info = AddonInfo()
info.name = 'gg_assist'
info.title = 'GG Assist'
info.author = 'XE_ManUp'
info.version = '1.5'
info.translations = ['gg_assist']

# ============================================================================
# >> GLOBAL VARIABLES
# ============================================================================
# Server Vars
gg_assist_advertise = es.ServerVar("gg_assist_advertise")
gg_assist_award_alive_only = es.ServerVar("gg_assist_award_alive_only")
gg_assist_percent = es.ServerVar("gg_assist_percent")
gg_assist_redeem_win = es.ServerVar("gg_assist_redeem_win")
gg_assist_skip_knife = es.ServerVar("gg_assist_skip_knife")
gg_assist_skip_nade = es.ServerVar("gg_assist_skip_nade")
gg_assist_sound = es.ServerVar("gg_assist_sound")

# ============================================================================
# >> CLASSES
# ============================================================================
class AdvertCounter:
    count = 0
    def __init__(self):
        self.__class__.count += 1

# ============================================================================
# >> LOAD & UNLOAD
# ============================================================================
def load():
    es.dbgmsg(0, "Loaded: gg_assist")

    # Set up attributes for all existing players
    setAttribute("#all", "damageTaken", {})
    setAttribute("#all", "assistPoints", 0)
    setAttribute("#all", "assistNotification", 0)

    # Register the say command (!assist)
    cmdlib.registerSayCommand('!assist', display_menu,
        'Opens the GG Assist menu.')

    # Register the say command (!redeem)
    cmdlib.registerSayCommand('!redeem', redeem_points_cmd,
        'Redeems assist points.')

    # Make the assist sound downloadable
    add_sound()

def unload():
    es.dbgmsg(0, "Unloaded: gg_assist")

    # Delete assist attributes from all existing players
    deleteAttribute("#all", "damageTaken")
    deleteAttribute("#all", "assistPoints")
    deleteAttribute("#all", "assistNotification")

    # Unregister the say command (!assist)
    cmdlib.unregisterSayCommand('!assist')

    # Unregister the say command (!assist)
    cmdlib.unregisterSayCommand('!redeem')

# ============================================================================
# >> GAME EVENTS
# ============================================================================
def es_map_start(event_var):
    # Reset attributes for all existing players
    setAttribute("#all", "damageTaken", {})
    setAttribute("#all", "assistPoints", 0)
    setAttribute("#all", "assistNotification", 0)

    # Make the assist sound downloadable
    add_sound()

    # Reset the Advert Counter
    AdvertCounter.count = 0

def gg_start(event_var):
    # Reset attributes for all existing players
    setAttribute("#all", "damageTaken", {})
    setAttribute("#all", "assistPoints", 0)
    setAttribute("#all", "assistNotification", 0)

def player_activate(event_var):
    userid = int(event_var["userid"])

    # Set up attributes
    setAttribute(userid, "damageTaken", {})
    setAttribute(userid, "assistPoints", 0)
    setAttribute(userid, "assistNotification", 0)

def round_start(event_var):
    # Reset all damage taken attributes - this is a new round
    setAttribute("#all", "damageTaken", {})

def player_spawn(event_var):
    # Make sure that the player that is spawning is on a team
    if not int(event_var["es_userteam"]) > 1:
        return

    # We will only advertise every 30 spawns (returns if there is a remainder)
    if AdvertCounter().count % 30:
        return

    # Select a random integer 1 through 4
    randomNumber = randint(1, 4)

    randomNumber = 4
    # Message the advertisement
    if randomNumber < 4:
        for userid in getPlayerList("#human"):
            Player(userid).msg("gg_assist_advert_%s" %randomNumber,
                prefix=True)
    else:
        for userid in getPlayerList("#human"):
            Player(userid).msg("gg_assist_advert_%s" %randomNumber,
                {'percent':int(gg_assist_percent)}, prefix=True)

def player_hurt(event_var):
    userid = int(event_var["userid"])
    attacker = int(event_var["attacker"])

    # Return if hurt by themselves
    if userid == attacker:
        return

    # Return if hurt by world
    if not attacker:
        return

    # Return if hurt by a teammate
    if event_var["es_userteam"] == event_var["es_attackerteam"]:
        return

    # Create or update damage done to the player
    if not Player(userid).damageTaken.has_key(attacker):
        Player(userid).damageTaken[attacker] = int(event_var["dmg_health"])
    else:
        Player(userid).damageTaken[attacker] += int(event_var["dmg_health"])

def player_death(event_var):
    userid = int(event_var["userid"])
    attacker = int(event_var["attacker"])

    # Loop through all players that did damage to this player
    for playerid in Player(userid).damageTaken:
        # We do not award the player that killed the player
        if playerid == attacker:
            continue

        # See if we are allowed to award the player
        if int(gg_assist_award_alive_only) and getPlayer(playerid).isdead:
            # Continue if the player is dead while gg_assist_award_alive_only
            # is active
            continue

        # Award points to the player
        award_points(playerid, userid, Player(userid).damageTaken[playerid])

    # Clear the player's damage taken dictionary
    Player(userid).damageTaken.clear()

# ============================================================================
# >> CUSTOM/HELPER FUNCTIONS
# ============================================================================
def award_points(userid, victim, points):
    # Make sure this player is still on the server; if not, return
    if not es.exists('userid', userid):
        return

    # Calculate the points based on the percent set up
    points = points * (int(gg_assist_percent) / 100.0)

    # Add points
    Player(userid).assistPoints += points

    if int(gg_assist_advertise):
        Player(userid).saytext2(Player(victim).index, 'gg_assist_earn_points',
            {'earned_points': points,
             'victim': es.getplayername(victim),
             'total_points': Player(userid).assistPoints
            },
            prefix=True,
        )

    # Do not continue with the player does not have 100 assist points
    if Player(userid).assistPoints < 100:
        return

    # Calculate the levels that can be gained if all assist points are redeemed
    assistLevelsAvailable = int(Player(userid).assistPoints / 100)

    # Return if the player has already been notified by sound and message
    if assistLevelsAvailable == Player(userid).assistNotification:
        return

    # Send a message
    if assistLevelsAvailable == 1:
        Player(userid).msg("gg_assist_notify_singular",
            {'points': Player(userid).assistPoints,
             'levels': assistLevelsAvailable
            },
            prefix=True
        )
    else:
        Player(userid).msg("gg_assist_notify_plural",
            {'points': Player(userid).assistPoints,
             'levels': assistLevelsAvailable
            },
            prefix=True
        )

    # Make sure there is a sound to play
if str(gg_assist_sound) and str(gg_assist_sound) != "0":
# es.playsound(userid, str(gg_assist_sound), 1.0)
pass


    # Increment the assist notification count
    Player(userid).assistNotification += 1

def redeem_points(userid, choice=None, popup=None):
    """Only redeems 100 points at a time. The player must type something each
    time they want to redeem a level for 100 points.
    """

    # Make sure the player has enough points to redeem
    if Player(userid).assistPoints < 100:
        # Error message to the player
        Player(userid).msg("gg_assist_not_enough_points", prefix=True)

    # Player error sound to the player
# es.playsound(userid, "buttons/weapon_cant_buy.wav", 1.0)
return


    # Knife check
    if Player(userid).weapon == "knife" and not int(gg_assist_skip_knife):
        # Error message to the player
        Player(userid).msg("gg_assist_deny_knife", prefix=True)

        # Player error sound to the player
# es.playsound(userid, "buttons/weapon_cant_buy.wav", 1.0)
return


    # HEGrenade check
    if Player(userid).weapon == "hegrenade" and not int(gg_assist_skip_nade):
        # Error message to the player
        Player(userid).msg("gg_assist_deny_nade", prefix=True)

        # Player error sound to the player
# es.playsound(userid, "buttons/weapon_cant_buy.wav", 1.0)
return


    # Do we allow the player to redeem assist points to win?
    if Player(userid).level == get_total_levels():
        if not int(gg_assist_redeem_win):
            # Error message to the player
            Player(userid).msg("gg_assist_deny_win", prefix=True)

            # Player error sound to the player
# es.playsound(userid, "buttons/weapon_cant_buy.wav", 1.0)
return


    # Level the player up
    if Player(userid).levelup(1, 0, "gg_assist"):
        # Remove the points
        Player(userid).assistPoints -= 100

        # Decrement the assist notification count
        Player(userid).assistNotification -= 1

        # Message the remaining balance
        Player(userid).msg("gg_assist_redeemed",
            {'points': Player(userid).assistPoints},
            prefix=True
        )

        # Play the levelup sound
        Player(userid).playsound("levelup")

def display_menu(userid, args):
    # Attempt to delete the popup
    try:
        popuplib.delete("gg_assist_popup")
    except:
        pass

    # Create the popuplib menu for !assist
    assistPopup = popuplib.create("gg_assist_popup")

    # Add lines
    assistPopup.addline(info.title)
    assistPopup.addline("="*10)
    assistPopup.addline(Player(userid).langstring("gg_assist_popup_points",
        {'points': Player(userid).assistPoints}))
    assistPopup.addline("="*10)
    assistPopup.addline(" ")
    assistPopup.addline(Player(userid).langstring("gg_assist_popup_redeem"))
    assistPopup.addline(" ")
    assistPopup.addline("-"*10)
    assistPopup.addline(Player(userid).langstring("gg_assist_popup_exit"))

    # Set the redeem points function to option 1
    assistPopup.select(1, redeem_points)

    # Send the menu
    assistPopup.send(userid)

def redeem_points_cmd(userid, args):
    # Redirect to redeem_points()
    redeem_points(userid)

def add_sound():
    # Make sure that a sound is listed
    if str(gg_assist_sound) and str(gg_assist_sound) != "0":
        # Make the sound downloadable
        es.stringtable("downloadable", "sound/%s" %str(gg_assist_sound))
tnarocks

Corporal
Corporal
 
Posts: 315
Joined: Mon Jan 25, 2010 3:56 pm
Location: Florida
Steam Friends Name: {TAG}TNA ROCKS(ENGAGED)

Postby satoon101 » Wed Jul 04, 2012 7:03 am

No, you seem to have removed all indentation from those lines. Make sure that they still have the proper indentation (4 spaces per level). I don't have time to do this myself right now, gotta get up early to visit family tomorrow (err.. today) for the 4th.

Satoon
satoon101

Site Admin
Site Admin
 
Posts: 1055
Joined: Thu Oct 09, 2008 4:27 pm

Postby satoon101 » Wed Jul 04, 2012 7:04 am

your-name-here has released an unofficial update for Windows servers. That can be found here:
http://forums.eventscripts.com/viewtopi ... 28&t=45806

Satoon
satoon101

Site Admin
Site Admin
 
Posts: 1055
Joined: Thu Oct 09, 2008 4:27 pm

Postby tnarocks » Wed Jul 04, 2012 7:11 am

let thats why i hate editing things cause i seem to mess them up. and im running a linux server so that wont help me..
tnarocks

Corporal
Corporal
 
Posts: 315
Joined: Mon Jan 25, 2010 3:56 pm
Location: Florida
Steam Friends Name: {TAG}TNA ROCKS(ENGAGED)

Next


Return to Custom Addons

Who is online

Users browsing this forum: No registered users and 1 guest

cron