Preparing "allow spectators" flag in network protocol (#215).

This commit is contained in:
lotodore
2013-10-27 00:41:13 +02:00
parent 11a45cd6d6
commit 6992c732af
8 changed files with 160 additions and 9 deletions
@@ -628,6 +628,16 @@ public final class ProtoBuf {
* <code>repeated uint32 manualBlinds = 14 [packed = true];</code>
*/
int getManualBlinds(int index);
// optional bool allowSpectators = 15 [default = true];
/**
* <code>optional bool allowSpectators = 15 [default = true];</code>
*/
boolean hasAllowSpectators();
/**
* <code>optional bool allowSpectators = 15 [default = true];</code>
*/
boolean getAllowSpectators();
}
/**
* Protobuf type {@code NetGameInfo}
@@ -770,6 +780,11 @@ public final class ProtoBuf {
input.popLimit(limit);
break;
}
case 120: {
bitField0_ |= 0x00002000;
allowSpectators_ = input.readBool();
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
@@ -1270,6 +1285,22 @@ public final class ProtoBuf {
}
private int manualBlindsMemoizedSerializedSize = -1;
// optional bool allowSpectators = 15 [default = true];
public static final int ALLOWSPECTATORS_FIELD_NUMBER = 15;
private boolean allowSpectators_;
/**
* <code>optional bool allowSpectators = 15 [default = true];</code>
*/
public boolean hasAllowSpectators() {
return ((bitField0_ & 0x00002000) == 0x00002000);
}
/**
* <code>optional bool allowSpectators = 15 [default = true];</code>
*/
public boolean getAllowSpectators() {
return allowSpectators_;
}
private void initFields() {
gameName_ = "";
netGameType_ = de.pokerth.protocol.ProtoBuf.NetGameInfo.NetGameType.normalGame;
@@ -1285,6 +1316,7 @@ public final class ProtoBuf {
firstSmallBlind_ = 0;
startMoney_ = 0;
manualBlinds_ = java.util.Collections.emptyList();
allowSpectators_ = true;
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
@@ -1384,6 +1416,9 @@ public final class ProtoBuf {
for (int i = 0; i < manualBlinds_.size(); i++) {
output.writeUInt32NoTag(manualBlinds_.get(i));
}
if (((bitField0_ & 0x00002000) == 0x00002000)) {
output.writeBool(15, allowSpectators_);
}
}
private int memoizedSerializedSize = -1;
@@ -1458,6 +1493,10 @@ public final class ProtoBuf {
}
manualBlindsMemoizedSerializedSize = dataSize;
}
if (((bitField0_ & 0x00002000) == 0x00002000)) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(15, allowSpectators_);
}
memoizedSerializedSize = size;
return size;
}
@@ -1577,6 +1616,8 @@ public final class ProtoBuf {
bitField0_ = (bitField0_ & ~0x00001000);
manualBlinds_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00002000);
allowSpectators_ = true;
bitField0_ = (bitField0_ & ~0x00004000);
return this;
}
@@ -1657,6 +1698,10 @@ public final class ProtoBuf {
bitField0_ = (bitField0_ & ~0x00002000);
}
result.manualBlinds_ = manualBlinds_;
if (((from_bitField0_ & 0x00004000) == 0x00004000)) {
to_bitField0_ |= 0x00002000;
}
result.allowSpectators_ = allowSpectators_;
result.bitField0_ = to_bitField0_;
return result;
}
@@ -1714,6 +1759,9 @@ public final class ProtoBuf {
}
}
if (other.hasAllowSpectators()) {
setAllowSpectators(other.getAllowSpectators());
}
return this;
}
@@ -2357,6 +2405,39 @@ public final class ProtoBuf {
return this;
}
// optional bool allowSpectators = 15 [default = true];
private boolean allowSpectators_ = true;
/**
* <code>optional bool allowSpectators = 15 [default = true];</code>
*/
public boolean hasAllowSpectators() {
return ((bitField0_ & 0x00004000) == 0x00004000);
}
/**
* <code>optional bool allowSpectators = 15 [default = true];</code>
*/
public boolean getAllowSpectators() {
return allowSpectators_;
}
/**
* <code>optional bool allowSpectators = 15 [default = true];</code>
*/
public Builder setAllowSpectators(boolean value) {
bitField0_ |= 0x00004000;
allowSpectators_ = value;
return this;
}
/**
* <code>optional bool allowSpectators = 15 [default = true];</code>
*/
public Builder clearAllowSpectators() {
bitField0_ = (bitField0_ & ~0x00004000);
allowSpectators_ = true;
return this;
}
// @@protoc_insertion_point(builder_scope:NetGameInfo)
}