Skip to content
This repository was archived by the owner on Apr 3, 2020. It is now read-only.

Commit 15d0bd6

Browse files
committed
Use random client ID instead of passing it as a query string
1 parent c824e13 commit 15d0bd6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

netcode.io.demoserver/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ public static string SendResponse(HttpListenerRequest request, HttpListenerRespo
133133
if (request.Url.AbsolutePath == "/token")
134134
{
135135
response.ContentType = "text/plain";
136-
137-
var clientId = ulong.Parse(request.QueryString["clientId"]);
136+
137+
var clientId = NetcodeLibrary.GetRandomUInt64();
138138
var token = NetcodeLibrary.GenerateConnectTokenFromPrivateKey(
139139
new[] { serverAddress + ":40000" },
140140
30,

netcode.io.demoserver/index.htm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
});
7070
window.setTimeout(function () { updateConnectionState(client); }, 100);
7171
$("#netcode_client").text("Created, obtaining token...");
72-
$.get("/token?clientId=1", function (token) {
72+
$.get("/token", function (token) {
7373
$("#netcode_client").text("Obtained token, connecting...");
7474
var tokenBuffer = b64ToBuffer(token);
7575
client.connect(tokenBuffer, function (err) {

0 commit comments

Comments
 (0)