SHARE
TWEET

Untitled

a guest Jan 18th, 2020 85 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. friendsServer.UpdateAndGetAllInformation(func(client *nex.Client, callID uint32, nnaInfo *nexproto.NNAInfo, presence *nexproto.NintendoPresenceV2, birthday *nex.DateTime) {
  2.         comment := "Pretendo Online"
  3.         datetime := nex.NewDateTime(0)
  4.  
  5.         rmcResponseStream := nex.NewStream()
  6.         rmcResponseStream.Grow(int64(
  7.             3 + // PrincipalPreference
  8.             1 + 2 + len(comment) + 1 + 8 + // Comment
  9.  
  10.             4 + // FriendInfo List length
  11.             4 + // PID
  12.             2 + 11 + 1 + // NNID
  13.             2 + 10 + 1 + // Mii Name
  14.             2 + // 2 bytes
  15.             4 + // Mii buffer
  16.             8 + // date
  17.             3 +
  18.             4 +
  19.             1 +
  20.             8 + // title id
  21.             2 + // title ver
  22.             1 +
  23.             2 + 12 + 1 +
  24.             29 +
  25.             2 + 16 + 1 +
  26.             32 +
  27.  
  28.             4 + // FriendRequest (Sent) List length
  29.             4 + // FriendRequest (Received) List length
  30.             4 + // BlacklistedPrincipal List length
  31.             1 + // Unknown
  32.             4 + // PersistentNotification List length
  33.             1)) // Unknown
  34.  
  35.         // TODO: Make the following fields into structs and encode them
  36.  
  37.         //PrincipalPreference
  38.         rmcResponseStream.WriteByteNext(0)
  39.         rmcResponseStream.WriteByteNext(0)
  40.         rmcResponseStream.WriteByteNext(0)
  41.         //Comment
  42.         rmcResponseStream.WriteByteNext(0)
  43.         rmcResponseStream.WriteNEXStringNext(comment)
  44.         rmcResponseStream.WriteU64LENext([]uint64{datetime.Now()})
  45.         //List<FriendInfo>
  46.         rmcResponseStream.WriteU32LENext([]uint32{1})
  47.         // NNAInfo
  48.         rmcResponseStream.WriteU32LENext([]uint32{1745583457})
  49.         rmcResponseStream.WriteNEXStringNext("RamboLeBoss")
  50.         rmcResponseStream.WriteNEXStringNext("RamboLeMii")
  51.         rmcResponseStream.WriteByteNext(0)
  52.         rmcResponseStream.WriteByteNext(0)
  53.         rmcResponseStream.WriteU32LENext([]uint32{0}) // Mii buffer
  54.         rmcResponseStream.WriteU64LENext([]uint64{datetime.Now()})
  55.         rmcResponseStream.WriteByteNext(0)
  56.         rmcResponseStream.WriteByteNext(0)
  57.         rmcResponseStream.WriteByteNext(0)
  58.         // Presence
  59.         rmcResponseStream.WriteU32LENext([]uint32{4})
  60.         rmcResponseStream.WriteByteNext(1)
  61.         rmcResponseStream.WriteU64LENext([]uint64{0x000500010113400})
  62.         rmcResponseStream.WriteByteNext(0x40)
  63.         rmcResponseStream.WriteByteNext(0)
  64.         rmcResponseStream.WriteByteNext(0)
  65.         rmcResponseStream.WriteNEXStringNext("BO2 je crois")
  66.         rmcResponseStream.WriteU32LENext([]uint32{0})
  67.         rmcResponseStream.WriteByteNext(0)
  68.         rmcResponseStream.WriteU32LENext([]uint32{0})
  69.         rmcResponseStream.WriteU32LENext([]uint32{0})
  70.         rmcResponseStream.WriteU32LENext([]uint32{1745583457})
  71.         rmcResponseStream.WriteU32LENext([]uint32{0})
  72.         rmcResponseStream.WriteU32LENext([]uint32{0})
  73.         rmcResponseStream.WriteByteNext(0)
  74.         rmcResponseStream.WriteByteNext(0)
  75.         rmcResponseStream.WriteByteNext(0)
  76.         // Comment
  77.         rmcResponseStream.WriteByteNext(0)
  78.         rmcResponseStream.WriteNEXStringNext("Still pretending")
  79.         rmcResponseStream.WriteU64LENext([]uint64{datetime.Now()})
  80.         // stuff
  81.         rmcResponseStream.WriteU64LENext([]uint64{datetime.Now()})
  82.         rmcResponseStream.WriteU64LENext([]uint64{datetime.Now()})
  83.         rmcResponseStream.WriteU64LENext([]uint64{datetime.Now()})
  84.  
  85.         //List<FriendRequest> (Sent)
  86.         rmcResponseStream.WriteU32LENext([]uint32{0})
  87.         //List<FriendRequest> (Received)
  88.         rmcResponseStream.WriteU32LENext([]uint32{0})
  89.         //List<BlacklistedPrincipal>
  90.         rmcResponseStream.WriteU32LENext([]uint32{0})
  91.         //Unknown
  92.         rmcResponseStream.WriteByteNext(0)
  93.         //List<PersistentNotification>
  94.         rmcResponseStream.WriteU32LENext([]uint32{0})
  95.         //Unknown
  96.         rmcResponseStream.WriteByteNext(0)
  97.  
  98.         rmcResponseBody := rmcResponseStream.Bytes()
  99.  
  100.         // Build response packet
  101.         rmcResponse := nex.NewRMCResponse(nexproto.FriendsProtocolID, callID)
  102.         rmcResponse.SetSuccess(nexproto.FriendsMethodUpdateAndGetAllInformation, rmcResponseBody)
  103.  
  104.         rmcResponseBytes := rmcResponse.Bytes()
  105.  
  106.         responsePacket := nex.NewPacketV0(client, nil)
  107.  
  108.         responsePacket.SetVersion(0)
  109.         responsePacket.SetSource(0xA1)
  110.         responsePacket.SetDestination(0xAF)
  111.         responsePacket.SetType(nex.DataPacket)
  112.         responsePacket.SetPayload(rmcResponseBytes)
  113.  
  114.         responsePacket.AddFlag(nex.FlagNeedsAck)
  115.         responsePacket.AddFlag(nex.FlagReliable)
  116.  
  117.         nexServer.Send(responsePacket)
  118.     })
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top