Skip to content
This repository has been archived by the owner on Jul 15, 2022. It is now read-only.

Commit

Permalink
Fixed packets being rewritten for wrong protocols
Browse files Browse the repository at this point in the history
  • Loading branch information
Zartec committed Mar 3, 2016
1 parent bb0bb71 commit ff92b11
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 17 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

BungeeCord for 1.7/1.8/1.9
==========
[![Build Status](https://travis-ci.org/hexagonmc/BungeeCord.svg?branch=master)](https://travis-ci.org/hexagonmc/BungeeCord)
[![Build Status](https://travis-ci.org/HexagonMC/BungeeCord.svg?branch=master)](https://travis-ci.org/HexagonMC/BungeeCord)

This is a fork of md_5's BungeeCord
https://www.spigotmc.org/threads/1-8-1-9-bungeecord.392/
Expand Down
12 changes: 6 additions & 6 deletions protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java
Original file line number Diff line number Diff line change
Expand Up @@ -191,20 +191,20 @@ protected final void registerPacket(int id, int newId, Class<? extends DefinedPa
packetClasses[id] = packetClass;
packetMap.put( packetClass, id );

packetRemap.get( ProtocolConstants.MINECRAFT_1_7_2 ).put( id, id );
packetRemapInv.get( ProtocolConstants.MINECRAFT_1_7_2 ).put( id, id );
packetRemap.get( ProtocolConstants.MINECRAFT_1_7_6 ).put( id, id );
packetRemapInv.get( ProtocolConstants.MINECRAFT_1_7_6 ).put( id, id );
if ( !newOnly )
{
packetRemap.get( ProtocolConstants.MINECRAFT_1_7_2 ).put( id, id );
packetRemapInv.get( ProtocolConstants.MINECRAFT_1_7_2 ).put( id, id );
packetRemap.get( ProtocolConstants.MINECRAFT_1_7_6 ).put( id, id );
packetRemapInv.get( ProtocolConstants.MINECRAFT_1_7_6 ).put( id, id );
packetRemap.get( ProtocolConstants.MINECRAFT_1_8 ).put( id, id );
packetRemapInv.get( ProtocolConstants.MINECRAFT_1_8 ).put( id, id );
}

if( !oldOnly )
{
packetRemap.get( ProtocolConstants.MINECRAFT_1_9 ).put( newId, id );
packetRemapInv.get( ProtocolConstants.MINECRAFT_1_9 ).put( id, newId );
packetRemap.get( ProtocolConstants.MINECRAFT_1_9 ).put( newId, id );
packetRemapInv.get( ProtocolConstants.MINECRAFT_1_9 ).put( id, newId );
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package net.md_5.bungee.module;


import java.io.IOException;
import java.net.URL;
import java.net.URLConnection;
Expand All @@ -10,27 +11,29 @@
import lombok.Data;
import net.md_5.bungee.Util;


@Data
public class TravisCiModuleSource implements ModuleSource
{

@Override
public void retrieve(ModuleSpec module, ModuleVersion version)
{
System.out.println( "Attempting to Jenkins download module " + module.getName() + " v" + version.getBuild() );
System.out.println("Attempting to download Tracis-CI module " + module.getName() + " v" + version.getBuild());
try
{
URL website = new URL( "https://github.com/HexagonMC/BungeeCord/releases/download/v" + version.getBuild() + "/" + module.getName() + ".jar" );
URL website = new URL("https://github.com/HexagonMC/BungeeCord/releases/download/v" + version.getBuild() + "/" + module.getName() + ".jar");
URLConnection con = website.openConnection();
// 15 second timeout at various stages
con.setConnectTimeout( 15000 );
con.setReadTimeout( 15000 );

Files.write( ByteStreams.toByteArray( con.getInputStream() ), module.getFile() );
System.out.println( "Download complete" );
} catch ( IOException ex )
con.setConnectTimeout(15000);
con.setReadTimeout(15000);

Files.write(ByteStreams.toByteArray(con.getInputStream()), module.getFile());
System.out.println("Download complete");
}
catch (IOException ex)
{
System.out.println( "Failed to download: " + Util.exception( ex ) );
System.out.println("Failed to download: " + Util.exception(ex));
}
}
}

0 comments on commit ff92b11

Please sign in to comment.