-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from ashquarky/v2-update
- Loading branch information
Showing
30 changed files
with
326 additions
and
787 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,8 +23,11 @@ go.work.sum | |
|
||
# custom | ||
.vscode | ||
.idea | ||
.env | ||
build | ||
log | ||
*.pem | ||
*.key | ||
*.key | ||
*.pcap | ||
*.pcapng |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
63 changes: 0 additions & 63 deletions
63
database/get_rankings_by_category_and_ranking_order_param.go
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package globals | ||
|
||
import ( | ||
"github.com/PretendoNetwork/nex-go/v2" | ||
"github.com/PretendoNetwork/nex-go/v2/types" | ||
"strconv" | ||
) | ||
|
||
var AuthenticationServerAccount *nex.Account | ||
|
||
var SecureServerAccount *nex.Account | ||
|
||
func InitAccounts() { | ||
AuthenticationServerAccount = nex.NewAccount(types.NewPID(1), "Quazal Authentication", KerberosPassword) | ||
SecureServerAccount = nex.NewAccount(types.NewPID(2), "Quazal Rendez-Vous", KerberosPassword) | ||
} | ||
|
||
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 { | ||
Logger.Error(err.Error()) | ||
return nil, nex.NewError(nex.ResultCodes.RendezVous.InvalidUsername, "Invalid username") | ||
} | ||
|
||
pid := types.NewPID(uint64(pidInt)) | ||
|
||
password, errorCode := PasswordFromPID(pid) | ||
if errorCode != 0 { | ||
Logger.Errorf("Password err: %v", errorCode) | ||
return nil, nex.NewError(errorCode, "Failed to get password from PID") | ||
} | ||
|
||
account := nex.NewAccount(pid, username, password) | ||
|
||
return account, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,36 @@ | ||
module github.com/PretendoNetwork/minecraft-wiiu | ||
|
||
go 1.19 | ||
go 1.21 | ||
|
||
replace github.com/PretendoNetwork/nex-protocols-common-go => ./nex-protocols-common-go | ||
toolchain go1.21.9 | ||
|
||
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.55 | ||
github.com/PretendoNetwork/nex-go/v2 v2.0.2 | ||
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 | ||
github.com/lib/pq v1.10.9 | ||
google.golang.org/grpc v1.59.0 | ||
google.golang.org/grpc v1.63.2 | ||
) | ||
|
||
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.17.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.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.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-20231006140011-7918f672742d // indirect | ||
golang.org/x/mod v0.13.0 // indirect | ||
golang.org/x/net v0.17.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-20231016165738-49dd2c1f3d0b // indirect | ||
google.golang.org/protobuf v1.31.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/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/googleapis/rpc v0.0.0-20240415180920-8c6c420018be // indirect | ||
google.golang.org/protobuf v1.33.0 // indirect | ||
) |
Oops, something went wrong.