J.
J.
Explore posts from servers
CC#
Created by J. on 11/9/2023 in #help
❔ Unity- realtime streaming protocol
What options do i have to stream video feeds from multiple cameras from a Unity client? my friend suggested to use some type of real-time streaming protocol using a websocket. But I have no idea what native or third party libraries are available in a unity context. what can I use? Preferably I would like a pipeline where I can integrate MQs somehow.
6 replies
CC#
Created by J. on 10/27/2023 in #help
❔ DB and web API data potential desync- how to resolve?
I have an app that will cross compare DB contract data to usage data fetched from a web API. The API returns details for users like "id", "name", "email" and so forth, which we also store on our server/DB ecause we need to tally before billing. But the API side can be modified by our client at any time. My current solution is that I will always treat the API as the source of ground truth. So if any of the user Id on the API changes and causes a mismatch, there would need to be a manual/automatic adjustment on the database side for the client records. My question is, is this an appropriate solution? 1. If so, how can this be done with the least amount of human intervention? 2. If not, what is an appropriate solution? From what I can see, the web API does not provide any endpoints to listen for changes to the user's id.
18 replies
CC#
Created by J. on 10/2/2023 in #help
❔ MSVS: My intellisense is not working and I have a huge list of errors in solution explorer
No description
6 replies
CC#
Created by J. on 9/21/2023 in #help
❔ Data breakpoints in MSVS
Hi, am having problems setting up data breakpoints (break when variable changes) in MSVS for C#. I've looked through numerous google articles but the option doesn't exist when I right click (it isn't even greyed out, it's just flat out not there). I am using community edition Visual Studio 2022
11 replies
CC#
Created by J. on 9/15/2023 in #help
❔ Lambda expressions in C#
Hi, I'm afraid I'm not used to lambdas enough and am struggling whenever they pop up. I need a place to practice lambda expressions (writing my own, as well as using existing ones). I searched on google but w3schools only has py and java examples
22 replies
CC#
Created by J. on 9/13/2023 in #help
❔ MSVS- List in Immediate Window
4 replies
CC#
Created by J. on 9/12/2023 in #help
❔ Syntactical Difference In Azure Function Scripts
I have syntax for two files:
[Function("CreatePrivateMessage")]
public HttpResponseData Run([HttpTrigger(AuthorizationLevel.Function, new string[]
{
"get",
"post"
})] HttpRequestData req)
{...
[Function("CreatePrivateMessage")]
public HttpResponseData Run([HttpTrigger(AuthorizationLevel.Function, new string[]
{
"get",
"post"
})] HttpRequestData req)
{...
[FunctionName("CreatePrivateMessage")]
public static async Task<IActionResult> Run(
[HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequest req,
ILogger log) {...

[FunctionName("CreatePrivateMessage")]
public static async Task<IActionResult> Run(
[HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequest req,
ILogger log) {...

They both work, but it seems that there is significant difference in the syntax. What's up with this? ChatGPT says that the first one (the one that returns HttpResponseData) is Azure Functions v4, whereas the async Task<IActionResult> one is Azure Functions v3. Is this true?
3 replies
CC#
Created by J. on 9/7/2023 in #help
❔ WebSocketSharp and Azure Endpoint (Error 1006)
Summary: 1) I create a UnityWebRequest which is used to call request.SendWebRequest(). 2) Use the returned request.downloadHandler.text to create a ws = new WebSocket(request.downloadHandler.text, "json.webpubsub.azure.v1"); 3) Attempt to perform ws.Connect() However, ws.Connect() never connects and instead always triggers OnClose() instead, citing error 1006. My actual code:
private IEnumerator ConnectToAzure()
{
string url = "https://myurl.azurewebsites.net/api/createprivatemessage?code=mycode";

InputData inputData = new InputData { sender = playFabId };
string data = JsonConvert.SerializeObject(inputData);
UnityWebRequest request = new UnityWebRequest(url, "POST");
byte[] bodyRaw = Encoding.UTF8.GetBytes(data);
request.uploadHandler = (UploadHandler)new UploadHandlerRaw(bodyRaw);
request.downloadHandler = (DownloadHandler)new DownloadHandlerBuffer();
request.SetRequestHeader("Content-Type", "application/json");

yield return request.SendWebRequest();

if (request.result == UnityWebRequest.Result.ConnectionError || request.result == UnityWebRequest.Result.ProtocolError)
{
Debug.LogError(request.error);
}
else
{
ws = new WebSocket(request.downloadHandler.text, "json.webpubsub.azure.v1");
IsWebSocketUrlReachable(url);
// Set the WebSocket headers
// client.SetCredentials(azureConnection, "", false);
ws.OnOpen += OnWebSocketOpen;
ws.OnMessage += OnMessage;
ws.OnError += OnError;
ws.OnClose += OnClose;
ws.Connect();
if(ws.ReadyState!= WebSocketState.Open) {
Debug.Log("WebSocket was NOT opened. Something went wrong during initial connection in ConnectToAzure()");
}
}
request.Dispose();
}
private IEnumerator ConnectToAzure()
{
string url = "https://myurl.azurewebsites.net/api/createprivatemessage?code=mycode";

InputData inputData = new InputData { sender = playFabId };
string data = JsonConvert.SerializeObject(inputData);
UnityWebRequest request = new UnityWebRequest(url, "POST");
byte[] bodyRaw = Encoding.UTF8.GetBytes(data);
request.uploadHandler = (UploadHandler)new UploadHandlerRaw(bodyRaw);
request.downloadHandler = (DownloadHandler)new DownloadHandlerBuffer();
request.SetRequestHeader("Content-Type", "application/json");

yield return request.SendWebRequest();

if (request.result == UnityWebRequest.Result.ConnectionError || request.result == UnityWebRequest.Result.ProtocolError)
{
Debug.LogError(request.error);
}
else
{
ws = new WebSocket(request.downloadHandler.text, "json.webpubsub.azure.v1");
IsWebSocketUrlReachable(url);
// Set the WebSocket headers
// client.SetCredentials(azureConnection, "", false);
ws.OnOpen += OnWebSocketOpen;
ws.OnMessage += OnMessage;
ws.OnError += OnError;
ws.OnClose += OnClose;
ws.Connect();
if(ws.ReadyState!= WebSocketState.Open) {
Debug.Log("WebSocket was NOT opened. Something went wrong during initial connection in ConnectToAzure()");
}
}
request.Dispose();
}
I am new to azure. How can I debug?
3 replies