mirror of
https://github.com/PretendoNetwork/wiiu-chat-secure.git
synced 2026-04-25 15:58:14 -05:00
chore: update to nex-go v2
This commit is contained in:
parent
5da06857c0
commit
3c990df98b
|
|
@ -8,7 +8,7 @@ import (
|
|||
"go.mongodb.org/mongo-driver/mongo/options"
|
||||
)
|
||||
|
||||
func GetCallInfoByTarget(target uint32) (uint32, uint32, bool) { // caller pid, target pid, ringing
|
||||
func GetCallInfoByTarget(target uint64) (uint64, uint64, bool) { // caller pid, target pid, ringing
|
||||
var result bson.M
|
||||
filter := bson.D{
|
||||
{"target_pid", target},
|
||||
|
|
@ -22,6 +22,6 @@ func GetCallInfoByTarget(target uint32) (uint32, uint32, bool) { // caller pid,
|
|||
panic(err)
|
||||
}
|
||||
} else {
|
||||
return uint32(result["caller_pid"].(int64)), uint32(result["target_pid"].(int64)), result["ringing"].(bool)
|
||||
return uint64(result["caller_pid"].(int64)), uint64(result["target_pid"].(int64)), result["ringing"].(bool)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,14 +2,15 @@ package globals
|
|||
|
||||
import (
|
||||
pb "github.com/PretendoNetwork/grpc-go/friends"
|
||||
"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"
|
||||
)
|
||||
|
||||
var Logger = plogger.NewLogger()
|
||||
var NEXServer *nex.Server
|
||||
var SecureServer *nex.PRUDPServer
|
||||
var SecureEndpoint *nex.PRUDPEndPoint
|
||||
var GRPCFriendsClientConnection *grpc.ClientConn
|
||||
var GRPCFriendsClient pb.FriendsClient
|
||||
var GRPCFriendsCommonMetadata metadata.MD
|
||||
|
|
|
|||
49
go.mod
49
go.mod
|
|
@ -1,39 +1,48 @@
|
|||
module github.com/PretendoNetwork/wiiu-chat-secure
|
||||
|
||||
go 1.18
|
||||
go 1.21
|
||||
|
||||
toolchain go1.22.4
|
||||
|
||||
require (
|
||||
github.com/PretendoNetwork/grpc-go v1.0.1
|
||||
github.com/PretendoNetwork/nex-go v1.0.28
|
||||
github.com/PretendoNetwork/nex-protocols-common-go v1.0.22
|
||||
github.com/PretendoNetwork/nex-protocols-go v1.0.38
|
||||
github.com/PretendoNetwork/plogger-go v1.0.3
|
||||
github.com/PretendoNetwork/nex-go/v2 v2.0.5
|
||||
github.com/PretendoNetwork/nex-protocols-common-go/v2 v2.0.5
|
||||
github.com/PretendoNetwork/nex-protocols-go/v2 v2.0.3
|
||||
github.com/PretendoNetwork/plogger-go v1.0.4
|
||||
github.com/joho/godotenv v1.5.1
|
||||
go.mongodb.org/mongo-driver v1.11.4
|
||||
google.golang.org/grpc v1.48.0
|
||||
go.mongodb.org/mongo-driver v1.16.0
|
||||
google.golang.org/grpc v1.65.0
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/fatih/color v1.15.0 // indirect
|
||||
github.com/golang/protobuf v1.5.2 // indirect
|
||||
github.com/PretendoNetwork/nex-go v1.0.41 // indirect
|
||||
github.com/PretendoNetwork/nex-protocols-go v1.0.58 // indirect
|
||||
github.com/dolthub/maphash v0.1.0 // indirect
|
||||
github.com/fatih/color v1.17.0 // indirect
|
||||
github.com/golang/protobuf v1.5.4 // indirect
|
||||
github.com/golang/snappy v0.0.4 // indirect
|
||||
github.com/jwalton/go-supportscolor v1.1.0 // indirect
|
||||
github.com/klauspost/compress v1.16.4 // indirect
|
||||
github.com/jwalton/go-supportscolor v1.2.0 // indirect
|
||||
github.com/klauspost/compress v1.17.8 // indirect
|
||||
github.com/lxzan/gws v1.8.3 // indirect
|
||||
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||
github.com/mattn/go-isatty v0.0.19 // indirect
|
||||
github.com/montanaflynn/stats v0.7.0 // indirect
|
||||
github.com/mattn/go-isatty v0.0.20 // indirect
|
||||
github.com/montanaflynn/stats v0.7.1 // indirect
|
||||
github.com/pkg/errors v0.9.1 // indirect
|
||||
github.com/rasky/go-lzo v0.0.0-20200203143853-96a758eda86e // indirect
|
||||
github.com/superwhiskers/crunch/v3 v3.5.7 // indirect
|
||||
github.com/xdg-go/pbkdf2 v1.0.0 // indirect
|
||||
github.com/xdg-go/scram v1.1.2 // indirect
|
||||
github.com/xdg-go/stringprep v1.0.4 // indirect
|
||||
github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a // indirect
|
||||
golang.org/x/crypto v0.8.0 // indirect
|
||||
golang.org/x/net v0.9.0 // indirect
|
||||
golang.org/x/sync v0.1.0 // indirect
|
||||
golang.org/x/sys v0.9.0 // indirect
|
||||
golang.org/x/term v0.9.0 // indirect
|
||||
golang.org/x/text v0.9.0 // indirect
|
||||
golang.org/x/crypto v0.23.0 // indirect
|
||||
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect
|
||||
golang.org/x/mod v0.17.0 // indirect
|
||||
golang.org/x/net v0.25.0 // indirect
|
||||
golang.org/x/sync v0.7.0 // indirect
|
||||
golang.org/x/sys v0.20.0 // indirect
|
||||
golang.org/x/term v0.20.0 // indirect
|
||||
golang.org/x/text v0.15.0 // indirect
|
||||
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 // indirect
|
||||
google.golang.org/protobuf v1.28.1 // indirect
|
||||
google.golang.org/protobuf v1.34.1 // indirect
|
||||
)
|
||||
|
|
|
|||
56
go.sum
56
go.sum
|
|
@ -7,18 +7,30 @@ github.com/PretendoNetwork/nex-go v1.0.26 h1:lJqDS5F8s836xcQzCEI5hNvUesmTsh2NGDC
|
|||
github.com/PretendoNetwork/nex-go v1.0.26/go.mod h1:qzc5s4iNrt1ubS9Axb38b2jPuEsiETN2mDijn+MthmI=
|
||||
github.com/PretendoNetwork/nex-go v1.0.28 h1:g3892srP1T7LaeY5JklMtLZ03gTxE8wpXqpPQpXpN74=
|
||||
github.com/PretendoNetwork/nex-go v1.0.28/go.mod h1:tWfWhrC/DCJuS08jTk0ceOv2R1VtElvKSVv13To6miE=
|
||||
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-go/v2 v2.0.5 h1:S/bYPb2SNUb9MSzai4wlqj/9J1JIiLuMtZcAAbBughM=
|
||||
github.com/PretendoNetwork/nex-go/v2 v2.0.5/go.mod h1:iW1xjbg/vl2c3uheitUFxGcrt0sxaDxeXR5QqDcyLpI=
|
||||
github.com/PretendoNetwork/nex-protocols-common-go v1.0.17 h1:w0n+RJAHANgX/iVnL5qRiyPJeDHcwr8w6DzDeFqxkqk=
|
||||
github.com/PretendoNetwork/nex-protocols-common-go v1.0.17/go.mod h1:5Y3jRIbvDxasj0CIvd024za+t9LMbD0OZkBwyKICijg=
|
||||
github.com/PretendoNetwork/nex-protocols-common-go v1.0.22 h1:oIKx3AsBApaKWl1f91q/Vt59YKJOjoUhzxs/F0UA1Vw=
|
||||
github.com/PretendoNetwork/nex-protocols-common-go v1.0.22/go.mod h1:UwVHUdB1WFlzVn4yq8WLai0J+9OQXw4cg5qNjnJQ3RU=
|
||||
github.com/PretendoNetwork/nex-protocols-common-go/v2 v2.0.5 h1:17b7vA8wjWLW9JdJTHeOoX2g2e4S/EwA32m9AuPEA80=
|
||||
github.com/PretendoNetwork/nex-protocols-common-go/v2 v2.0.5/go.mod h1:0wDEYxDYbUOjsKjsTUjU0/f3pL1MT54h+tGn4UyeB+A=
|
||||
github.com/PretendoNetwork/nex-protocols-go v1.0.29 h1:sye/cpRHpDuoV1I+vpeTBIEXaKsJ5biK/+zo3O92dlY=
|
||||
github.com/PretendoNetwork/nex-protocols-go v1.0.29/go.mod h1:Pw1u2rsZGXuv45iM9y/7nZ5TBr1L5hctv9ylNXlW1ws=
|
||||
github.com/PretendoNetwork/nex-protocols-go v1.0.38 h1:DCzzlIx8NJlTLcfisqeVg4vXTKvIVe0kF1cXzDBz6p8=
|
||||
github.com/PretendoNetwork/nex-protocols-go v1.0.38/go.mod h1:jZSnoM2G4oc7tKXeUf2OkJ6VyfJc4nb7gR++2oNEh5A=
|
||||
github.com/PretendoNetwork/nex-protocols-go v1.0.58 h1:W8pZ2LOlJm/mo/UOJjkLWNVHs0jQmkoa8qoI5A1WVyY=
|
||||
github.com/PretendoNetwork/nex-protocols-go v1.0.58/go.mod h1:136762CMIcAsTZDrt4W7gDE4ppiBuc9zN2QFOHESjS8=
|
||||
github.com/PretendoNetwork/nex-protocols-go/v2 v2.0.3 h1:80CG7f9w/34MN1vAZ1XP3ec4LJ4mqKlkests+HQzrvc=
|
||||
github.com/PretendoNetwork/nex-protocols-go/v2 v2.0.3/go.mod h1:2UN8khoMDNaeJ4GcIG7ez7MqqmbLfLzbVS6hSa+kGnk=
|
||||
github.com/PretendoNetwork/plogger-go v1.0.2 h1:vWKEnEmJJzYwqLxLyiSsAvCrZV6qnnu/a0GQOjIfzY0=
|
||||
github.com/PretendoNetwork/plogger-go v1.0.2/go.mod h1:7kD6M4vPq1JL4LTuPg6kuB1OvUBOwQOtAvTaUwMbwvU=
|
||||
github.com/PretendoNetwork/plogger-go v1.0.3 h1:KEnrUfPaCn0LFweg8OrhtiDhlN3pclWpNhlmAtmgfB0=
|
||||
github.com/PretendoNetwork/plogger-go v1.0.3/go.mod h1:7kD6M4vPq1JL4LTuPg6kuB1OvUBOwQOtAvTaUwMbwvU=
|
||||
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/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
|
||||
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
||||
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||
|
|
@ -32,6 +44,8 @@ github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWH
|
|||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
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/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
|
||||
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
|
||||
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
|
||||
|
|
@ -40,6 +54,8 @@ github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.
|
|||
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
|
||||
github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs=
|
||||
github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw=
|
||||
github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4=
|
||||
github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI=
|
||||
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
|
||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
||||
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
||||
|
|
@ -57,6 +73,8 @@ github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw
|
|||
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
||||
github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
|
||||
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
||||
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
|
||||
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
|
||||
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||
github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
|
||||
github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||
|
|
@ -75,27 +93,39 @@ 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.1.0 h1:HsXFJdMPjRUAx8cIW6g30hVSFYaxh9yRQwEWgkAR7lQ=
|
||||
github.com/jwalton/go-supportscolor v1.1.0/go.mod h1:hFVUAZV2cWg+WFFC4v8pT2X/S2qUUBYMioBD9AINXGs=
|
||||
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.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
|
||||
github.com/klauspost/compress v1.16.4 h1:91KN02FnsOYhuunwU4ssRe8lc2JosWmizWa91B5v1PU=
|
||||
github.com/klauspost/compress v1.16.4/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
|
||||
github.com/klauspost/compress v1.17.8 h1:YcnTYrq7MikUT7k0Yb5eceMmALQPYBW/Xltxn0NAMnU=
|
||||
github.com/klauspost/compress v1.17.8/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
|
||||
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
|
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/lxzan/gws v1.8.3 h1:umX2VLhXj7oVV4Sd2gCuqzrzpVWtqkKMy0tjHBBxXg0=
|
||||
github.com/lxzan/gws v1.8.3/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/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc=
|
||||
github.com/montanaflynn/stats v0.7.0 h1:r3y12KyNxj/Sb/iOE46ws+3mS1+MZca1wlHQFPsY/JU=
|
||||
github.com/montanaflynn/stats v0.7.0/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow=
|
||||
github.com/montanaflynn/stats v0.7.1 h1:etflOAAHORrCC44V+aR6Ftzort912ZU+YLiSTuV8eaE=
|
||||
github.com/montanaflynn/stats v0.7.1/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow=
|
||||
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
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/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
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/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
|
||||
|
|
@ -120,6 +150,8 @@ github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a/go.mod h1:ul22v+Nro/
|
|||
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||
go.mongodb.org/mongo-driver v1.11.4 h1:4ayjakA013OdpGyL2K3ZqylTac/rMjrJOMZ1EHizXas=
|
||||
go.mongodb.org/mongo-driver v1.11.4/go.mod h1:PTSz5yu21bkT/wXpkS7WR5f0ddqw5quethTUn9WM+2g=
|
||||
go.mongodb.org/mongo-driver v1.16.0 h1:tpRsfBJMROVHKpdGyc1BBEzzjDUWjItxbVSZ8Ls4BQ4=
|
||||
go.mongodb.org/mongo-driver v1.16.0/go.mod h1:oB6AhJQvFQL4LEHyXi6aJzQJtBiTQHiAd83l0GdFaiw=
|
||||
go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
|
|
@ -128,11 +160,18 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y
|
|||
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
golang.org/x/crypto v0.8.0 h1:pd9TJtTueMTVQXzk8E2XESSMQDj/U7OUu0PqJqPXQjQ=
|
||||
golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE=
|
||||
golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M=
|
||||
golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI=
|
||||
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
|
||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 h1:vr/HnozRka3pE4EsMEg1lgkXJkTFJCVUX+S/ZT6wYzM=
|
||||
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842/go.mod h1:XtvwrStGgqGPLc4cjQfWqZHG1YFdYs6swckp8vpsjnc=
|
||||
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
|
||||
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
||||
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.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
|
|
@ -147,6 +186,9 @@ golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qx
|
|||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||
golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM=
|
||||
golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns=
|
||||
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
|
||||
golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac=
|
||||
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
|
|
@ -157,6 +199,8 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ
|
|||
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o=
|
||||
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
|
||||
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
|
|
@ -175,6 +219,8 @@ golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU=
|
|||
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s=
|
||||
golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=
|
||||
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
|
|
@ -182,6 +228,8 @@ golang.org/x/term v0.8.0 h1:n5xxQn2i3PC0yLAbjTpNT85q/Kgzcr2gIoX9OrJUols=
|
|||
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
|
||||
golang.org/x/term v0.9.0 h1:GRRCnKYhdQrD8kfRAdQ6Zcw1P0OcELxGLKJvtjVMZ28=
|
||||
golang.org/x/term v0.9.0/go.mod h1:M6DEAAIenWoTxdKrOltXcmDY3rSplQUkrvaDU5FcQyo=
|
||||
golang.org/x/term v0.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw=
|
||||
golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
|
|
@ -189,6 +237,9 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
|||
golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
|
||||
golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE=
|
||||
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
|
||||
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk=
|
||||
golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
|
||||
|
|
@ -197,6 +248,7 @@ golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBn
|
|||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
|
|
@ -215,6 +267,8 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp
|
|||
google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
|
||||
google.golang.org/grpc v1.48.0 h1:rQOsyJ/8+ufEDJd/Gdsz7HG220Mh9HAhFHRGnIjda0w=
|
||||
google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
|
||||
google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc=
|
||||
google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ=
|
||||
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
|
||||
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
|
||||
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
|
||||
|
|
@ -229,6 +283,8 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ
|
|||
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w=
|
||||
google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
|
||||
google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg=
|
||||
google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
|
|
|
|||
|
|
@ -5,10 +5,11 @@ import (
|
|||
"encoding/binary"
|
||||
|
||||
pb "github.com/PretendoNetwork/grpc-go/friends"
|
||||
nex "github.com/PretendoNetwork/nex-go"
|
||||
friends_wiiu_types "github.com/PretendoNetwork/nex-protocols-go/friends-wiiu/types"
|
||||
nintendo_notifications "github.com/PretendoNetwork/nex-protocols-go/nintendo-notifications"
|
||||
nintendo_notifications_types "github.com/PretendoNetwork/nex-protocols-go/nintendo-notifications/types"
|
||||
"github.com/PretendoNetwork/nex-go/v2"
|
||||
"github.com/PretendoNetwork/nex-go/v2/types"
|
||||
friends_wiiu_types "github.com/PretendoNetwork/nex-protocols-go/v2/friends-wiiu/types"
|
||||
nintendo_notifications "github.com/PretendoNetwork/nex-protocols-go/v2/nintendo-notifications"
|
||||
nintendo_notifications_types "github.com/PretendoNetwork/nex-protocols-go/v2/nintendo-notifications/types"
|
||||
"github.com/PretendoNetwork/wiiu-chat-secure/globals"
|
||||
"google.golang.org/grpc/metadata"
|
||||
)
|
||||
|
|
@ -18,35 +19,35 @@ func SendFriendsNotification(caller uint32, target uint32, ringing bool) {
|
|||
|
||||
presence := friends_wiiu_types.NewNintendoPresenceV2()
|
||||
|
||||
presence.Online = true
|
||||
presence.Online.Value = true
|
||||
presence.GameKey = friends_wiiu_types.NewGameKey()
|
||||
presence.GameServerID = 0x1005A000
|
||||
presence.PID = 1 // This is not a PID, but the amount of times the PID is repeated in bytes in the application data.
|
||||
presence.GatheringID = caller
|
||||
presence.GameServerID.Value = 0x1005A000
|
||||
presence.PID = types.NewPID(1) // This is not a PID, but the amount of times the PID is repeated in bytes in the application data.
|
||||
presence.GatheringID.Value = caller
|
||||
|
||||
if ringing {
|
||||
presence.Unknown2 = 0x65
|
||||
presence.Unknown2.Value = 0x65
|
||||
}
|
||||
|
||||
targetBytes := make([]byte, 4)
|
||||
binary.BigEndian.PutUint32(targetBytes, target)
|
||||
|
||||
presence.ApplicationData = targetBytes
|
||||
presence.ApplicationData.Value = targetBytes
|
||||
|
||||
presence.GameKey.TitleID = 0x000500101005A100
|
||||
presence.GameKey.TitleVersion = 55
|
||||
presence.GameKey.TitleID.Value = 0x000500101005A100
|
||||
presence.GameKey.TitleVersion.Value = 55
|
||||
|
||||
eventObject := nintendo_notifications_types.NewNintendoNotificationEvent()
|
||||
eventObject.Type = nintendo_notifications.NotificationTypes.FriendStartedTitle
|
||||
eventObject.SenderPID = caller
|
||||
eventObject.DataHolder = nex.NewDataHolder()
|
||||
eventObject.DataHolder.SetTypeName("NintendoPresenceV2")
|
||||
eventObject.DataHolder.SetObjectData(presence)
|
||||
eventObject.Type.Value = nintendo_notifications.NotificationTypes.FriendStartedTitle
|
||||
eventObject.SenderPID = types.NewPID(uint64(caller))
|
||||
eventObject.DataHolder = types.NewAnyDataHolder()
|
||||
eventObject.DataHolder.TypeName = types.NewString("NintendoPresenceV2")
|
||||
eventObject.DataHolder.ObjectData = presence
|
||||
|
||||
stream := nex.NewStreamOut(globals.NEXServer)
|
||||
eventObjectBytes := eventObject.Bytes(stream)
|
||||
stream := nex.NewByteStreamOut(globals.SecureEndpoint.LibraryVersions(), globals.SecureEndpoint.ByteStreamSettings())
|
||||
eventObject.WriteTo(stream)
|
||||
|
||||
_, err := globals.GRPCFriendsClient.SendUserNotificationWiiU(ctx, &pb.SendUserNotificationWiiURequest{Pid: target, NotificationData: eventObjectBytes})
|
||||
_, err := globals.GRPCFriendsClient.SendUserNotificationWiiU(ctx, &pb.SendUserNotificationWiiURequest{Pid: target, NotificationData: stream.Bytes()})
|
||||
if err != nil {
|
||||
globals.Logger.Criticalf("Greeting Friends gRPC failed! : %v", err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,38 +0,0 @@
|
|||
package nex_match_making_ext
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
|
||||
"github.com/PretendoNetwork/nex-go"
|
||||
match_making_ext "github.com/PretendoNetwork/nex-protocols-go/match-making-ext"
|
||||
"github.com/PretendoNetwork/wiiu-chat-secure/globals"
|
||||
)
|
||||
|
||||
func EndParticipation(err error, client *nex.Client, callID uint32, idGathering uint32, strMessage string) {
|
||||
globals.Logger.Info("ENDING PARTICIPATION: GID: " + strconv.FormatUint(uint64(idGathering), 10) + ", MESSAGE: " + strMessage)
|
||||
|
||||
rmcResponseStream := nex.NewStreamOut(globals.NEXServer)
|
||||
|
||||
// TODO - Check if this is always true or not, and if not when to set to false
|
||||
rmcResponseStream.WriteBool(true)
|
||||
|
||||
rmcResponseBody := rmcResponseStream.Bytes()
|
||||
|
||||
rmcResponse := nex.NewRMCResponse(match_making_ext.ProtocolID, callID)
|
||||
rmcResponse.SetSuccess(match_making_ext.MethodEndParticipation, rmcResponseBody)
|
||||
|
||||
rmcResponseBytes := rmcResponse.Bytes()
|
||||
|
||||
responsePacket, _ := nex.NewPacketV1(client, nil)
|
||||
|
||||
responsePacket.SetVersion(1)
|
||||
responsePacket.SetSource(0xA1)
|
||||
responsePacket.SetDestination(0xAF)
|
||||
responsePacket.SetType(nex.DataPacket)
|
||||
responsePacket.SetPayload(rmcResponseBytes)
|
||||
|
||||
responsePacket.AddFlag(nex.FlagNeedsAck)
|
||||
responsePacket.AddFlag(nex.FlagReliable)
|
||||
|
||||
globals.NEXServer.Send(responsePacket)
|
||||
}
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
package nex_match_making
|
||||
|
||||
import (
|
||||
nex "github.com/PretendoNetwork/nex-go"
|
||||
match_making "github.com/PretendoNetwork/nex-protocols-go/match-making"
|
||||
match_making_types "github.com/PretendoNetwork/nex-protocols-go/match-making/types"
|
||||
"github.com/PretendoNetwork/wiiu-chat-secure/globals"
|
||||
)
|
||||
|
||||
func FindBySingleID(err error, client *nex.Client, callID uint32, id uint32) {
|
||||
caller := id // Gathering ID and caller are the same here
|
||||
|
||||
result := true
|
||||
|
||||
gathering := match_making_types.NewGathering()
|
||||
gathering.ID = id
|
||||
gathering.OwnerPID = caller
|
||||
gathering.HostPID = caller
|
||||
gathering.MinimumParticipants = 2
|
||||
gathering.MaximumParticipants = 2
|
||||
gathering.Description = "Doors Invite Request"
|
||||
|
||||
dataHolder := nex.NewDataHolder()
|
||||
dataHolder.SetTypeName("Gathering")
|
||||
dataHolder.SetObjectData(gathering)
|
||||
|
||||
rmcResponseStream := nex.NewStreamOut(globals.NEXServer)
|
||||
rmcResponseStream.WriteBool(result)
|
||||
rmcResponseStream.WriteDataHolder(dataHolder)
|
||||
|
||||
rmcResponse := nex.NewRMCResponse(match_making.ProtocolID, callID)
|
||||
rmcResponse.SetSuccess(match_making.MethodFindBySingleID, rmcResponseStream.Bytes())
|
||||
|
||||
rmcResponseBytes := rmcResponse.Bytes()
|
||||
|
||||
responsePacket, _ := nex.NewPacketV1(client, nil)
|
||||
|
||||
responsePacket.SetVersion(1)
|
||||
responsePacket.SetSource(0xA1)
|
||||
responsePacket.SetDestination(0xAF)
|
||||
responsePacket.SetType(nex.DataPacket)
|
||||
responsePacket.SetPayload(rmcResponseBytes)
|
||||
|
||||
responsePacket.AddFlag(nex.FlagNeedsAck)
|
||||
responsePacket.AddFlag(nex.FlagReliable)
|
||||
|
||||
globals.NEXServer.Send(responsePacket)
|
||||
}
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
package nex_match_making
|
||||
|
||||
import (
|
||||
nex "github.com/PretendoNetwork/nex-go"
|
||||
match_making "github.com/PretendoNetwork/nex-protocols-go/match-making"
|
||||
"github.com/PretendoNetwork/wiiu-chat-secure/database"
|
||||
"github.com/PretendoNetwork/wiiu-chat-secure/globals"
|
||||
)
|
||||
|
||||
func GetSessionUrls(err error, client *nex.Client, callID uint32, gid uint32) {
|
||||
var stationUrlStrings []string
|
||||
|
||||
hostpid, _, _ := database.GetCallInfoByCaller(gid)
|
||||
|
||||
stationUrlStrings = globals.NEXServer.FindClientFromPID(hostpid).StationURLs()
|
||||
|
||||
rmcResponseStream := nex.NewStreamOut(globals.NEXServer)
|
||||
rmcResponseStream.WriteListString(stationUrlStrings)
|
||||
|
||||
rmcResponseBody := rmcResponseStream.Bytes()
|
||||
|
||||
// Build response packet
|
||||
rmcResponse := nex.NewRMCResponse(match_making.ProtocolID, callID)
|
||||
rmcResponse.SetSuccess(match_making.MethodGetSessionURLs, rmcResponseBody)
|
||||
|
||||
rmcResponseBytes := rmcResponse.Bytes()
|
||||
|
||||
responsePacket, _ := nex.NewPacketV1(client, nil)
|
||||
|
||||
responsePacket.SetVersion(1)
|
||||
responsePacket.SetSource(0xA1)
|
||||
responsePacket.SetDestination(0xAF)
|
||||
responsePacket.SetType(nex.DataPacket)
|
||||
responsePacket.SetPayload(rmcResponseBytes)
|
||||
|
||||
responsePacket.AddFlag(nex.FlagNeedsAck)
|
||||
responsePacket.AddFlag(nex.FlagReliable)
|
||||
|
||||
globals.NEXServer.Send(responsePacket)
|
||||
}
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
package nex_match_making
|
||||
|
||||
import (
|
||||
nex "github.com/PretendoNetwork/nex-go"
|
||||
match_making "github.com/PretendoNetwork/nex-protocols-go/match-making"
|
||||
"github.com/PretendoNetwork/wiiu-chat-secure/database"
|
||||
"github.com/PretendoNetwork/wiiu-chat-secure/globals"
|
||||
)
|
||||
|
||||
func UnregisterGathering(err error, client *nex.Client, callID uint32, idGathering uint32) {
|
||||
database.EndCall(idGathering)
|
||||
|
||||
rmcResponse := nex.NewRMCResponse(match_making.MethodUnregisterGathering, callID)
|
||||
rmcResponse.SetSuccess(match_making.ProtocolID, []byte{0x01})
|
||||
|
||||
rmcResponseBytes := rmcResponse.Bytes()
|
||||
|
||||
responsePacket, _ := nex.NewPacketV1(client, nil)
|
||||
|
||||
responsePacket.SetVersion(1)
|
||||
responsePacket.SetSource(0xA1)
|
||||
responsePacket.SetDestination(0xAF)
|
||||
responsePacket.SetType(nex.DataPacket)
|
||||
responsePacket.SetPayload(rmcResponseBytes)
|
||||
|
||||
responsePacket.AddFlag(nex.FlagNeedsAck)
|
||||
responsePacket.AddFlag(nex.FlagReliable)
|
||||
|
||||
globals.NEXServer.Send(responsePacket)
|
||||
}
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
package nex_matchmake_extension
|
||||
|
||||
import (
|
||||
//"math/rand"
|
||||
|
||||
nex "github.com/PretendoNetwork/nex-go"
|
||||
"github.com/PretendoNetwork/wiiu-chat-secure/globals"
|
||||
|
||||
matchmake_extension "github.com/PretendoNetwork/nex-protocols-go/matchmake-extension"
|
||||
)
|
||||
|
||||
func CreateMatchmakeSession(err error, client *nex.Client, callID uint32, anyGathering *nex.DataHolder, message string, participationCount uint16) {
|
||||
var gid uint32 = client.PID() // TODO: Random this
|
||||
sessionKey := make([]byte, 32)
|
||||
//rand.Read(sessionKey)
|
||||
|
||||
rmcResponseStream := nex.NewStreamOut(globals.NEXServer)
|
||||
|
||||
rmcResponseStream.WriteUInt32LE(gid)
|
||||
rmcResponseStream.WriteBuffer(sessionKey)
|
||||
|
||||
rmcResponseBody := rmcResponseStream.Bytes()
|
||||
|
||||
rmcResponse := nex.NewRMCResponse(matchmake_extension.ProtocolID, callID)
|
||||
rmcResponse.SetSuccess(matchmake_extension.MethodCreateMatchmakeSession, rmcResponseBody)
|
||||
|
||||
rmcResponseBytes := rmcResponse.Bytes()
|
||||
|
||||
responsePacket, _ := nex.NewPacketV1(client, nil)
|
||||
|
||||
responsePacket.SetVersion(1)
|
||||
responsePacket.SetSource(0xA1)
|
||||
responsePacket.SetDestination(0xAF)
|
||||
responsePacket.SetType(nex.DataPacket)
|
||||
responsePacket.SetPayload(rmcResponseBytes)
|
||||
|
||||
responsePacket.AddFlag(nex.FlagNeedsAck)
|
||||
responsePacket.AddFlag(nex.FlagReliable)
|
||||
|
||||
globals.NEXServer.Send(responsePacket)
|
||||
}
|
||||
|
|
@ -1,56 +1,48 @@
|
|||
package nex_matchmake_extension
|
||||
package matchmake_extension
|
||||
|
||||
import (
|
||||
nex "github.com/PretendoNetwork/nex-go"
|
||||
nex "github.com/PretendoNetwork/nex-go/v2"
|
||||
"github.com/PretendoNetwork/nex-go/v2/types"
|
||||
"github.com/PretendoNetwork/wiiu-chat-secure/database"
|
||||
"github.com/PretendoNetwork/wiiu-chat-secure/globals"
|
||||
|
||||
matchmake_extension "github.com/PretendoNetwork/nex-protocols-go/matchmake-extension"
|
||||
"github.com/PretendoNetwork/nex-protocols-go/notifications"
|
||||
notifications_types "github.com/PretendoNetwork/nex-protocols-go/notifications/types"
|
||||
matchmake_extension "github.com/PretendoNetwork/nex-protocols-go/v2/matchmake-extension"
|
||||
notifications "github.com/PretendoNetwork/nex-protocols-go/v2/notifications"
|
||||
notifications_types "github.com/PretendoNetwork/nex-protocols-go/v2/notifications/types"
|
||||
)
|
||||
|
||||
func GetFriendNotificationData(err error, client *nex.Client, callID uint32, uiType int32) {
|
||||
dataList := make([]*notifications_types.NotificationEvent, 0)
|
||||
func GetFriendNotificationData(err error, packet nex.PacketInterface, callID uint32, uiType *types.PrimitiveS32) (*nex.RMCMessage, *nex.Error) {
|
||||
dataList := types.NewList[*notifications_types.NotificationEvent]()
|
||||
|
||||
caller, target, ringing := database.GetCallInfoByTarget(client.PID())
|
||||
caller, target, ringing := database.GetCallInfoByTarget(packet.Sender().PID().Value())
|
||||
|
||||
// TODO: Multiple calls. Wii U Chat can handle it, but we don't support it yet
|
||||
if caller != 0 && target == client.PID() && ringing {
|
||||
if caller != 0 && target == packet.Sender().PID().Value() && ringing {
|
||||
// Being called
|
||||
notificationType := notifications.BuildNotificationType(notifications.NotificationCategories.RequestJoinGathering, notifications.NotificationSubTypes.RequestJoinGathering.None)
|
||||
|
||||
notification := notifications_types.NewNotificationEvent()
|
||||
|
||||
notification.PIDSource = caller
|
||||
notification.Type = notificationType
|
||||
notification.Param1 = caller
|
||||
notification.Param2 = target
|
||||
notification.StrParam = "Invite Request"
|
||||
notification.PIDSource = types.NewPID(caller)
|
||||
notification.Type.Value = notificationType
|
||||
notification.Param1.Value = uint32(caller)
|
||||
notification.Param2.Value = uint32(target)
|
||||
notification.StrParam.Value = "Invite Request"
|
||||
|
||||
dataList = append(dataList, notification)
|
||||
dataList.Append(notification)
|
||||
}
|
||||
|
||||
rmcResponseStream := nex.NewStreamOut(globals.NEXServer)
|
||||
rmcResponseStream.WriteListStructure(dataList)
|
||||
connection := packet.Sender().(*nex.PRUDPConnection)
|
||||
endpoint := connection.Endpoint().(*nex.PRUDPEndPoint)
|
||||
|
||||
rmcResponseStream := nex.NewByteStreamOut(endpoint.LibraryVersions(), endpoint.ByteStreamSettings())
|
||||
dataList.WriteTo(rmcResponseStream)
|
||||
|
||||
rmcResponseBody := rmcResponseStream.Bytes()
|
||||
|
||||
rmcResponse := nex.NewRMCResponse(matchmake_extension.ProtocolID, callID)
|
||||
rmcResponse.SetSuccess(matchmake_extension.MethodGetFriendNotificationData, rmcResponseBody)
|
||||
rmcResponse := nex.NewRMCSuccess(endpoint, rmcResponseBody)
|
||||
rmcResponse.ProtocolID = matchmake_extension.ProtocolID
|
||||
rmcResponse.MethodID = matchmake_extension.MethodGetFriendNotificationData
|
||||
rmcResponse.CallID = callID
|
||||
|
||||
rmcResponseBytes := rmcResponse.Bytes()
|
||||
|
||||
responsePacket, _ := nex.NewPacketV1(client, nil)
|
||||
|
||||
responsePacket.SetVersion(1)
|
||||
responsePacket.SetSource(0xA1)
|
||||
responsePacket.SetDestination(0xAF)
|
||||
responsePacket.SetType(nex.DataPacket)
|
||||
responsePacket.SetPayload(rmcResponseBytes)
|
||||
|
||||
responsePacket.AddFlag(nex.FlagNeedsAck)
|
||||
responsePacket.AddFlag(nex.FlagReliable)
|
||||
|
||||
globals.NEXServer.Send(responsePacket)
|
||||
return rmcResponse, nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,35 +0,0 @@
|
|||
package nex_matchmake_extension
|
||||
|
||||
import (
|
||||
nex "github.com/PretendoNetwork/nex-go"
|
||||
matchmake_extension "github.com/PretendoNetwork/nex-protocols-go/matchmake-extension"
|
||||
"github.com/PretendoNetwork/wiiu-chat-secure/database"
|
||||
"github.com/PretendoNetwork/wiiu-chat-secure/globals"
|
||||
)
|
||||
|
||||
func JoinMatchmakeSessionEx(err error, client *nex.Client, callID uint32, gid uint32, strMessage string, dontCareMyBlockList bool, participationCount uint16) {
|
||||
globals.Logger.Infof("gid: %d, strMessage: %s, dontCareMyBlockList: %t, participationCount: %d\r\n", gid, strMessage, dontCareMyBlockList, participationCount)
|
||||
|
||||
database.EndCallRinging(gid)
|
||||
|
||||
output := nex.NewStreamOut(globals.NEXServer)
|
||||
output.WriteBuffer(make([]byte, 32))
|
||||
|
||||
rmcResponse := nex.NewRMCResponse(matchmake_extension.ProtocolID, callID)
|
||||
rmcResponse.SetSuccess(matchmake_extension.MethodJoinMatchmakeSessionEx, output.Bytes())
|
||||
|
||||
rmcResponseBytes := rmcResponse.Bytes()
|
||||
|
||||
responsePacket, _ := nex.NewPacketV1(client, nil)
|
||||
|
||||
responsePacket.SetVersion(1)
|
||||
responsePacket.SetSource(0xA1)
|
||||
responsePacket.SetDestination(0xAF)
|
||||
responsePacket.SetType(nex.DataPacket)
|
||||
responsePacket.SetPayload(rmcResponseBytes)
|
||||
|
||||
responsePacket.AddFlag(nex.FlagNeedsAck)
|
||||
responsePacket.AddFlag(nex.FlagReliable)
|
||||
|
||||
globals.NEXServer.Send(responsePacket)
|
||||
}
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
package nex_matchmake_extension
|
||||
|
||||
import (
|
||||
nex "github.com/PretendoNetwork/nex-go"
|
||||
"github.com/PretendoNetwork/wiiu-chat-secure/globals"
|
||||
|
||||
matchmake_extension "github.com/PretendoNetwork/nex-protocols-go/matchmake-extension"
|
||||
)
|
||||
|
||||
func OpenParticipation(err error, client *nex.Client, callID uint32, gid uint32) {
|
||||
// TODO: Implement this
|
||||
|
||||
// Build response packet
|
||||
rmcResponse := nex.NewRMCResponse(matchmake_extension.ProtocolID, callID)
|
||||
rmcResponse.SetSuccess(matchmake_extension.MethodOpenParticipation, nil)
|
||||
|
||||
rmcResponseBytes := rmcResponse.Bytes()
|
||||
|
||||
responsePacket, _ := nex.NewPacketV1(client, nil)
|
||||
|
||||
responsePacket.SetVersion(1)
|
||||
responsePacket.SetSource(0xA1)
|
||||
responsePacket.SetDestination(0xAF)
|
||||
responsePacket.SetType(nex.DataPacket)
|
||||
responsePacket.SetPayload(rmcResponseBytes)
|
||||
|
||||
responsePacket.AddFlag(nex.FlagNeedsAck)
|
||||
responsePacket.AddFlag(nex.FlagReliable)
|
||||
|
||||
globals.NEXServer.Send(responsePacket)
|
||||
}
|
||||
|
|
@ -1,64 +1,59 @@
|
|||
package nex_matchmake_extension
|
||||
package matchmake_extension
|
||||
|
||||
import (
|
||||
nex "github.com/PretendoNetwork/nex-go"
|
||||
nex "github.com/PretendoNetwork/nex-go/v2"
|
||||
"github.com/PretendoNetwork/nex-go/v2/types"
|
||||
"github.com/PretendoNetwork/wiiu-chat-secure/database"
|
||||
"github.com/PretendoNetwork/wiiu-chat-secure/globals"
|
||||
"github.com/PretendoNetwork/wiiu-chat-secure/grpc"
|
||||
nex_notifications "github.com/PretendoNetwork/wiiu-chat-secure/nex/notifications"
|
||||
|
||||
matchmake_extension "github.com/PretendoNetwork/nex-protocols-go/matchmake-extension"
|
||||
"github.com/PretendoNetwork/nex-protocols-go/notifications"
|
||||
matchmake_extension "github.com/PretendoNetwork/nex-protocols-go/v2/matchmake-extension"
|
||||
notifications "github.com/PretendoNetwork/nex-protocols-go/v2/notifications"
|
||||
)
|
||||
|
||||
func UpdateNotificationData(err error, client *nex.Client, callID uint32, uiType uint32, uiParam1 uint32, uiParam2 uint32, strParam string) {
|
||||
func UpdateNotificationData(err error, packet nex.PacketInterface, callID uint32, uiType *types.PrimitiveU32, uiParam1 *types.PrimitiveU32, uiParam2 *types.PrimitiveU32, strParam *types.String) (*nex.RMCMessage, *nex.Error) {
|
||||
globals.Logger.Infof("uiType: %d, uiParam1: %d, uiParam2: %d, strParam: %s\r\n", uiType, uiParam1, uiParam2, strParam)
|
||||
recipientClient := globals.NEXServer.FindClientFromPID(uiParam2)
|
||||
recipientClient := globals.SecureEndpoint.FindConnectionByPID(uint64(uiParam2.Value))
|
||||
|
||||
if uiType == notifications.NotificationCategories.RequestJoinGathering {
|
||||
if uiType.Value == notifications.NotificationCategories.RequestJoinGathering {
|
||||
notificationType := notifications.BuildNotificationType(notifications.NotificationCategories.RequestJoinGathering, notifications.NotificationSubTypes.RequestJoinGathering.None)
|
||||
database.NewCall(client.PID(), uiParam2)
|
||||
database.NewCall(uint32(packet.Sender().PID().Value()), uiParam2.Value)
|
||||
|
||||
// If they don't have a session with the app, tell Friends to alert them on the HOME menu.
|
||||
if recipientClient != nil && recipientClient.StationURLs() != nil {
|
||||
nex_notifications.ProcessNotificationEvent(callID, client.PID(), notificationType, uiParam1, uiParam2, strParam)
|
||||
if recipientClient != nil && recipientClient.StationURLs != nil {
|
||||
nex_notifications.ProcessNotificationEvent(callID, uint32(packet.Sender().PID().Value()), notificationType, uiParam1.Value, uiParam2.Value, strParam.Value)
|
||||
} else {
|
||||
grpc.SendFriendsNotification(client.PID(), uiParam2, true)
|
||||
grpc.SendFriendsNotification(uint32(packet.Sender().PID().Value()), uiParam2.Value, true)
|
||||
}
|
||||
}
|
||||
|
||||
if uiType == notifications.NotificationCategories.EndGathering {
|
||||
if uiType.Value == notifications.NotificationCategories.EndGathering {
|
||||
notificationType := notifications.BuildNotificationType(notifications.NotificationCategories.EndGathering, notifications.NotificationSubTypes.EndGathering.None)
|
||||
database.EndCall(uiParam1)
|
||||
database.EndCall(uiParam1.Value)
|
||||
|
||||
// Alert the other side we aren't calling anymore.
|
||||
|
||||
if recipientClient != nil && recipientClient.StationURLs() != nil {
|
||||
nex_notifications.ProcessNotificationEvent(callID, client.PID(), notificationType, uiParam1, uiParam2, strParam)
|
||||
if recipientClient != nil && recipientClient.StationURLs != nil {
|
||||
nex_notifications.ProcessNotificationEvent(callID, uint32(packet.Sender().PID().Value()), notificationType, uiParam1.Value, uiParam2.Value, strParam.Value)
|
||||
} else {
|
||||
grpc.SendFriendsNotification(client.PID(), uiParam2, false)
|
||||
grpc.SendFriendsNotification(uint32(packet.Sender().PID().Value()), uiParam2.Value, false)
|
||||
}
|
||||
|
||||
// The user must be kicked, otherwise the app hangs forever.
|
||||
globals.NEXServer.TimeoutKick(client)
|
||||
// globals.NEXServer.TimeoutKick(client)
|
||||
// TODO: Use timeout manager
|
||||
}
|
||||
|
||||
// Build response packet
|
||||
rmcResponse := nex.NewRMCResponse(matchmake_extension.ProtocolID, callID)
|
||||
rmcResponse.SetSuccess(matchmake_extension.MethodUpdateNotificationData, nil)
|
||||
|
||||
rmcResponseBytes := rmcResponse.Bytes()
|
||||
connection := packet.Sender().(*nex.PRUDPConnection)
|
||||
endpoint := connection.Endpoint().(*nex.PRUDPEndPoint)
|
||||
|
||||
responsePacket, _ := nex.NewPacketV1(client, nil)
|
||||
rmcResponse := nex.NewRMCSuccess(endpoint, nil)
|
||||
rmcResponse.ProtocolID = matchmake_extension.ProtocolID
|
||||
rmcResponse.MethodID = matchmake_extension.MethodUpdateNotificationData
|
||||
rmcResponse.CallID = callID
|
||||
|
||||
responsePacket.SetVersion(1)
|
||||
responsePacket.SetSource(0xA1)
|
||||
responsePacket.SetDestination(0xAF)
|
||||
responsePacket.SetType(nex.DataPacket)
|
||||
responsePacket.SetPayload(rmcResponseBytes)
|
||||
|
||||
responsePacket.AddFlag(nex.FlagNeedsAck)
|
||||
responsePacket.AddFlag(nex.FlagReliable)
|
||||
|
||||
globals.NEXServer.Send(responsePacket)
|
||||
return rmcResponse, nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,44 +1,34 @@
|
|||
package nex_notifications
|
||||
|
||||
import (
|
||||
nex "github.com/PretendoNetwork/nex-go"
|
||||
"github.com/PretendoNetwork/nex-protocols-go/notifications"
|
||||
notifications_types "github.com/PretendoNetwork/nex-protocols-go/notifications/types"
|
||||
nex "github.com/PretendoNetwork/nex-go/v2"
|
||||
"github.com/PretendoNetwork/nex-go/v2/types"
|
||||
notifications "github.com/PretendoNetwork/nex-protocols-go/v2/notifications"
|
||||
notifications_types "github.com/PretendoNetwork/nex-protocols-go/v2/notifications/types"
|
||||
"github.com/PretendoNetwork/wiiu-chat-secure/globals"
|
||||
)
|
||||
|
||||
func ProcessNotificationEvent(callID uint32, pidSource uint32, uiType uint32, uiParam1 uint32, uiParam2 uint32, strParam string) {
|
||||
event := notifications_types.NewNotificationEvent()
|
||||
|
||||
event.PIDSource = pidSource // Sender PID
|
||||
event.Type = uiType // Notification type
|
||||
event.Param1 = uiParam1 // Gathering ID
|
||||
event.Param2 = uiParam2 // Recipient PID
|
||||
event.StrParam = strParam // Unknown
|
||||
event.PIDSource = types.NewPID(uint64(pidSource)) // Sender PID
|
||||
event.Type.Value = uiType // Notification type
|
||||
event.Param1.Value = uiParam1 // Gathering ID
|
||||
event.Param2.Value = uiParam2 // Recipient PID
|
||||
event.StrParam.Value = strParam // Unknown
|
||||
|
||||
eventObject := nex.NewStreamOut(globals.NEXServer)
|
||||
eventObject.WriteStructure(event)
|
||||
|
||||
rmcRequest := nex.NewRMCRequest()
|
||||
rmcRequest.SetProtocolID(notifications.ProtocolID)
|
||||
rmcRequest.SetCallID(0xFFFF + callID)
|
||||
rmcRequest.SetMethodID(notifications.MethodProcessNotificationEvent)
|
||||
rmcRequest.SetParameters(eventObject.Bytes())
|
||||
eventObject := nex.NewByteStreamOut(globals.SecureServer.LibraryVersions, globals.SecureEndpoint.ByteStreamSettings()) // TODO: use the endpoint library versions/byte stream settings
|
||||
event.WriteTo(eventObject)
|
||||
|
||||
rmcRequest := nex.NewRMCRequest(notifications.NewProtocol().Endpoint()) // TODO: check
|
||||
rmcRequestBytes := rmcRequest.Bytes()
|
||||
|
||||
targetClient := globals.NEXServer.FindClientFromPID(uiParam2)
|
||||
targetClient := globals.SecureEndpoint.FindConnectionByPID(uint64(uiParam2))
|
||||
|
||||
requestPacket, _ := nex.NewPacketV1(targetClient, nil)
|
||||
requestPacket, _ := nex.NewPRUDPPacketV1(globals.SecureServer, targetClient, nil)
|
||||
|
||||
requestPacket.SetVersion(1)
|
||||
requestPacket.SetSource(0xA1)
|
||||
requestPacket.SetDestination(0xAF)
|
||||
requestPacket.SetType(nex.DataPacket)
|
||||
requestPacket.SetType(1) // TODO: is this correct?
|
||||
requestPacket.SetPayload(rmcRequestBytes)
|
||||
|
||||
requestPacket.AddFlag(nex.FlagNeedsAck)
|
||||
requestPacket.AddFlag(nex.FlagReliable)
|
||||
|
||||
globals.NEXServer.Send(requestPacket)
|
||||
globals.SecureServer.Send(requestPacket)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,31 @@
|
|||
package nex
|
||||
|
||||
import (
|
||||
nat_traversal "github.com/PretendoNetwork/nex-protocols-common-go/nat-traversal"
|
||||
secureconnection "github.com/PretendoNetwork/nex-protocols-common-go/secure-connection"
|
||||
|
||||
common_matchmaking "github.com/PretendoNetwork/nex-protocols-common-go/v2/match-making"
|
||||
common_matchmakingext "github.com/PretendoNetwork/nex-protocols-common-go/v2/match-making-ext"
|
||||
common_nattraversal "github.com/PretendoNetwork/nex-protocols-common-go/v2/nat-traversal"
|
||||
common_secure "github.com/PretendoNetwork/nex-protocols-common-go/v2/secure-connection"
|
||||
matchmaking "github.com/PretendoNetwork/nex-protocols-go/v2/match-making"
|
||||
matchmakingext "github.com/PretendoNetwork/nex-protocols-go/v2/match-making-ext"
|
||||
nattraversal "github.com/PretendoNetwork/nex-protocols-go/v2/nat-traversal"
|
||||
secure "github.com/PretendoNetwork/nex-protocols-go/v2/secure-connection"
|
||||
"github.com/PretendoNetwork/wiiu-chat-secure/globals"
|
||||
)
|
||||
|
||||
func registerCommonProtocols() {
|
||||
nat_traversal.NewCommonNATTraversalProtocol(globals.NEXServer)
|
||||
secureconnection.NewCommonSecureConnectionProtocol(globals.NEXServer)
|
||||
secureProtocol := secure.NewProtocol()
|
||||
globals.SecureEndpoint.RegisterServiceProtocol(secureProtocol)
|
||||
common_secure.NewCommonProtocol(secureProtocol)
|
||||
|
||||
natTraversalProtocol := nattraversal.NewProtocol()
|
||||
globals.SecureEndpoint.RegisterServiceProtocol(natTraversalProtocol)
|
||||
common_nattraversal.NewCommonProtocol(natTraversalProtocol)
|
||||
|
||||
matchMakingProtocol := matchmaking.NewProtocol()
|
||||
globals.SecureEndpoint.RegisterServiceProtocol(matchMakingProtocol)
|
||||
common_matchmaking.NewCommonProtocol(matchMakingProtocol)
|
||||
|
||||
matchMakingExtProtocol := matchmakingext.NewProtocol()
|
||||
globals.SecureEndpoint.RegisterServiceProtocol(matchMakingExtProtocol)
|
||||
common_matchmakingext.NewCommonProtocol(matchMakingExtProtocol)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,31 +1,16 @@
|
|||
package nex
|
||||
|
||||
import (
|
||||
match_making "github.com/PretendoNetwork/nex-protocols-go/match-making"
|
||||
match_making_ext "github.com/PretendoNetwork/nex-protocols-go/match-making-ext"
|
||||
matchmake_extension "github.com/PretendoNetwork/nex-protocols-go/matchmake-extension"
|
||||
common_matchmake_extension "github.com/PretendoNetwork/nex-protocols-common-go/v2/matchmake-extension"
|
||||
matchmake_extension "github.com/PretendoNetwork/nex-protocols-go/v2/matchmake-extension"
|
||||
"github.com/PretendoNetwork/wiiu-chat-secure/globals"
|
||||
nex_match_making "github.com/PretendoNetwork/wiiu-chat-secure/nex/match-making"
|
||||
nex_match_making_ext "github.com/PretendoNetwork/wiiu-chat-secure/nex/match-making-ext"
|
||||
nex_matchmake_extension "github.com/PretendoNetwork/wiiu-chat-secure/nex/matchmake-extension"
|
||||
)
|
||||
|
||||
func registerNEXProtocols() {
|
||||
matchmakeExtensionProtocol := matchmake_extension.NewMatchmakeExtensionProtocol(globals.NEXServer)
|
||||
|
||||
matchmakeExtensionProtocol.OpenParticipation(nex_matchmake_extension.OpenParticipation)
|
||||
matchmakeExtensionProtocol.CreateMatchmakeSession(nex_matchmake_extension.CreateMatchmakeSession)
|
||||
matchmakeExtensionProtocol.UpdateNotificationData(nex_matchmake_extension.UpdateNotificationData)
|
||||
matchmakeExtensionProtocol.GetFriendNotificationData(nex_matchmake_extension.GetFriendNotificationData)
|
||||
matchmakeExtensionProtocol.JoinMatchmakeSessionEx(nex_matchmake_extension.JoinMatchmakeSessionEx)
|
||||
|
||||
matchMakingProtocol := match_making.NewMatchMakingProtocol(globals.NEXServer)
|
||||
|
||||
matchMakingProtocol.UnregisterGathering(nex_match_making.UnregisterGathering)
|
||||
matchMakingProtocol.FindBySingleID(nex_match_making.FindBySingleID)
|
||||
matchMakingProtocol.GetSessionURLs(nex_match_making.GetSessionUrls)
|
||||
|
||||
matchMakingExtProtocol := match_making_ext.NewMatchMakingExtProtocol(globals.NEXServer)
|
||||
|
||||
matchMakingExtProtocol.EndParticipation(nex_match_making_ext.EndParticipation)
|
||||
matchmakeExtensionProtocol := matchmake_extension.NewProtocol()
|
||||
globals.SecureEndpoint.RegisterServiceProtocol(matchmakeExtensionProtocol)
|
||||
common_matchmake_extension.NewCommonProtocol(matchmakeExtensionProtocol)
|
||||
matchmakeExtensionProtocol.GetFriendNotificationData = nex_matchmake_extension.GetFriendNotificationData
|
||||
matchmakeExtensionProtocol.UpdateNotificationData = nex_matchmake_extension.UpdateNotificationData
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,32 +2,28 @@ package nex
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
nex "github.com/PretendoNetwork/nex-go"
|
||||
_ "github.com/PretendoNetwork/nex-protocols-go"
|
||||
nex "github.com/PretendoNetwork/nex-go/v2"
|
||||
_ "github.com/PretendoNetwork/nex-protocols-go/v2"
|
||||
"github.com/PretendoNetwork/wiiu-chat-secure/globals"
|
||||
)
|
||||
|
||||
func StartNEXServer() {
|
||||
globals.NEXServer = nex.NewServer()
|
||||
globals.NEXServer.SetPRUDPVersion(1)
|
||||
globals.NEXServer.SetPRUDPProtocolMinorVersion(2)
|
||||
globals.NEXServer.SetKerberosPassword(os.Getenv("PN_WIIU_CHAT_KERBEROS_PASSWORD"))
|
||||
globals.NEXServer.SetAccessKey("e7a47214")
|
||||
globals.NEXServer.SetDefaultNEXVersion(&nex.NEXVersion{
|
||||
Major: 3,
|
||||
Minor: 4,
|
||||
Patch: 2,
|
||||
})
|
||||
globals.NEXServer.SetPingTimeout(65535)
|
||||
globals.SecureServer = nex.NewPRUDPServer()
|
||||
|
||||
globals.NEXServer.On("Data", func(packet *nex.PacketV1) {
|
||||
request := packet.RMCRequest()
|
||||
globals.SecureEndpoint = nex.NewPRUDPEndPoint(1)
|
||||
globals.SecureEndpoint.IsSecureEndPoint = true
|
||||
globals.SecureEndpoint.SetAccessKey("e7a47214")
|
||||
globals.SecureServer.LibraryVersions.SetDefault(nex.NewLibraryVersion(3, 4, 2))
|
||||
globals.SecureServer.BindPRUDPEndPoint(globals.SecureEndpoint)
|
||||
// globals.SecureServer.SetPingTimeout(65535) // TODO: what to replace with
|
||||
|
||||
globals.SecureEndpoint.OnData(func(packet nex.PacketInterface) {
|
||||
request := packet.RMCMessage()
|
||||
|
||||
fmt.Println("==WiiU Chat - 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("======================")
|
||||
})
|
||||
|
||||
|
|
@ -35,5 +31,5 @@ func StartNEXServer() {
|
|||
registerCommonProtocols()
|
||||
registerNEXProtocols()
|
||||
|
||||
globals.NEXServer.Listen(":60005")
|
||||
globals.SecureServer.Listen(60005)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user