public void WriteAddEntity( byte id, Player player, Position pos ) { Write( OutputCodes.AddEntity ); Write( id ); Write( player.GetListName() ); Write( (short)pos.x ); Write( (short)pos.h ); Write( (short)pos.y ); Write( pos.r ); Write( pos.l ); }
public void WriteAddEntity( byte id, Player player, Position pos ) { if( player == null ) throw new ArgumentNullException( "player" ); Write( OpCode.AddEntity ); Write( id ); Write( player.GetListName() ); Write( pos.X ); Write( pos.H ); Write( pos.Y ); Write( pos.R ); Write( pos.L ); }
internal static Packet MakeAddEntity(Player player, Position pos) { Packet packet = new Packet(74); packet.data[0] = (byte)OutputCodes.AddEntity; packet.data[1] = (byte)player.id; ASCIIEncoding.ASCII.GetBytes(player.GetListName().PadRight(64), 0, 64, packet.data, 2); ToNetOrder(pos.x, packet.data, 66); ToNetOrder(pos.h, packet.data, 68); ToNetOrder(pos.y, packet.data, 70); packet.data[72] = pos.r; packet.data[73] = pos.l; return(packet); }
public void WriteAddEntity(byte id, Player player, Position pos) { if (player == null) { throw new ArgumentNullException("player"); } Write(OpCode.AddEntity); Write(id); Write(player.GetListName()); Write(pos.X); Write(pos.H); Write(pos.Y); Write(pos.R); Write(pos.L); }
internal static Packet MakeAddEntity( Player player, Position pos ) { Packet packet = new Packet( 74 ); packet.data[0] = (byte)OutputCodes.AddEntity; packet.data[1] = (byte)player.id; ASCIIEncoding.ASCII.GetBytes( player.GetListName().PadRight( 64 ), 0, 64, packet.data, 2 ); ToNetOrder( pos.x, packet.data, 66 ); ToNetOrder( pos.h, packet.data, 68 ); ToNetOrder( pos.y, packet.data, 70 ); packet.data[72] = pos.r; packet.data[73] = pos.l; return packet; }
void ReAddEntity( VisibleEntity entity, Player player, Position newPos ) { SendNow( PacketWriter.MakeRemoveEntity( entity.Id ) ); SendNow( PacketWriter.MakeAddEntity( entity.Id, player.GetListName(), newPos ) ); entity.LastKnownPosition = newPos; }
void AddEntity( Player player, Position newPos ) { var pos = new VisibleEntity( newPos, freePlayerIDs.Pop(), player.Info.Rank ); entities.Add( player, pos ); SendNow( PacketWriter.MakeAddEntity( pos.Id, player.GetListName(), newPos ) ); }