1
0

Merge branch 'master' into EntityCustomName

This commit is contained in:
Howaner 2014-09-02 19:36:14 +02:00
commit 42dcd534df
7 changed files with 252 additions and 74 deletions

View File

@ -85,6 +85,21 @@ Sandstone, 4 = Sand, 1:1, 1:2, 2:1, 2:2
SmoothSandstone, 4 = Sandstone, 1:1, 1:2, 2:1, 2:2 SmoothSandstone, 4 = Sandstone, 1:1, 1:2, 2:1, 2:2
OrnamentSandstone = SandstoneSlab, 1:1, 1:2 OrnamentSandstone = SandstoneSlab, 1:1, 1:2
JackOLantern = Pumpkin, 1:1 | Torch, 1:2 JackOLantern = Pumpkin, 1:1 | Torch, 1:2
PolishedGranite, 4 = Granite, 1:1, 1:2, 2:1, 2:2
PolishedDiorite, 4 = Diorite, 1:1, 1:2, 2:1, 2:2
PolishedAndesite, 4 = Andesite, 1:1, 1:2, 2:1, 2:2
CoarsedDirt, 4 = Dirt, 1:1, 2:2 | Gravel, 1:2, 2:1
CoarsedDirt, 4 = Gravel, 1:1, 2:2 | Dirt, 1:2, 2:1
SlimeBlock = Slimeball, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3, 3:1, 3:2, 3:3
Prismarine = PrismarineShard, 1:1, 1:2, 2:1, 2:2
PrismarineBricks = PrismarineShard, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3, 3:1, 3:2, 3:3
DarkPrismarine = PrismarineShard, 1:1, 1:2, 1:3, 2:1, 2:3, 3:1, 3:2, 3:3 | Inksac, 2:2
SeaLantern = PrismarineShard, 1:1, 1:3, 3:1, 3:3 | PrismarineCrystals, 1:2, 2:1, 2:2, 2:3, 3:2
RedSandstone, 4 = RedSand, 1:1, 1:2, 2:1, 2:2
ChiseledRedSandstone, 4 = RedSandstoneSlab, 1:1, 1:2
SmoothRedSandstone, 4 = RedSand, 1:1, 1:2, 2:1, 2:2
MossyStoneBrick = Stonebrick, * | Vines, *
Leather = RabbitHide, 1:1, 1:2, 2:1, 2:2
# Slabs: # Slabs:
StoneSlab, 6 = Stone, 1:1, 2:1, 3:1 StoneSlab, 6 = Stone, 1:1, 2:1, 3:1
@ -101,6 +116,7 @@ StonebrickSlab, 6 = StoneBrick, 1:1, 2:1, 3:1
NetherbrickSlab, 6 = NetherBrick, 1:1, 2:1, 3:1 NetherbrickSlab, 6 = NetherBrick, 1:1, 2:1, 3:1
Quartzslab, 6 = QuartzBlock, 1:1, 2:1, 3:1 Quartzslab, 6 = QuartzBlock, 1:1, 2:1, 3:1
snow, 6 = SnowBlock, 1:1, 2:1, 3:1 snow, 6 = SnowBlock, 1:1, 2:1, 3:1
RedSandstoneSlab, 6 = RedSandstone, 1:1, 2:1, 3:1
# Stairs: # Stairs:
@ -128,6 +144,8 @@ quartzstairs, 4 = QuartzBlock, 1:1, 1:2, 2:2, 1:3, 2:3, 3:3
quartzstairs, 4 = QuartzBlock, 3:1, 2:2, 3:2, 1:3, 2:3, 3:3 quartzstairs, 4 = QuartzBlock, 3:1, 2:2, 3:2, 1:3, 2:3, 3:3
StoneBrickStairs, 4 = StoneBrick, 1:1, 1:2, 2:2, 1:3, 2:3, 3:3 StoneBrickStairs, 4 = StoneBrick, 1:1, 1:2, 2:2, 1:3, 2:3, 3:3
StoneBrickStairs, 4 = StoneBrick, 3:1, 2:2, 3:2, 1:3, 2:3, 3:3 StoneBrickStairs, 4 = StoneBrick, 3:1, 2:2, 3:2, 1:3, 2:3, 3:3
RedSandstoneStairs, 4 = RedSandstone, 3:1, 2:2, 3:2, 1:3, 2:3, 3:3
RedSandstoneStairs, 4 = RedSandstone, 3:1, 2:2, 3:2, 1:3, 2:3, 3:3
# Other # Other
Carpet = Wool, 1:3, 2:3 Carpet = Wool, 1:3, 2:3
@ -262,11 +280,19 @@ ActivatorRail, 6 = IronIngot, 1:1, 1:2, 1:3, 3:1, 3:2, 3:3 | Stick, 2:1, 2:3 | R
#******************************************************# #******************************************************#
# Mechanisms # Mechanisms
# #
WoodenDoor = Planks, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3 WoodenDoor, 3 = OakPlanks, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3
IronDoor = IronIngot, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3 SpruceDoor, 3 = SprucePlanks, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3
BirchDoor, 3 = BirchPlanks, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3
JungleDoor, 3 = JunglePlanks, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3
AcaciaDoor, 3 = AcaciaPlanks, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3
DarkOakDoor, 3 = DarkOakPlanks, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3
IronDoor, 3 = IronIngot, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3
TrapDoor, 2 = Planks, 1:1, 2:1, 3:1, 1:2, 2:2, 3:2 TrapDoor, 2 = Planks, 1:1, 2:1, 3:1, 1:2, 2:2, 3:2
IronTrapDoor = IronIngot, 1:1, 1:2, 2:1, 2:2
WoodPlate = Planks, 1:1, 2:1 WoodPlate = Planks, 1:1, 2:1
StonePlate = Stone, 1:1, 2:1 StonePlate = Stone, 1:1, 2:1
lightweightedpressureplate = IronIngot, 1:1, 2:1
heavyweightedpressureplate = GoldIngot, 1:1, 2:1
StoneButton = Stone, 1:1 StoneButton = Stone, 1:1
WoodenButton = Planks, 1:1 WoodenButton = Planks, 1:1
RedstoneTorchOn = Stick, 1:2 | RedstoneDust, 1:1 RedstoneTorchOn = Stick, 1:2 | RedstoneDust, 1:1
@ -304,6 +330,8 @@ MelonSeeds = MelonSlice, *
PumpkinSeeds, 4 = Pumpkin, * PumpkinSeeds, 4 = Pumpkin, *
PumpkinPie = Pumpkin, * | Sugar, * | egg, * PumpkinPie = Pumpkin, * | Sugar, * | egg, *
Wheat, 9 = Haybale, * Wheat, 9 = Haybale, *
RabbitStew = Cooked Rabbit, 2:1 | Carrot, 1:2 | BakedPotato, 2:2 | BrownMushroom, 3:2 | Bowl, 2:3
RabbitStew = Cooked Rabbit, 2:1 | Carrot, 1:2 | BakedPotato, 2:2 | RedMushroom, 3:2 | Bowl, 2:3
@ -332,17 +360,49 @@ IronBars, 16 = IronIngot, 1:1, 2:1, 3:1, 1:2, 2:2, 3:2
Paper, 3 = Sugarcane, 1:1, 2:1, 3:1 Paper, 3 = Sugarcane, 1:1, 2:1, 3:1
Book = Paper, *, *, * | leather, * Book = Paper, *, *, * | leather, *
Bookandquill = Book, * | feather, * | inksac, * Bookandquill = Book, * | feather, * | inksac, *
Fence, 2 = Stick, 1:1, 2:1, 3:1, 1:2, 2:2, 3:2 Fence, 3 = OakPlanks, 1:1, 1:2, 3:1, 3:2 | Stick, 2:1, 2:2
SpruceFence, 3 = SprucePlanks, 1:1, 1:2, 3:1, 3:2 | Stick, 2:1, 2:2
BirchFence, 3 = BirchPlanks, 1:1, 1:2, 3:1, 3:2 | Stick, 2:1, 2:2
JungleFence, 3 = JunglePlanks, 1:1, 1:2, 3:1, 3:2 | Stick, 2:1, 2:2
DarkOakFence, 3 = DarkOakPlanks, 1:1, 1:2, 3:1, 3:2 | Stick, 2:1, 2:2
AcaciaFence, 3 = AcaciaPlanks, 1:1, 1:2, 3:1, 3:2 | Stick, 2:1, 2:2
Cobblestonewall, 6 = cobblestone, 1:2, 1:3, 2:2, 2:3, 3:2, 3:3 Cobblestonewall, 6 = cobblestone, 1:2, 1:3, 2:2, 2:3, 3:2, 3:3
mossycobblestonewall, 6 = mossycobblestone, 1:2, 1:3, 2:2, 2:3, 3:2, 3:3 mossycobblestonewall, 6 = mossycobblestone, 1:2, 1:3, 2:2, 2:3, 3:2, 3:3
NetherBrickFence, 6 = NetherBrick, 1:1, 2:1, 3:1, 1:2, 2:2, 3:2 NetherBrickFence, 6 = NetherBrick, 1:1, 2:1, 3:1, 1:2, 2:2, 3:2
FenceGate = Stick, 1:1, 1:2, 3:1, 3:2 | Planks, 2:1, 2:2 FenceGate = Stick, 1:1, 1:2, 3:1, 3:2 | OakPlanks, 2:1, 2:2
SpruceFenceGate = Stick, 1:1, 1:2, 3:1, 3:2 | SprucePlanks, 2:1, 2:2
BirchFenceGate = Stick, 1:1, 1:2, 3:1, 3:2 | BirchPlanks, 2:1, 2:2
JungleFenceGate = Stick, 1:1, 1:2, 3:1, 3:2 | JunglePlanks, 2:1, 2:2
DarkOakFenceGate = Stick, 1:1, 1:2, 3:1, 3:2 | DarkOakPlanks, 2:1, 2:2
AcaciaFenceGate = Stick, 1:1, 1:2, 3:1, 3:2 | AcaciaPlanks, 2:1, 2:2
Bed = Planks, 1:2, 2:2, 3:2 | Wool, 1:1, 2:1, 3:1 Bed = Planks, 1:2, 2:2, 3:2 | Wool, 1:1, 2:1, 3:1
GoldIngot = GoldNugget, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3, 3:1, 3:2, 3:3 GoldIngot = GoldNugget, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3, 3:1, 3:2, 3:3
EyeOfEnder = EnderPearl, * | BlazePowder, * EyeOfEnder = EnderPearl, * | BlazePowder, *
Beacon = Glass, 1:1, 1:2, 2:1, 3:1, 3:2 | Obsidian, 1:3, 2:3, 3:3 | NetherStar, 2:2 Beacon = Glass, 1:1, 1:2, 2:1, 3:1, 3:2 | Obsidian, 1:3, 2:3, 3:3 | NetherStar, 2:2
Anvil = IronBlock, 1:1, 2:1, 3:1 | IronIngot, 2:2, 1:3, 2:3, 3:3 Anvil = IronBlock, 1:1, 2:1, 3:1 | IronIngot, 2:2, 1:3, 2:3, 3:3
FlowerPot = Brick, 1:2, 2:3, 3:2 FlowerPot = Brick, 1:2, 2:3, 3:2
ArmorStand = Stick, 1:1, 1:3, 2:1, 2:2, 3:1, 3:3 | StoneSlab, 2:3
# These are just the basic ones, you can add various shapes and stuff to each of them
# ToDo: Add the various shapes (saved in NBT-Tags, not in meta)
# Banners:
WhiteBanner = Stick, 2:3 | WhiteWool, 1:1, 1:2, 2:1, 2:2, 2:1, 2:2
OrangeBanner = Stick, 2:3 | OrangeWool, 1:1, 1:2, 2:1, 2:2, 2:1, 2:2
MagentaBanner = Stick, 2:3 | MagentaWool, 1:1, 1:2, 2:1, 2:2, 2:1, 2:2
LightBlueBanner = Stick, 2:3 | LightBlueWool, 1:1, 1:2, 2:1, 2:2, 2:1, 2:2
YellowBanner = Stick, 2:3 | YellowWool, 1:1, 1:2, 2:1, 2:2, 2:1, 2:2
LimeBanner = Stick, 2:3 | LimeWool, 1:1, 1:2, 2:1, 2:2, 2:1, 2:2
PinkBanner = Stick, 2:3 | PinkWool, 1:1, 1:2, 2:1, 2:2, 2:1, 2:2
GrayBanner = Stick, 2:3 | GrayWool, 1:1, 1:2, 2:1, 2:2, 2:1, 2:2
LightGrayBanner = Stick, 2:3 | LightGrayWool, 1:1, 1:2, 2:1, 2:2, 2:1, 2:2
CyanBanner = Stick, 2:3 | CyanWool, 1:1, 1:2, 2:1, 2:2, 2:1, 2:2
PurpleBanner = Stick, 2:3 | PurpleWool, 1:1, 1:2, 2:1, 2:2, 2:1, 2:2
BlueBanner = Stick, 2:3 | BlueWool, 1:1, 1:2, 2:1, 2:2, 2:1, 2:2
BrownBanner = Stick, 2:3 | BrownWool, 1:1, 1:2, 2:1, 2:2, 2:1, 2:2
GreenBanner = Stick, 2:3 | GreenWool, 1:1, 1:2, 2:1, 2:2, 2:1, 2:2
RedBanner = Stick, 2:3 | RedWool, 1:1, 1:2, 2:1, 2:2, 2:1, 2:2
BlackBanner = Stick, 2:3 | BlackWool, 1:1, 1:2, 2:1, 2:2, 2:1, 2:2

View File

@ -56,6 +56,10 @@ TallGrass = NetherBrickItem
RawFish = CookedFish RawFish = CookedFish
Log = CharCoal Log = CharCoal
Cactus = GreenDye Cactus = GreenDye
WetSponge = Sponge
Stonebrick = CrackedStonebrick
RawRabbit = CookedRabbit
RawMutton = CookedMutton
@ -70,6 +74,11 @@ Cactus = GreenDye
! Planks = 300 # -> 15 sec ! Planks = 300 # -> 15 sec
! Stick = 100 # -> 5 sec ! Stick = 100 # -> 5 sec
! Fence = 300 # -> 15 sec ! Fence = 300 # -> 15 sec
! SpruceFence = 300 # -> 15 sec
! BirchFence = 300 # -> 15 sec
! JungleFence = 300 # -> 15 sec
! DarkOakFence = 300 # -> 15 sec
! AcaciaFence = 300 # -> 15 sec
! WoodStairs = 300 # -> 15 sec ! WoodStairs = 300 # -> 15 sec
! Workbench = 300 # -> 15 sec ! Workbench = 300 # -> 15 sec
! Bookshelf = 300 # -> 15 sec ! Bookshelf = 300 # -> 15 sec
@ -83,6 +92,10 @@ Cactus = GreenDye
! NoteBlock = 300 # -> 15 sec ! NoteBlock = 300 # -> 15 sec
! DaylightSensor = 300 # -> 15 sec ! DaylightSensor = 300 # -> 15 sec
! FenceGate = 300 # -> 15 sec ! FenceGate = 300 # -> 15 sec
! SpruceFenceGate = 300 # -> 15 sec
! BirchFenceGate = 300 # -> 15 sec
! JungleFenceGate = 300 # -> 15 sec
! DarkOakFenceGate = 300 # -> 15 sec
! Trapdoor = 300 # -> 15 sec ! Trapdoor = 300 # -> 15 sec
! TrappedChest = 300 # -> 15 sec ! TrappedChest = 300 # -> 15 sec
! WoodPlate = 300 # -> 15 sec ! WoodPlate = 300 # -> 15 sec
@ -92,3 +105,4 @@ Cactus = GreenDye
! WoodHoe = 200 # -> 10 sec ! WoodHoe = 200 # -> 10 sec
! WoodSword = 200 # -> 10 sec ! WoodSword = 200 # -> 10 sec

View File

@ -1,9 +1,17 @@
[Items] [Items]
air=0 air=0
rock=1 rock=1
granite=1:1
polishedgranite=1:2
diorite=1:3
polisheddiorite=1:4
andesite=1:5
polishedandesite=1:6
stone=1 stone=1
grass=2 grass=2
dirt=3 dirt=3
coarseddirt=3:1
podzol=3:2
cobblestone=4 cobblestone=4
cobble=4 cobble=4
planks=5 planks=5
@ -45,6 +53,7 @@ stilllava=11
slava=11 slava=11
stationarylava=11 stationarylava=11
sand=12 sand=12
redsand=12:1
gravel=13 gravel=13
goldore=14 goldore=14
ironore=15 ironore=15
@ -69,6 +78,7 @@ spruceleaves=18:1
birchleaves=18:2 birchleaves=18:2
jungleleaves=18:3 jungleleaves=18:3
sponge=19 sponge=19
wetsponge=19:1
glass=20 glass=20
lapisore=21 lapisore=21
lapisblock=22 lapisblock=22
@ -395,9 +405,42 @@ acaciawoodstairs=163
bigoakwoodstiars=164 bigoakwoodstiars=164
darkoakwoodstairs=164 darkoakwoodstairs=164
roofedoakwoodstairs=164 roofedoakwoodstairs=164
slimeblock=165
irontrapdoor=167
prismarine=168
prismarinebricks=168:1
darkprismarine=168:2
sealantern=169
haybale=170 haybale=170
carpet=171 carpet=171
hardenedclay=172 hardenedclay=172
redsandstone=179
chiseledredsandstone=179:1
smoothredsandstone=179:2
redsandstonestairs=180
redsandstoneslab=182
coniferfencegate=183
pinefencegate=183
sprucefencegate=183
darkfencegate=183
birchfencegate=184
whitefencegate=184
junglefencegate=185
darkoakfencegate=186
bigoakfencegate=186
roofedoakfencegate=186
acaciafencegate=187
coniferfence=188
pinefence=188
sprucefence=188
darkfence=188
birchfence=189
whitefence=189
junglefence=190
darkoakfence=191
bigoakfence=191
roofedoakfence=191
acaciafence=192
ironshovel=256 ironshovel=256
ironspade=256 ironspade=256
ironpickaxe=257 ironpickaxe=257
@ -645,13 +688,52 @@ netherbrickitem=405
netherquartz=406 netherquartz=406
tntminecart=407 tntminecart=407
hopperminecart=408 hopperminecart=408
prismarineshard=409
prismarinecrystals=410
rawrabbit=411
cookedrabbit=412
rabbitstew=413
rabbitsoup=413
rabbitsfood=414
rabbithide=415
armorstand=416
ironhorsearmor=417 ironhorsearmor=417
goldhorsearmor=418 goldhorsearmor=418
diamondhorsearmor=419 diamondhorsearmor=419
lead=420 lead=420
nametag=421 nametag=421
commandblockminecart=422 commandblockminecart=422
rawmutton=423
cookedmutton=424
banner=425
blackbanner=415:0
redbanner=415:1
greenbanner=415:2
brownbanner=415:3
bluebanner=415:4
purplebanner=415:5
cyanbanner=415:6
silverbanner=415:7
lightgraybanner=415:7
graybanner=415:8
pinkbanner=415:9
limebanner=415:10
yellowbanner=415:11
lightbluebanner=415:12
magentabanner=415:13
orangebanner=415:14
whitebanner=415:15
coniferdoor=427
pinedoor=427
sprucedoor=427
darkdoor=427
birchdoor=428
whitedoor=428
jungledoor=429
acaciadoor=430
bigoakdoor=431
darkoakdoor=431
roofedoakdoor=431
goldrecord=2256 goldrecord=2256
greenrecord=2257 greenrecord=2257
blocksrecord=2258 blocksrecord=2258

View File

@ -197,32 +197,32 @@ public:
inline static int GetHeight(const HeightMap & a_HeightMap, int a_X, int a_Z) inline static int GetHeight(const HeightMap & a_HeightMap, int a_X, int a_Z)
{ {
ASSERT((a_X >= 0) && (a_X <= Width)); ASSERT((a_X >= 0) && (a_X < Width));
ASSERT((a_Z >= 0) && (a_Z <= Width)); ASSERT((a_Z >= 0) && (a_Z < Width));
return a_HeightMap[a_X + Width * a_Z]; return a_HeightMap[a_X + Width * a_Z];
} }
inline static void SetHeight(HeightMap & a_HeightMap, int a_X, int a_Z, unsigned char a_Height) inline static void SetHeight(HeightMap & a_HeightMap, int a_X, int a_Z, unsigned char a_Height)
{ {
ASSERT((a_X >= 0) && (a_X <= Width)); ASSERT((a_X >= 0) && (a_X < Width));
ASSERT((a_Z >= 0) && (a_Z <= Width)); ASSERT((a_Z >= 0) && (a_Z < Width));
a_HeightMap[a_X + Width * a_Z] = a_Height; a_HeightMap[a_X + Width * a_Z] = a_Height;
} }
inline static EMCSBiome GetBiome(const BiomeMap & a_BiomeMap, int a_X, int a_Z) inline static EMCSBiome GetBiome(const BiomeMap & a_BiomeMap, int a_X, int a_Z)
{ {
ASSERT((a_X >= 0) && (a_X <= Width)); ASSERT((a_X >= 0) && (a_X < Width));
ASSERT((a_Z >= 0) && (a_Z <= Width)); ASSERT((a_Z >= 0) && (a_Z < Width));
return a_BiomeMap[a_X + Width * a_Z]; return a_BiomeMap[a_X + Width * a_Z];
} }
inline static void SetBiome(BiomeMap & a_BiomeMap, int a_X, int a_Z, EMCSBiome a_Biome) inline static void SetBiome(BiomeMap & a_BiomeMap, int a_X, int a_Z, EMCSBiome a_Biome)
{ {
ASSERT((a_X >= 0) && (a_X <= Width)); ASSERT((a_X >= 0) && (a_X < Width));
ASSERT((a_Z >= 0) && (a_Z <= Width)); ASSERT((a_Z >= 0) && (a_Z < Width));
a_BiomeMap[a_X + Width * a_Z] = a_Biome; a_BiomeMap[a_X + Width * a_Z] = a_Biome;
} }

View File

@ -150,10 +150,14 @@ void cPickup::Tick(float a_Dt, cChunk & a_Chunk)
} }
} }
if (!IsDestroyed() && (m_Item.m_ItemCount < m_Item.GetMaxStackSize())) // Don't combine into an already full pickup // Try to combine the pickup with adjacent same-item pickups:
if (!IsDestroyed() && (m_Item.m_ItemCount < m_Item.GetMaxStackSize())) // Don't combine if already full
{ {
// By using a_Chunk's ForEachEntity() instead of cWorld's, pickups don't combine across chunk boundaries.
// That is a small price to pay for not having to traverse the entire world for each entity.
// The speedup in the tick thread is quite considerable.
cPickupCombiningCallback PickupCombiningCallback(GetPosition(), this); cPickupCombiningCallback PickupCombiningCallback(GetPosition(), this);
m_World->ForEachEntity(PickupCombiningCallback); // Not ForEachEntityInChunk, otherwise pickups don't combine across chunk boundaries a_Chunk.ForEachEntity(PickupCombiningCallback);
if (PickupCombiningCallback.FoundMatchingPickup()) if (PickupCombiningCallback.FoundMatchingPickup())
{ {
m_World->BroadcastEntityMetadata(*this); m_World->BroadcastEntityMetadata(*this);

View File

@ -979,9 +979,18 @@ bool cProtocolRecognizer::TryRecognizeLengthedProtocol(UInt32 a_PacketLengthRema
AString ServerAddress; AString ServerAddress;
short ServerPort; short ServerPort;
UInt32 NextState; UInt32 NextState;
m_Buffer.ReadVarUTF8String(ServerAddress); if (!m_Buffer.ReadVarUTF8String(ServerAddress))
m_Buffer.ReadBEShort(ServerPort); {
m_Buffer.ReadVarInt(NextState); break;
}
if (!m_Buffer.ReadBEShort(ServerPort))
{
break;
}
if (!m_Buffer.ReadVarInt(NextState))
{
break;
}
m_Buffer.CommitRead(); m_Buffer.CommitRead();
m_Protocol = new cProtocol172(m_Client, ServerAddress, (UInt16)ServerPort, NextState); m_Protocol = new cProtocol172(m_Client, ServerAddress, (UInt16)ServerPort, NextState);
return true; return true;
@ -991,9 +1000,18 @@ bool cProtocolRecognizer::TryRecognizeLengthedProtocol(UInt32 a_PacketLengthRema
AString ServerAddress; AString ServerAddress;
short ServerPort; short ServerPort;
UInt32 NextState; UInt32 NextState;
m_Buffer.ReadVarUTF8String(ServerAddress); if (!m_Buffer.ReadVarUTF8String(ServerAddress))
m_Buffer.ReadBEShort(ServerPort); {
m_Buffer.ReadVarInt(NextState); break;
}
if (!m_Buffer.ReadBEShort(ServerPort))
{
break;
}
if (!m_Buffer.ReadVarInt(NextState))
{
break;
}
m_Buffer.CommitRead(); m_Buffer.CommitRead();
m_Protocol = new cProtocol176(m_Client, ServerAddress, (UInt16)ServerPort, NextState); m_Protocol = new cProtocol176(m_Client, ServerAddress, (UInt16)ServerPort, NextState);
return true; return true;

View File

@ -45,7 +45,7 @@ int main(int argc, char ** argv)
BLOCKTYPE * WritePosition = &TestBuffer[WritePosIdx]; BLOCKTYPE * WritePosition = &TestBuffer[WritePosIdx];
memset(TestBuffer, 0x03, sizeof(TestBuffer)); memset(TestBuffer, 0x03, sizeof(TestBuffer));
size_t LastReportedStep = 1; size_t LastReportedStep = 1;
for (size_t idx = 0; idx < 5000; idx += 7) for (size_t idx = 0; idx < 5000; idx += 73)
{ {
if (idx / 500 != LastReportedStep) if (idx / 500 != LastReportedStep)
{ {
@ -53,7 +53,7 @@ int main(int argc, char ** argv)
LastReportedStep = idx / 500; LastReportedStep = idx / 500;
} }
for (size_t len = 3; len < 1000; len += 13) for (size_t len = 3; len < 700; len += 13)
{ {
Data.CopyBlockTypes(WritePosition, idx, len); Data.CopyBlockTypes(WritePosition, idx, len);