Exemplo n.º 1
0
def onPlayerConnect(player):

    defaultUnlocks = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
    host.pers_plrSetUnlocks(player.index, defaultUnlocks, defaultUnlocks)

    if g_debug: print "Unlock module: onPlayerConnect"
    if not player.isAIPlayer():
        id = player.index
        reconnect = id in sessionPlayerUnlockMap

        # always get new unlocks on reconnect/map restart/map change etc
        if reconnect:
            del sessionPlayerUnlockMap[id]

        newUnlockSet = UnlockSet()

        newUnlockSet.unlockLevel = {}
        for i in range(0, NUM_KIT_TYPES):
            newUnlockSet.unlockLevel[i] = 0

        sessionPlayerUnlockMap[id] = newUnlockSet
        player.unlocks = sessionPlayerUnlockMap[id]

        # Added by Chump - for bf2statistics stats (plus de-indenting)
        #if bf2.serverSettings.getUseGlobalUnlocks():
        if player.getProfileId() > 2000:
            # Added by ArmEagle needed to prevent servercrash on linux on offline account connect
            #    but host.pmgr_p_set logically raises an exception when called on an online account
            if host.pmgr_p_get("profileid", player.index) == 0:
                host.pmgr_p_set("profileid", player.index,
                                player.getProfileId())

            success = host.pers_plrRequestUnlocks(player.index, 1)
            if not success:
                if g_debug: print "Requesting unlocks: Failed"
            else:
                if g_debug: print "Requesting unlocks: Success"

        else:
            if g_debug:
                print "Player %d had no profile id, can't request unlocks" % player.index

        if g_debug: print "Added player %d to unlock checking" % (player.index)
Exemplo n.º 2
0
def onPlayerConnect(player):

	defaultUnlocks = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
	host.pers_plrSetUnlocks(player.index, defaultUnlocks, defaultUnlocks)

	if g_debug: print "Unlock module: onPlayerConnect"
	if not player.isAIPlayer():
		id = player.index
		reconnect = id in sessionPlayerUnlockMap
		
		# always get new unlocks on reconnect/map restart/map change etc
		if reconnect:
			del sessionPlayerUnlockMap[id]
			
		newUnlockSet = UnlockSet()

		newUnlockSet.unlockLevel = {}
		for i in range(0, NUM_KIT_TYPES):
			newUnlockSet.unlockLevel[i] = 0

		sessionPlayerUnlockMap[id] = newUnlockSet
		player.unlocks = sessionPlayerUnlockMap[id]
		
# Added by Chump - for bf2statistics stats (plus de-indenting)
		#if bf2.serverSettings.getUseGlobalUnlocks():
		if player.getProfileId() > 2000:
			# Added by ArmEagle needed to prevent servercrash on linux on offline account connect
			#    but host.pmgr_p_set logically raises an exception when called on an online account
			if host.pmgr_p_get("profileid", player.index) == 0:
				host.pmgr_p_set("profileid", player.index, player.getProfileId())
			
			success = host.pers_plrRequestUnlocks(player.index, 1)
			if not success:
				if g_debug: print "Requesting unlocks: Failed"
			else:
				if g_debug: print "Requesting unlocks: Success"
				
		else:
			if g_debug: print "Player %d had no profile id, can't request unlocks" % player.index
				
		if g_debug: print "Added player %d to unlock checking" % (player.index)
Exemplo n.º 3
0
	def setMaxOrderPoint(self, t): return host.pmgr_p_set("maxOrderPoint", self.index, t)

	def getTotalDogtagCount(self): return host.pmgr_p_get("totalDogtagCount", self.index)
Exemplo n.º 4
0
	def setIsInsideCP(self, val): return host.pmgr_p_set("isInsideCP", self.index, val)
	def getIsInsideCP(self): return host.pmgr_p_get("isInsideCP", self.index)
Exemplo n.º 5
0
	def setOrderPoint(self, t): return host.pmgr_p_set("orderPoint", self.index, t)
	def setMaxOrderPoint(self, t): return host.pmgr_p_set("maxOrderPoint", self.index, t)
Exemplo n.º 6
0
	def setTeam(self, t): return host.pmgr_p_set("team", self.index, t)
	def getPing(self): return host.pmgr_p_get("ping", self.index)
Exemplo n.º 7
0
	def setSpawnGroup(self, t): return host.pmgr_p_set("sgr", self.index, t)
	
	def getKit(self): return host.pmgr_p_get("kit", self.index)
Exemplo n.º 8
0
	def setTimeToSpawn(self, t): return host.pmgr_p_set("tts", self.index, t)

	def getSquadId(self): return host.pmgr_p_get("sqid", self.index)
Exemplo n.º 9
0
 def setTeam(self, t):
     return host.pmgr_p_set("team", self.index, t)
Exemplo n.º 10
0
 def setTotalDogtagCount(self, t):
     return host.pmgr_p_set("totalDogtagCount", self.index, t)
Exemplo n.º 11
0
 def setTimeToSpawn(self, t):
     return host.pmgr_p_set("tts", self.index, t)
Exemplo n.º 12
0
	def setTotalDogtagCount(self, t): return host.pmgr_p_set("totalDogtagCount", self.index, t)
	
	def getCDKeyHash(self): return host.pmgr_p_get("cdKeyHash", self.index)
Exemplo n.º 13
0
 def setMaxOrderPoint(self, t):
     return host.pmgr_p_set("maxOrderPoint", self.index, t)
Exemplo n.º 14
0
	def setMaxOrderPoint(self, t): return host.pmgr_p_set("maxOrderPoint", self.index, t)

	def getTotalDogtagCount(self): return host.pmgr_p_get("totalDogtagCount", self.index)
Exemplo n.º 15
0
	def setSpawnGroup(self, t): return host.pmgr_p_set("sgr", self.index, t)
	
	def getKit(self): return host.pmgr_p_get("kit", self.index)
Exemplo n.º 16
0
	def setName(self, name): return host.pmgr_p_set("name", self.index, name)

	def getSpawnGroup(self): return host.pmgr_p_get("sgr", self.index)
Exemplo n.º 17
0
	def setTotalDogtagCount(self, t): return host.pmgr_p_set("totalDogtagCount", self.index, t)
	
	def getCDKeyHash(self): return host.pmgr_p_get("cdKeyHash", self.index)
Exemplo n.º 18
0
 def setSpawnGroup(self, t):
     return host.pmgr_p_set("sgr", self.index, t)
Exemplo n.º 19
0
	def setTeam(self, t): return host.pmgr_p_set("team", self.index, t)
	def getPing(self): return host.pmgr_p_get("ping", self.index)
Exemplo n.º 20
0
	def setSuicide(self, t): return host.pmgr_p_set("suicide", self.index, t)
	
	def getTimeToSpawn(self): return host.pmgr_p_get("tts", self.index)
Exemplo n.º 21
0
 def setName(self, name):
     return host.pmgr_p_set("name", self.index, name)
Exemplo n.º 22
0
	def setSuicide(self, t): return host.pmgr_p_set("suicide", self.index, t)
	
	def getTimeToSpawn(self): return host.pmgr_p_get("tts", self.index)
Exemplo n.º 23
0
 def setIsInsideCP(self, val):
     return host.pmgr_p_set("isInsideCP", self.index, val)
Exemplo n.º 24
0
	def setTimeToSpawn(self, t): return host.pmgr_p_set("tts", self.index, t)

	def getSquadId(self): return host.pmgr_p_get("sqid", self.index)
Exemplo n.º 25
0
 def setSuicide(self, t):
     return host.pmgr_p_set("suicide", self.index, t)
Exemplo n.º 26
0
	def setName(self, name): return host.pmgr_p_set("name", self.index, name)

	def getSpawnGroup(self): return host.pmgr_p_get("sgr", self.index)