Scores and player names synchronized across the network

Added:

-sniper rifle works, uses same RPC call to deal damage as the rifle
-kills to win option under the host game setup screen.
-I had previously added a string "name" to the Player struct, but realized that it wasn't being shared through the RPC calls when a new player joins. I added this and the names seem to be working correctly now.

Had some weird issues where the "dead" player would be the same as the "killer" player in the ReportDeath function. Previously, I was passing NetworkPlayer references; when I checked which players were being sent through the debugger, they were the same. I couldn't figure out why, so I added a function "FindPlayerByViewID" and that seemed to work correctly, with the correct players being passed through the RPC call. 

Another weird thing is that when using the FindPlayer function, the player's own representation of their score ("my.score") was not updating despite it being changed via:

Player killerplayer = FindPlayer(...);

through FindPlayer, this should return a reference to the player "my", because you are trying to find yourself. However I would get killerplayer.score updating but my.score staying at zero. The player returned is correct...Because of this I've added a check to see if the player is yourself, and then updating my.score separately. This seems kind of hacky but I can't figure out an alternative at the moment. FindPlayer should return a reference to my, not a copy, so it makes no sense that my is not updated by incrementing killerplayer.score.

I'm hoping I don't get this exact same problem when I update the otherPlayers list when the player being found is not "my". If that is the case, and otherPlayers is NOT being updated correctly (even though killerplayer.score IS), then trying to create a scoreboard with the sorted scores of otherPlayers and my (which I suppose will have to be concatenated into a single list) will not work because they will all show up as zero with the exception of "my", which I am updating through the process I described above (see lines 203 and on in NetworkManager).


EDIT:

I just checked and indeed, when you get killed, otherPlayers[0].score stays at zero (just like my.score) even though killerPlayer.score increments to 1 as expected. I also checked and made sure that the player in otherPlayers[0] is the same as killerPlayer.


EDIT2:

IT WORKS! Changed player struct to a class so that the values can be changed.