I'm following the tutorial "Implementing RT Chat Services".
In ChatManager.cs on the following line :
foreach (RTSessionInfo.RTPlayer player in GameSparksManager.Instance().GetSessionInfo().GetPlayerList()) {
I'm getting an error 'Type `RTSessionInfo.RTPlayer' does not contain a definition for `peerID' and no extension method `peerID' of type `RTSessionInfo.RTPlayer' could be found. Are you missing an assembly reference?'.
Also this error 'The name `DateTime' does not exist in the current context' appears for the following code:
In the previous tutorial, in GameSparksManager.cs, I've put the 'public class RTSessionInfo' outside the 'public class GameSparksManager : MonoBehaviour'.
To test, I've put the 'public class RTSessionInfo' inside the 'public class GameSparksManager : MonoBehaviour' but then I got the following error in the LobbyManager.cs : 'The type or namespace name `RTSessionInfo' could not be found. Are you missing an assembly reference?' for this code:
To address your first problem. My RTPlayerClass is defined within my ManagerSingleton.cs and looks like so:
public class RTPlayer
{
public string displayName;
public string id;
public int peerId;
public string isOnline;
public RTPlayer(string _displayName, string _id, int _peerId)
{
this.displayName = _displayName;
this.id = _id;
this.peerId = _peerId;
}
}
It is referenced in the following way which is slightly different than the way in which you are doing so as well as enumerating it:
foreach (RTPlayer player in ManagerSingleton.Instance().GetSessionInfo().GetRTPlayerList())
{
Debug.Log("Sending Message to " + player.displayName + " ... \n" + messageInput.text);
ManagerSingleton.Instance().getRTSession().SendData(1, GameSparksRT.DeliveryIntent.RELIABLE, data, new int[] { player.peerId });
}
Is it possible you have inappropriately defined the RTPlayer class ?
Best Regards, Patrick.
N
Nikola Lemmens
said
about 6 years ago
Hi Patrick,
My RTPlayer class is exactly the same. It is defined under the RTSessionInfo class as in the tutorial.
public class RTSessionInfo
{
private string hostURL;
public string GetHostURL(){ return this.hostURL; }
private string acccessToken;
public string GetAccessToken(){ return this.acccessToken; }
private int portID;
public int GetPortID(){ return this.portID; }
private string matchID;
public string GetMatchID(){ return this.matchID; }
private List<RTPlayer> playerList = new List<RTPlayer> ();
public List<RTPlayer> GetPlayerList(){
return playerList;
}
/// <summary>
/// Creates a new RTSession object which is held until a new RT session is created
/// </summary>
/// <param name="_message">Message.</param>
public RTSessionInfo (MatchFoundMessage _message){
portID = (int)_message.Port;
hostURL = _message.Host;
acccessToken = _message.AccessToken;
matchID = _message.MatchId;
// we loop through each participant and get their peerId and display name //
foreach(MatchFoundMessage._Participant p in _message.Participants){
playerList.Add(new RTPlayer(p.DisplayName, p.Id, (int)p.PeerId));
}
}
public class RTPlayer
{
public string displayName;
public string id;
public int peerId;
public bool isOnline;
public RTPlayer(string _displayName, string _id, int _peerId)
{
this.displayName = _displayName;
this.id = _id;
this.peerId = _peerId;
}
}
}
It's in my GameSparksManager script but outside
the public class GameSparksManager : MonoBehaviour
{
...
}
When I put the whole
public class RTSessionInfo
{
...
}
inside the
the public class GameSparksManager : MonoBehaviour
{
...
}
I get an error in my LobbyManager.cs as described above..
N
Nikola Lemmens
said
about 6 years ago
Hi Patrick,
I'v been searching for a couple hours but still can't find from where the errors come. I attached a repro, maybe you can have a look?
Sorry to bump on this. But I compared my scripts with the ones provided from the RT Multiplayer Tanks Game recap and I couldn't find any differences.
I keep getting the error 'Type `RTSessionInfo.RTPlayer' does not contain a definition for `peerID' and no extension method `peerID' of type `RTSessionInfo.RTPlayer' could be found. Are you missing an assembly reference?'.
Does anybody has a another idea why I can't get hold of the RTSessionInfo class info from my GameSparksManager script?
Any thoughts would be helpful,
Best Regards
Nikola
Customer Support
said
about 6 years ago
Hey Nikola.
The only reason i can think for this is that you have two references for RTPlayer somehow. Could you try remove (comment out) the RTPlayer class entirely and recompile?
I also think that the script might no be updating correctly in Unity. Not sure how to fix this, but if you remove the RTPlayer entirely and start again, you should be able to hunt down the problem.
Sean
N
Nikola Lemmens
said
about 6 years ago
Answer
Disregard last transmission!!
Found the issue. Had problems with monodevelop lately, fixed it and could see now that I had a typo in the reference peerId iso peerID.
Nikola Lemmens
Hi,
I'm following the tutorial "Implementing RT Chat Services".
In ChatManager.cs on the following line :
I'm getting an error 'Type `RTSessionInfo.RTPlayer' does not contain a definition for `peerID' and no extension method `peerID' of type `RTSessionInfo.RTPlayer' could be found. Are you missing an assembly reference?'.
Also this error 'The name `DateTime' does not exist in the current context' appears for the following code:
In the previous tutorial, in GameSparksManager.cs, I've put the 'public class RTSessionInfo' outside the 'public class GameSparksManager : MonoBehaviour'.
To test, I've put the 'public class RTSessionInfo' inside the 'public class GameSparksManager : MonoBehaviour' but then I got the following error in the LobbyManager.cs : 'The type or namespace name `RTSessionInfo' could not be found. Are you missing an assembly reference?' for this code:
What would be the best way to solve this 'class inheritance' problem?
Best regards
Nikola
Disregard last transmission!!
Found the issue. Had problems with monodevelop lately, fixed it and could see now that I had a typo in the reference peerId iso peerID.
Cheers,
Nikola
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstCustomer Support
Hi Nikola,
To address your first problem. My RTPlayerClass is defined within my ManagerSingleton.cs and looks like so:
It is referenced in the following way which is slightly different than the way in which you are doing so as well as enumerating it:
Is it possible you have inappropriately defined the RTPlayer class ?
Best Regards, Patrick.
Nikola Lemmens
Hi Patrick,
My RTPlayer class is exactly the same. It is defined under the RTSessionInfo class as in the tutorial.
It's in my GameSparksManager script but outside
When I put the whole
inside the
I get an error in my LobbyManager.cs as described above..
Nikola Lemmens
Hi Patrick,
I'v been searching for a couple hours but still can't find from where the errors come. I attached a repro, maybe you can have a look?
Best regards,
Nikola
Nikola Lemmens
Hi,
Sorry to bump on this. But I compared my scripts with the ones provided from the RT Multiplayer Tanks Game recap and I couldn't find any differences.
I keep getting the error 'Type `RTSessionInfo.RTPlayer' does not contain a definition for `peerID' and no extension method `peerID' of type `RTSessionInfo.RTPlayer' could be found. Are you missing an assembly reference?'.
Does anybody has a another idea why I can't get hold of the RTSessionInfo class info from my GameSparksManager script?
Any thoughts would be helpful,
Best Regards
Nikola
Customer Support
The only reason i can think for this is that you have two references for RTPlayer somehow.
Could you try remove (comment out) the RTPlayer class entirely and recompile?
I also think that the script might no be updating correctly in Unity. Not sure how to fix this, but if you remove the RTPlayer entirely and start again, you should be able to hunt down the problem.
Sean
Nikola Lemmens
Disregard last transmission!!
Found the issue. Had problems with monodevelop lately, fixed it and could see now that I had a typo in the reference peerId iso peerID.
Cheers,
Nikola
-
Documentation Notes
-
Design issues with user events
-
Using NoSQL
-
Runtime Collections vs Metadata Collections
-
Anonymous authentication from browser app
-
Modules
-
Movement With Unity
-
Problem with url parameters for downloadables
-
Querying NoSql GameSparks database
-
Challenge accesType
See all 2487 topics