Advertisement
Guest User

Untitled

a guest
Feb 14th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.40 KB | None | 0 0
  1. def getProfileData(self, username):
  2. found = False
  3. for room in self.rooms.values():
  4. for client in room.clients.values():
  5. if client.username == username:
  6. if client.isInTribe:
  7. tribe = client.TribeName
  8. else:
  9. tribe = ''
  10. stats = ','.join(map(str, [client.micesaves,client.shamancheese,client.firstcount,client.cheesecount,client.hardModeSaves,client.bootcampcount,client.divineModeSaves]))
  11. userlook = client.look
  12. color1 = client.color1
  13. date = client.datereg
  14. p = Array.ByteArray()
  15. p.writeInt(client.avatar)
  16. p.writeUTF(username)
  17. p.writeUTF(stats)
  18. if str(client.titleNumber).isdigit():
  19. p.writeShort(int(client.titleNumber))
  20. else:
  21. t, c = str(client.titleNumber).split(',')
  22. p.writeShort(int(t))
  23. p.writeShort(len(client.titleList))
  24. for i in client.titleList:
  25. if ',' in str(i):
  26. t, c = str(i).split(',')
  27. p.writeShort(int(t))
  28. p.writeUnsignedByte(int(c))
  29. else:
  30. p.writeShort(int(i))
  31. p.writeUnsignedByte(1)
  32.  
  33. p.writeUTF(userlook)
  34. p.writeUTF(tribe)
  35. p.writeInt(int(str(date)[:len(str(date)) - 3]))
  36. p.writeInt(int(color1, 16))
  37. p.writeShort(client.playerLevel)
  38. p.writeUnsignedByte(client.gender)
  39. priv = client.privilegeLevel
  40. if priv == 1 or priv == 2 or priv == 3:
  41. tempPriv = 1
  42. if priv == 10:
  43. tempPriv = 10
  44. if priv == 2 or priv == 4:
  45. tempPriv = 20
  46. if priv == 5 or priv == 6 or priv == 8:
  47. tempPriv = 6
  48. p.writeUnsignedByte(tempPriv)
  49. p.writeUnsignedByte(1)
  50. p.writeUTF(client.marriage)
  51. p.writeUnsignedByte(len(client.Badges))
  52. for i in client.Badges:
  53. p.writeUnsignedByte(int(i))
  54. statss = [30, client.racingStats[0], 1500, 124], [31, client.racingStats[1], 10000, 125], [33, client.racingStats[2], 10000, 126], [32, client.racingStats[3], 10000, 127], [26, client.survivorStats[0], 1000, 120], [27, client.survivorStats[1], 800, 121], [28, client.survivorStats[2], 20000, 122], [29, client.survivorStats[3], 10000, 123]
  55. p.writeUnsignedByte(len(statss))
  56. for stat in statss:
  57. p.writeUnsignedByte(int(stat[0]))
  58. p.writeInt(int(stat[1]))
  59. p.writeInt(int(stat[2]))
  60. p.writeUnsignedByte(int(stat[3]))
  61.  
  62. found = p.toString()
  63.  
  64. return found
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement