public ActionResult Index() { Task.Factory.StartNew(() => { VoiceCom.ReadVoice(); }); return(View()); }
public static void VoiceCom_ClientSpeak(VoiceCom hook, PlayerClient sender, PlayerClient client) { object[] args = new object[] { hook, sender, client }; Method.Invoke("RustExtended.RustHook.VoiceCom_ClientSpeak", args); }
public static void clientSpeak(VoiceCom voiceCom, int setupData, byte[] data) { //try //{ // PlayerClient client; // if (((voice.distance > 0f) && PlayerClient.Find(voiceCom.networkViewOwner, out client)) && client.hasLastKnownPosition) // { // float num = inGlobalV.Contains(client.userID.ToString()) ? (1000000000f * 1000000000f) : (voice.distance * voice.distance); // Vector3 lastKnownPosition = client.lastKnownPosition; // int num3 = 0; // try // { // foreach (PlayerClient client2 in AllPlayerClients) // { // if (((client2 != null) && client2.hasLastKnownPosition) && (client2 != client)) // { // Vector3 vector; // vector.x = client2.lastKnownPosition.x - lastKnownPosition.x; // vector.y = client2.lastKnownPosition.y - lastKnownPosition.y; // vector.z = client2.lastKnownPosition.z - lastKnownPosition.z; // float num2 = ((vector.x * vector.x) + (vector.y * vector.y)) + (vector.z * vector.z); // if (num2 <= num) // { // num3++; // voiceCom.playerList.Add(client2.netPlayer); // } // } // } // if (num3 > 0) // { // object[] args = new object[] { voice.distance, setupData, data }; // voiceCom.networkView.RPC("VoiceCom:voiceplay", voiceCom.playerList, args); // } // } // finally // { // if (num3 > 0) // { // voiceCom.playerList.Clear(); // } // } // } //} //catch (Exception ex) //{ // conLog.Error(ex.ToString()); //} }
public static void clientSpeak(VoiceCom voiceCom, int setupData, byte[] data) { try { PlayerClient client; if (((voice.distance > 0f) && PlayerClient.Find(voiceCom.networkViewOwner, out client)) && client.hasLastKnownPosition) { float num = inGlobalV.Contains(client.userID.ToString()) ? (1000000000f * 1000000000f) : (voice.distance * voice.distance); Vector3 lastKnownPosition = client.lastKnownPosition; int num3 = 0; try { foreach (PlayerClient client2 in PlayerClient.All) { if (((client2 != null) && client2.hasLastKnownPosition) && (client2 != client)) { Vector3 vector; vector.x = client2.lastKnownPosition.x - lastKnownPosition.x; vector.y = client2.lastKnownPosition.y - lastKnownPosition.y; vector.z = client2.lastKnownPosition.z - lastKnownPosition.z; float num2 = ((vector.x * vector.x) + (vector.y * vector.y)) + (vector.z * vector.z); if (num2 <= num) { num3++; voiceCom.playerList.Add(client2.netPlayer); } } } if (num3 > 0) { object[] args = new object[] { voice.distance, setupData, data }; voiceCom.networkView.RPC("VoiceCom:voiceplay", voiceCom.playerList, args); } } finally { if (num3 > 0) { voiceCom.playerList.Clear(); } } } } catch (Exception ex) { conLog.Error(ex.ToString()); } }