Hello,
I am trying to send a variable from the server to a UE4 client using a photonlistener class. I am trying to avoid using the LoadBalancing server.
My basic code looks like...
Server: (c#)
public void OnLogin(){
perationResponse response = new OperationResponse(ClientOperationResponseCodes.LoggedIn);
response.Parameters = new Dictionary(ClientParameterCodes.Username,"bob");
SendOperationResponse(response, sendParameters);
}
Client: (c++)
void TestClient::onOperationResponse(const OperationResponse& operationResponse)
{
Hashtable opData = ValueObject(operationResponce.GetParameters());
if(opData.getValue(ClientParameterCodes::Username))
{
JString Username = (ValueObject(opData.getValue(ClientParameterCodes::Username)).getDataCopy();
FString UN(Username.UTF8Representation().cstr);
GEngine->AddOnScreenDebugMessage(-1, 15.0f, FColor::Red, UN + " Logged into the server");
}
}
Result:
" Logged into the server"
Unfortunately this is not the exact code i have been testing as i am working currently and ive done this from memory. However this is basically what i am trying to do.
Please can someone provide me with some working theory on how to get this working as every time i try to print the username out it is blank.
Kind Regards,
Imperator132k
I am trying to send a variable from the server to a UE4 client using a photonlistener class. I am trying to avoid using the LoadBalancing server.
My basic code looks like...
Server: (c#)
public void OnLogin(){
perationResponse response = new OperationResponse(ClientOperationResponseCodes.LoggedIn);
response.Parameters = new Dictionary(ClientParameterCodes.Username,"bob");
SendOperationResponse(response, sendParameters);
}
Client: (c++)
void TestClient::onOperationResponse(const OperationResponse& operationResponse)
{
Hashtable opData = ValueObject(operationResponce.GetParameters());
if(opData.getValue(ClientParameterCodes::Username))
{
JString Username = (ValueObject(opData.getValue(ClientParameterCodes::Username)).getDataCopy();
FString UN(Username.UTF8Representation().cstr);
GEngine->AddOnScreenDebugMessage(-1, 15.0f, FColor::Red, UN + " Logged into the server");
}
}
Result:
" Logged into the server"
Unfortunately this is not the exact code i have been testing as i am working currently and ive done this from memory. However this is basically what i am trying to do.
Please can someone provide me with some working theory on how to get this working as every time i try to print the username out it is blank.
Kind Regards,
Imperator132k