This variable is never used, simply assigned. This of course is not a big deal, however I would suggest that this should be added to the MDPlayerInfo by default as most multiplayer games require a name, this could also serve as a good example on how to replicate values.
Personally I added the following to my MDPlayerInfo:
private String _playerName = "UnkownPlayer";
[MDReplicated]
public string PlayerName
{
get { return _playerName; }
set {
_playerName = value;
this.GetGameSession().NotifyPlayerNameChanged(PeerId);
}
}
In addition I added a new event to the MDGameSession,
public event PlayerEventHandler OnPlayerNameChanged = delegate {};
public void NotifyPlayerNameChanged(int peerId)
{
OnPlayerNameChanged(peerId);
}
I think this is something that almost every multiplayer game needs and it also serves as a simple example on how you can replicate values and send out a notification.
In MDGameSession.GetOrCreatePlayerObject(int PeerId) we have this line,
string PlayerName = String.Format(PlayerNameFormat, PeerId);
This variable is never used, simply assigned. This of course is not a big deal, however I would suggest that this should be added to the MDPlayerInfo by default as most multiplayer games require a name, this could also serve as a good example on how to replicate values.
Personally I added the following to my MDPlayerInfo:
In addition I added a new event to the MDGameSession,
I think this is something that almost every multiplayer game needs and it also serves as a simple example on how you can replicate values and send out a notification.