Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
hauntii committed Jul 6, 2023
1 parent a63b2dc commit 73fffb1
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 23 deletions.
2 changes: 1 addition & 1 deletion database/connect_mongo.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ var callsCollection *mongo.Collection
var tourneysCollection *mongo.Collection

func connectMongo() {
mongoClient, _ = mongo.NewClient(options.Client().ApplyURI(os.Getenv("MONGO_URI")))
mongoClient, _ = mongo.NewClient(options.Client().ApplyURI(os.Getenv("PN_WIIU_CHAT_MONGO_URI")))
mongoContext, _ = context.WithTimeout(context.Background(), 10*time.Second)
_ = mongoClient.Connect(mongoContext)

Expand Down
10 changes: 0 additions & 10 deletions nex/matchmake-extension/get_friend_notification_data.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package nex_matchmake_extension

import (
"fmt"

nex "github.com/PretendoNetwork/nex-go"
"github.com/PretendoNetwork/wiiu-chat-secure/database"
"github.com/PretendoNetwork/wiiu-chat-secure/globals"
Expand All @@ -13,14 +11,6 @@ import (
)

func GetFriendNotificationData(err error, client *nex.Client, callID uint32, uiType int32) {
fmt.Println(client.PID()) // DEBUG

/*if !isUserAllowed(client.PID()) {
globals.NEXServer.Kick(client)
// get outta here
}*/
// pls stay, whitelist is gone

dataList := make([]*notifications_types.NotificationEvent, 0)

caller, target, ringing := database.GetCallInfoByTarget(client.PID())
Expand Down
4 changes: 1 addition & 3 deletions nex/matchmake-extension/join_matchmake_session_ex.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
package nex_matchmake_extension

import (
"fmt"

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) {
fmt.Printf("gid: %d, strMessage: %s, dontCareMyBlockList: %t, participationCount: %d\r\n", gid, strMessage, dontCareMyBlockList, participationCount)
globals.Logger.Infof("gid: %d, strMessage: %s, dontCareMyBlockList: %t, participationCount: %d\r\n", gid, strMessage, dontCareMyBlockList, participationCount)

database.EndCallRinging(gid)

Expand Down
10 changes: 1 addition & 9 deletions nex/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func StartNEXServer() {
globals.NEXServer = nex.NewServer()
globals.NEXServer.SetPRUDPVersion(1)
globals.NEXServer.SetPRUDPProtocolMinorVersion(2)
globals.NEXServer.SetKerberosPassword(os.Getenv("KERBEROS_PASSWORD"))
globals.NEXServer.SetKerberosPassword(os.Getenv("PN_WIIU_CHAT_KERBEROS_PASSWORD"))
globals.NEXServer.SetAccessKey("e7a47214")
globals.NEXServer.SetDefaultNEXVersion(&nex.NEXVersion{
Major: 3,
Expand All @@ -31,14 +31,6 @@ func StartNEXServer() {
fmt.Println("======================")
})

globals.NEXServer.On("Kick", func(packet *nex.PacketV1) {
fmt.Println("Kick client event called")
})

globals.NEXServer.On("Disconnect", func(packet *nex.PacketV1) {
fmt.Println("Disconnect client event called")
})

// * Register the common handlers first so that they can be overridden if needed
registerCommonProtocols()
registerNEXProtocols()
Expand Down

0 comments on commit 73fffb1

Please sign in to comment.