-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRedirectorComponent.cs
More file actions
72 lines (65 loc) · 2.25 KB
/
RedirectorComponent.cs
File metadata and controls
72 lines (65 loc) · 2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
using Blaze3SDK.Blaze.Redirector;
using Blaze3SDK.Components;
using BlazeCommon;
namespace TheDirector;
internal class RedirectorComponent : RedirectorComponentBase.Server
{
public override Task<ServerInstanceInfo> GetServerInstanceAsync(ServerInstanceRequest request, BlazeRpcContext context)
{
var responseData = new ServerInstanceInfo
{
mAddress = new ServerAddress
{
IpAddress = new IpAddress
{
mHostname = Program.PublicIp,
mIp = Util.GetIPAddressAsUInt(Program.PublicIp),
},
},
mMessages = new List<string>
{
{"You are now connecting to a private server Zamboni\nNot affiliated with EA Sports"}
},
mSecure = false,
};
switch (request.mClientName)
{
case "NHL10":
{
responseData.mAddress.IpAddress = responseData.mAddress.IpAddress.Value with { mPort = 13337 };
break;
}
case "NHL11":
{
responseData.mAddress.IpAddress = responseData.mAddress.IpAddress.Value with { mPort = 13367 };
break;
}
case "NHL12":
{
responseData.mAddress.IpAddress = responseData.mAddress.IpAddress.Value with { mPort = 26767 };
break;
}
case "NHL13":
{
responseData.mAddress.IpAddress = responseData.mAddress.IpAddress.Value with { mPort = 36767 };
break;
}
case "NHL14":
{
responseData.mAddress.IpAddress = responseData.mAddress.IpAddress.Value with { mPort = 34767 };
break;
}
case "NHL15":
{
responseData.mAddress.IpAddress = responseData.mAddress.IpAddress.Value with { mPort = 16567 };
break;
}
case "NHL16":
{
responseData.mAddress.IpAddress = responseData.mAddress.IpAddress.Value with { mPort = 16767 };
break;
}
}
return Task.FromResult(responseData);
}
}