Exemplo n.º 1
0
 private void ShowOpponentInfo(ParticipantInfo opponent)
 {
     NetworkSessionManager.DebugScr("printing opponent info");
     DisplayName.text   = opponent.DisplayName;
     ParticipantId.text = opponent.ParticipantId;
     Rating.text        = opponent.Rating.ToString();
 }
Exemplo n.º 2
0
        public static void ReadOpponentInfo(byte[] data, MatchInfo match)
        {
            NetworkSessionManager.DebugScr("reading opponent info " + data.Length);
            byte[] playerInfo = new byte[data.Length - 1];
            Array.Copy(data, 1, playerInfo, 0, data.Length - 1);
            string infoString = Encoding.UTF8.GetString(playerInfo);

            NetworkSessionManager.DebugScr(infoString);
            int rating = Convert.ToInt32(infoString);

            NetworkSessionManager.DebugScr("pre SetData: " + rating);

            match.Opponent.SetRating(rating);
        }
Exemplo n.º 3
0
        public void SendPlayerInfo(MatchInfo match)
        {
            string playerInfo = match.Player.Rating.ToString();

            byte[] playerInfoBytes = Encoding.UTF8.GetBytes(playerInfo);
            NetworkSessionManager.DebugScr("player bytes " + playerInfoBytes.Length);
            byte[] packet = new byte[playerInfoBytes.Length + 1];
            packet[0] = packetType;

            try {
                Array.Copy(playerInfoBytes, 0, packet, 1, playerInfoBytes.Length);
            } catch (Exception e) {
                NetworkSessionManager.DebugScr(e.Message);
            }

            NetworkSessionManager.DebugScr("sending my info " + packet.Length);
            SendMessageToAll(true, packet);
        }
 GoogleMultiplayer(NetworkSessionManager networkStateManager)
 {
     netSM = networkStateManager;
 }