From d07a25c848595a1b8a37bfdfd1220f338d289e1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20L=C3=B3pez=20Guimaraes?= Date: Sat, 18 Nov 2023 22:39:10 +0000 Subject: [PATCH 01/11] Convert to use new nex-go --- globals/globals.go | 4 +- globals/password_from_pid.go | 4 +- nex/authentication.go | 21 ++++++----- ..._common_authentication_server_protocols.go | 4 +- nex/register_secure_server_nex_protocols.go | 4 +- nex/secure.go | 22 ++++++----- nex/storage-manager/acquire_card_id.go | 27 ++++---------- nex/storage-manager/activate_with_card_id.go | 37 +++++++------------ 8 files changed, 53 insertions(+), 70 deletions(-) diff --git a/globals/globals.go b/globals/globals.go index 61546bd..fa606b0 100644 --- a/globals/globals.go +++ b/globals/globals.go @@ -10,8 +10,8 @@ import ( var Logger *plogger.Logger var KerberosPassword = "password" // * Default password -var AuthenticationServer *nex.Server -var SecureServer *nex.Server +var AuthenticationServer *nex.PRUDPServer +var SecureServer *nex.PRUDPServer var GRPCAccountClientConnection *grpc.ClientConn var GRPCAccountClient pb.AccountClient var GRPCAccountCommonMetadata metadata.MD diff --git a/globals/password_from_pid.go b/globals/password_from_pid.go index f59823c..513d7e3 100644 --- a/globals/password_from_pid.go +++ b/globals/password_from_pid.go @@ -9,10 +9,10 @@ import ( "google.golang.org/grpc/metadata" ) -func PasswordFromPID(pid uint32) (string, uint32) { +func PasswordFromPID(pid *nex.PID) (string, uint32) { ctx := metadata.NewOutgoingContext(context.Background(), GRPCAccountCommonMetadata) - response, err := GRPCAccountClient.GetNEXPassword(ctx, &pb.GetNEXPasswordRequest{Pid: pid}) + response, err := GRPCAccountClient.GetNEXPassword(ctx, &pb.GetNEXPasswordRequest{Pid: pid.LegacyValue()}) if err != nil { globals.Logger.Error(err.Error()) return "", nex.Errors.RendezVous.InvalidUsername diff --git a/nex/authentication.go b/nex/authentication.go index b0524f3..c2ac6ca 100644 --- a/nex/authentication.go +++ b/nex/authentication.go @@ -3,6 +3,7 @@ package nex import ( "fmt" "os" + "strconv" nex "github.com/PretendoNetwork/nex-go" "github.com/PretendoNetwork/mario-kart-7/globals" @@ -11,23 +12,25 @@ import ( var serverBuildString string func StartAuthenticationServer() { - globals.AuthenticationServer = nex.NewServer() - globals.AuthenticationServer.SetPRUDPVersion(0) - globals.AuthenticationServer.SetDefaultNEXVersion(nex.NewNEXVersion(2, 4, 3)) + globals.AuthenticationServer = nex.NewPRUDPServer() + globals.AuthenticationServer.PRUDPVersion = 0 + globals.AuthenticationServer.SetDefaultLibraryVersion(nex.NewLibraryVersion(2, 4, 3)) - globals.AuthenticationServer.SetKerberosPassword(globals.KerberosPassword) + globals.AuthenticationServer.SetKerberosPassword([]byte(globals.KerberosPassword)) globals.AuthenticationServer.SetAccessKey("6181dff1") - globals.AuthenticationServer.On("Data", func(packet *nex.PacketV0) { - request := packet.RMCRequest() + globals.AuthenticationServer.OnData(func(packet nex.PacketInterface) { + request := packet.RMCMessage() fmt.Println("=== MK7 - Auth ===") - fmt.Printf("Protocol ID: %#v\n", request.ProtocolID()) - fmt.Printf("Method ID: %#v\n", request.MethodID()) + fmt.Printf("Protocol ID: %#v\n", request.ProtocolID) + fmt.Printf("Method ID: %#v\n", request.MethodID) fmt.Println("==================") }) registerCommonAuthenticationServerProtocols() - globals.AuthenticationServer.Listen(fmt.Sprintf(":%s", os.Getenv("PN_MK7_AUTHENTICATION_SERVER_PORT"))) + port, _ := strconv.Atoi(os.Getenv("PN_MK7_AUTHENTICATION_SERVER_PORT")) + + globals.AuthenticationServer.Listen(port) } diff --git a/nex/register_common_authentication_server_protocols.go b/nex/register_common_authentication_server_protocols.go index 103f0bd..d056788 100644 --- a/nex/register_common_authentication_server_protocols.go +++ b/nex/register_common_authentication_server_protocols.go @@ -19,7 +19,7 @@ func registerCommonAuthenticationServerProtocols() { secureStationURL.SetAddress(os.Getenv("PN_MK7_SECURE_SERVER_HOST")) secureStationURL.SetPort(uint32(port)) secureStationURL.SetCID(1) - secureStationURL.SetPID(2) + secureStationURL.SetPID(nex.NewPID[uint32](2)) secureStationURL.SetSID(1) secureStationURL.SetStream(10) secureStationURL.SetType(2) @@ -27,5 +27,5 @@ func registerCommonAuthenticationServerProtocols() { ticketGrantingProtocol.SetSecureStationURL(secureStationURL) ticketGrantingProtocol.SetBuildName(serverBuildString) - globals.AuthenticationServer.SetPasswordFromPIDFunction(globals.PasswordFromPID) + globals.AuthenticationServer.PasswordFromPID = globals.PasswordFromPID } diff --git a/nex/register_secure_server_nex_protocols.go b/nex/register_secure_server_nex_protocols.go index 499f763..c4bb05f 100644 --- a/nex/register_secure_server_nex_protocols.go +++ b/nex/register_secure_server_nex_protocols.go @@ -17,6 +17,6 @@ func registerSecureServerNEXProtocols() { storageManagerProtocol := storage_manager.NewProtocol(globals.SecureServer) - storageManagerProtocol.AcquireCardID(nex_storage_manager.AcquireCardID) - storageManagerProtocol.ActivateWithCardID(nex_storage_manager.ActivateWithCardID) + storageManagerProtocol.AcquireCardID = nex_storage_manager.AcquireCardID + storageManagerProtocol.ActivateWithCardID = nex_storage_manager.ActivateWithCardID } diff --git a/nex/secure.go b/nex/secure.go index 8e84ade..5679cc6 100644 --- a/nex/secure.go +++ b/nex/secure.go @@ -3,30 +3,34 @@ package nex import ( "fmt" "os" + "strconv" "github.com/PretendoNetwork/mario-kart-7/globals" nex "github.com/PretendoNetwork/nex-go" ) func StartSecureServer() { - globals.SecureServer = nex.NewServer() - globals.SecureServer.SetPRUDPVersion(0) - globals.SecureServer.SetDefaultNEXVersion(nex.NewNEXVersion(2, 4, 3)) + globals.SecureServer = nex.NewPRUDPServer() + globals.SecureServer.IsSecureServer = true + globals.SecureServer.PRUDPVersion = 0 + globals.SecureServer.SetDefaultLibraryVersion(nex.NewLibraryVersion(2, 4, 3)) globals.SecureServer.SetAccessKey("6181dff1") - globals.SecureServer.SetKerberosPassword(globals.KerberosPassword) + globals.SecureServer.SetKerberosPassword([]byte(globals.KerberosPassword)) - globals.SecureServer.On("Data", func(packet *nex.PacketV0) { - request := packet.RMCRequest() + globals.SecureServer.OnData(func(packet nex.PacketInterface) { + request := packet.RMCMessage() fmt.Println("=== MK7 - Secure ===") - fmt.Printf("Protocol ID: %#v\n", request.ProtocolID()) - fmt.Printf("Method ID: %#v\n", request.MethodID()) + fmt.Printf("Protocol ID: %#v\n", request.ProtocolID) + fmt.Printf("Method ID: %#v\n", request.MethodID) fmt.Println("====================") }) registerCommonSecureServerProtocols() registerSecureServerNEXProtocols() - globals.SecureServer.Listen(fmt.Sprintf(":%s", os.Getenv("PN_MK7_SECURE_SERVER_PORT"))) + port, _ := strconv.Atoi(os.Getenv("PN_MK7_SECURE_SERVER_PORT")) + + globals.SecureServer.Listen(port) } diff --git a/nex/storage-manager/acquire_card_id.go b/nex/storage-manager/acquire_card_id.go index 87c11b7..d745e7a 100644 --- a/nex/storage-manager/acquire_card_id.go +++ b/nex/storage-manager/acquire_card_id.go @@ -8,10 +8,10 @@ import ( storage_manager "github.com/PretendoNetwork/nex-protocols-go/storage-manager" ) -func AcquireCardID(err error, client *nex.Client, callID uint32) uint32 { +func AcquireCardID(err error, packet nex.PacketInterface, callID uint32) (*nex.RMCMessage, uint32) { if err != nil { globals.Logger.Error(err.Error()) - return nex.Errors.Core.Unknown + return nil, nex.Errors.Core.Unknown } cardID := rand.Uint64() @@ -22,23 +22,10 @@ func AcquireCardID(err error, client *nex.Client, callID uint32) uint32 { rmcResponseBody := rmcResponseStream.Bytes() - rmcResponse := nex.NewRMCResponse(storage_manager.ProtocolID, callID) - rmcResponse.SetSuccess(storage_manager.MethodAcquireCardID, rmcResponseBody) + rmcResponse := nex.NewRMCSuccess(rmcResponseBody) + rmcResponse.ProtocolID = storage_manager.ProtocolID + rmcResponse.MethodID = storage_manager.MethodAcquireCardID + rmcResponse.CallID = callID - rmcResponseBytes := rmcResponse.Bytes() - - responsePacket, _ := nex.NewPacketV0(client, nil) - - responsePacket.SetVersion(0) - responsePacket.SetSource(0xA1) - responsePacket.SetDestination(0xAF) - responsePacket.SetType(nex.DataPacket) - responsePacket.SetPayload(rmcResponseBytes) - - responsePacket.AddFlag(nex.FlagNeedsAck) - responsePacket.AddFlag(nex.FlagReliable) - - globals.SecureServer.Send(responsePacket) - - return 0 + return rmcResponse, 0 } diff --git a/nex/storage-manager/activate_with_card_id.go b/nex/storage-manager/activate_with_card_id.go index 34da8a6..49c9369 100644 --- a/nex/storage-manager/activate_with_card_id.go +++ b/nex/storage-manager/activate_with_card_id.go @@ -9,12 +9,14 @@ import ( storage_manager "github.com/PretendoNetwork/nex-protocols-go/storage-manager" ) -func ActivateWithCardID(err error, client *nex.Client, callID uint32, unknown uint8, cardID uint64) uint32 { +func ActivateWithCardID(err error, packet nex.PacketInterface, callID uint32, unknown uint8, cardID uint64) (*nex.RMCMessage, uint32) { if err != nil { globals.Logger.Error(err.Error()) - return nex.Errors.Core.InvalidArgument + return nil, nex.Errors.Core.InvalidArgument } + client := packet.Sender() + // * It's not guaranteed that the client will call AcquireCardID, // * because that method is only called the first time the client // * goes online, and it may have used official servers previously. @@ -22,17 +24,17 @@ func ActivateWithCardID(err error, client *nex.Client, callID uint32, unknown ui // * To workaround this, we ignore the card ID stuff and get the // * unique ID using the PID var firstTime bool - uniqueID, err := database.GetUniqueIDByOwnerPID(client.PID()) + uniqueID, err := database.GetUniqueIDByOwnerPID(client.PID().LegacyValue()) if err != nil && err != sql.ErrNoRows { globals.Logger.Critical(err.Error()) - return nex.Errors.Core.Unknown + return nil, nex.Errors.Core.Unknown } if err == sql.ErrNoRows { - uniqueID, err = database.InsertCommonDataByOwnerPID(client.PID()) + uniqueID, err = database.InsertCommonDataByOwnerPID(client.PID().LegacyValue()) if err != nil { globals.Logger.Critical(err.Error()) - return nex.Errors.Core.Unknown + return nil, nex.Errors.Core.Unknown } firstTime = true @@ -45,23 +47,10 @@ func ActivateWithCardID(err error, client *nex.Client, callID uint32, unknown ui rmcResponseBody := rmcResponseStream.Bytes() - rmcResponse := nex.NewRMCResponse(storage_manager.ProtocolID, callID) - rmcResponse.SetSuccess(storage_manager.MethodActivateWithCardID, rmcResponseBody) - - rmcResponseBytes := rmcResponse.Bytes() - - responsePacket, _ := nex.NewPacketV0(client, nil) - - responsePacket.SetVersion(0) - responsePacket.SetSource(0xA1) - responsePacket.SetDestination(0xAF) - responsePacket.SetType(nex.DataPacket) - responsePacket.SetPayload(rmcResponseBytes) - - responsePacket.AddFlag(nex.FlagNeedsAck) - responsePacket.AddFlag(nex.FlagReliable) - - globals.SecureServer.Send(responsePacket) + rmcResponse := nex.NewRMCSuccess(rmcResponseBody) + rmcResponse.ProtocolID = storage_manager.ProtocolID + rmcResponse.MethodID = storage_manager.MethodActivateWithCardID + rmcResponse.CallID = callID - return 0 + return rmcResponse, 0 } From 60658ca8943d35c7818a9636f80bbe17184b5e07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20L=C3=B3pez=20Guimaraes?= Date: Thu, 7 Dec 2023 14:36:47 +0000 Subject: [PATCH 02/11] Update with latest changes --- ..._common_authentication_server_protocols.go | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/nex/register_common_authentication_server_protocols.go b/nex/register_common_authentication_server_protocols.go index d056788..de4e606 100644 --- a/nex/register_common_authentication_server_protocols.go +++ b/nex/register_common_authentication_server_protocols.go @@ -2,7 +2,6 @@ package nex import ( "os" - "strconv" nex "github.com/PretendoNetwork/nex-go" ticket_granting "github.com/PretendoNetwork/nex-protocols-common-go/ticket-granting" @@ -12,17 +11,15 @@ import ( func registerCommonAuthenticationServerProtocols() { ticketGrantingProtocol := ticket_granting.NewCommonTicketGrantingProtocol(globals.AuthenticationServer) - port, _ := strconv.Atoi(os.Getenv("PN_MK7_SECURE_SERVER_PORT")) - secureStationURL := nex.NewStationURL("") - secureStationURL.SetScheme("prudps") - secureStationURL.SetAddress(os.Getenv("PN_MK7_SECURE_SERVER_HOST")) - secureStationURL.SetPort(uint32(port)) - secureStationURL.SetCID(1) - secureStationURL.SetPID(nex.NewPID[uint32](2)) - secureStationURL.SetSID(1) - secureStationURL.SetStream(10) - secureStationURL.SetType(2) + secureStationURL.Scheme = "prudps" + secureStationURL.Fields.Set("address", os.Getenv("PN_MK7_SECURE_SERVER_HOST")) + secureStationURL.Fields.Set("port", os.Getenv("PN_MK7_SECURE_SERVER_PORT")) + secureStationURL.Fields.Set("CID", "1") + secureStationURL.Fields.Set("PID", "2") + secureStationURL.Fields.Set("sid", "1") + secureStationURL.Fields.Set("stream", "10") + secureStationURL.Fields.Set("type", "2") ticketGrantingProtocol.SetSecureStationURL(secureStationURL) ticketGrantingProtocol.SetBuildName(serverBuildString) From f266f85cead1956d0e0296f06011d14330d1369f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20L=C3=B3pez=20Guimaraes?= Date: Thu, 14 Dec 2023 23:25:53 +0000 Subject: [PATCH 03/11] Update with latest changes --- .../cleanup_search_matchmake_session.go | 3 ++ ..._common_authentication_server_protocols.go | 12 ++++--- ...register_common_secure_server_protocols.go | 32 ++++++++++++------- nex/secure.go | 2 +- 4 files changed, 32 insertions(+), 17 deletions(-) diff --git a/nex/matchmake-extension/common/cleanup_search_matchmake_session.go b/nex/matchmake-extension/common/cleanup_search_matchmake_session.go index 76d6ce1..8bba788 100644 --- a/nex/matchmake-extension/common/cleanup_search_matchmake_session.go +++ b/nex/matchmake-extension/common/cleanup_search_matchmake_session.go @@ -7,4 +7,7 @@ import ( func CleanupSearchMatchmakeSession(matchmakeSession *matchmaking_types.MatchmakeSession) { // Cleanup VR matchmakeSession.Attributes[1] = 0 + + // Cleanup participation count + matchmakeSession.ParticipationCount = 0 } diff --git a/nex/register_common_authentication_server_protocols.go b/nex/register_common_authentication_server_protocols.go index de4e606..6865e33 100644 --- a/nex/register_common_authentication_server_protocols.go +++ b/nex/register_common_authentication_server_protocols.go @@ -4,12 +4,14 @@ import ( "os" nex "github.com/PretendoNetwork/nex-go" - ticket_granting "github.com/PretendoNetwork/nex-protocols-common-go/ticket-granting" + ticket_granting "github.com/PretendoNetwork/nex-protocols-go/ticket-granting" + common_ticket_granting "github.com/PretendoNetwork/nex-protocols-common-go/ticket-granting" "github.com/PretendoNetwork/mario-kart-7/globals" ) func registerCommonAuthenticationServerProtocols() { - ticketGrantingProtocol := ticket_granting.NewCommonTicketGrantingProtocol(globals.AuthenticationServer) + ticketGrantingProtocol := ticket_granting.NewProtocol(globals.AuthenticationServer) + commonTicketGrantingProtocol := common_ticket_granting.NewCommonProtocol(ticketGrantingProtocol) secureStationURL := nex.NewStationURL("") secureStationURL.Scheme = "prudps" @@ -21,8 +23,8 @@ func registerCommonAuthenticationServerProtocols() { secureStationURL.Fields.Set("stream", "10") secureStationURL.Fields.Set("type", "2") - ticketGrantingProtocol.SetSecureStationURL(secureStationURL) - ticketGrantingProtocol.SetBuildName(serverBuildString) + commonTicketGrantingProtocol.SecureStationURL = secureStationURL + commonTicketGrantingProtocol.BuildName = serverBuildString - globals.AuthenticationServer.PasswordFromPID = globals.PasswordFromPID + globals.AuthenticationServer.SetPasswordFromPIDFunction(globals.PasswordFromPID) } diff --git a/nex/register_common_secure_server_protocols.go b/nex/register_common_secure_server_protocols.go index bfc761f..eb4496c 100644 --- a/nex/register_common_secure_server_protocols.go +++ b/nex/register_common_secure_server_protocols.go @@ -2,25 +2,35 @@ package nex import ( "github.com/PretendoNetwork/mario-kart-7/globals" - matchmake_extension "github.com/PretendoNetwork/nex-protocols-common-go/matchmake-extension" - matchmaking "github.com/PretendoNetwork/nex-protocols-common-go/matchmaking" - match_making_ext "github.com/PretendoNetwork/nex-protocols-common-go/matchmaking-ext" - nattraversal "github.com/PretendoNetwork/nex-protocols-common-go/nat-traversal" - secure "github.com/PretendoNetwork/nex-protocols-common-go/secure-connection" + matchmake_extension "github.com/PretendoNetwork/nex-protocols-go/matchmake-extension" + common_matchmake_extension "github.com/PretendoNetwork/nex-protocols-common-go/matchmake-extension" + match_making "github.com/PretendoNetwork/nex-protocols-go/match-making" + common_match_making "github.com/PretendoNetwork/nex-protocols-common-go/match-making" + match_making_ext "github.com/PretendoNetwork/nex-protocols-go/match-making-ext" + common_match_making_ext "github.com/PretendoNetwork/nex-protocols-common-go/match-making-ext" + nat_traversal "github.com/PretendoNetwork/nex-protocols-go/nat-traversal" + common_nat_traversal "github.com/PretendoNetwork/nex-protocols-common-go/nat-traversal" + secure "github.com/PretendoNetwork/nex-protocols-go/secure-connection" + common_secure "github.com/PretendoNetwork/nex-protocols-common-go/secure-connection" nex_matchmake_extension_common "github.com/PretendoNetwork/mario-kart-7/nex/matchmake-extension/common" ) func registerCommonSecureServerProtocols() { - secure.NewCommonSecureConnectionProtocol(globals.SecureServer) + secureProtocol := secure.NewProtocol(globals.SecureServer) + common_secure.NewCommonProtocol(secureProtocol) - nattraversal.NewCommonNATTraversalProtocol(globals.SecureServer) + natTraversalProtocol := nat_traversal.NewProtocol(globals.SecureServer) + common_nat_traversal.NewCommonProtocol(natTraversalProtocol) - matchmaking.NewCommonMatchMakingProtocol(globals.SecureServer) + matchMakingProtocol := match_making.NewProtocol(globals.SecureServer) + common_match_making.NewCommonProtocol(matchMakingProtocol) - match_making_ext.NewCommonMatchMakingExtProtocol(globals.SecureServer) + matchMakingExtProtocol := match_making_ext.NewProtocol(globals.SecureServer) + common_match_making_ext.NewCommonProtocol(matchMakingExtProtocol) - matchmakeExtensionProtocol := matchmake_extension.NewCommonMatchmakeExtensionProtocol(globals.SecureServer) + matchmakeExtensionProtocol := matchmake_extension.NewProtocol(globals.SecureServer) + commonMatchmakeExtensionProtocol := common_matchmake_extension.NewCommonProtocol(matchmakeExtensionProtocol) - matchmakeExtensionProtocol.CleanupSearchMatchmakeSession(nex_matchmake_extension_common.CleanupSearchMatchmakeSession) + commonMatchmakeExtensionProtocol.CleanupSearchMatchmakeSession = nex_matchmake_extension_common.CleanupSearchMatchmakeSession } diff --git a/nex/secure.go b/nex/secure.go index 5679cc6..d4fd9bf 100644 --- a/nex/secure.go +++ b/nex/secure.go @@ -11,7 +11,7 @@ import ( func StartSecureServer() { globals.SecureServer = nex.NewPRUDPServer() - globals.SecureServer.IsSecureServer = true + globals.SecureServer.SecureVirtualServerPorts = []uint8{1} globals.SecureServer.PRUDPVersion = 0 globals.SecureServer.SetDefaultLibraryVersion(nex.NewLibraryVersion(2, 4, 3)) From bd50689f232f920cb7662f83e3f30ed17ac93dfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20L=C3=B3pez=20Guimaraes?= Date: Sat, 16 Dec 2023 16:10:17 +0000 Subject: [PATCH 04/11] Update RMC method creation --- nex/storage-manager/acquire_card_id.go | 2 +- nex/storage-manager/activate_with_card_id.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nex/storage-manager/acquire_card_id.go b/nex/storage-manager/acquire_card_id.go index d745e7a..5bd87e1 100644 --- a/nex/storage-manager/acquire_card_id.go +++ b/nex/storage-manager/acquire_card_id.go @@ -22,7 +22,7 @@ func AcquireCardID(err error, packet nex.PacketInterface, callID uint32) (*nex.R rmcResponseBody := rmcResponseStream.Bytes() - rmcResponse := nex.NewRMCSuccess(rmcResponseBody) + rmcResponse := nex.NewRMCSuccess(globals.SecureServer, rmcResponseBody) rmcResponse.ProtocolID = storage_manager.ProtocolID rmcResponse.MethodID = storage_manager.MethodAcquireCardID rmcResponse.CallID = callID diff --git a/nex/storage-manager/activate_with_card_id.go b/nex/storage-manager/activate_with_card_id.go index 49c9369..f9b5716 100644 --- a/nex/storage-manager/activate_with_card_id.go +++ b/nex/storage-manager/activate_with_card_id.go @@ -47,7 +47,7 @@ func ActivateWithCardID(err error, packet nex.PacketInterface, callID uint32, un rmcResponseBody := rmcResponseStream.Bytes() - rmcResponse := nex.NewRMCSuccess(rmcResponseBody) + rmcResponse := nex.NewRMCSuccess(globals.SecureServer, rmcResponseBody) rmcResponse.ProtocolID = storage_manager.ProtocolID rmcResponse.MethodID = storage_manager.MethodActivateWithCardID rmcResponse.CallID = callID From 836b23d3d82c3519ba35f4be99c0c835fc105102 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20L=C3=B3pez=20Guimaraes?= Date: Thu, 25 Jan 2024 17:40:35 +0000 Subject: [PATCH 05/11] Update with latest changes --- globals/accounts.go | 56 +++++++++++++++++++ globals/globals.go | 2 + globals/password_from_pid.go | 5 +- init.go | 10 +++- nex/authentication.go | 14 +++-- .../cleanup_search_matchmake_session.go | 5 +- ..._common_authentication_server_protocols.go | 24 ++++---- ...register_common_secure_server_protocols.go | 5 ++ nex/register_secure_server_nex_protocols.go | 7 ++- nex/secure.go | 15 +++-- nex/storage-manager/acquire_card_id.go | 11 ++-- nex/storage-manager/activate_with_card_id.go | 25 +++++---- 12 files changed, 132 insertions(+), 47 deletions(-) create mode 100644 globals/accounts.go diff --git a/globals/accounts.go b/globals/accounts.go new file mode 100644 index 0000000..5160601 --- /dev/null +++ b/globals/accounts.go @@ -0,0 +1,56 @@ +package globals + +import ( + "strconv" + + "github.com/PretendoNetwork/nex-go" + "github.com/PretendoNetwork/nex-go/types" +) + +var AuthenticationServerAccount *nex.Account +var SecureServerAccount *nex.Account + +func AccountDetailsByPID(pid *types.PID) (*nex.Account, *nex.Error) { + if pid.Equals(AuthenticationServerAccount.PID) { + return AuthenticationServerAccount, nil + } + + if pid.Equals(SecureServerAccount.PID) { + return SecureServerAccount, nil + } + + password, errorCode := PasswordFromPID(pid) + if errorCode != 0 { + return nil, nex.NewError(errorCode, "Failed to get password from PID") + } + + account := nex.NewAccount(pid, strconv.Itoa(int(pid.LegacyValue())), password) + + return account, nil +} + +func AccountDetailsByUsername(username string) (*nex.Account, *nex.Error) { + if username == AuthenticationServerAccount.Username { + return AuthenticationServerAccount, nil + } + + if username == SecureServerAccount.Username { + return SecureServerAccount, nil + } + + pidInt, err := strconv.Atoi(username) + if err != nil { + return nil, nex.NewError(nex.ResultCodes.RendezVous.InvalidUsername, "Invalid username") + } + + pid := types.NewPID(uint64(pidInt)) + + password, errorCode := PasswordFromPID(pid) + if errorCode != 0 { + return nil, nex.NewError(errorCode, "Failed to get password from PID") + } + + account := nex.NewAccount(pid, username, password) + + return account, nil +} diff --git a/globals/globals.go b/globals/globals.go index fa606b0..3905c77 100644 --- a/globals/globals.go +++ b/globals/globals.go @@ -11,7 +11,9 @@ import ( var Logger *plogger.Logger var KerberosPassword = "password" // * Default password var AuthenticationServer *nex.PRUDPServer +var AuthenticationEndpoint *nex.PRUDPEndPoint var SecureServer *nex.PRUDPServer +var SecureEndpoint *nex.PRUDPEndPoint var GRPCAccountClientConnection *grpc.ClientConn var GRPCAccountClient pb.AccountClient var GRPCAccountCommonMetadata metadata.MD diff --git a/globals/password_from_pid.go b/globals/password_from_pid.go index 513d7e3..ec8e4fb 100644 --- a/globals/password_from_pid.go +++ b/globals/password_from_pid.go @@ -5,17 +5,18 @@ import ( pb "github.com/PretendoNetwork/grpc-go/account" "github.com/PretendoNetwork/nex-go" + "github.com/PretendoNetwork/nex-go/types" "github.com/PretendoNetwork/nex-protocols-go/globals" "google.golang.org/grpc/metadata" ) -func PasswordFromPID(pid *nex.PID) (string, uint32) { +func PasswordFromPID(pid *types.PID) (string, uint32) { ctx := metadata.NewOutgoingContext(context.Background(), GRPCAccountCommonMetadata) response, err := GRPCAccountClient.GetNEXPassword(ctx, &pb.GetNEXPasswordRequest{Pid: pid.LegacyValue()}) if err != nil { globals.Logger.Error(err.Error()) - return "", nex.Errors.RendezVous.InvalidUsername + return "", nex.ResultCodes.RendezVous.InvalidUsername } return response.Password, 0 diff --git a/init.go b/init.go index 0812e34..bf5a587 100644 --- a/init.go +++ b/init.go @@ -6,14 +6,17 @@ import ( "strconv" "strings" + "github.com/PretendoNetwork/nex-go" + "github.com/PretendoNetwork/nex-go/types" pb "github.com/PretendoNetwork/grpc-go/account" - "github.com/PretendoNetwork/mario-kart-7/globals" - "github.com/PretendoNetwork/mario-kart-7/database" "github.com/PretendoNetwork/plogger-go" "github.com/joho/godotenv" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" "google.golang.org/grpc/metadata" + + "github.com/PretendoNetwork/mario-kart-7/database" + "github.com/PretendoNetwork/mario-kart-7/globals" ) func init() { @@ -46,6 +49,9 @@ func init() { globals.KerberosPassword = kerberosPassword } + globals.AuthenticationServerAccount = nex.NewAccount(types.NewPID(1), "Quazal Authentication", globals.KerberosPassword) + globals.SecureServerAccount = nex.NewAccount(types.NewPID(2), "Quazal Rendez-Vous", globals.KerberosPassword) + if strings.TrimSpace(authenticationServerPort) == "" { globals.Logger.Error("PN_MK7_AUTHENTICATION_SERVER_PORT environment variable not set") os.Exit(0) diff --git a/nex/authentication.go b/nex/authentication.go index c2ac6ca..ad25c91 100644 --- a/nex/authentication.go +++ b/nex/authentication.go @@ -5,7 +5,7 @@ import ( "os" "strconv" - nex "github.com/PretendoNetwork/nex-go" + "github.com/PretendoNetwork/nex-go" "github.com/PretendoNetwork/mario-kart-7/globals" ) @@ -13,13 +13,17 @@ var serverBuildString string func StartAuthenticationServer() { globals.AuthenticationServer = nex.NewPRUDPServer() - globals.AuthenticationServer.PRUDPVersion = 0 - globals.AuthenticationServer.SetDefaultLibraryVersion(nex.NewLibraryVersion(2, 4, 3)) - globals.AuthenticationServer.SetKerberosPassword([]byte(globals.KerberosPassword)) + globals.AuthenticationEndpoint = nex.NewPRUDPEndPoint(1) + globals.AuthenticationEndpoint.ServerAccount = globals.AuthenticationServerAccount + globals.AuthenticationEndpoint.AccountDetailsByPID = globals.AccountDetailsByPID + globals.AuthenticationEndpoint.AccountDetailsByUsername = globals.AccountDetailsByUsername + globals.AuthenticationServer.BindPRUDPEndPoint(globals.AuthenticationEndpoint) + + globals.AuthenticationServer.SetDefaultLibraryVersion(nex.NewLibraryVersion(2, 4, 3)) globals.AuthenticationServer.SetAccessKey("6181dff1") - globals.AuthenticationServer.OnData(func(packet nex.PacketInterface) { + globals.AuthenticationEndpoint.OnData(func(packet nex.PacketInterface) { request := packet.RMCMessage() fmt.Println("=== MK7 - Auth ===") diff --git a/nex/matchmake-extension/common/cleanup_search_matchmake_session.go b/nex/matchmake-extension/common/cleanup_search_matchmake_session.go index 8bba788..8ac35c0 100644 --- a/nex/matchmake-extension/common/cleanup_search_matchmake_session.go +++ b/nex/matchmake-extension/common/cleanup_search_matchmake_session.go @@ -1,13 +1,14 @@ package nex_matchmake_extension_common import ( + "github.com/PretendoNetwork/nex-go/types" matchmaking_types "github.com/PretendoNetwork/nex-protocols-go/match-making/types" ) func CleanupSearchMatchmakeSession(matchmakeSession *matchmaking_types.MatchmakeSession) { // Cleanup VR - matchmakeSession.Attributes[1] = 0 + matchmakeSession.Attributes.SetIndex(1, types.NewPrimitiveU32(0)) // Cleanup participation count - matchmakeSession.ParticipationCount = 0 + matchmakeSession.ParticipationCount.Value = 0 } diff --git a/nex/register_common_authentication_server_protocols.go b/nex/register_common_authentication_server_protocols.go index 6865e33..63db27c 100644 --- a/nex/register_common_authentication_server_protocols.go +++ b/nex/register_common_authentication_server_protocols.go @@ -3,7 +3,7 @@ package nex import ( "os" - nex "github.com/PretendoNetwork/nex-go" + "github.com/PretendoNetwork/nex-go/types" ticket_granting "github.com/PretendoNetwork/nex-protocols-go/ticket-granting" common_ticket_granting "github.com/PretendoNetwork/nex-protocols-common-go/ticket-granting" "github.com/PretendoNetwork/mario-kart-7/globals" @@ -11,20 +11,20 @@ import ( func registerCommonAuthenticationServerProtocols() { ticketGrantingProtocol := ticket_granting.NewProtocol(globals.AuthenticationServer) + globals.AuthenticationEndpoint.RegisterServiceProtocol(ticketGrantingProtocol) commonTicketGrantingProtocol := common_ticket_granting.NewCommonProtocol(ticketGrantingProtocol) - secureStationURL := nex.NewStationURL("") + secureStationURL := types.NewStationURL("") secureStationURL.Scheme = "prudps" - secureStationURL.Fields.Set("address", os.Getenv("PN_MK7_SECURE_SERVER_HOST")) - secureStationURL.Fields.Set("port", os.Getenv("PN_MK7_SECURE_SERVER_PORT")) - secureStationURL.Fields.Set("CID", "1") - secureStationURL.Fields.Set("PID", "2") - secureStationURL.Fields.Set("sid", "1") - secureStationURL.Fields.Set("stream", "10") - secureStationURL.Fields.Set("type", "2") + secureStationURL.Fields["address"] = os.Getenv("PN_MK7_SECURE_SERVER_HOST") + secureStationURL.Fields["port"] = os.Getenv("PN_MK7_SECURE_SERVER_PORT") + secureStationURL.Fields["CID"] = "1" + secureStationURL.Fields["PID"] = "2" + secureStationURL.Fields["sid"] = "1" + secureStationURL.Fields["stream"] = "10" + secureStationURL.Fields["type"] = "2" commonTicketGrantingProtocol.SecureStationURL = secureStationURL - commonTicketGrantingProtocol.BuildName = serverBuildString - - globals.AuthenticationServer.SetPasswordFromPIDFunction(globals.PasswordFromPID) + commonTicketGrantingProtocol.BuildName = types.NewString(serverBuildString) + commonTicketGrantingProtocol.SecureServerAccount = globals.SecureServerAccount } diff --git a/nex/register_common_secure_server_protocols.go b/nex/register_common_secure_server_protocols.go index eb4496c..951753f 100644 --- a/nex/register_common_secure_server_protocols.go +++ b/nex/register_common_secure_server_protocols.go @@ -18,18 +18,23 @@ import ( func registerCommonSecureServerProtocols() { secureProtocol := secure.NewProtocol(globals.SecureServer) + globals.SecureEndpoint.RegisterServiceProtocol(secureProtocol) common_secure.NewCommonProtocol(secureProtocol) natTraversalProtocol := nat_traversal.NewProtocol(globals.SecureServer) + globals.SecureEndpoint.RegisterServiceProtocol(natTraversalProtocol) common_nat_traversal.NewCommonProtocol(natTraversalProtocol) matchMakingProtocol := match_making.NewProtocol(globals.SecureServer) + globals.SecureEndpoint.RegisterServiceProtocol(matchMakingProtocol) common_match_making.NewCommonProtocol(matchMakingProtocol) matchMakingExtProtocol := match_making_ext.NewProtocol(globals.SecureServer) + globals.SecureEndpoint.RegisterServiceProtocol(matchMakingExtProtocol) common_match_making_ext.NewCommonProtocol(matchMakingExtProtocol) matchmakeExtensionProtocol := matchmake_extension.NewProtocol(globals.SecureServer) + globals.SecureEndpoint.RegisterServiceProtocol(matchmakeExtensionProtocol) commonMatchmakeExtensionProtocol := common_matchmake_extension.NewCommonProtocol(matchmakeExtensionProtocol) commonMatchmakeExtensionProtocol.CleanupSearchMatchmakeSession = nex_matchmake_extension_common.CleanupSearchMatchmakeSession diff --git a/nex/register_secure_server_nex_protocols.go b/nex/register_secure_server_nex_protocols.go index c4bb05f..7f7f81d 100644 --- a/nex/register_secure_server_nex_protocols.go +++ b/nex/register_secure_server_nex_protocols.go @@ -10,12 +10,15 @@ import ( ) func registerSecureServerNEXProtocols() { - _ = datastore.NewProtocol(globals.SecureServer) + datastoreProtocol := datastore.NewProtocol(globals.SecureServer) + globals.SecureEndpoint.RegisterServiceProtocol(datastoreProtocol) // TODO - Add legacy ranking protocol! - _ = ranking.NewProtocol(globals.SecureServer) + rankingProtocol := ranking.NewProtocol(globals.SecureServer) + globals.SecureEndpoint.RegisterServiceProtocol(rankingProtocol) storageManagerProtocol := storage_manager.NewProtocol(globals.SecureServer) + globals.SecureEndpoint.RegisterServiceProtocol(storageManagerProtocol) storageManagerProtocol.AcquireCardID = nex_storage_manager.AcquireCardID storageManagerProtocol.ActivateWithCardID = nex_storage_manager.ActivateWithCardID diff --git a/nex/secure.go b/nex/secure.go index d4fd9bf..34fcdda 100644 --- a/nex/secure.go +++ b/nex/secure.go @@ -5,20 +5,23 @@ import ( "os" "strconv" - "github.com/PretendoNetwork/mario-kart-7/globals" nex "github.com/PretendoNetwork/nex-go" + "github.com/PretendoNetwork/mario-kart-7/globals" ) func StartSecureServer() { globals.SecureServer = nex.NewPRUDPServer() - globals.SecureServer.SecureVirtualServerPorts = []uint8{1} - globals.SecureServer.PRUDPVersion = 0 - globals.SecureServer.SetDefaultLibraryVersion(nex.NewLibraryVersion(2, 4, 3)) + globals.SecureEndpoint = nex.NewPRUDPEndPoint(1) + globals.SecureEndpoint.ServerAccount = globals.SecureServerAccount + globals.SecureEndpoint.AccountDetailsByPID = globals.AccountDetailsByPID + globals.SecureEndpoint.AccountDetailsByUsername = globals.AccountDetailsByUsername + globals.SecureServer.BindPRUDPEndPoint(globals.SecureEndpoint) + + globals.SecureServer.SetDefaultLibraryVersion(nex.NewLibraryVersion(2, 4, 3)) globals.SecureServer.SetAccessKey("6181dff1") - globals.SecureServer.SetKerberosPassword([]byte(globals.KerberosPassword)) - globals.SecureServer.OnData(func(packet nex.PacketInterface) { + globals.SecureEndpoint.OnData(func(packet nex.PacketInterface) { request := packet.RMCMessage() fmt.Println("=== MK7 - Secure ===") diff --git a/nex/storage-manager/acquire_card_id.go b/nex/storage-manager/acquire_card_id.go index 5bd87e1..6af6e4f 100644 --- a/nex/storage-manager/acquire_card_id.go +++ b/nex/storage-manager/acquire_card_id.go @@ -4,21 +4,22 @@ import ( "math/rand" "github.com/PretendoNetwork/mario-kart-7/globals" - nex "github.com/PretendoNetwork/nex-go" + "github.com/PretendoNetwork/nex-go" + "github.com/PretendoNetwork/nex-go/types" storage_manager "github.com/PretendoNetwork/nex-protocols-go/storage-manager" ) func AcquireCardID(err error, packet nex.PacketInterface, callID uint32) (*nex.RMCMessage, uint32) { if err != nil { globals.Logger.Error(err.Error()) - return nil, nex.Errors.Core.Unknown + return nil, nex.ResultCodes.Core.Unknown } - cardID := rand.Uint64() + cardID := types.NewPrimitiveU64(rand.Uint64()) - rmcResponseStream := nex.NewStreamOut(globals.SecureServer) + rmcResponseStream := nex.NewByteStreamOut(globals.SecureServer) - rmcResponseStream.WriteUInt64LE(cardID) + cardID.WriteTo(rmcResponseStream) rmcResponseBody := rmcResponseStream.Bytes() diff --git a/nex/storage-manager/activate_with_card_id.go b/nex/storage-manager/activate_with_card_id.go index f9b5716..ddd18dc 100644 --- a/nex/storage-manager/activate_with_card_id.go +++ b/nex/storage-manager/activate_with_card_id.go @@ -6,44 +6,47 @@ import ( "github.com/PretendoNetwork/mario-kart-7/database" "github.com/PretendoNetwork/mario-kart-7/globals" nex "github.com/PretendoNetwork/nex-go" + "github.com/PretendoNetwork/nex-go/types" storage_manager "github.com/PretendoNetwork/nex-protocols-go/storage-manager" ) -func ActivateWithCardID(err error, packet nex.PacketInterface, callID uint32, unknown uint8, cardID uint64) (*nex.RMCMessage, uint32) { +func ActivateWithCardID(err error, packet nex.PacketInterface, callID uint32, unknown *types.PrimitiveU8, cardID *types.PrimitiveU64) (*nex.RMCMessage, uint32) { if err != nil { globals.Logger.Error(err.Error()) - return nil, nex.Errors.Core.InvalidArgument + return nil, nex.ResultCodes.Core.InvalidArgument } client := packet.Sender() + uniqueID := types.NewPrimitiveU32(0) + firstTime := types.NewPrimitiveBool(false) + // * It's not guaranteed that the client will call AcquireCardID, // * because that method is only called the first time the client // * goes online, and it may have used official servers previously. // * // * To workaround this, we ignore the card ID stuff and get the // * unique ID using the PID - var firstTime bool - uniqueID, err := database.GetUniqueIDByOwnerPID(client.PID().LegacyValue()) + uniqueID.Value, err = database.GetUniqueIDByOwnerPID(client.PID().LegacyValue()) if err != nil && err != sql.ErrNoRows { globals.Logger.Critical(err.Error()) - return nil, nex.Errors.Core.Unknown + return nil, nex.ResultCodes.Core.Unknown } if err == sql.ErrNoRows { - uniqueID, err = database.InsertCommonDataByOwnerPID(client.PID().LegacyValue()) + uniqueID.Value, err = database.InsertCommonDataByOwnerPID(client.PID().LegacyValue()) if err != nil { globals.Logger.Critical(err.Error()) - return nil, nex.Errors.Core.Unknown + return nil, nex.ResultCodes.Core.Unknown } - firstTime = true + firstTime.Value = true } - rmcResponseStream := nex.NewStreamOut(globals.SecureServer) + rmcResponseStream := nex.NewByteStreamOut(globals.SecureServer) - rmcResponseStream.WriteUInt32LE(uniqueID) - rmcResponseStream.WriteBool(firstTime) + uniqueID.WriteTo(rmcResponseStream) + firstTime.WriteTo(rmcResponseStream) rmcResponseBody := rmcResponseStream.Bytes() From 281129aabb7488b6784c2726a0a22d83b0edc9a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20L=C3=B3pez=20Guimaraes?= Date: Sun, 11 Feb 2024 00:07:27 +0000 Subject: [PATCH 06/11] refactor: Update ServerInterface to EndpointInterface Also update the method handlers to use the new nex.Error return --- nex/authentication.go | 4 ++-- ...ister_common_authentication_server_protocols.go | 2 +- nex/register_common_secure_server_protocols.go | 10 +++++----- nex/register_secure_server_nex_protocols.go | 6 +++--- nex/secure.go | 4 ++-- nex/storage-manager/acquire_card_id.go | 10 +++++----- nex/storage-manager/activate_with_card_id.go | 14 +++++++------- 7 files changed, 25 insertions(+), 25 deletions(-) diff --git a/nex/authentication.go b/nex/authentication.go index ad25c91..fe8408d 100644 --- a/nex/authentication.go +++ b/nex/authentication.go @@ -20,8 +20,8 @@ func StartAuthenticationServer() { globals.AuthenticationEndpoint.AccountDetailsByUsername = globals.AccountDetailsByUsername globals.AuthenticationServer.BindPRUDPEndPoint(globals.AuthenticationEndpoint) - globals.AuthenticationServer.SetDefaultLibraryVersion(nex.NewLibraryVersion(2, 4, 3)) - globals.AuthenticationServer.SetAccessKey("6181dff1") + globals.AuthenticationServer.LibraryVersions.SetDefault(nex.NewLibraryVersion(2, 4, 3)) + globals.AuthenticationServer.AccessKey = "6181dff1" globals.AuthenticationEndpoint.OnData(func(packet nex.PacketInterface) { request := packet.RMCMessage() diff --git a/nex/register_common_authentication_server_protocols.go b/nex/register_common_authentication_server_protocols.go index 63db27c..3aeb263 100644 --- a/nex/register_common_authentication_server_protocols.go +++ b/nex/register_common_authentication_server_protocols.go @@ -10,7 +10,7 @@ import ( ) func registerCommonAuthenticationServerProtocols() { - ticketGrantingProtocol := ticket_granting.NewProtocol(globals.AuthenticationServer) + ticketGrantingProtocol := ticket_granting.NewProtocol(globals.AuthenticationEndpoint) globals.AuthenticationEndpoint.RegisterServiceProtocol(ticketGrantingProtocol) commonTicketGrantingProtocol := common_ticket_granting.NewCommonProtocol(ticketGrantingProtocol) diff --git a/nex/register_common_secure_server_protocols.go b/nex/register_common_secure_server_protocols.go index 951753f..ce479cb 100644 --- a/nex/register_common_secure_server_protocols.go +++ b/nex/register_common_secure_server_protocols.go @@ -17,23 +17,23 @@ import ( ) func registerCommonSecureServerProtocols() { - secureProtocol := secure.NewProtocol(globals.SecureServer) + secureProtocol := secure.NewProtocol(globals.SecureEndpoint) globals.SecureEndpoint.RegisterServiceProtocol(secureProtocol) common_secure.NewCommonProtocol(secureProtocol) - natTraversalProtocol := nat_traversal.NewProtocol(globals.SecureServer) + natTraversalProtocol := nat_traversal.NewProtocol(globals.SecureEndpoint) globals.SecureEndpoint.RegisterServiceProtocol(natTraversalProtocol) common_nat_traversal.NewCommonProtocol(natTraversalProtocol) - matchMakingProtocol := match_making.NewProtocol(globals.SecureServer) + matchMakingProtocol := match_making.NewProtocol(globals.SecureEndpoint) globals.SecureEndpoint.RegisterServiceProtocol(matchMakingProtocol) common_match_making.NewCommonProtocol(matchMakingProtocol) - matchMakingExtProtocol := match_making_ext.NewProtocol(globals.SecureServer) + matchMakingExtProtocol := match_making_ext.NewProtocol(globals.SecureEndpoint) globals.SecureEndpoint.RegisterServiceProtocol(matchMakingExtProtocol) common_match_making_ext.NewCommonProtocol(matchMakingExtProtocol) - matchmakeExtensionProtocol := matchmake_extension.NewProtocol(globals.SecureServer) + matchmakeExtensionProtocol := matchmake_extension.NewProtocol(globals.SecureEndpoint) globals.SecureEndpoint.RegisterServiceProtocol(matchmakeExtensionProtocol) commonMatchmakeExtensionProtocol := common_matchmake_extension.NewCommonProtocol(matchmakeExtensionProtocol) diff --git a/nex/register_secure_server_nex_protocols.go b/nex/register_secure_server_nex_protocols.go index 7f7f81d..8a629b1 100644 --- a/nex/register_secure_server_nex_protocols.go +++ b/nex/register_secure_server_nex_protocols.go @@ -10,14 +10,14 @@ import ( ) func registerSecureServerNEXProtocols() { - datastoreProtocol := datastore.NewProtocol(globals.SecureServer) + datastoreProtocol := datastore.NewProtocol(globals.SecureEndpoint) globals.SecureEndpoint.RegisterServiceProtocol(datastoreProtocol) // TODO - Add legacy ranking protocol! - rankingProtocol := ranking.NewProtocol(globals.SecureServer) + rankingProtocol := ranking.NewProtocol(globals.SecureEndpoint) globals.SecureEndpoint.RegisterServiceProtocol(rankingProtocol) - storageManagerProtocol := storage_manager.NewProtocol(globals.SecureServer) + storageManagerProtocol := storage_manager.NewProtocol(globals.SecureEndpoint) globals.SecureEndpoint.RegisterServiceProtocol(storageManagerProtocol) storageManagerProtocol.AcquireCardID = nex_storage_manager.AcquireCardID diff --git a/nex/secure.go b/nex/secure.go index 34fcdda..f9685b5 100644 --- a/nex/secure.go +++ b/nex/secure.go @@ -18,8 +18,8 @@ func StartSecureServer() { globals.SecureEndpoint.AccountDetailsByUsername = globals.AccountDetailsByUsername globals.SecureServer.BindPRUDPEndPoint(globals.SecureEndpoint) - globals.SecureServer.SetDefaultLibraryVersion(nex.NewLibraryVersion(2, 4, 3)) - globals.SecureServer.SetAccessKey("6181dff1") + globals.SecureServer.LibraryVersions.SetDefault(nex.NewLibraryVersion(2, 4, 3)) + globals.SecureServer.AccessKey = "6181dff1" globals.SecureEndpoint.OnData(func(packet nex.PacketInterface) { request := packet.RMCMessage() diff --git a/nex/storage-manager/acquire_card_id.go b/nex/storage-manager/acquire_card_id.go index 6af6e4f..1adde5f 100644 --- a/nex/storage-manager/acquire_card_id.go +++ b/nex/storage-manager/acquire_card_id.go @@ -9,24 +9,24 @@ import ( storage_manager "github.com/PretendoNetwork/nex-protocols-go/storage-manager" ) -func AcquireCardID(err error, packet nex.PacketInterface, callID uint32) (*nex.RMCMessage, uint32) { +func AcquireCardID(err error, packet nex.PacketInterface, callID uint32) (*nex.RMCMessage, *nex.Error) { if err != nil { globals.Logger.Error(err.Error()) - return nil, nex.ResultCodes.Core.Unknown + return nil, nex.NewError(nex.ResultCodes.Core.Unknown, err.Error()) } cardID := types.NewPrimitiveU64(rand.Uint64()) - rmcResponseStream := nex.NewByteStreamOut(globals.SecureServer) + rmcResponseStream := nex.NewByteStreamOut(globals.SecureServer.LibraryVersions, globals.SecureServer.ByteStreamSettings) cardID.WriteTo(rmcResponseStream) rmcResponseBody := rmcResponseStream.Bytes() - rmcResponse := nex.NewRMCSuccess(globals.SecureServer, rmcResponseBody) + rmcResponse := nex.NewRMCSuccess(globals.SecureEndpoint, rmcResponseBody) rmcResponse.ProtocolID = storage_manager.ProtocolID rmcResponse.MethodID = storage_manager.MethodAcquireCardID rmcResponse.CallID = callID - return rmcResponse, 0 + return rmcResponse, nil } diff --git a/nex/storage-manager/activate_with_card_id.go b/nex/storage-manager/activate_with_card_id.go index ddd18dc..92163fa 100644 --- a/nex/storage-manager/activate_with_card_id.go +++ b/nex/storage-manager/activate_with_card_id.go @@ -10,10 +10,10 @@ import ( storage_manager "github.com/PretendoNetwork/nex-protocols-go/storage-manager" ) -func ActivateWithCardID(err error, packet nex.PacketInterface, callID uint32, unknown *types.PrimitiveU8, cardID *types.PrimitiveU64) (*nex.RMCMessage, uint32) { +func ActivateWithCardID(err error, packet nex.PacketInterface, callID uint32, unknown *types.PrimitiveU8, cardID *types.PrimitiveU64) (*nex.RMCMessage, *nex.Error) { if err != nil { globals.Logger.Error(err.Error()) - return nil, nex.ResultCodes.Core.InvalidArgument + return nil, nex.NewError(nex.ResultCodes.Core.InvalidArgument, err.Error()) } client := packet.Sender() @@ -30,30 +30,30 @@ func ActivateWithCardID(err error, packet nex.PacketInterface, callID uint32, un uniqueID.Value, err = database.GetUniqueIDByOwnerPID(client.PID().LegacyValue()) if err != nil && err != sql.ErrNoRows { globals.Logger.Critical(err.Error()) - return nil, nex.ResultCodes.Core.Unknown + return nil, nex.NewError(nex.ResultCodes.Core.Unknown, err.Error()) } if err == sql.ErrNoRows { uniqueID.Value, err = database.InsertCommonDataByOwnerPID(client.PID().LegacyValue()) if err != nil { globals.Logger.Critical(err.Error()) - return nil, nex.ResultCodes.Core.Unknown + return nil, nex.NewError(nex.ResultCodes.Core.Unknown, err.Error()) } firstTime.Value = true } - rmcResponseStream := nex.NewByteStreamOut(globals.SecureServer) + rmcResponseStream := nex.NewByteStreamOut(globals.SecureServer.LibraryVersions, globals.SecureServer.ByteStreamSettings) uniqueID.WriteTo(rmcResponseStream) firstTime.WriteTo(rmcResponseStream) rmcResponseBody := rmcResponseStream.Bytes() - rmcResponse := nex.NewRMCSuccess(globals.SecureServer, rmcResponseBody) + rmcResponse := nex.NewRMCSuccess(globals.SecureEndpoint, rmcResponseBody) rmcResponse.ProtocolID = storage_manager.ProtocolID rmcResponse.MethodID = storage_manager.MethodActivateWithCardID rmcResponse.CallID = callID - return rmcResponse, 0 + return rmcResponse, nil } From afb92cc42a68bff4564f46236d198a76395f4ec8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20L=C3=B3pez=20Guimaraes?= Date: Sun, 11 Feb 2024 00:56:43 +0000 Subject: [PATCH 07/11] nex/secure: Bring back IsSecureEndpoint property --- nex/secure.go | 1 + 1 file changed, 1 insertion(+) diff --git a/nex/secure.go b/nex/secure.go index f9685b5..5ef2700 100644 --- a/nex/secure.go +++ b/nex/secure.go @@ -13,6 +13,7 @@ func StartSecureServer() { globals.SecureServer = nex.NewPRUDPServer() globals.SecureEndpoint = nex.NewPRUDPEndPoint(1) + globals.SecureEndpoint.IsSecureEndpoint = true globals.SecureEndpoint.ServerAccount = globals.SecureServerAccount globals.SecureEndpoint.AccountDetailsByPID = globals.AccountDetailsByPID globals.SecureEndpoint.AccountDetailsByUsername = globals.AccountDetailsByUsername From ccf14e9c9261648a1af45027dda05e3308efe52c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20L=C3=B3pez=20Guimaraes?= Date: Thu, 22 Feb 2024 16:13:22 +0000 Subject: [PATCH 08/11] nex: Update with latest changes --- nex/register_common_authentication_server_protocols.go | 2 +- nex/register_common_secure_server_protocols.go | 10 +++++----- nex/register_secure_server_nex_protocols.go | 6 +++--- nex/secure.go | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/nex/register_common_authentication_server_protocols.go b/nex/register_common_authentication_server_protocols.go index 3aeb263..4a783dc 100644 --- a/nex/register_common_authentication_server_protocols.go +++ b/nex/register_common_authentication_server_protocols.go @@ -10,7 +10,7 @@ import ( ) func registerCommonAuthenticationServerProtocols() { - ticketGrantingProtocol := ticket_granting.NewProtocol(globals.AuthenticationEndpoint) + ticketGrantingProtocol := ticket_granting.NewProtocol() globals.AuthenticationEndpoint.RegisterServiceProtocol(ticketGrantingProtocol) commonTicketGrantingProtocol := common_ticket_granting.NewCommonProtocol(ticketGrantingProtocol) diff --git a/nex/register_common_secure_server_protocols.go b/nex/register_common_secure_server_protocols.go index ce479cb..8bb9b3e 100644 --- a/nex/register_common_secure_server_protocols.go +++ b/nex/register_common_secure_server_protocols.go @@ -17,23 +17,23 @@ import ( ) func registerCommonSecureServerProtocols() { - secureProtocol := secure.NewProtocol(globals.SecureEndpoint) + secureProtocol := secure.NewProtocol() globals.SecureEndpoint.RegisterServiceProtocol(secureProtocol) common_secure.NewCommonProtocol(secureProtocol) - natTraversalProtocol := nat_traversal.NewProtocol(globals.SecureEndpoint) + natTraversalProtocol := nat_traversal.NewProtocol() globals.SecureEndpoint.RegisterServiceProtocol(natTraversalProtocol) common_nat_traversal.NewCommonProtocol(natTraversalProtocol) - matchMakingProtocol := match_making.NewProtocol(globals.SecureEndpoint) + matchMakingProtocol := match_making.NewProtocol() globals.SecureEndpoint.RegisterServiceProtocol(matchMakingProtocol) common_match_making.NewCommonProtocol(matchMakingProtocol) - matchMakingExtProtocol := match_making_ext.NewProtocol(globals.SecureEndpoint) + matchMakingExtProtocol := match_making_ext.NewProtocol() globals.SecureEndpoint.RegisterServiceProtocol(matchMakingExtProtocol) common_match_making_ext.NewCommonProtocol(matchMakingExtProtocol) - matchmakeExtensionProtocol := matchmake_extension.NewProtocol(globals.SecureEndpoint) + matchmakeExtensionProtocol := matchmake_extension.NewProtocol() globals.SecureEndpoint.RegisterServiceProtocol(matchmakeExtensionProtocol) commonMatchmakeExtensionProtocol := common_matchmake_extension.NewCommonProtocol(matchmakeExtensionProtocol) diff --git a/nex/register_secure_server_nex_protocols.go b/nex/register_secure_server_nex_protocols.go index 8a629b1..fdbab3b 100644 --- a/nex/register_secure_server_nex_protocols.go +++ b/nex/register_secure_server_nex_protocols.go @@ -10,14 +10,14 @@ import ( ) func registerSecureServerNEXProtocols() { - datastoreProtocol := datastore.NewProtocol(globals.SecureEndpoint) + datastoreProtocol := datastore.NewProtocol() globals.SecureEndpoint.RegisterServiceProtocol(datastoreProtocol) // TODO - Add legacy ranking protocol! - rankingProtocol := ranking.NewProtocol(globals.SecureEndpoint) + rankingProtocol := ranking.NewProtocol() globals.SecureEndpoint.RegisterServiceProtocol(rankingProtocol) - storageManagerProtocol := storage_manager.NewProtocol(globals.SecureEndpoint) + storageManagerProtocol := storage_manager.NewProtocol() globals.SecureEndpoint.RegisterServiceProtocol(storageManagerProtocol) storageManagerProtocol.AcquireCardID = nex_storage_manager.AcquireCardID diff --git a/nex/secure.go b/nex/secure.go index 5ef2700..183339b 100644 --- a/nex/secure.go +++ b/nex/secure.go @@ -13,7 +13,7 @@ func StartSecureServer() { globals.SecureServer = nex.NewPRUDPServer() globals.SecureEndpoint = nex.NewPRUDPEndPoint(1) - globals.SecureEndpoint.IsSecureEndpoint = true + globals.SecureEndpoint.IsSecureEndPoint = true globals.SecureEndpoint.ServerAccount = globals.SecureServerAccount globals.SecureEndpoint.AccountDetailsByPID = globals.AccountDetailsByPID globals.SecureEndpoint.AccountDetailsByUsername = globals.AccountDetailsByUsername From a0f01c1bf7e25b45a52a2b1f4300c8175bbe064a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20L=C3=B3pez=20Guimaraes?= Date: Sun, 17 Mar 2024 22:38:25 +0000 Subject: [PATCH 09/11] Update with latest changes --- nex/authentication.go | 2 ++ ..._common_authentication_server_protocols.go | 24 +++++++++++-------- nex/secure.go | 2 ++ 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/nex/authentication.go b/nex/authentication.go index fe8408d..037cbd5 100644 --- a/nex/authentication.go +++ b/nex/authentication.go @@ -18,6 +18,8 @@ func StartAuthenticationServer() { globals.AuthenticationEndpoint.ServerAccount = globals.AuthenticationServerAccount globals.AuthenticationEndpoint.AccountDetailsByPID = globals.AccountDetailsByPID globals.AuthenticationEndpoint.AccountDetailsByUsername = globals.AccountDetailsByUsername + // * The default silence time is too low for Mario Kart 7, so we set a higher value + globals.AuthenticationEndpoint.DefaultStreamSettings.MaxSilenceTime = 20000 globals.AuthenticationServer.BindPRUDPEndPoint(globals.AuthenticationEndpoint) globals.AuthenticationServer.LibraryVersions.SetDefault(nex.NewLibraryVersion(2, 4, 3)) diff --git a/nex/register_common_authentication_server_protocols.go b/nex/register_common_authentication_server_protocols.go index 4a783dc..b602629 100644 --- a/nex/register_common_authentication_server_protocols.go +++ b/nex/register_common_authentication_server_protocols.go @@ -2,11 +2,13 @@ package nex import ( "os" + "strconv" + "github.com/PretendoNetwork/mario-kart-7/globals" + "github.com/PretendoNetwork/nex-go/constants" "github.com/PretendoNetwork/nex-go/types" - ticket_granting "github.com/PretendoNetwork/nex-protocols-go/ticket-granting" common_ticket_granting "github.com/PretendoNetwork/nex-protocols-common-go/ticket-granting" - "github.com/PretendoNetwork/mario-kart-7/globals" + ticket_granting "github.com/PretendoNetwork/nex-protocols-go/ticket-granting" ) func registerCommonAuthenticationServerProtocols() { @@ -14,15 +16,17 @@ func registerCommonAuthenticationServerProtocols() { globals.AuthenticationEndpoint.RegisterServiceProtocol(ticketGrantingProtocol) commonTicketGrantingProtocol := common_ticket_granting.NewCommonProtocol(ticketGrantingProtocol) + port, _ := strconv.Atoi(os.Getenv("PN_MK7_SECURE_SERVER_PORT")) + secureStationURL := types.NewStationURL("") - secureStationURL.Scheme = "prudps" - secureStationURL.Fields["address"] = os.Getenv("PN_MK7_SECURE_SERVER_HOST") - secureStationURL.Fields["port"] = os.Getenv("PN_MK7_SECURE_SERVER_PORT") - secureStationURL.Fields["CID"] = "1" - secureStationURL.Fields["PID"] = "2" - secureStationURL.Fields["sid"] = "1" - secureStationURL.Fields["stream"] = "10" - secureStationURL.Fields["type"] = "2" + secureStationURL.SetURLType(constants.StationURLPRUDPS) + secureStationURL.SetAddress(os.Getenv("PN_MK7_SECURE_SERVER_HOST")) + secureStationURL.SetPortNumber(uint16(port)) + secureStationURL.SetConnectionID(1) + secureStationURL.SetPrincipalID(types.NewPID(2)) + secureStationURL.SetStreamID(1) + secureStationURL.SetStreamType(constants.StreamTypeRVSecure) + secureStationURL.SetType(uint8(constants.StationURLFlagPublic)) commonTicketGrantingProtocol.SecureStationURL = secureStationURL commonTicketGrantingProtocol.BuildName = types.NewString(serverBuildString) diff --git a/nex/secure.go b/nex/secure.go index 183339b..074854c 100644 --- a/nex/secure.go +++ b/nex/secure.go @@ -17,6 +17,8 @@ func StartSecureServer() { globals.SecureEndpoint.ServerAccount = globals.SecureServerAccount globals.SecureEndpoint.AccountDetailsByPID = globals.AccountDetailsByPID globals.SecureEndpoint.AccountDetailsByUsername = globals.AccountDetailsByUsername + // * The default silence time is too low for Mario Kart 7, so we set a higher value + globals.SecureEndpoint.DefaultStreamSettings.MaxSilenceTime = 20000 globals.SecureServer.BindPRUDPEndPoint(globals.SecureEndpoint) globals.SecureServer.LibraryVersions.SetDefault(nex.NewLibraryVersion(2, 4, 3)) From 53f54ae5b1bdeedbd066cb4a68f96d1a4c61b9d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20L=C3=B3pez=20Guimaraes?= Date: Mon, 8 Apr 2024 00:00:20 +0100 Subject: [PATCH 10/11] chore: Update NEX module versions to v2 --- globals/accounts.go | 4 +- globals/globals.go | 2 +- globals/password_from_pid.go | 6 +- go.mod | 36 ++++---- go.sum | 84 +++++++++++-------- init.go | 4 +- nex/authentication.go | 2 +- .../cleanup_search_matchmake_session.go | 4 +- ..._common_authentication_server_protocols.go | 8 +- ...register_common_secure_server_protocols.go | 20 ++--- nex/register_secure_server_nex_protocols.go | 6 +- nex/secure.go | 2 +- nex/storage-manager/acquire_card_id.go | 6 +- nex/storage-manager/activate_with_card_id.go | 6 +- 14 files changed, 103 insertions(+), 87 deletions(-) diff --git a/globals/accounts.go b/globals/accounts.go index 5160601..40ecadc 100644 --- a/globals/accounts.go +++ b/globals/accounts.go @@ -3,8 +3,8 @@ package globals import ( "strconv" - "github.com/PretendoNetwork/nex-go" - "github.com/PretendoNetwork/nex-go/types" + "github.com/PretendoNetwork/nex-go/v2" + "github.com/PretendoNetwork/nex-go/v2/types" ) var AuthenticationServerAccount *nex.Account diff --git a/globals/globals.go b/globals/globals.go index 3905c77..60e931f 100644 --- a/globals/globals.go +++ b/globals/globals.go @@ -2,7 +2,7 @@ package globals import ( pb "github.com/PretendoNetwork/grpc-go/account" - "github.com/PretendoNetwork/nex-go" + "github.com/PretendoNetwork/nex-go/v2" "github.com/PretendoNetwork/plogger-go" "google.golang.org/grpc" "google.golang.org/grpc/metadata" diff --git a/globals/password_from_pid.go b/globals/password_from_pid.go index ec8e4fb..7cf14d6 100644 --- a/globals/password_from_pid.go +++ b/globals/password_from_pid.go @@ -4,9 +4,9 @@ import ( "context" pb "github.com/PretendoNetwork/grpc-go/account" - "github.com/PretendoNetwork/nex-go" - "github.com/PretendoNetwork/nex-go/types" - "github.com/PretendoNetwork/nex-protocols-go/globals" + "github.com/PretendoNetwork/nex-go/v2" + "github.com/PretendoNetwork/nex-go/v2/types" + "github.com/PretendoNetwork/nex-protocols-go/v2/globals" "google.golang.org/grpc/metadata" ) diff --git a/go.mod b/go.mod index 68e6c29..b5d8c4b 100644 --- a/go.mod +++ b/go.mod @@ -1,31 +1,35 @@ module github.com/PretendoNetwork/mario-kart-7 -go 1.19 +go 1.21 require ( github.com/PretendoNetwork/grpc-go v1.0.2 - github.com/PretendoNetwork/nex-go v1.0.41 - github.com/PretendoNetwork/nex-protocols-common-go v1.0.28 - github.com/PretendoNetwork/nex-protocols-go v1.0.53 + github.com/PretendoNetwork/nex-go/v2 v2.0.1 + github.com/PretendoNetwork/nex-protocols-common-go/v2 v2.0.1 + github.com/PretendoNetwork/nex-protocols-go/v2 v2.0.1 github.com/PretendoNetwork/plogger-go v1.0.4 github.com/joho/godotenv v1.5.1 github.com/lib/pq v1.10.9 - google.golang.org/grpc v1.58.2 + google.golang.org/grpc v1.63.0 ) require ( - github.com/fatih/color v1.15.0 // indirect - github.com/golang/protobuf v1.5.3 // indirect + github.com/dolthub/maphash v0.1.0 // indirect + github.com/fatih/color v1.16.0 // indirect + github.com/golang/protobuf v1.5.4 // indirect github.com/jwalton/go-supportscolor v1.2.0 // indirect + github.com/klauspost/compress v1.17.7 // indirect + github.com/lxzan/gws v1.8.1 // indirect github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.19 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/rasky/go-lzo v0.0.0-20200203143853-96a758eda86e // indirect github.com/superwhiskers/crunch/v3 v3.5.7 // indirect - golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect - golang.org/x/mod v0.13.0 // indirect - golang.org/x/net v0.15.0 // indirect - golang.org/x/sys v0.13.0 // indirect - golang.org/x/term v0.13.0 // indirect - golang.org/x/text v0.13.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97 // indirect - google.golang.org/protobuf v1.31.0 // indirect + golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 // indirect + golang.org/x/mod v0.17.0 // indirect + golang.org/x/net v0.24.0 // indirect + golang.org/x/sys v0.19.0 // indirect + golang.org/x/term v0.19.0 // indirect + golang.org/x/text v0.14.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect + google.golang.org/protobuf v1.33.0 // indirect ) diff --git a/go.sum b/go.sum index 5d2f54e..6713bc0 100644 --- a/go.sum +++ b/go.sum @@ -1,56 +1,68 @@ github.com/PretendoNetwork/grpc-go v1.0.2 h1:9TvKmX7dCOANyoHEra1MMYqS1N/RGav66TRG4SHInvo= github.com/PretendoNetwork/grpc-go v1.0.2/go.mod h1:XZjEsij9lL7HJBNkH6JPbBIkUSq/1rjflvjGdv+DAj0= -github.com/PretendoNetwork/nex-go v1.0.41 h1:TcBb1Bpe2KAB+AXaGX1K9NVQBRtZJIoy4yCvRde2xbI= -github.com/PretendoNetwork/nex-go v1.0.41/go.mod h1:QwHEa165DeVd0xIuthrgc3j6NWXT8lyPSG6t5kC/Shk= -github.com/PretendoNetwork/nex-protocols-common-go v1.0.28 h1:ErkWga7Uzn4WoDU8Q/Sy+geHy0fF0G/5wFnL5i6hngI= -github.com/PretendoNetwork/nex-protocols-common-go v1.0.28/go.mod h1:4jYhLg+Cb2qhJHyyA+f2OwCrmc98zuTO3JPWK22mIKw= -github.com/PretendoNetwork/nex-protocols-go v1.0.53 h1:o56sr8D2Mx//pGEFF/pzDTwOWusI0aQVehoyRYqSqVo= -github.com/PretendoNetwork/nex-protocols-go v1.0.53/go.mod h1:9r4KbNELVZj01TY8p+FGYDb9+e4mHLiWKo5NL1fPqD8= +github.com/PretendoNetwork/nex-go/v2 v2.0.1 h1:7UEwulBtWD+HIbwB0uaRjBK1EXFLfSnv0t5+WyQYV0s= +github.com/PretendoNetwork/nex-go/v2 v2.0.1/go.mod h1:EZNyRVr0WpPLHZQqZZvarQ8/tXsEyVqLr6zy/hKCAV4= +github.com/PretendoNetwork/nex-protocols-common-go/v2 v2.0.1 h1:e8NNIfAnIeOqXraScvnbsyvw9S+lXq38NXp9JpPn9+4= +github.com/PretendoNetwork/nex-protocols-common-go/v2 v2.0.1/go.mod h1:YEnnM1XDVGf34885MdHcRwZR/g9Qvjn3qkXlGlgiGPk= +github.com/PretendoNetwork/nex-protocols-go/v2 v2.0.1 h1:BqrHYF2JeYfB/JUmhU3pWR1qUJEEqUDM4pigXzi95Ik= +github.com/PretendoNetwork/nex-protocols-go/v2 v2.0.1/go.mod h1:TAzlc/gOu6E5Ct2NoTpN+Ea9Gpjh38dTsGqfs0pfZ4w= github.com/PretendoNetwork/plogger-go v1.0.4 h1:PF7xHw9eDRHH+RsAP9tmAE7fG0N0p6H4iPwHKnsoXwc= github.com/PretendoNetwork/plogger-go v1.0.4/go.mod h1:7kD6M4vPq1JL4LTuPg6kuB1OvUBOwQOtAvTaUwMbwvU= -github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= -github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dolthub/maphash v0.1.0 h1:bsQ7JsF4FkkWyrP3oCnFJgrCUAFbFf3kOl4L/QxPDyQ= +github.com/dolthub/maphash v0.1.0/go.mod h1:gkg4Ch4CdCDu5h6PMriVLawB7koZ+5ijb9puGMV50a4= +github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= +github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= github.com/jwalton/go-supportscolor v1.2.0 h1:g6Ha4u7Vm3LIsQ5wmeBpS4gazu0UP1DRDE8y6bre4H8= github.com/jwalton/go-supportscolor v1.2.0/go.mod h1:hFVUAZV2cWg+WFFC4v8pT2X/S2qUUBYMioBD9AINXGs= +github.com/klauspost/compress v1.17.7 h1:ehO88t2UGzQK66LMdE8tibEd1ErmzZjNEqWkjLAKQQg= +github.com/klauspost/compress v1.17.7/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/lxzan/gws v1.8.1 h1:+Oc2f8U0YUE7mkBKUYUABvszUB9pfTfPQl7C26PW+LE= +github.com/lxzan/gws v1.8.1/go.mod h1:FcGeRMB7HwGuTvMLR24ku0Zx0p6RXqeKASeMc4VYgi4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= -github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rasky/go-lzo v0.0.0-20200203143853-96a758eda86e h1:dCWirM5F3wMY+cmRda/B1BiPsFtmzXqV9b0hLWtVBMs= +github.com/rasky/go-lzo v0.0.0-20200203143853-96a758eda86e/go.mod h1:9leZcVcItj6m9/CfHY5Em/iBrCz7js8LcRQGTKEEv2M= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/superwhiskers/crunch/v3 v3.5.7 h1:N9RLxaR65C36i26BUIpzPXGy2f6pQ7wisu2bawbKNqg= github.com/superwhiskers/crunch/v3 v3.5.7/go.mod h1:4ub2EKgF1MAhTjoOCTU4b9uLMsAweHEa89aRrfAypXA= -golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g= -golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k= -golang.org/x/mod v0.13.0 h1:I/DsJXRlw/8l/0c24sM9yb0T4z9liZTduXvdAWYiysY= -golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8= -golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= +golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 h1:985EYyeCOxTpcgOTJpflJUwOeEz0CQOdPt73OzpE9F8= +golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0/go.mod h1:/lliqkxwWAhPjf5oSOIJup2XcqJaw8RGS6k3TGEc7GI= +golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= -golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek= -golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= -golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= -golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97 h1:6GQBEOdGkX6MMTLT9V+TjtIRZCw9VPD5Z+yHY9wMgS0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97/go.mod h1:v7nGkzlmW8P3n/bKmWBn2WpBjpOEx8Q6gMueudAmKfY= -google.golang.org/grpc v1.58.2 h1:SXUpjxeVF3FKrTYQI4f4KvbGD5u2xccdYdurwowix5I= -google.golang.org/grpc v1.58.2/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +golang.org/x/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q= +golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= +google.golang.org/grpc v1.63.0 h1:WjKe+dnvABXyPJMD7KDNLxtoGk5tgk+YFWN6cBWjZE8= +google.golang.org/grpc v1.63.0/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/init.go b/init.go index bf5a587..c7589dd 100644 --- a/init.go +++ b/init.go @@ -6,8 +6,8 @@ import ( "strconv" "strings" - "github.com/PretendoNetwork/nex-go" - "github.com/PretendoNetwork/nex-go/types" + "github.com/PretendoNetwork/nex-go/v2" + "github.com/PretendoNetwork/nex-go/v2/types" pb "github.com/PretendoNetwork/grpc-go/account" "github.com/PretendoNetwork/plogger-go" "github.com/joho/godotenv" diff --git a/nex/authentication.go b/nex/authentication.go index 037cbd5..2216216 100644 --- a/nex/authentication.go +++ b/nex/authentication.go @@ -5,7 +5,7 @@ import ( "os" "strconv" - "github.com/PretendoNetwork/nex-go" + "github.com/PretendoNetwork/nex-go/v2" "github.com/PretendoNetwork/mario-kart-7/globals" ) diff --git a/nex/matchmake-extension/common/cleanup_search_matchmake_session.go b/nex/matchmake-extension/common/cleanup_search_matchmake_session.go index 8ac35c0..aada4b4 100644 --- a/nex/matchmake-extension/common/cleanup_search_matchmake_session.go +++ b/nex/matchmake-extension/common/cleanup_search_matchmake_session.go @@ -1,8 +1,8 @@ package nex_matchmake_extension_common import ( - "github.com/PretendoNetwork/nex-go/types" - matchmaking_types "github.com/PretendoNetwork/nex-protocols-go/match-making/types" + "github.com/PretendoNetwork/nex-go/v2/types" + matchmaking_types "github.com/PretendoNetwork/nex-protocols-go/v2/match-making/types" ) func CleanupSearchMatchmakeSession(matchmakeSession *matchmaking_types.MatchmakeSession) { diff --git a/nex/register_common_authentication_server_protocols.go b/nex/register_common_authentication_server_protocols.go index b602629..b35e76f 100644 --- a/nex/register_common_authentication_server_protocols.go +++ b/nex/register_common_authentication_server_protocols.go @@ -5,10 +5,10 @@ import ( "strconv" "github.com/PretendoNetwork/mario-kart-7/globals" - "github.com/PretendoNetwork/nex-go/constants" - "github.com/PretendoNetwork/nex-go/types" - common_ticket_granting "github.com/PretendoNetwork/nex-protocols-common-go/ticket-granting" - ticket_granting "github.com/PretendoNetwork/nex-protocols-go/ticket-granting" + "github.com/PretendoNetwork/nex-go/v2/constants" + "github.com/PretendoNetwork/nex-go/v2/types" + common_ticket_granting "github.com/PretendoNetwork/nex-protocols-common-go/v2/ticket-granting" + ticket_granting "github.com/PretendoNetwork/nex-protocols-go/v2/ticket-granting" ) func registerCommonAuthenticationServerProtocols() { diff --git a/nex/register_common_secure_server_protocols.go b/nex/register_common_secure_server_protocols.go index 8bb9b3e..08c4e9d 100644 --- a/nex/register_common_secure_server_protocols.go +++ b/nex/register_common_secure_server_protocols.go @@ -2,16 +2,16 @@ package nex import ( "github.com/PretendoNetwork/mario-kart-7/globals" - matchmake_extension "github.com/PretendoNetwork/nex-protocols-go/matchmake-extension" - common_matchmake_extension "github.com/PretendoNetwork/nex-protocols-common-go/matchmake-extension" - match_making "github.com/PretendoNetwork/nex-protocols-go/match-making" - common_match_making "github.com/PretendoNetwork/nex-protocols-common-go/match-making" - match_making_ext "github.com/PretendoNetwork/nex-protocols-go/match-making-ext" - common_match_making_ext "github.com/PretendoNetwork/nex-protocols-common-go/match-making-ext" - nat_traversal "github.com/PretendoNetwork/nex-protocols-go/nat-traversal" - common_nat_traversal "github.com/PretendoNetwork/nex-protocols-common-go/nat-traversal" - secure "github.com/PretendoNetwork/nex-protocols-go/secure-connection" - common_secure "github.com/PretendoNetwork/nex-protocols-common-go/secure-connection" + matchmake_extension "github.com/PretendoNetwork/nex-protocols-go/v2/matchmake-extension" + common_matchmake_extension "github.com/PretendoNetwork/nex-protocols-common-go/v2/matchmake-extension" + match_making "github.com/PretendoNetwork/nex-protocols-go/v2/match-making" + common_match_making "github.com/PretendoNetwork/nex-protocols-common-go/v2/match-making" + match_making_ext "github.com/PretendoNetwork/nex-protocols-go/v2/match-making-ext" + common_match_making_ext "github.com/PretendoNetwork/nex-protocols-common-go/v2/match-making-ext" + nat_traversal "github.com/PretendoNetwork/nex-protocols-go/v2/nat-traversal" + common_nat_traversal "github.com/PretendoNetwork/nex-protocols-common-go/v2/nat-traversal" + secure "github.com/PretendoNetwork/nex-protocols-go/v2/secure-connection" + common_secure "github.com/PretendoNetwork/nex-protocols-common-go/v2/secure-connection" nex_matchmake_extension_common "github.com/PretendoNetwork/mario-kart-7/nex/matchmake-extension/common" ) diff --git a/nex/register_secure_server_nex_protocols.go b/nex/register_secure_server_nex_protocols.go index fdbab3b..9efec02 100644 --- a/nex/register_secure_server_nex_protocols.go +++ b/nex/register_secure_server_nex_protocols.go @@ -2,9 +2,9 @@ package nex import ( "github.com/PretendoNetwork/mario-kart-7/globals" - datastore "github.com/PretendoNetwork/nex-protocols-go/datastore" - ranking "github.com/PretendoNetwork/nex-protocols-go/ranking" - storage_manager "github.com/PretendoNetwork/nex-protocols-go/storage-manager" + datastore "github.com/PretendoNetwork/nex-protocols-go/v2/datastore" + ranking "github.com/PretendoNetwork/nex-protocols-go/v2/ranking" + storage_manager "github.com/PretendoNetwork/nex-protocols-go/v2/storage-manager" nex_storage_manager "github.com/PretendoNetwork/mario-kart-7/nex/storage-manager" ) diff --git a/nex/secure.go b/nex/secure.go index 074854c..43b6704 100644 --- a/nex/secure.go +++ b/nex/secure.go @@ -5,7 +5,7 @@ import ( "os" "strconv" - nex "github.com/PretendoNetwork/nex-go" + nex "github.com/PretendoNetwork/nex-go/v2" "github.com/PretendoNetwork/mario-kart-7/globals" ) diff --git a/nex/storage-manager/acquire_card_id.go b/nex/storage-manager/acquire_card_id.go index 1adde5f..39a276a 100644 --- a/nex/storage-manager/acquire_card_id.go +++ b/nex/storage-manager/acquire_card_id.go @@ -4,9 +4,9 @@ import ( "math/rand" "github.com/PretendoNetwork/mario-kart-7/globals" - "github.com/PretendoNetwork/nex-go" - "github.com/PretendoNetwork/nex-go/types" - storage_manager "github.com/PretendoNetwork/nex-protocols-go/storage-manager" + "github.com/PretendoNetwork/nex-go/v2" + "github.com/PretendoNetwork/nex-go/v2/types" + storage_manager "github.com/PretendoNetwork/nex-protocols-go/v2/storage-manager" ) func AcquireCardID(err error, packet nex.PacketInterface, callID uint32) (*nex.RMCMessage, *nex.Error) { diff --git a/nex/storage-manager/activate_with_card_id.go b/nex/storage-manager/activate_with_card_id.go index 92163fa..5febec8 100644 --- a/nex/storage-manager/activate_with_card_id.go +++ b/nex/storage-manager/activate_with_card_id.go @@ -5,9 +5,9 @@ import ( "github.com/PretendoNetwork/mario-kart-7/database" "github.com/PretendoNetwork/mario-kart-7/globals" - nex "github.com/PretendoNetwork/nex-go" - "github.com/PretendoNetwork/nex-go/types" - storage_manager "github.com/PretendoNetwork/nex-protocols-go/storage-manager" + nex "github.com/PretendoNetwork/nex-go/v2" + "github.com/PretendoNetwork/nex-go/v2/types" + storage_manager "github.com/PretendoNetwork/nex-protocols-go/v2/storage-manager" ) func ActivateWithCardID(err error, packet nex.PacketInterface, callID uint32, unknown *types.PrimitiveU8, cardID *types.PrimitiveU64) (*nex.RMCMessage, *nex.Error) { From 907a75733d2492737b90bd5324cc18c81bd1d962 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20L=C3=B3pez=20Guimaraes?= Date: Mon, 8 Apr 2024 20:44:20 +0100 Subject: [PATCH 11/11] Update nex-protocols-common-go to v2.0.2 --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index b5d8c4b..d487c7c 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.21 require ( github.com/PretendoNetwork/grpc-go v1.0.2 github.com/PretendoNetwork/nex-go/v2 v2.0.1 - github.com/PretendoNetwork/nex-protocols-common-go/v2 v2.0.1 + github.com/PretendoNetwork/nex-protocols-common-go/v2 v2.0.2 github.com/PretendoNetwork/nex-protocols-go/v2 v2.0.1 github.com/PretendoNetwork/plogger-go v1.0.4 github.com/joho/godotenv v1.5.1 diff --git a/go.sum b/go.sum index 6713bc0..68f815f 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,8 @@ github.com/PretendoNetwork/grpc-go v1.0.2 h1:9TvKmX7dCOANyoHEra1MMYqS1N/RGav66TR github.com/PretendoNetwork/grpc-go v1.0.2/go.mod h1:XZjEsij9lL7HJBNkH6JPbBIkUSq/1rjflvjGdv+DAj0= github.com/PretendoNetwork/nex-go/v2 v2.0.1 h1:7UEwulBtWD+HIbwB0uaRjBK1EXFLfSnv0t5+WyQYV0s= github.com/PretendoNetwork/nex-go/v2 v2.0.1/go.mod h1:EZNyRVr0WpPLHZQqZZvarQ8/tXsEyVqLr6zy/hKCAV4= -github.com/PretendoNetwork/nex-protocols-common-go/v2 v2.0.1 h1:e8NNIfAnIeOqXraScvnbsyvw9S+lXq38NXp9JpPn9+4= -github.com/PretendoNetwork/nex-protocols-common-go/v2 v2.0.1/go.mod h1:YEnnM1XDVGf34885MdHcRwZR/g9Qvjn3qkXlGlgiGPk= +github.com/PretendoNetwork/nex-protocols-common-go/v2 v2.0.2 h1:ZCSEA+jXE2eHF/uD/rrtugR0tlpdzmM6IVG8THlC4as= +github.com/PretendoNetwork/nex-protocols-common-go/v2 v2.0.2/go.mod h1:YEnnM1XDVGf34885MdHcRwZR/g9Qvjn3qkXlGlgiGPk= github.com/PretendoNetwork/nex-protocols-go/v2 v2.0.1 h1:BqrHYF2JeYfB/JUmhU3pWR1qUJEEqUDM4pigXzi95Ik= github.com/PretendoNetwork/nex-protocols-go/v2 v2.0.1/go.mod h1:TAzlc/gOu6E5Ct2NoTpN+Ea9Gpjh38dTsGqfs0pfZ4w= github.com/PretendoNetwork/plogger-go v1.0.4 h1:PF7xHw9eDRHH+RsAP9tmAE7fG0N0p6H4iPwHKnsoXwc=