Exemple #1
0
def reCacheConnection(forceRecache=False):
    """
    Reconnect to the server to check for updates. This overwrites the cache.
    Sends version variables to the server to warn of any version issues for
    security updates, etc.

    @param bool forceRecache Whether or not it will ignore if the connection
                             already has a cache.
    """
    if not connection.hasCache() or forceRecache is True:
        data = {}
        data["eventscripts_ver"] = str(es.getString("eventscripts_ver"))
        data["es_corelib_ver"] = str(es.getString("es_corelib_ver"))
        data["eventscripts_ver_revision"] = str(
            es.getString("eventscripts_ver_revision"))
        data["eventscripts_xa"] = str(es.getString("eventscripts_xa"))
        data["os.name"] = os.name
        data["game"] = es.getGameName()
        data["hostport"] = str(es.getString("hostport"))
        try:
            l = es.getInt("hostip")
            data["hostip"] = '%d.%d.%d.%d' % (l >> 24 & 255, l >> 16 & 255,
                                              l >> 8 & 255, l & 255)
        except:
            # oh well, skip the IP address
            es.dbgmsg(1, "es_checkversion: Couldn't get IP address properly")
            pass
        connection.data = data
        connection.connect()
        connection.reCacheUpdate()
        connection.disconnect()
def reCacheConnection(forceRecache=False):
    """
    Reconnect to the server to check for updates. This overwrites the cache.
    Sends version variables to the server to warn of any version issues for
    security updates, etc.

    @param bool forceRecache Whether or not it will ignore if the connection
                             already has a cache.
    """
    if not connection.hasCache() or forceRecache is True:
        data = {}
        data["eventscripts_ver"] = str(es.getString("eventscripts_ver"))
        data["es_corelib_ver"] = str(es.getString("es_corelib_ver"))
        data["eventscripts_ver_revision"] = str(es.getString("eventscripts_ver_revision"))
        data["eventscripts_xa"] = str(es.getString("eventscripts_xa"))
        data["os.name"] = os.name
        data["game"] = es.getGameName()
        data["hostport"] = str(es.getString("hostport"))
        try:
          l = es.getInt("hostip")
          data["hostip"] = '%d.%d.%d.%d' % (l>>24 & 255, l>>16 & 255, l>>8 & 255, l & 255)
        except:
          # oh well, skip the IP address
          es.dbgmsg(1, "es_checkversion: Couldn't get IP address properly")
          pass
        connection.data = data
        connection.connect()
        connection.reCacheUpdate()
        connection.disconnect()
def load():
    global checksites
    global mapname
    es.set('bombsite_limiter_ver', '1.0.4')
    es.makepublic('bombsite_limiter_ver')
    es.msg('#multi', '#green[#lightgreenBombsite#green-#lightgreenLimiter#lightgreen]#default Loaded...')
    for map in maplist:
        mapsites[map] = bombsites(map, maplist[map])
    mapname = es.getString('eventscripts_currentmap')
    try:
        for userid in es.getUseridList():
            siteCheck()
            if len(bombsitesNum) >= 1:
                gamethread.delayed(0.5, mapsites[mapname].announce, (userid))
            else:
                checksites = 1
    except KeyError:
        mapsites[mapname] = bombsites(mapname, 'A')
        for userid in es.getUseridList():
            gamethread.delayed(0.5, mapsites[mapname].announce, (userid))
Exemple #4
0
def load():
    global checksites
    global mapname
    es.set('bombsite_limiter_ver', '1.0.4')
    es.makepublic('bombsite_limiter_ver')
    es.msg(
        '#multi',
        '#green[#lightgreenBombsite#green-#lightgreenLimiter#lightgreen]#default Loaded...'
    )
    for map in maplist:
        mapsites[map] = bombsites(map, maplist[map])
    mapname = es.getString('eventscripts_currentmap')
    try:
        for userid in es.getUseridList():
            siteCheck()
            if len(bombsitesNum) >= 1:
                gamethread.delayed(0.5, mapsites[mapname].announce, (userid))
            else:
                checksites = 1
    except KeyError:
        mapsites[mapname] = bombsites(mapname, 'A')
        for userid in es.getUseridList():
            gamethread.delayed(0.5, mapsites[mapname].announce, (userid))
def gettimestring(argv):
    sv[argv[0]] = time.strftime(es.getString('eventscripts_timeformat'))
def pyscriptexists(addonname):
    return os.path.exists("%s/%s/%s.py" % (es.getString("eventscripts_addondir"), addonname, addonname.split("/")[-1]))
def bomb_beginplant(ev):
    userid = ev['userid']
    mapname = es.getString('eventscripts_currentmap')
    mapsites[mapname].plant(userid, int(ev['site']), mapname)
def round_start(ev):
    global mapname
    mapname = es.getString('eventscripts_currentmap')
Exemple #9
0
def gettimestring(argv):
  sv[argv[0]] = time.strftime(es.getString('eventscripts_timeformat'))
Exemple #10
0
def bomb_beginplant(ev):
    userid = ev['userid']
    mapname = es.getString('eventscripts_currentmap')
    mapsites[mapname].plant(userid, int(ev['site']), mapname)
Exemple #11
0
def round_start(ev):
    global mapname
    mapname = es.getString('eventscripts_currentmap')
Exemple #12
0
def pyscriptexists(addonname):
    return os.path.exists('%s/%s/%s.py' %
                          (es.getString('eventscripts_addondir'), addonname,
                           addonname.split('/')[-1]))
def pyscriptexists(addonname):
  return os.path.exists('%s/%s/%s.py' % (es.getString('eventscripts_addondir'), addonname, addonname.split('/')[-1]))