def invoke(): # Added by Chump - for bf2statistics stats #host.pers_gamespyStatsNewGame() snapshot_start = host.timer_getWallTime() if g_debug: print "Gathering SNAPSHOT Data" snapShot = getSnapShot() # Send snapshot to Backend Server print "Sending SNAPSHOT to backend: %s" % str(http_backend_addr) SNAP_SEND = 0 # ------------------------------------------------------------------- # Attempt to send snapshot # ------------------------------------------------------------------- try: backend_response = http_postSnapshot(http_backend_addr, http_backend_port, http_backend_asp, snapShot) SNAP_SEND = 1 except Exception, e: SNAP_SEND = 0 print "An error occurred while sending SNAPSHOT to backend: %s" % str( e)
def invoke(): # Added by Chump - for bf2statistics stats #host.pers_gamespyStatsNewGame() snapshot_start = host.timer_getWallTime() if g_debug: print "Gathering SNAPSHOT Data" snapShot = getSnapShot() # Send snapshot to Backend Server print "Sending SNAPSHOT to backend: %s" % str(http_backend_addr) SNAP_SEND = 0 # ------------------------------------------------------------------- # Attempt to send snapshot # ------------------------------------------------------------------- try: backend_response = http_postSnapshot( http_backend_addr, http_backend_port, http_backend_asp, snapShot ) SNAP_SEND = 1 except Exception, e: SNAP_SEND = 0 print "An error occurred while sending SNAPSHOT to backend: %s" % str(e)
def invoke(): # Added by Chump - for bf2statistics stats #host.pers_gamespyStatsNewGame() snapshot_start = time() if g_debug: print "Gathering SNAPSHOT Data" snapShot = getSnapShot() elapsedTime = time() - snapshot_start ms = elapsedTime * 1000 print "SNAPSHOT Data generated in %d ms" % ms # Send snapshot to Backend Server print "Sending SNAPSHOT to backend: %s" % str(http_backend_addr) snapshot_sent = 0 # ------------------------------------------------------------------- # Attempt to send snapshot # ------------------------------------------------------------------- try: backend_response = http_postSnapshot(http_backend_addr, http_backend_port, http_backend_asp, snapShot) if backend_response and backend_response[0] == 'O': print "SNAPSHOT Received: OK" snapshot_sent = 1 if g_debug: sayAll("Game Stats Received OK") else: print "SNAPSHOT Received: ERROR" if backend_response and backend_response[0] == 'E': datalines = backend_response.splitlines() response = datalines[2].split("\t") print "Backend Response: %s" % str(response[-1:]) if g_debug: sayAll("Game Stats Received in ERROR: %s" % str(response[-1:])) snapshot_sent = 0 except Exception, e: snapshot_sent = 0 print "An error occurred while sending SNAPSHOT to backend: %s" % str( e) if g_debug: sayAll( "An error occurred while sending stats data to backend: %s" % str(e))
def invoke(): # Added by Chump - for bf2statistics stats #host.pers_gamespyStatsNewGame() snapshot_start = host.timer_getWallTime() if g_debug: print "snapshot.py[64]: Gathering SNAPSHOT Data" snapShot = getSnapShot() # Print in log print snapShot # Send snapshot to Backend Server print "snapshot.py: Sending SNAPSHOT to backend: %s" % str(http_backend_addr) try: backend_response = http_postSnapshot( http_backend_addr, http_backend_port, http_backend_asp, snapShot ) except Exception, e: print "snapshot.py: An error occurred while sending SNAPSHOT to backend: %s" % str(e)
print "Cannot write to SNAPSHOT log file! Reason: %s" % str(e) print "Printing Snapshot as last resort manual processing: ", snapShot else: print "Printing Snapshot: ", snapShot # Send Snapshot to Central Backend Server if http_central_enable == 1 or http_central_enable == 2: print "Sending SNAPSHOT to Central Backend: %s" % str(http_central_addr) #Append CDB Setting so backened knows what to do with this snapShotCDB = snapShot + '\\cdb_update\\' + http_central_enable try: backend_response = http_postSnapshot( http_central_addr, http_central_port, http_central_asp, snapShotCDB ) except Exception, e: print "An error occurred while sending SNAPSHOT to Central Backend: %s" % str(e) print "SNAPSHOT Processing Time: %d" % (host.timer_getWallTime() - snapshot_start) # ------------------------------------------------------------------------------ # omero 2006-03-31 # ------------------------------------------------------------------------------ # always do the following at the end... repackStatsVectors()
print "Printing Snapshot as last resort manual processing: ", snapShot else: print "Printing Snapshot: ", snapShot # Send Snapshot to Central Backend Server if http_central_enable == 1 or http_central_enable == 2: print "Sending SNAPSHOT to Central Backend: %s" % str( http_central_addr) #Append CDB Setting so backened knows what to do with this snapShotCDB = snapShot + '\\cdb_update\\' + http_central_enable try: backend_response = http_postSnapshot(http_central_addr, http_central_port, http_central_asp, snapShotCDB) except Exception, e: print "An error occurred while sending SNAPSHOT to Central Backend: %s" % str( e) print "SNAPSHOT Processing Time: %d" % (host.timer_getWallTime() - snapshot_start) # ------------------------------------------------------------------------------ # omero 2006-03-31 # ------------------------------------------------------------------------------ # always do the following at the end... repackStatsVectors()