Ejemplo n.º 1
0
 public void SendEnd(EndData se)
 {
     if (!started || Learning)
     {
         return;
     }
     Learning           = true;
     WaitingSkillLevels = true;
     Debug.Log("Round++,Now:" + RoundNow);
     //sts = se;
     Src[Sender.clientNum]  = se;
     SLtb[Sender.clientNum] = true;
     Debug.Log("End Message " + Sender.clientNum + " Set");
     Bond.IO.Safe.OutputBuffer ob2 = new Bond.IO.Safe.OutputBuffer(128);
     Bond.Protocols.CompactBinaryWriter <Bond.IO.Safe.OutputBuffer> boc = new Bond.Protocols.CompactBinaryWriter <Bond.IO.Safe.OutputBuffer>(ob2);
     Serialize.To(boc, se);
     byte[] sendBytes = new byte[ob2.Data.Array.Length + 1];
     sendBytes[0] = (byte)2;
     ob2.Data.Array.CopyTo(sendBytes, 1);
     foreach (CSteamID i in TOmb)
     {
         if (i != SteamUser.GetSteamID())
         {
             SteamNetworking.SendP2PPacket(i, sendBytes, (uint)sendBytes.Length, EP2PSend.k_EP2PSendReliable);
         }
     }
     Debug.Log("End Sent");
     EndingCompare();
     TotalRounds = int.Parse(SteamMatchmaking.GetLobbyData(Sender.roomid, "Total_Rounds"));
     LearnTime   = int.Parse(SteamMatchmaking.GetLobbyData(Sender.roomid, "Learn_Time"));
 }
Ejemplo n.º 2
0
    public void SendMyWord()
    {
        Bond.IO.Safe.OutputBuffer outputBuffer = new Bond.IO.Safe.OutputBuffer(4096);
        Bond.Protocols.CompactBinaryWriter <Bond.IO.Safe.OutputBuffer> compactBinaryWriter = new Bond.Protocols.CompactBinaryWriter <Bond.IO.Safe.OutputBuffer>(outputBuffer);
        UserWord userWord = new UserWord();

        userWord.myWord = MyWord.text;
        MyWord.text     = "";
        Serialize.To(compactBinaryWriter, userWord);
        SteamMatchmaking.SendLobbyChatMsg(Sender.roomid, outputBuffer.Data.Array, outputBuffer.Data.Array.Length);
    }
Ejemplo n.º 3
0
 public void Sendlsd(SkillData sd)
 {
     Bond.IO.Safe.OutputBuffer ob2 = new Bond.IO.Safe.OutputBuffer(128);
     Bond.Protocols.CompactBinaryWriter <Bond.IO.Safe.OutputBuffer> boc = new Bond.Protocols.CompactBinaryWriter <Bond.IO.Safe.OutputBuffer>(ob2);
     Serialize.To(boc, sd);
     byte[] sendBytes = new byte[ob2.Data.Array.Length + 1];
     sendBytes[0] = (byte)1;
     ob2.Data.Array.CopyTo(sendBytes, 1);
     for (int i = 0; i < TOmb.Length; i++)
     {
         if (i != clientNum)
         {
             SteamNetworking.SendP2PPacket(TOmb[i], sendBytes, (uint)sendBytes.Length, EP2PSend.k_EP2PSendReliable);
         }
     }
 }