public static NewCharacterDBPacket Read(NetPacketReader message) { var facCount = (int)message.GetVariableUInt32(); var factions = new List <NewCharFaction>(facCount); for (int i = 0; i < facCount; i++) { factions.Add(new NewCharFaction() { Nickname = message.GetString(), RepGroup = message.GetString(), Base = message.GetString(), Package = message.GetString(), Pilot = message.GetString() }); } var pkgCount = (int)message.GetVariableUInt32(); var packages = new List <NewCharPackage>(pkgCount); for (int i = 0; i < pkgCount; i++) { packages.Add(new NewCharPackage() { Nickname = message.GetString(), StridName = message.GetInt(), StridDesc = message.GetInt(), Ship = message.GetString(), Loadout = message.GetString(), Money = message.GetLong() }); } var pilotCount = (int)message.GetVariableUInt32(); var pilots = new List <NewCharPilot>(pilotCount); for (int i = 0; i < pilotCount; i++) { pilots.Add(new NewCharPilot() { Nickname = message.GetString(), Body = message.GetString(), Comm = message.GetString(), Voice = message.GetString(), BodyAnim = message.GetString(), CommAnim = new string[] { message.GetString(), message.GetString() } }); } return(new NewCharacterDBPacket() { Factions = factions, Packages = packages, Pilots = pilots }); }
public static SpawnedEffect Read(NetPacketReader message) { var x = new SpawnedEffect() { ID = message.GetVariableUInt32(), Effect = message.GetStringPacked() }; x.Hardpoints = new string[message.GetVariableUInt32()]; for (int i = 0; i < x.Hardpoints.Length; i++) { x.Hardpoints[i] = message.GetStringPacked(); } return(x); }
public static AddCharacterPacket Read(NetPacketReader message) { var ac = new AddCharacterPacket(); ac.Character = new SelectableCharacter(); ac.Character.Name = message.GetString(); ac.Character.Rank = (int)message.GetVariableUInt32(); ac.Character.Funds = message.GetLong(); ac.Character.Ship = message.GetString(); ac.Character.Location = message.GetString(); return(ac); }
public static CharacterListActionPacket Read(NetPacketReader message) { var cla = new CharacterListActionPacket(); cla.Action = (CharacterListAction)message.GetByte(); switch (cla.Action) { case CharacterListAction.SelectCharacter: cla.IntArg = (int)message.GetVariableUInt32(); break; case CharacterListAction.CreateNewCharacter: cla.IntArg = (int)message.GetVariableUInt32(); cla.StringArg = message.GetString(); break; case CharacterListAction.DeleteCharacter: cla.IntArg = (int)message.GetVariableUInt32(); break; } return(cla); }
public static OpenCharacterListPacket Read(NetPacketReader message) { var oc = new OpenCharacterListPacket(); oc.Info = new CharacterSelectInfo(); oc.Info.ServerName = message.GetString(); oc.Info.ServerDescription = message.GetString(); oc.Info.ServerNews = message.GetString(); var charCount = (int)message.GetVariableUInt32(); oc.Info.Characters = new List <SelectableCharacter>(charCount); for (int i = 0; i < charCount; i++) { var c = new SelectableCharacter(); c.Name = message.GetString(); c.Rank = (int)message.GetVariableUInt32(); c.Funds = message.GetLong(); c.Ship = message.GetString(); c.Location = message.GetString(); oc.Info.Characters.Add(c); } return(oc); }
public static NetShipLoadout Read(NetPacketReader message) { var s = new NetShipLoadout(); s.ShipCRC = message.GetUInt(); var equipCount = (int)message.GetVariableUInt32(); s.Equipment = new List <NetShipEquip>(equipCount); for (int i = 0; i < equipCount; i++) { s.Equipment.Add(new NetShipEquip(message.GetUInt(), message.GetUInt(), message.GetByte())); } return(s); }
public static object Read(NetPacketReader message) { var count = message.GetVariableUInt32(); var solars = new List <SolarInfo>((int)count); for (int i = 0; i < count; i++) { solars.Add(SolarInfo.Read(message)); } return(new SpawnSolarPacket() { Solars = solars }); }
public static NetShipLoadout Read(NetPacketReader message) { var s = new NetShipLoadout(); s.ShipCRC = message.GetUInt(); s.Health = message.GetFloat(); var cargoCount = (int)message.GetVariableUInt32(); s.Items = new List <NetShipCargo>(cargoCount); for (int i = 0; i < cargoCount; i++) { s.Items.Add(new NetShipCargo(message.GetInt(), message.GetUInt(), message.GetUInt(), message.GetByte(), message.GetInt())); } return(s); }
public static object Read(NetPacketReader message) { var pk = new MsnDialogPacket() { Lines = new NetDlgLine[(int)message.GetVariableUInt32()] }; for (int i = 0; i < pk.Lines.Length; i++) { pk.Lines[i] = new NetDlgLine() { Voice = message.GetString(), Hash = message.GetUInt() }; } return(pk); }
public static IPacket Read(NetPacketReader message) { return((IPacket)parsers[(int)message.GetVariableUInt32()](message)); }