mirror of
https://github.com/EpinelPS/EpinelPS.git
synced 2025-12-14 16:04:36 +01:00
Initial commit
This commit is contained in:
34
nksrv/LobbyServer/Msgs/Auth/DoEnterServer.cs
Normal file
34
nksrv/LobbyServer/Msgs/Auth/DoEnterServer.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
using Google.Protobuf;
|
||||
using nksrv.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace nksrv.LobbyServer.Msgs.Auth
|
||||
{
|
||||
[PacketPath("/auth/enterserver")]
|
||||
public class GetUserOnlineStateLog : LobbyMsgHandler
|
||||
{
|
||||
protected override async Task HandleAsync()
|
||||
{
|
||||
var req = await ReadData<EnterServerRequest>();
|
||||
|
||||
var response = new EnterServerResponse();
|
||||
var rsp = LobbyHandler.GenGameClientTok(req.ClientPublicKey, req.AuthToken);
|
||||
response.GameClientToken = rsp.ClientAuthToken;
|
||||
response.FeatureDataInfo = new NetFeatureDataInfo() { UseFeatureData = true };
|
||||
response.Identifier = new NetLegacyUserIdentifier() { Server = 21769, Usn = 10984769 };
|
||||
response.ShouldRestartAfter = Duration.FromTimeSpan(TimeSpan.FromSeconds(86400));
|
||||
|
||||
// This was probably the public key for communication at some point during the game's development
|
||||
// But, the developers chose to hardcode server public key in the client, which prevents this
|
||||
// private server from "just working", so thats why hex patch is required.
|
||||
// The only point of encrypting packets is to make it harder for me to develop this and users to use this.
|
||||
response.EncryptionToken = ByteString.CopyFromUtf8(rsp.ClientAuthToken);
|
||||
WriteData(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
18
nksrv/LobbyServer/Msgs/Auth/DoIntlAuth.cs
Normal file
18
nksrv/LobbyServer/Msgs/Auth/DoIntlAuth.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using nksrv.Utils;
|
||||
|
||||
namespace nksrv.LobbyServer.Msgs.Auth
|
||||
{
|
||||
[PacketPath("/auth/intl")]
|
||||
public class DoIntlAuth : LobbyMsgHandler
|
||||
{
|
||||
protected override async Task HandleAsync()
|
||||
{
|
||||
var req = await ReadData<ReqAuthIntl>();
|
||||
|
||||
var response = new AuthIntlResponse();
|
||||
//response.BanInfo = new NetBanInfo() { BanId = 123, Description = "The server admin is sad today because the hinge on his HP laptop broke which happened to be an HP Elitebook 8470p, and the RAM controller exploded and then fixed itself, please contact him", StartAt = Timestamp.FromDateTime(DateTime.UtcNow), EndAt = Timestamp.FromDateTime(DateTime.UtcNow.AddDays(256)) };
|
||||
response.AuthSuccess = new NetAuthSuccess() { AuthToken = req.Token, CentauriZoneId = "84", FirstAuth = "", PurchaseRestriction = new NetUserPurchaseRestriction() { PurchaseRestriction = PurchaseRestriction.Unknown2, UpdatedAt = 638546758794611090 } };
|
||||
WriteData(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user