Example #1
0
 protected override void OnGameQuit()
 {
     NetSyncComponent.TriggerServerEvent("D", false);
     if (reciever.Connected == true)
     {
         reciever.Recieve();
         reciever.Send(true);
         reciever.Stop();
     }
 }
Example #2
0
 /// <summary>
 /// Requests a bullet to spawn on the server.
 /// </summary>
 /// <param name="player">A reference to the player the client controlls.</param>
 public void RequestBullet(PlayerManager player)
 {
     NetSyncComponent.TriggerServerEvent("RB", false, (byte)player.lookingAt);
 }
Example #3
0
 /// <summary>
 /// Requests to drop the current weapon to the server.
 /// </summary>
 public void RequestWeaponDrop()
 {
     NetSyncComponent.TriggerServerEvent("RD", false);
 }
Example #4
0
 /// <summary>
 /// Tells the server that this client loaded the new level.
 /// </summary>
 public void LevelLoaded()
 {
     NetSyncComponent.TriggerServerEvent("LL", true);
     NetManager.Instance.Reset();
 }
Example #5
0
 /// <summary>
 /// Requests to pickup a weapon from the server.
 /// </summary>
 /// <param name="pickable">The weapon to be picked up.</param>
 public void RequestPickupWeapon(Pickable pickable)
 {
     NetSyncComponent.TriggerServerEvent("RW", false, pickable.Actor.GetComponent <NetSyncComponent>().Id);
 }