Ejemplo n.º 1
0
	def __init__(self):
		super().__init__()
		self.name = None
		self.unk1 = 0
		self.unk2 = 0
		self.data = None
		self.datetime = common.DateTime(0)
Ejemplo n.º 2
0
 def test_datetime(self):
     datetime = common.DateTime(135593643393)
     assert datetime.second() == 1
     assert datetime.minute() == 54
     assert datetime.hour() == 12
     assert datetime.day() == 1
     assert datetime.month() == 8
     assert datetime.year() == 2020
Ejemplo n.º 3
0
 def test_standard_datetime(self):
     import datetime
     dt = common.DateTime(135593643393).standard_datetime()
     assert dt == datetime.datetime(2020,
                                    8,
                                    1,
                                    12,
                                    54,
                                    1,
                                    tzinfo=datetime.timezone.utc)
Ejemplo n.º 4
0
	def __init__(self):
		super().__init__()
		self.game_mode = 0
		self.attribs = [0, 0, 0, 0, 0, 0]
		self.open_participation = True
		self.matchmake_system = 0
		self.application_data = b""
		self.player_count = 0
		self.progress_score = 100
		self.session_key = b""
		self.option = 0
		self.param = MatchmakeParam()
		self.started_time = common.DateTime(0)
		self.user_password = ""
		self.refer_gid = 0
		self.user_password_enabled = False
		self.system_password_enabled = False
		self.codeword = ""
Ejemplo n.º 5
0
 def datetime(self):
     return common.DateTime(self.u64())
                                friends.FriendsTitle.NEX_VERSION,
                                backend.Settings("friends.cfg"))
backend.connect(nex_token.host, nex_token.port)
backend.login(nex_token.username, nex_token.password, None,
              authentication.NintendoLoginData(nex_token.token))

#Even though you're sending your username and pid to the server, you can't
#requests friend information of other people. You'll always get your own data
client = friends.FriendsClient(backend)
principal_preference, comment, friends, requests_sent, requests_received, \
  blacklist, unk1, notifications, unk2 = client.get_all_information(
    friends.NNAInfo(
        friends.PrincipalBasicInfo(
   pid, USERNAME, #Pid and nnid
   #If you change mii name or data here it will also be changed on Nintendo's servers
   friends.MiiV2(mii.name, 0, 0, mii.data, common.DateTime(0)),
   2
        ),
        0x5E, 0x0B
    ),
    #NintendoPresenceV2 tells the server about your online status, which
    #game you're currently playing, etc. This will be shown to your friends
    #in their friend list (unless you disabled this feature).
    friends.NintendoPresenceV2(
        0, 0, friends.GameKey(0, 0), 0, None, 0, 0, 0, 0, 0, 0, b"", 3, 3, 3
    ),
    #Enter your birthday here
    common.DateTime.make(31, 12, 2000, 0, 0, 0)
)

#Now print everything
Ejemplo n.º 7
0
 def __init__(self):
     super().__init__()
     self.main_station = common.StationURL.parse("prudp:/")
     self.special_protocols = []
     self.special_station = common.StationURL.parse("prudp:/")
     self.server_time = common.DateTime(0)
Ejemplo n.º 8
0
 def test_timestamp(self):
     datetime = common.DateTime(135593643393)
     assert datetime.timestamp() == 1596279241
Ejemplo n.º 9
0
 def test_value(self):
     datetime = common.DateTime(135593643393)
     assert datetime.value() == 135593643393
Ejemplo n.º 10
0
 def test_datetime(self):
     stream = streams.StreamOut(settings.default())
     stream.datetime(common.DateTime(135605968896))
     assert stream.get() == bytes.fromhex("00e0be921f000000")