PsyOps

SC Fix Core Code

Mar 15th, 2014
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.76 KB | None | 0 0
  1.       private void HandlePlayerUpdate (Byte[] buffer)
  2.       {
  3.          PlayerUpdatePacket packet = new PlayerUpdatePacket ();
  4.  
  5.          // Parse the player update packet
  6.          packet.Packet = buffer;
  7.  
  8.          // Get the player information
  9.          PlayerInfo playerInfo = m_playerHandler.PlayerInformation (packet.TeamEvent.PlayerId);
  10.  
  11.          if (playerInfo != null)
  12.          {
  13.              if ((int)packet.ShipEvent.ShipType == 255)
  14.                  packet.ShipEvent.ShipType = playerInfo.Ship;
  15.  
  16.             // Check if the ship changed
  17.             if (packet.ShipEvent.ShipType != playerInfo.Ship)
  18.             {
  19.                // Set the player name and moderator level in the event
  20.                packet.ShipEvent.PlayerName = playerInfo.PlayerName;
  21.                packet.ShipEvent.ModLevel = playerInfo.ModeratorLevel;
  22.                packet.ShipEvent.PreviousShipType = playerInfo.Ship;
  23.  
  24.                // Update the ship type in the player information
  25.                playerInfo.Ship = packet.ShipEvent.ShipType;
  26.  
  27.                // Add the event to the core event queue
  28.                m_eventQueue.Add (packet.ShipEvent);
  29.             }
  30.  
  31.             // Check if the frequency changed
  32.             if (packet.TeamEvent.Frequency != playerInfo.Frequency)
  33.             {
  34.                // Set the player name and moderator level in the event
  35.                packet.TeamEvent.PlayerName = playerInfo.PlayerName;
  36.                packet.TeamEvent.ModLevel = playerInfo.ModeratorLevel;
  37.  
  38.                // Update the frequency in the player information
  39.                playerInfo.Frequency = packet.TeamEvent.Frequency;
  40.  
  41.                // Add the event to the core event queue
  42.                m_eventQueue.Add (packet.TeamEvent);
  43.             }
  44.          }
  45.       }
Advertisement
Add Comment
Please, Sign In to add comment