Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void HandlePlayerUpdate (Byte[] buffer)
- {
- PlayerUpdatePacket packet = new PlayerUpdatePacket ();
- // Parse the player update packet
- packet.Packet = buffer;
- // Get the player information
- PlayerInfo playerInfo = m_playerHandler.PlayerInformation (packet.TeamEvent.PlayerId);
- if (playerInfo != null)
- {
- if ((int)packet.ShipEvent.ShipType == 255)
- packet.ShipEvent.ShipType = playerInfo.Ship;
- // Check if the ship changed
- if (packet.ShipEvent.ShipType != playerInfo.Ship)
- {
- // Set the player name and moderator level in the event
- packet.ShipEvent.PlayerName = playerInfo.PlayerName;
- packet.ShipEvent.ModLevel = playerInfo.ModeratorLevel;
- packet.ShipEvent.PreviousShipType = playerInfo.Ship;
- // Update the ship type in the player information
- playerInfo.Ship = packet.ShipEvent.ShipType;
- // Add the event to the core event queue
- m_eventQueue.Add (packet.ShipEvent);
- }
- // Check if the frequency changed
- if (packet.TeamEvent.Frequency != playerInfo.Frequency)
- {
- // Set the player name and moderator level in the event
- packet.TeamEvent.PlayerName = playerInfo.PlayerName;
- packet.TeamEvent.ModLevel = playerInfo.ModeratorLevel;
- // Update the frequency in the player information
- playerInfo.Frequency = packet.TeamEvent.Frequency;
- // Add the event to the core event queue
- m_eventQueue.Add (packet.TeamEvent);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment