Adding first code for new go-based dedicated server.
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
/*****************************************************************************
|
||||
* PokerTH dedicated server *
|
||||
* Copyright (C) 2014 Lothar May *
|
||||
* *
|
||||
* This program is free software: you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU Affero General Public License as *
|
||||
* published by the Free Software Foundation, either version 3 of the *
|
||||
* License, or (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU Affero General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU Affero General Public License *
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
||||
* *
|
||||
* *
|
||||
* Additional permission under GNU AGPL version 3 section 7 *
|
||||
* *
|
||||
* If you modify this program, or any covered work, by linking or *
|
||||
* combining it with the OpenSSL project's OpenSSL library (or a *
|
||||
* modified version of that library), containing parts covered by the *
|
||||
* terms of the OpenSSL or SSLeay licenses, the authors of PokerTH *
|
||||
* (Felix Hammer, Florian Thauer, Lothar May) grant you additional *
|
||||
* permission to convey the resulting work. *
|
||||
* Corresponding Source for a non-source form of such a combination *
|
||||
* shall include the source code for the parts of OpenSSL used as well *
|
||||
* as that of the covered work. *
|
||||
*****************************************************************************/
|
||||
package gameserver
|
||||
|
||||
import (
|
||||
"log"
|
||||
"sync/atomic"
|
||||
)
|
||||
|
||||
type Dispatcher struct {
|
||||
handler PacketHandler
|
||||
receiver chan SessionPacket
|
||||
lastSessionId uint32
|
||||
}
|
||||
|
||||
func NewDispatcher(handler PacketHandler) *Dispatcher {
|
||||
return &Dispatcher{handler, make(chan SessionPacket, RECV_DISPATCHER_NUM_PACKET_BUF), 0}
|
||||
}
|
||||
|
||||
func (d *Dispatcher) GetReceiver() *chan SessionPacket {
|
||||
return &d.receiver
|
||||
}
|
||||
|
||||
func (d *Dispatcher) GetNextSessionId() uint32 {
|
||||
return atomic.AddUint32(&d.lastSessionId, 1)
|
||||
}
|
||||
|
||||
func (d *Dispatcher) Run() {
|
||||
var sessionPacket SessionPacket
|
||||
for {
|
||||
select {
|
||||
case sessionPacket = <-d.receiver:
|
||||
log.Printf("Packet in dispatcher session %d type %d", sessionPacket.session.id, sessionPacket.packet.GetMessageType())
|
||||
d.handler.HandlePacket(sessionPacket.session, sessionPacket.packet)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
/*****************************************************************************
|
||||
* PokerTH dedicated server *
|
||||
* Copyright (C) 2014 Lothar May *
|
||||
* *
|
||||
* This program is free software: you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU Affero General Public License as *
|
||||
* published by the Free Software Foundation, either version 3 of the *
|
||||
* License, or (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU Affero General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU Affero General Public License *
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
||||
* *
|
||||
* *
|
||||
* Additional permission under GNU AGPL version 3 section 7 *
|
||||
* *
|
||||
* If you modify this program, or any covered work, by linking or *
|
||||
* combining it with the OpenSSL project's OpenSSL library (or a *
|
||||
* modified version of that library), containing parts covered by the *
|
||||
* terms of the OpenSSL or SSLeay licenses, the authors of PokerTH *
|
||||
* (Felix Hammer, Florian Thauer, Lothar May) grant you additional *
|
||||
* permission to convey the resulting work. *
|
||||
* Corresponding Source for a non-source form of such a combination *
|
||||
* shall include the source code for the parts of OpenSSL used as well *
|
||||
* as that of the covered work. *
|
||||
*****************************************************************************/
|
||||
package gameserver
|
||||
|
||||
import (
|
||||
"code.google.com/p/goprotobuf/proto"
|
||||
"container/list"
|
||||
"log"
|
||||
"pokerth"
|
||||
)
|
||||
|
||||
type PacketHandler interface {
|
||||
HandlePacket(session *Session, packet *pokerth.PokerTHMessage)
|
||||
}
|
||||
|
||||
type Lobby struct {
|
||||
sessions *list.List
|
||||
}
|
||||
|
||||
func NewLobby() *Lobby {
|
||||
return &Lobby{list.New()}
|
||||
}
|
||||
|
||||
func (l *Lobby) AddSession(session *Session) {
|
||||
log.Print("New session")
|
||||
l.sessions.PushBack(session)
|
||||
announce := &pokerth.PokerTHMessage{
|
||||
MessageType: pokerth.PokerTHMessage_PokerTHMessageType.Enum(pokerth.PokerTHMessage_Type_AnnounceMessage),
|
||||
AnnounceMessage: &pokerth.AnnounceMessage{
|
||||
ProtocolVersion: &pokerth.AnnounceMessage_Version{
|
||||
MajorVersion: proto.Uint32(NET_VERSION_MAJOR),
|
||||
MinorVersion: proto.Uint32(NET_VERSION_MINOR),
|
||||
},
|
||||
LatestGameVersion: &pokerth.AnnounceMessage_Version{
|
||||
MajorVersion: proto.Uint32(POKERTH_VERSION_MAJOR),
|
||||
MinorVersion: proto.Uint32(POKERTH_VERSION_MINOR),
|
||||
},
|
||||
LatestBetaRevision: proto.Uint32(0),
|
||||
ServerType: pokerth.AnnounceMessage_ServerType.Enum(pokerth.AnnounceMessage_serverTypeInternetAuth),
|
||||
NumPlayersOnServer: proto.Uint32(0),
|
||||
},
|
||||
}
|
||||
session.sender <- announce
|
||||
}
|
||||
|
||||
func (l *Lobby) HandlePacket(session *Session, packet *pokerth.PokerTHMessage) {
|
||||
log.Print("packet")
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
/*****************************************************************************
|
||||
* PokerTH dedicated server *
|
||||
* Copyright (C) 2014 Lothar May *
|
||||
* *
|
||||
* This program is free software: you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU Affero General Public License as *
|
||||
* published by the Free Software Foundation, either version 3 of the *
|
||||
* License, or (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU Affero General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU Affero General Public License *
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
||||
* *
|
||||
* *
|
||||
* Additional permission under GNU AGPL version 3 section 7 *
|
||||
* *
|
||||
* If you modify this program, or any covered work, by linking or *
|
||||
* combining it with the OpenSSL project's OpenSSL library (or a *
|
||||
* modified version of that library), containing parts covered by the *
|
||||
* terms of the OpenSSL or SSLeay licenses, the authors of PokerTH *
|
||||
* (Felix Hammer, Florian Thauer, Lothar May) grant you additional *
|
||||
* permission to convey the resulting work. *
|
||||
* Corresponding Source for a non-source form of such a combination *
|
||||
* shall include the source code for the parts of OpenSSL used as well *
|
||||
* as that of the covered work. *
|
||||
*****************************************************************************/
|
||||
package gameserver
|
||||
|
||||
import (
|
||||
"encoding/binary"
|
||||
"pokerth"
|
||||
)
|
||||
|
||||
const NET_HEADER_SIZE uint32 = 4
|
||||
|
||||
type PacketSerializer interface {
|
||||
ReadPacket(buf []byte, num uint32) (uint32, *pokerth.PokerTHMessage)
|
||||
WritePacket(buf []byte, packet *pokerth.PokerTHMessage) uint32
|
||||
}
|
||||
|
||||
func readPacketRaw(buf []byte, num uint32) (uint32, *pokerth.PokerTHMessage) {
|
||||
packet := &pokerth.PokerTHMessage{}
|
||||
err := packet.Unmarshal(buf[0:num])
|
||||
if err != nil {
|
||||
packet = nil
|
||||
}
|
||||
return num, packet
|
||||
}
|
||||
|
||||
func readPacketWithHeader(buf []byte, num uint32) (uint32, *pokerth.PokerTHMessage) {
|
||||
var bytesScanned uint32 = 0
|
||||
var packetSize uint32 = 0
|
||||
packet := &pokerth.PokerTHMessage{}
|
||||
if num >= NET_HEADER_SIZE {
|
||||
packetSize = binary.BigEndian.Uint32(buf[0:NET_HEADER_SIZE])
|
||||
if packetSize <= 0 {
|
||||
bytesScanned = NET_HEADER_SIZE
|
||||
} else if num >= NET_HEADER_SIZE+packetSize {
|
||||
bytesScanned, packet = readPacketRaw(buf[NET_HEADER_SIZE:], NET_HEADER_SIZE+packetSize)
|
||||
}
|
||||
}
|
||||
return bytesScanned, packet
|
||||
}
|
||||
|
||||
func writePacketGeneric(buf []byte, packet *pokerth.PokerTHMessage, headerSize uint32) uint32 {
|
||||
var bytesWritten uint32 = 0
|
||||
num, err := packet.MarshalTo(buf[headerSize:])
|
||||
if err == nil {
|
||||
if headerSize > 0 {
|
||||
binary.BigEndian.PutUint32(buf[0:headerSize], uint32(num))
|
||||
bytesWritten = uint32(num) + headerSize
|
||||
} else {
|
||||
bytesWritten = uint32(num)
|
||||
}
|
||||
}
|
||||
return bytesWritten
|
||||
}
|
||||
|
||||
type RawPacketSerializer struct {
|
||||
}
|
||||
|
||||
func (RawPacketSerializer) ReadPacket(buf []byte, num uint32) (uint32, *pokerth.PokerTHMessage) {
|
||||
return readPacketRaw(buf, num)
|
||||
}
|
||||
|
||||
func (RawPacketSerializer) WritePacket(buf []byte, packet *pokerth.PokerTHMessage) uint32 {
|
||||
return writePacketGeneric(buf, packet, 0)
|
||||
}
|
||||
|
||||
type HeaderPacketSerializer struct {
|
||||
}
|
||||
|
||||
func (HeaderPacketSerializer) ReadPacket(buf []byte, num uint32) (uint32, *pokerth.PokerTHMessage) {
|
||||
return readPacketWithHeader(buf, num)
|
||||
}
|
||||
|
||||
func (HeaderPacketSerializer) WritePacket(buf []byte, packet *pokerth.PokerTHMessage) uint32 {
|
||||
return writePacketGeneric(buf, packet, NET_HEADER_SIZE)
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
/*****************************************************************************
|
||||
* PokerTH dedicated server *
|
||||
* Copyright (C) 2014 Lothar May *
|
||||
* *
|
||||
* This program is free software: you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU Affero General Public License as *
|
||||
* published by the Free Software Foundation, either version 3 of the *
|
||||
* License, or (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU Affero General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU Affero General Public License *
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
||||
* *
|
||||
* *
|
||||
* Additional permission under GNU AGPL version 3 section 7 *
|
||||
* *
|
||||
* If you modify this program, or any covered work, by linking or *
|
||||
* combining it with the OpenSSL project's OpenSSL library (or a *
|
||||
* modified version of that library), containing parts covered by the *
|
||||
* terms of the OpenSSL or SSLeay licenses, the authors of PokerTH *
|
||||
* (Felix Hammer, Florian Thauer, Lothar May) grant you additional *
|
||||
* permission to convey the resulting work. *
|
||||
* Corresponding Source for a non-source form of such a combination *
|
||||
* shall include the source code for the parts of OpenSSL used as well *
|
||||
* as that of the covered work. *
|
||||
*****************************************************************************/
|
||||
package gameserver
|
||||
|
||||
import (
|
||||
"log"
|
||||
"net"
|
||||
"pokerth"
|
||||
)
|
||||
|
||||
const POKERTH_VERSION_MAJOR = 1
|
||||
const POKERTH_VERSION_MINOR = 11
|
||||
|
||||
const NET_VERSION_MAJOR = 5
|
||||
const NET_VERSION_MINOR = 1
|
||||
|
||||
const MAX_PACKET_SIZE uint32 = 384
|
||||
const RECV_BUF_SIZE uint32 = 4 * MAX_PACKET_SIZE
|
||||
const SEND_BUF_SIZE uint32 = 2 * MAX_PACKET_SIZE
|
||||
const SEND_NUM_PACKET_BUF = 2048
|
||||
const RECV_DISPATCHER_NUM_PACKET_BUF = 2048
|
||||
|
||||
type Session struct {
|
||||
id uint32
|
||||
PacketSerializer
|
||||
Connection net.Conn
|
||||
sender chan *pokerth.PokerTHMessage
|
||||
receiver *chan SessionPacket
|
||||
}
|
||||
|
||||
type SessionPacket struct {
|
||||
session *Session
|
||||
packet *pokerth.PokerTHMessage
|
||||
}
|
||||
|
||||
func NewSession(id uint32, serializer PacketSerializer, conn net.Conn, receiver *chan SessionPacket) *Session {
|
||||
return &Session{id, serializer, conn, make(chan *pokerth.PokerTHMessage, SEND_NUM_PACKET_BUF), receiver}
|
||||
}
|
||||
|
||||
func (s *Session) Run() {
|
||||
// run sender as separate goroutine
|
||||
go s.handleSend()
|
||||
s.handleReceive()
|
||||
}
|
||||
|
||||
func (s *Session) handleReceive() {
|
||||
// close connection on exit
|
||||
defer s.Connection.Close()
|
||||
|
||||
var buf [RECV_BUF_SIZE]byte
|
||||
var bufPos uint32 = 0
|
||||
for {
|
||||
// read upto RECV_BUF_SIZE bytes
|
||||
num, err := s.Connection.Read(buf[bufPos:])
|
||||
bufPos += uint32(num)
|
||||
if err != nil {
|
||||
log.Printf("Read error: %s\n", err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
bytesScanned, packet := s.ReadPacket(buf[0:bufPos], bufPos)
|
||||
|
||||
if bytesScanned > 0 {
|
||||
if packet == nil {
|
||||
log.Print("Invalid packet")
|
||||
} else {
|
||||
log.Printf("Packet in: %d\n", packet.GetMessageType())
|
||||
*s.receiver <- SessionPacket{s, packet}
|
||||
remainingBytes := bufPos - bytesScanned
|
||||
if remainingBytes > 0 {
|
||||
copy(buf[0:], buf[bytesScanned:remainingBytes])
|
||||
bufPos = remainingBytes
|
||||
} else {
|
||||
bufPos = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Session) handleSend() {
|
||||
var buf [RECV_BUF_SIZE]byte
|
||||
var packet *pokerth.PokerTHMessage
|
||||
for {
|
||||
select {
|
||||
case packet = <-s.sender:
|
||||
packetSize := s.WritePacket(buf[0:RECV_BUF_SIZE], packet)
|
||||
if packetSize > 0 {
|
||||
var bufStart uint32 = 0
|
||||
for bufStart < packetSize {
|
||||
num, err := s.Connection.Write(buf[bufStart:packetSize])
|
||||
if err != nil {
|
||||
log.Printf("Write error: %s\n", err.Error())
|
||||
return
|
||||
}
|
||||
bufStart += uint32(num)
|
||||
}
|
||||
log.Printf("Packet out: %d, size: %d\n", packet.GetMessageType(), packetSize)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
/*****************************************************************************
|
||||
* PokerTH dedicated server *
|
||||
* Copyright (C) 2014 Lothar May *
|
||||
* *
|
||||
* This program is free software: you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU Affero General Public License as *
|
||||
* published by the Free Software Foundation, either version 3 of the *
|
||||
* License, or (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU Affero General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU Affero General Public License *
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
||||
* *
|
||||
* *
|
||||
* Additional permission under GNU AGPL version 3 section 7 *
|
||||
* *
|
||||
* If you modify this program, or any covered work, by linking or *
|
||||
* combining it with the OpenSSL project's OpenSSL library (or a *
|
||||
* modified version of that library), containing parts covered by the *
|
||||
* terms of the OpenSSL or SSLeay licenses, the authors of PokerTH *
|
||||
* (Felix Hammer, Florian Thauer, Lothar May) grant you additional *
|
||||
* permission to convey the resulting work. *
|
||||
* Corresponding Source for a non-source form of such a combination *
|
||||
* shall include the source code for the parts of OpenSSL used as well *
|
||||
* as that of the covered work. *
|
||||
*****************************************************************************/
|
||||
package main
|
||||
|
||||
import (
|
||||
"code.google.com/p/go.net/websocket"
|
||||
"gameserver"
|
||||
"log"
|
||||
"net"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
var lobby *gameserver.Lobby
|
||||
var dispatcher *gameserver.Dispatcher
|
||||
|
||||
func main() {
|
||||
lobby = gameserver.NewLobby()
|
||||
dispatcher = gameserver.NewDispatcher(lobby)
|
||||
go dispatcher.Run()
|
||||
|
||||
listener, err := net.Listen("tcp", ":7234")
|
||||
if err != nil {
|
||||
log.Fatalf("Listen error: %s", err.Error())
|
||||
}
|
||||
go acceptSockets(listener)
|
||||
|
||||
server := websocket.Server{Handler: handleWebsocketConn}
|
||||
http.Handle("/pokerthwebsocket", server)
|
||||
http.ListenAndServe(":7233", nil)
|
||||
}
|
||||
|
||||
func acceptSockets(listener net.Listener) {
|
||||
for {
|
||||
conn, err := listener.Accept()
|
||||
if err != nil {
|
||||
log.Fatalf("Accept error: %s\n", err.Error())
|
||||
}
|
||||
s := gameserver.NewSession(dispatcher.GetNextSessionId(), gameserver.HeaderPacketSerializer{}, conn, dispatcher.GetReceiver())
|
||||
lobby.AddSession(s)
|
||||
go s.Run()
|
||||
}
|
||||
}
|
||||
|
||||
func handleWebsocketConn(ws *websocket.Conn) {
|
||||
ws.PayloadType = websocket.BinaryFrame
|
||||
s := gameserver.NewSession(dispatcher.GetNextSessionId(), gameserver.RawPacketSerializer{}, ws, dispatcher.GetReceiver())
|
||||
lobby.AddSession(s)
|
||||
s.Run()
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
+360
-315
@@ -1,6 +1,6 @@
|
||||
/*****************************************************************************
|
||||
* PokerTH - The open source texas holdem engine *
|
||||
* Copyright (C) 2006-2013 Felix Hammer, Florian Thauer, Lothar May *
|
||||
* Copyright (C) 2006-2014 Felix Hammer, Florian Thauer, Lothar May *
|
||||
* *
|
||||
* This program is free software: you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU Affero General Public License as *
|
||||
@@ -29,10 +29,16 @@
|
||||
* as that of the covered work. *
|
||||
*****************************************************************************/
|
||||
|
||||
import "src/third_party/gogoprotobuf/gogo.proto";
|
||||
|
||||
option java_package = "de.pokerth.protocol";
|
||||
option java_outer_classname = "ProtoBuf";
|
||||
option optimize_for = LITE_RUNTIME;
|
||||
|
||||
option (gogoproto.marshaler_all) = true;
|
||||
option (gogoproto.unmarshaler_all) = true;
|
||||
option (gogoproto.sizer_all) = true;
|
||||
|
||||
// Enumerations used by several messages.
|
||||
|
||||
enum NetGameMode {
|
||||
@@ -145,24 +151,21 @@ message AnnounceMessage {
|
||||
required uint32 numPlayersOnServer = 5;
|
||||
}
|
||||
|
||||
// buildId contains a constant build id (specific for Windows/Linux/Mac builds)
|
||||
message InitMessage {
|
||||
message AuthClientRequestMessage {
|
||||
required AnnounceMessage.Version requestedVersion = 1;
|
||||
// buildId contains a constant build id (specific for Windows/Linux/Mac builds)
|
||||
required uint32 buildId = 2;
|
||||
optional bytes myLastSessionId = 3;
|
||||
optional string authServerPassword = 4;
|
||||
enum LoginType {
|
||||
guestLogin = 0;
|
||||
authenticatedLogin = 1;
|
||||
unauthenticatedLogin = 2;
|
||||
}
|
||||
required LoginType login = 5;
|
||||
required LoginType login = 3;
|
||||
optional string authServerPassword = 4;
|
||||
// Only used for guest login or unauthenticated login.
|
||||
optional string nickName = 6;
|
||||
optional string nickName = 5;
|
||||
// Authenticated login data is according to SCRAM SHA-1
|
||||
optional bytes clientUserData = 7;
|
||||
// Ignored for guest login.
|
||||
optional bytes avatarHash = 8;
|
||||
optional bytes clientUserData = 6;
|
||||
}
|
||||
|
||||
message AuthServerChallengeMessage {
|
||||
@@ -174,12 +177,18 @@ message AuthClientResponseMessage {
|
||||
}
|
||||
|
||||
message AuthServerVerificationMessage {
|
||||
required bytes serverVerification = 1;
|
||||
required bytes yourSessionId = 1;
|
||||
required uint32 yourPlayerId = 2;
|
||||
optional bytes serverVerification = 3;
|
||||
}
|
||||
|
||||
message InitMessage {
|
||||
optional bytes myLastSessionId = 1;
|
||||
// Ignored for guest login.
|
||||
optional bytes avatarHash = 2;
|
||||
}
|
||||
|
||||
message InitAckMessage {
|
||||
required bytes yourSessionId = 1;
|
||||
required uint32 yourPlayerId = 2;
|
||||
optional bytes yourAvatarHash = 3;
|
||||
optional uint32 rejoinGameId = 4;
|
||||
}
|
||||
@@ -277,95 +286,98 @@ message PlayerInfoReplyMessage {
|
||||
optional PlayerInfoData playerInfoData = 2;
|
||||
}
|
||||
|
||||
// The following request will not be confirmed by the server. It is used,
|
||||
// optionally, to reduce server traffic. The server might ignore it.
|
||||
// The following request is used optionally to reduce server traffic.
|
||||
message SubscriptionRequestMessage {
|
||||
required uint32 requestId = 1;
|
||||
enum SubscriptionAction {
|
||||
unsubscribeGameList = 1;
|
||||
resubscribeGameList = 2;
|
||||
}
|
||||
required SubscriptionAction subscriptionAction = 1;
|
||||
required SubscriptionAction subscriptionAction = 2;
|
||||
}
|
||||
|
||||
message JoinExistingGameMessage {
|
||||
required uint32 gameId = 1;
|
||||
optional string password = 2;
|
||||
optional bool autoLeave = 3 [default = false];
|
||||
optional bool spectateOnly = 4 [default = false];
|
||||
message SubscriptionReplyMessage {
|
||||
required uint32 requestId = 1;
|
||||
required bool ack = 2;
|
||||
}
|
||||
|
||||
message JoinNewGameMessage {
|
||||
required NetGameInfo gameInfo = 1;
|
||||
optional string password = 2;
|
||||
optional bool autoLeave = 3;
|
||||
message CreateGameMessage {
|
||||
required uint32 requestId = 1;
|
||||
required NetGameInfo gameInfo = 2;
|
||||
optional string password = 3;
|
||||
optional bool autoLeave = 4;
|
||||
}
|
||||
|
||||
message RejoinExistingGameMessage {
|
||||
required uint32 gameId = 1;
|
||||
optional bool autoLeave = 2;
|
||||
message CreateGameFailedMessage {
|
||||
required uint32 requestId = 1;
|
||||
enum CreateGameFailureReason {
|
||||
notAllowedAsGuest = 1;
|
||||
gameNameInUse = 2;
|
||||
badGameName = 3;
|
||||
invalidSettings = 4;
|
||||
}
|
||||
required CreateGameFailureReason createGameFailureReason = 2;
|
||||
}
|
||||
|
||||
message JoinGameMessage {
|
||||
optional string password = 1;
|
||||
optional bool autoLeave = 2 [default = false];
|
||||
optional bool spectateOnly = 3 [default = false];
|
||||
}
|
||||
|
||||
message RejoinGameMessage {
|
||||
optional bool autoLeave = 1 [default = false];
|
||||
}
|
||||
|
||||
message JoinGameAckMessage {
|
||||
required uint32 gameId = 1;
|
||||
required bool areYouGameAdmin = 2;
|
||||
required NetGameInfo gameInfo = 3;
|
||||
optional bool spectateOnly = 4;
|
||||
required bool areYouGameAdmin = 1;
|
||||
required NetGameInfo gameInfo = 2;
|
||||
optional bool spectateOnly = 3;
|
||||
}
|
||||
|
||||
message JoinGameFailedMessage {
|
||||
required uint32 gameId = 1;
|
||||
enum JoinGameFailureReason {
|
||||
invalidGame = 1;
|
||||
gameIsFull = 2;
|
||||
gameIsRunning = 3;
|
||||
invalidPassword = 4;
|
||||
notAllowedAsGuest = 5;
|
||||
notInvited = 6;
|
||||
gameNameInUse = 7;
|
||||
badGameName = 8;
|
||||
invalidSettings = 9;
|
||||
ipAddressBlocked = 10;
|
||||
rejoinFailed = 11;
|
||||
noSpectatorsAllowed = 12;
|
||||
notInvited = 5;
|
||||
ipAddressBlocked = 6;
|
||||
rejoinFailed = 7;
|
||||
noSpectatorsAllowed = 8;
|
||||
}
|
||||
required JoinGameFailureReason joinGameFailureReason = 2;
|
||||
required JoinGameFailureReason joinGameFailureReason = 1;
|
||||
}
|
||||
|
||||
message GamePlayerJoinedMessage {
|
||||
required uint32 gameId = 1;
|
||||
required uint32 playerId = 2;
|
||||
required bool isGameAdmin = 3;
|
||||
required uint32 playerId = 1;
|
||||
required bool isGameAdmin = 2;
|
||||
}
|
||||
|
||||
message GamePlayerLeftMessage {
|
||||
required uint32 gameId = 1;
|
||||
required uint32 playerId = 2;
|
||||
required uint32 playerId = 1;
|
||||
enum GamePlayerLeftReason {
|
||||
leftOnRequest = 0;
|
||||
leftKicked = 1;
|
||||
leftError = 2;
|
||||
}
|
||||
required GamePlayerLeftReason gamePlayerLeftReason = 3;
|
||||
required GamePlayerLeftReason gamePlayerLeftReason = 2;
|
||||
}
|
||||
|
||||
message GameSpectatorJoinedMessage {
|
||||
required uint32 gameId = 1;
|
||||
required uint32 playerId = 2;
|
||||
required uint32 playerId = 1;
|
||||
}
|
||||
|
||||
message GameSpectatorLeftMessage {
|
||||
required uint32 gameId = 1;
|
||||
required uint32 playerId = 2;
|
||||
required GamePlayerLeftMessage.GamePlayerLeftReason gameSpectatorLeftReason = 3;
|
||||
required uint32 playerId = 1;
|
||||
required GamePlayerLeftMessage.GamePlayerLeftReason gameSpectatorLeftReason = 2;
|
||||
}
|
||||
|
||||
message GameAdminChangedMessage {
|
||||
required uint32 gameId = 1;
|
||||
required uint32 newAdminPlayerId = 2;
|
||||
required uint32 newAdminPlayerId = 1;
|
||||
}
|
||||
|
||||
message RemovedFromGameMessage {
|
||||
required uint32 gameId = 1;
|
||||
enum RemovedFromGameReason {
|
||||
removedOnRequest = 0; // No error, client wished to leave.
|
||||
kickedFromGame = 1;
|
||||
@@ -375,16 +387,14 @@ message RemovedFromGameMessage {
|
||||
removedStartFailed = 5;
|
||||
gameClosed = 6;
|
||||
}
|
||||
required RemovedFromGameReason removedFromGameReason = 2;
|
||||
required RemovedFromGameReason removedFromGameReason = 1;
|
||||
}
|
||||
|
||||
message KickPlayerRequestMessage {
|
||||
required uint32 gameId = 1;
|
||||
required uint32 playerId = 2;
|
||||
required uint32 playerId = 1;
|
||||
}
|
||||
|
||||
message LeaveGameRequestMessage {
|
||||
required uint32 gameId = 1;
|
||||
}
|
||||
|
||||
message InvitePlayerToGameMessage {
|
||||
@@ -414,124 +424,109 @@ message RejectInvNotifyMessage {
|
||||
}
|
||||
|
||||
message StartEventMessage {
|
||||
required uint32 gameId = 1;
|
||||
enum StartEventType {
|
||||
startEvent = 0;
|
||||
rejoinEvent = 1;
|
||||
}
|
||||
required StartEventType startEventType = 2;
|
||||
optional bool fillWithComputerPlayers = 3;
|
||||
required StartEventType startEventType = 1;
|
||||
optional bool fillWithComputerPlayers = 2;
|
||||
}
|
||||
|
||||
message StartEventAckMessage {
|
||||
required uint32 gameId = 1;
|
||||
}
|
||||
|
||||
message GameStartInitialMessage {
|
||||
required uint32 gameId = 1;
|
||||
required uint32 startDealerPlayerId = 2;
|
||||
repeated uint32 playerSeats = 3 [packed = true];
|
||||
required uint32 startDealerPlayerId = 1;
|
||||
repeated uint32 playerSeats = 2 [packed = true];
|
||||
}
|
||||
|
||||
message GameStartRejoinMessage {
|
||||
required uint32 gameId = 1;
|
||||
required uint32 startDealerPlayerId = 2;
|
||||
required uint32 handNum = 3;
|
||||
required uint32 startDealerPlayerId = 1;
|
||||
required uint32 handNum = 2;
|
||||
message RejoinPlayerData {
|
||||
required uint32 playerId = 1;
|
||||
required uint32 playerMoney = 2;
|
||||
}
|
||||
repeated RejoinPlayerData rejoinPlayerData = 4;
|
||||
repeated RejoinPlayerData rejoinPlayerData = 3;
|
||||
}
|
||||
|
||||
message HandStartMessage {
|
||||
required uint32 gameId = 1;
|
||||
message PlainCards {
|
||||
required uint32 plainCard1 = 1;
|
||||
required uint32 plainCard2 = 2;
|
||||
}
|
||||
optional PlainCards plainCards = 2;
|
||||
optional bytes encryptedCards = 3;
|
||||
required uint32 smallBlind = 4;
|
||||
repeated NetPlayerState seatStates = 5;
|
||||
optional uint32 dealerPlayerId = 6;
|
||||
optional PlainCards plainCards = 1;
|
||||
optional bytes encryptedCards = 2;
|
||||
required uint32 smallBlind = 3;
|
||||
repeated NetPlayerState seatStates = 4;
|
||||
optional uint32 dealerPlayerId = 5;
|
||||
}
|
||||
|
||||
message PlayersTurnMessage {
|
||||
required uint32 gameId = 1;
|
||||
required uint32 playerId = 2;
|
||||
required NetGameState gameState = 3;
|
||||
required uint32 playerId = 1;
|
||||
required NetGameState gameState = 2;
|
||||
}
|
||||
|
||||
message MyActionRequestMessage {
|
||||
required uint32 gameId = 1;
|
||||
required uint32 handNum = 2;
|
||||
required NetGameState gameState = 3;
|
||||
required NetPlayerAction myAction = 4;
|
||||
required uint32 myRelativeBet = 5;
|
||||
required uint32 handNum = 1;
|
||||
required NetGameState gameState = 2;
|
||||
required NetPlayerAction myAction = 3;
|
||||
required uint32 myRelativeBet = 4;
|
||||
}
|
||||
|
||||
message YourActionRejectedMessage {
|
||||
required uint32 gameId = 1;
|
||||
required NetGameState gameState = 2;
|
||||
required NetPlayerAction yourAction = 3;
|
||||
required uint32 yourRelativeBet = 4;
|
||||
required NetGameState gameState = 1;
|
||||
required NetPlayerAction yourAction = 2;
|
||||
required uint32 yourRelativeBet = 3;
|
||||
enum RejectionReason {
|
||||
rejectedInvalidGameState = 1;
|
||||
rejectedNotYourTurn = 2;
|
||||
rejectedActionNotAllowed = 3;
|
||||
}
|
||||
required RejectionReason rejectionReason = 5;
|
||||
required RejectionReason rejectionReason = 4;
|
||||
}
|
||||
|
||||
message PlayersActionDoneMessage {
|
||||
required uint32 gameId = 1;
|
||||
required uint32 playerId = 2;
|
||||
required NetGameState gameState = 3;
|
||||
required NetPlayerAction playerAction = 4;
|
||||
required uint32 totalPlayerBet = 5;
|
||||
required uint32 playerMoney = 6;
|
||||
required uint32 highestSet = 7;
|
||||
required uint32 minimumRaise = 8;
|
||||
required uint32 playerId = 1;
|
||||
required NetGameState gameState = 2;
|
||||
required NetPlayerAction playerAction = 3;
|
||||
required uint32 totalPlayerBet = 4;
|
||||
required uint32 playerMoney = 5;
|
||||
required uint32 highestSet = 6;
|
||||
required uint32 minimumRaise = 7;
|
||||
}
|
||||
|
||||
message DealFlopCardsMessage {
|
||||
required uint32 gameId = 1;
|
||||
required uint32 flopCard1 = 2;
|
||||
required uint32 flopCard2 = 3;
|
||||
required uint32 flopCard3 = 4;
|
||||
required uint32 flopCard1 = 1;
|
||||
required uint32 flopCard2 = 2;
|
||||
required uint32 flopCard3 = 3;
|
||||
}
|
||||
|
||||
message DealTurnCardMessage {
|
||||
required uint32 gameId = 1;
|
||||
required uint32 turnCard = 2;
|
||||
required uint32 turnCard = 1;
|
||||
}
|
||||
|
||||
message DealRiverCardMessage {
|
||||
required uint32 gameId = 1;
|
||||
required uint32 riverCard = 2;
|
||||
required uint32 riverCard = 1;
|
||||
}
|
||||
|
||||
message AllInShowCardsMessage {
|
||||
required uint32 gameId = 1;
|
||||
message PlayerAllIn {
|
||||
required uint32 playerId = 1;
|
||||
required uint32 allInCard1 = 2;
|
||||
required uint32 allInCard2 = 3;
|
||||
}
|
||||
repeated PlayerAllIn playersAllIn = 2;
|
||||
repeated PlayerAllIn playersAllIn = 1;
|
||||
}
|
||||
|
||||
message EndOfHandShowCardsMessage {
|
||||
required uint32 gameId = 1;
|
||||
repeated PlayerResult playerResults = 2;
|
||||
repeated PlayerResult playerResults = 1;
|
||||
}
|
||||
|
||||
message EndOfHandHideCardsMessage {
|
||||
required uint32 gameId = 1;
|
||||
required uint32 playerId = 2;
|
||||
required uint32 moneyWon = 3;
|
||||
required uint32 playerMoney = 4;
|
||||
required uint32 playerId = 1;
|
||||
required uint32 moneyWon = 2;
|
||||
required uint32 playerMoney = 3;
|
||||
}
|
||||
|
||||
message ShowMyCardsRequestMessage {
|
||||
@@ -542,8 +537,7 @@ message AfterHandShowCardsMessage {
|
||||
}
|
||||
|
||||
message EndOfGameMessage {
|
||||
required uint32 gameId = 1;
|
||||
required uint32 winnerPlayerId = 2;
|
||||
required uint32 winnerPlayerId = 1;
|
||||
}
|
||||
|
||||
message PlayerIdChangedMessage {
|
||||
@@ -552,13 +546,11 @@ message PlayerIdChangedMessage {
|
||||
}
|
||||
|
||||
message AskKickPlayerMessage {
|
||||
required uint32 gameId = 1;
|
||||
required uint32 playerId = 2;
|
||||
required uint32 playerId = 1;
|
||||
}
|
||||
|
||||
message AskKickDeniedMessage {
|
||||
required uint32 gameId = 1;
|
||||
required uint32 playerId = 2;
|
||||
required uint32 playerId = 1;
|
||||
enum KickDeniedReason {
|
||||
kickDeniedInvalidGameState = 0;
|
||||
kickDeniedNotPossible = 1;
|
||||
@@ -566,56 +558,51 @@ message AskKickDeniedMessage {
|
||||
kickDeniedAlreadyInProgress = 3;
|
||||
kickDeniedInvalidPlayerId = 4;
|
||||
}
|
||||
required KickDeniedReason kickDeniedReason = 3;
|
||||
required KickDeniedReason kickDeniedReason = 2;
|
||||
}
|
||||
|
||||
message StartKickPetitionMessage {
|
||||
required uint32 gameId = 1;
|
||||
required uint32 petitionId = 2;
|
||||
required uint32 proposingPlayerId = 3;
|
||||
required uint32 kickPlayerId = 4;
|
||||
required uint32 kickTimeoutSec = 5;
|
||||
required uint32 numVotesNeededToKick = 6;
|
||||
required uint32 petitionId = 1;
|
||||
required uint32 proposingPlayerId = 2;
|
||||
required uint32 kickPlayerId = 3;
|
||||
required uint32 kickTimeoutSec = 4;
|
||||
required uint32 numVotesNeededToKick = 5;
|
||||
}
|
||||
|
||||
message VoteKickRequestMessage {
|
||||
required uint32 gameId = 1;
|
||||
required uint32 petitionId = 2;
|
||||
required bool voteKick = 3;
|
||||
required uint32 petitionId = 1;
|
||||
required bool voteKick = 2;
|
||||
}
|
||||
|
||||
message VoteKickReplyMessage {
|
||||
required uint32 gameId = 1;
|
||||
required uint32 petitionId = 2;
|
||||
required uint32 petitionId = 1;
|
||||
enum VoteKickReplyType {
|
||||
voteKickAck = 0;
|
||||
voteKickDeniedInvalid = 1;
|
||||
voteKickDeniedAlreadyVoted = 2;
|
||||
}
|
||||
required VoteKickReplyType voteKickReplyType = 3;
|
||||
required VoteKickReplyType voteKickReplyType = 2;
|
||||
}
|
||||
|
||||
message KickPetitionUpdateMessage {
|
||||
required uint32 gameId = 1;
|
||||
required uint32 petitionId = 2;
|
||||
required uint32 numVotesAgainstKicking = 3;
|
||||
required uint32 numVotesInFavourOfKicking = 4;
|
||||
required uint32 numVotesNeededToKick = 5;
|
||||
required uint32 petitionId = 1;
|
||||
required uint32 numVotesAgainstKicking = 2;
|
||||
required uint32 numVotesInFavourOfKicking = 3;
|
||||
required uint32 numVotesNeededToKick = 4;
|
||||
}
|
||||
|
||||
message EndKickPetitionMessage {
|
||||
required uint32 gameId = 1;
|
||||
required uint32 petitionId = 2;
|
||||
required uint32 numVotesAgainstKicking = 3;
|
||||
required uint32 numVotesInFavourOfKicking = 4;
|
||||
required uint32 resultPlayerKicked = 5;
|
||||
required uint32 petitionId = 1;
|
||||
required uint32 numVotesAgainstKicking = 2;
|
||||
required uint32 numVotesInFavourOfKicking = 3;
|
||||
required uint32 resultPlayerKicked = 4;
|
||||
enum PetitionEndReason {
|
||||
petitionEndEnoughVotes = 0;
|
||||
petitionEndTooFewPlayers = 1;
|
||||
petitionEndPlayerLeft = 2;
|
||||
petitionEndTimeout = 3;
|
||||
}
|
||||
required PetitionEndReason petitionEndReason = 6;
|
||||
required PetitionEndReason petitionEndReason = 5;
|
||||
}
|
||||
|
||||
message StatisticsMessage {
|
||||
@@ -630,23 +617,20 @@ message StatisticsMessage {
|
||||
}
|
||||
|
||||
message ChatRequestMessage {
|
||||
optional uint32 targetGameId = 1;
|
||||
optional uint32 targetPlayerId = 2;
|
||||
required string chatText = 3;
|
||||
}
|
||||
|
||||
message ChatMessage {
|
||||
optional uint32 gameId = 1;
|
||||
optional uint32 playerId = 2;
|
||||
optional uint32 playerId = 1;
|
||||
enum ChatType {
|
||||
chatTypeLobby = 0;
|
||||
chatTypeGame = 1;
|
||||
chatTypeBot = 2;
|
||||
chatTypeBroadcast = 3;
|
||||
chatTypePrivate = 4;
|
||||
chatTypeStandard = 0;
|
||||
chatTypeBot = 1;
|
||||
chatTypeBroadcast = 2;
|
||||
chatTypePrivate = 3;
|
||||
}
|
||||
required ChatType chatType = 3;
|
||||
required string chatText = 4;
|
||||
required ChatType chatType = 2;
|
||||
required string chatText = 3;
|
||||
}
|
||||
|
||||
message ChatRejectMessage {
|
||||
@@ -749,173 +733,234 @@ message AdminBanPlayerAckMessage {
|
||||
required AdminBanPlayerResult banPlayerResult = 2;
|
||||
}
|
||||
|
||||
// The main message type (it is prefixed by 4 bytes length of the message).
|
||||
message AuthMessage {
|
||||
enum AuthMessageType {
|
||||
Type_AuthClientRequestMessage = 1;
|
||||
Type_AuthServerChallengeMessage = 2;
|
||||
Type_AuthClientResponseMessage = 3;
|
||||
Type_AuthServerVerificationMessage = 4;
|
||||
Type_ErrorMessage = 1024;
|
||||
}
|
||||
required AuthMessageType messageType = 1;
|
||||
|
||||
optional AuthClientRequestMessage authClientRequestMessage = 2;
|
||||
optional AuthServerChallengeMessage authServerChallengeMessage = 3;
|
||||
optional AuthClientResponseMessage authClientResponseMessage = 4;
|
||||
optional AuthServerVerificationMessage authServerVerificationMessage = 5;
|
||||
optional ErrorMessage errorMessage = 1025;
|
||||
}
|
||||
|
||||
message LobbyMessage {
|
||||
enum LobbyMessageType {
|
||||
Type_InitMessage = 1;
|
||||
Type_InitAckMessage = 2;
|
||||
Type_AvatarRequestMessage = 3;
|
||||
Type_AvatarHeaderMessage = 4;
|
||||
Type_AvatarDataMessage = 5;
|
||||
Type_AvatarEndMessage = 6;
|
||||
Type_UnknownAvatarMessage = 7;
|
||||
Type_PlayerListMessage = 8;
|
||||
Type_GameListNewMessage = 9;
|
||||
Type_GameListUpdateMessage = 10;
|
||||
Type_GameListPlayerJoinedMessage = 11;
|
||||
Type_GameListPlayerLeftMessage = 12;
|
||||
Type_GameListSpectatorJoinedMessage = 13;
|
||||
Type_GameListSpectatorLeftMessage = 14;
|
||||
Type_GameListAdminChangedMessage = 15;
|
||||
Type_PlayerInfoRequestMessage = 16;
|
||||
Type_PlayerInfoReplyMessage = 17;
|
||||
Type_SubscriptionRequestMessage = 18;
|
||||
Type_SubscriptionReplyMessage = 19;
|
||||
Type_CreateGameMessage = 20;
|
||||
Type_CreateGameFailedMessage = 21;
|
||||
Type_InvitePlayerToGameMessage = 22;
|
||||
Type_InviteNotifyMessage = 23;
|
||||
Type_RejectGameInvitationMessage = 24;
|
||||
Type_RejectInvNotifyMessage = 25;
|
||||
Type_StatisticsMessage = 26;
|
||||
Type_ChatRequestMessage = 27;
|
||||
Type_ChatMessage = 28;
|
||||
Type_ChatRejectMessage = 29;
|
||||
Type_DialogMessage = 30;
|
||||
Type_TimeoutWarningMessage = 31;
|
||||
Type_ResetTimeoutMessage = 32;
|
||||
Type_ReportAvatarMessage = 33;
|
||||
Type_ReportAvatarAckMessage = 34;
|
||||
Type_ReportGameMessage = 35;
|
||||
Type_ReportGameAckMessage = 36;
|
||||
Type_AdminRemoveGameMessage = 37;
|
||||
Type_AdminRemoveGameAckMessage = 38;
|
||||
Type_AdminBanPlayerMessage = 39;
|
||||
Type_AdminBanPlayerAckMessage = 40;
|
||||
Type_ErrorMessage = 1024;
|
||||
}
|
||||
required LobbyMessageType messageType = 1;
|
||||
|
||||
optional InitMessage initMessage = 2;
|
||||
optional InitAckMessage initAckMessage = 3;
|
||||
optional AvatarRequestMessage avatarRequestMessage = 4;
|
||||
optional AvatarHeaderMessage avatarHeaderMessage = 5;
|
||||
optional AvatarDataMessage avatarDataMessage = 6;
|
||||
optional AvatarEndMessage avatarEndMessage = 7;
|
||||
optional UnknownAvatarMessage unknownAvatarMessage = 8;
|
||||
optional PlayerListMessage playerListMessage = 9;
|
||||
optional GameListNewMessage gameListNewMessage = 10;
|
||||
optional GameListUpdateMessage gameListUpdateMessage = 11;
|
||||
optional GameListPlayerJoinedMessage gameListPlayerJoinedMessage = 12;
|
||||
optional GameListPlayerLeftMessage gameListPlayerLeftMessage = 13;
|
||||
optional GameListSpectatorJoinedMessage gameListSpectatorJoinedMessage = 14;
|
||||
optional GameListSpectatorLeftMessage gameListSpectatorLeftMessage = 15;
|
||||
optional GameListAdminChangedMessage gameListAdminChangedMessage = 16;
|
||||
optional PlayerInfoRequestMessage playerInfoRequestMessage = 17;
|
||||
optional PlayerInfoReplyMessage playerInfoReplyMessage = 18;
|
||||
optional SubscriptionRequestMessage subscriptionRequestMessage = 19;
|
||||
optional SubscriptionReplyMessage subscriptionReplyMessage = 20;
|
||||
optional CreateGameMessage createGameMessage = 21;
|
||||
optional CreateGameFailedMessage createGameFailedMessage = 22;
|
||||
optional InvitePlayerToGameMessage invitePlayerToGameMessage = 23;
|
||||
optional InviteNotifyMessage inviteNotifyMessage = 24;
|
||||
optional RejectGameInvitationMessage rejectGameInvitationMessage = 25;
|
||||
optional RejectInvNotifyMessage rejectInvNotifyMessage = 26;
|
||||
optional StatisticsMessage statisticsMessage = 27;
|
||||
optional ChatRequestMessage chatRequestMessage = 28;
|
||||
optional ChatMessage chatMessage = 29;
|
||||
optional ChatRejectMessage chatRejectMessage = 30;
|
||||
optional DialogMessage dialogMessage = 31;
|
||||
optional TimeoutWarningMessage timeoutWarningMessage = 32;
|
||||
optional ResetTimeoutMessage resetTimeoutMessage = 33;
|
||||
optional ReportAvatarMessage reportAvatarMessage = 34;
|
||||
optional ReportAvatarAckMessage reportAvatarAckMessage = 35;
|
||||
optional ReportGameMessage reportGameMessage = 36;
|
||||
optional ReportGameAckMessage reportGameAckMessage = 37;
|
||||
optional AdminRemoveGameMessage adminRemoveGameMessage = 38;
|
||||
optional AdminRemoveGameAckMessage adminRemoveGameAckMessage = 39;
|
||||
optional AdminBanPlayerMessage adminBanPlayerMessage = 40;
|
||||
optional AdminBanPlayerAckMessage adminBanPlayerAckMessage = 41;
|
||||
optional ErrorMessage errorMessage = 1025;
|
||||
}
|
||||
|
||||
message GameManagementMessage {
|
||||
enum GameManagementMessageType {
|
||||
Type_JoinGameMessage = 1;
|
||||
Type_RejoinGameMessage = 2;
|
||||
Type_JoinGameAckMessage = 3;
|
||||
Type_JoinGameFailedMessage = 4;
|
||||
Type_GamePlayerJoinedMessage = 5;
|
||||
Type_GamePlayerLeftMessage = 6;
|
||||
Type_GameSpectatorJoinedMessage = 7;
|
||||
Type_GameSpectatorLeftMessage = 8;
|
||||
Type_GameAdminChangedMessage = 9;
|
||||
Type_RemovedFromGameMessage = 10;
|
||||
Type_KickPlayerRequestMessage = 11;
|
||||
Type_LeaveGameRequestMessage = 12;
|
||||
Type_StartEventMessage = 13;
|
||||
Type_StartEventAckMessage = 14;
|
||||
Type_GameStartInitialMessage = 15;
|
||||
Type_GameStartRejoinMessage = 16;
|
||||
Type_EndOfGameMessage = 17;
|
||||
Type_PlayerIdChangedMessage = 18;
|
||||
Type_AskKickPlayerMessage = 19;
|
||||
Type_AskKickDeniedMessage = 20;
|
||||
Type_StartKickPetitionMessage = 21;
|
||||
Type_VoteKickRequestMessage = 22;
|
||||
Type_VoteKickReplyMessage = 23;
|
||||
Type_KickPetitionUpdateMessage = 24;
|
||||
Type_EndKickPetitionMessage = 25;
|
||||
Type_ChatRequestMessage = 26;
|
||||
Type_ChatMessage = 27;
|
||||
Type_ChatRejectMessage = 28;
|
||||
Type_ErrorMessage = 1024;
|
||||
}
|
||||
required GameManagementMessageType messageType = 1;
|
||||
|
||||
optional JoinGameMessage joinGameMessage = 2;
|
||||
optional RejoinGameMessage rejoinGameMessage = 3;
|
||||
optional JoinGameAckMessage joinGameAckMessage = 4;
|
||||
optional JoinGameFailedMessage joinGameFailedMessage = 5;
|
||||
optional GamePlayerJoinedMessage gamePlayerJoinedMessage = 6;
|
||||
optional GamePlayerLeftMessage gamePlayerLeftMessage = 7;
|
||||
optional GameSpectatorJoinedMessage gameSpectatorJoinedMessage = 8;
|
||||
optional GameSpectatorLeftMessage gameSpectatorLeftMessage = 9;
|
||||
optional GameAdminChangedMessage gameAdminChangedMessage = 10;
|
||||
optional RemovedFromGameMessage removedFromGameMessage = 11;
|
||||
optional KickPlayerRequestMessage kickPlayerRequestMessage = 12;
|
||||
optional LeaveGameRequestMessage leaveGameRequestMessage = 13;
|
||||
optional StartEventMessage startEventMessage = 14;
|
||||
optional StartEventAckMessage startEventAckMessage = 15;
|
||||
optional GameStartInitialMessage gameStartInitialMessage = 16;
|
||||
optional GameStartRejoinMessage gameStartRejoinMessage = 17;
|
||||
optional EndOfGameMessage endOfGameMessage = 18;
|
||||
optional PlayerIdChangedMessage playerIdChangedMessage = 19;
|
||||
optional AskKickPlayerMessage askKickPlayerMessage = 20;
|
||||
optional AskKickDeniedMessage askKickDeniedMessage = 21;
|
||||
optional StartKickPetitionMessage startKickPetitionMessage = 22;
|
||||
optional VoteKickRequestMessage voteKickRequestMessage = 23;
|
||||
optional VoteKickReplyMessage voteKickReplyMessage = 24;
|
||||
optional KickPetitionUpdateMessage kickPetitionUpdateMessage = 25;
|
||||
optional EndKickPetitionMessage endKickPetitionMessage = 26;
|
||||
optional ChatRequestMessage chatRequestMessage = 27;
|
||||
optional ChatMessage chatMessage = 28;
|
||||
optional ChatRejectMessage chatRejectMessage = 29;
|
||||
optional ErrorMessage errorMessage = 1025;
|
||||
}
|
||||
|
||||
message GameEngineMessage {
|
||||
enum GameEngineMessageType {
|
||||
Type_HandStartMessage = 1;
|
||||
Type_PlayersTurnMessage = 2;
|
||||
Type_MyActionRequestMessage = 3;
|
||||
Type_YourActionRejectedMessage = 4;
|
||||
Type_PlayersActionDoneMessage = 5;
|
||||
Type_DealFlopCardsMessage = 6;
|
||||
Type_DealTurnCardMessage = 7;
|
||||
Type_DealRiverCardMessage = 8;
|
||||
Type_AllInShowCardsMessage = 9;
|
||||
Type_EndOfHandShowCardsMessage = 10;
|
||||
Type_EndOfHandHideCardsMessage = 11;
|
||||
Type_ShowMyCardsRequestMessage = 12;
|
||||
Type_AfterHandShowCardsMessage = 13;
|
||||
}
|
||||
required GameEngineMessageType messageType = 1;
|
||||
|
||||
optional HandStartMessage handStartMessage = 2;
|
||||
optional PlayersTurnMessage playersTurnMessage = 3;
|
||||
optional MyActionRequestMessage myActionRequestMessage = 4;
|
||||
optional YourActionRejectedMessage yourActionRejectedMessage = 5;
|
||||
optional PlayersActionDoneMessage playersActionDoneMessage = 6;
|
||||
optional DealFlopCardsMessage dealFlopCardsMessage = 7;
|
||||
optional DealTurnCardMessage dealTurnCardMessage = 8;
|
||||
optional DealRiverCardMessage dealRiverCardMessage = 9;
|
||||
optional AllInShowCardsMessage allInShowCardsMessage = 10;
|
||||
optional EndOfHandShowCardsMessage endOfHandShowCardsMessage = 11;
|
||||
optional EndOfHandHideCardsMessage endOfHandHideCardsMessage = 12;
|
||||
optional ShowMyCardsRequestMessage showMyCardsRequestMessage = 13;
|
||||
optional AfterHandShowCardsMessage afterHandShowCardsMessage = 14;
|
||||
}
|
||||
|
||||
message GameMessage {
|
||||
enum GameMessageType {
|
||||
Type_GameManagementMessage = 1;
|
||||
Type_GameEngineMessage = 2;
|
||||
}
|
||||
required GameMessageType messageType = 1;
|
||||
required uint32 gameId = 2;
|
||||
|
||||
optional GameManagementMessage gameManagementMessage = 3;
|
||||
optional GameEngineMessage gameEngineMessage = 4;
|
||||
}
|
||||
|
||||
// The main message type (with TCP, it is prefixed by 4 bytes length of the message).
|
||||
message PokerTHMessage {
|
||||
enum PokerTHMessageType {
|
||||
Type_AnnounceMessage = 1;
|
||||
Type_InitMessage = 2;
|
||||
Type_AuthServerChallengeMessage = 3;
|
||||
Type_AuthClientResponseMessage = 4;
|
||||
Type_AuthServerVerificationMessage = 5;
|
||||
Type_InitAckMessage = 6;
|
||||
Type_AvatarRequestMessage = 7;
|
||||
Type_AvatarHeaderMessage = 8;
|
||||
Type_AvatarDataMessage = 9;
|
||||
Type_AvatarEndMessage = 10;
|
||||
Type_UnknownAvatarMessage = 11;
|
||||
Type_PlayerListMessage = 12;
|
||||
Type_GameListNewMessage = 13;
|
||||
Type_GameListUpdateMessage = 14;
|
||||
Type_GameListPlayerJoinedMessage = 15;
|
||||
Type_GameListPlayerLeftMessage = 16;
|
||||
Type_GameListAdminChangedMessage = 17;
|
||||
Type_PlayerInfoRequestMessage = 18;
|
||||
Type_PlayerInfoReplyMessage = 19;
|
||||
Type_SubscriptionRequestMessage = 20;
|
||||
Type_JoinExistingGameMessage = 21;
|
||||
Type_JoinNewGameMessage = 22;
|
||||
Type_RejoinExistingGameMessage = 23;
|
||||
Type_JoinGameAckMessage = 24;
|
||||
Type_JoinGameFailedMessage = 25;
|
||||
Type_GamePlayerJoinedMessage = 26;
|
||||
Type_GamePlayerLeftMessage = 27;
|
||||
Type_GameAdminChangedMessage = 28;
|
||||
Type_RemovedFromGameMessage = 29;
|
||||
Type_KickPlayerRequestMessage = 30;
|
||||
Type_LeaveGameRequestMessage = 31;
|
||||
Type_InvitePlayerToGameMessage = 32;
|
||||
Type_InviteNotifyMessage = 33;
|
||||
Type_RejectGameInvitationMessage = 34;
|
||||
Type_RejectInvNotifyMessage = 35;
|
||||
Type_StartEventMessage = 36;
|
||||
Type_StartEventAckMessage = 37;
|
||||
Type_GameStartInitialMessage = 38;
|
||||
Type_GameStartRejoinMessage = 39;
|
||||
Type_HandStartMessage = 40;
|
||||
Type_PlayersTurnMessage = 41;
|
||||
Type_MyActionRequestMessage = 42;
|
||||
Type_YourActionRejectedMessage = 43;
|
||||
Type_PlayersActionDoneMessage = 44;
|
||||
Type_DealFlopCardsMessage = 45;
|
||||
Type_DealTurnCardMessage = 46;
|
||||
Type_DealRiverCardMessage = 47;
|
||||
Type_AllInShowCardsMessage = 48;
|
||||
Type_EndOfHandShowCardsMessage = 49;
|
||||
Type_EndOfHandHideCardsMessage = 50;
|
||||
Type_ShowMyCardsRequestMessage = 51;
|
||||
Type_AfterHandShowCardsMessage = 52;
|
||||
Type_EndOfGameMessage = 53;
|
||||
Type_PlayerIdChangedMessage = 54;
|
||||
Type_AskKickPlayerMessage = 55;
|
||||
Type_AskKickDeniedMessage = 56;
|
||||
Type_StartKickPetitionMessage = 57;
|
||||
Type_VoteKickRequestMessage = 58;
|
||||
Type_VoteKickReplyMessage = 59;
|
||||
Type_KickPetitionUpdateMessage = 60;
|
||||
Type_EndKickPetitionMessage = 61;
|
||||
Type_StatisticsMessage = 62;
|
||||
Type_ChatRequestMessage = 63;
|
||||
Type_ChatMessage = 64;
|
||||
Type_ChatRejectMessage = 65;
|
||||
Type_DialogMessage = 66;
|
||||
Type_TimeoutWarningMessage = 67;
|
||||
Type_ResetTimeoutMessage = 68;
|
||||
Type_ReportAvatarMessage = 69;
|
||||
Type_ReportAvatarAckMessage = 70;
|
||||
Type_ReportGameMessage = 71;
|
||||
Type_ReportGameAckMessage = 72;
|
||||
Type_ErrorMessage = 73;
|
||||
Type_AdminRemoveGameMessage = 74;
|
||||
Type_AdminRemoveGameAckMessage = 75;
|
||||
Type_AdminBanPlayerMessage = 76;
|
||||
Type_AdminBanPlayerAckMessage = 77;
|
||||
Type_GameListSpectatorJoinedMessage = 78;
|
||||
Type_GameListSpectatorLeftMessage = 79;
|
||||
Type_GameSpectatorJoinedMessage = 80;
|
||||
Type_GameSpectatorLeftMessage = 81;
|
||||
Type_AuthMessage = 2;
|
||||
Type_LobbyMessage = 3;
|
||||
Type_GameMessage = 4;
|
||||
}
|
||||
required PokerTHMessageType messageType = 1;
|
||||
|
||||
optional AnnounceMessage announceMessage = 2;
|
||||
optional InitMessage initMessage = 3;
|
||||
optional AuthServerChallengeMessage authServerChallengeMessage = 4;
|
||||
optional AuthClientResponseMessage authClientResponseMessage = 5;
|
||||
optional AuthServerVerificationMessage authServerVerificationMessage = 6;
|
||||
optional InitAckMessage initAckMessage = 7;
|
||||
optional AvatarRequestMessage avatarRequestMessage = 8;
|
||||
optional AvatarHeaderMessage avatarHeaderMessage = 9;
|
||||
optional AvatarDataMessage avatarDataMessage = 10;
|
||||
optional AvatarEndMessage avatarEndMessage = 11;
|
||||
optional UnknownAvatarMessage unknownAvatarMessage = 12;
|
||||
optional PlayerListMessage playerListMessage = 13;
|
||||
optional GameListNewMessage gameListNewMessage = 14;
|
||||
optional GameListUpdateMessage gameListUpdateMessage = 15;
|
||||
optional GameListPlayerJoinedMessage gameListPlayerJoinedMessage = 16;
|
||||
optional GameListPlayerLeftMessage gameListPlayerLeftMessage = 17;
|
||||
optional GameListAdminChangedMessage gameListAdminChangedMessage = 18;
|
||||
optional PlayerInfoRequestMessage playerInfoRequestMessage = 19;
|
||||
optional PlayerInfoReplyMessage playerInfoReplyMessage = 20;
|
||||
optional SubscriptionRequestMessage subscriptionRequestMessage = 21;
|
||||
optional JoinExistingGameMessage joinExistingGameMessage = 22;
|
||||
optional JoinNewGameMessage joinNewGameMessage = 23;
|
||||
optional RejoinExistingGameMessage rejoinExistingGameMessage = 24;
|
||||
optional JoinGameAckMessage joinGameAckMessage = 25;
|
||||
optional JoinGameFailedMessage joinGameFailedMessage = 26;
|
||||
optional GamePlayerJoinedMessage gamePlayerJoinedMessage = 27;
|
||||
optional GamePlayerLeftMessage gamePlayerLeftMessage = 28;
|
||||
optional GameAdminChangedMessage gameAdminChangedMessage = 29;
|
||||
optional RemovedFromGameMessage removedFromGameMessage = 30;
|
||||
optional KickPlayerRequestMessage kickPlayerRequestMessage = 31;
|
||||
optional LeaveGameRequestMessage leaveGameRequestMessage = 32;
|
||||
optional InvitePlayerToGameMessage invitePlayerToGameMessage = 33;
|
||||
optional InviteNotifyMessage inviteNotifyMessage = 34;
|
||||
optional RejectGameInvitationMessage rejectGameInvitationMessage = 35;
|
||||
optional RejectInvNotifyMessage rejectInvNotifyMessage = 36;
|
||||
optional StartEventMessage startEventMessage = 37;
|
||||
optional StartEventAckMessage startEventAckMessage = 38;
|
||||
optional GameStartInitialMessage gameStartInitialMessage = 39;
|
||||
optional GameStartRejoinMessage gameStartRejoinMessage = 40;
|
||||
optional HandStartMessage handStartMessage = 41;
|
||||
optional PlayersTurnMessage playersTurnMessage = 42;
|
||||
optional MyActionRequestMessage myActionRequestMessage = 43;
|
||||
optional YourActionRejectedMessage yourActionRejectedMessage = 44;
|
||||
optional PlayersActionDoneMessage playersActionDoneMessage = 45;
|
||||
optional DealFlopCardsMessage dealFlopCardsMessage = 46;
|
||||
optional DealTurnCardMessage dealTurnCardMessage = 47;
|
||||
optional DealRiverCardMessage dealRiverCardMessage = 48;
|
||||
optional AllInShowCardsMessage allInShowCardsMessage = 49;
|
||||
optional EndOfHandShowCardsMessage endOfHandShowCardsMessage = 50;
|
||||
optional EndOfHandHideCardsMessage endOfHandHideCardsMessage = 51;
|
||||
optional ShowMyCardsRequestMessage showMyCardsRequestMessage = 52;
|
||||
optional AfterHandShowCardsMessage afterHandShowCardsMessage = 53;
|
||||
optional EndOfGameMessage endOfGameMessage = 54;
|
||||
optional PlayerIdChangedMessage playerIdChangedMessage = 55;
|
||||
optional AskKickPlayerMessage askKickPlayerMessage = 56;
|
||||
optional AskKickDeniedMessage askKickDeniedMessage = 57;
|
||||
optional StartKickPetitionMessage startKickPetitionMessage = 58;
|
||||
optional VoteKickRequestMessage voteKickRequestMessage = 59;
|
||||
optional VoteKickReplyMessage voteKickReplyMessage = 60;
|
||||
optional KickPetitionUpdateMessage kickPetitionUpdateMessage = 61;
|
||||
optional EndKickPetitionMessage endKickPetitionMessage = 62;
|
||||
optional StatisticsMessage statisticsMessage = 63;
|
||||
optional ChatRequestMessage chatRequestMessage = 64;
|
||||
optional ChatMessage chatMessage = 65;
|
||||
optional ChatRejectMessage chatRejectMessage = 66;
|
||||
optional DialogMessage dialogMessage = 67;
|
||||
optional TimeoutWarningMessage timeoutWarningMessage = 68;
|
||||
optional ResetTimeoutMessage resetTimeoutMessage = 69;
|
||||
optional ReportAvatarMessage reportAvatarMessage = 70;
|
||||
optional ReportAvatarAckMessage reportAvatarAckMessage = 71;
|
||||
optional ReportGameMessage reportGameMessage = 72;
|
||||
optional ReportGameAckMessage reportGameAckMessage = 73;
|
||||
optional ErrorMessage errorMessage = 74;
|
||||
optional AdminRemoveGameMessage adminRemoveGameMessage = 75;
|
||||
optional AdminRemoveGameAckMessage adminRemoveGameAckMessage = 76;
|
||||
optional AdminBanPlayerMessage adminBanPlayerMessage = 77;
|
||||
optional AdminBanPlayerAckMessage adminBanPlayerAckMessage = 78;
|
||||
optional GameListSpectatorJoinedMessage gameListSpectatorJoinedMessage = 79;
|
||||
optional GameListSpectatorLeftMessage gameListSpectatorLeftMessage = 80;
|
||||
optional GameSpectatorJoinedMessage gameSpectatorJoinedMessage = 81;
|
||||
optional GameSpectatorLeftMessage gameSpectatorLeftMessage = 82;
|
||||
optional AuthMessage authMessage = 3;
|
||||
optional LobbyMessage lobbyMessage = 4;
|
||||
optional GameMessage gameMessage = 5;
|
||||
}
|
||||
|
||||
+622
@@ -0,0 +1,622 @@
|
||||
// Protocol Buffers - Google's data interchange format
|
||||
// Copyright 2008 Google Inc. All rights reserved.
|
||||
// http://code.google.com/p/protobuf/
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the names of its
|
||||
// contributors may be used to endorse or promote products derived from
|
||||
// this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
// Author: kenton@google.com (Kenton Varda)
|
||||
// Based on original Protocol Buffers design by
|
||||
// Sanjay Ghemawat, Jeff Dean, and others.
|
||||
//
|
||||
// The messages in this file describe the definitions found in .proto files.
|
||||
// A valid .proto file can be translated directly to a FileDescriptorProto
|
||||
// without any other information (e.g. without reading its imports).
|
||||
|
||||
|
||||
|
||||
package google.protobuf;
|
||||
option java_package = "com.google.protobuf";
|
||||
option java_outer_classname = "DescriptorProtos";
|
||||
|
||||
// descriptor.proto must be optimized for speed because reflection-based
|
||||
// algorithms don't work during bootstrapping.
|
||||
option optimize_for = SPEED;
|
||||
|
||||
// The protocol compiler can output a FileDescriptorSet containing the .proto
|
||||
// files it parses.
|
||||
message FileDescriptorSet {
|
||||
repeated FileDescriptorProto file = 1;
|
||||
}
|
||||
|
||||
// Describes a complete .proto file.
|
||||
message FileDescriptorProto {
|
||||
optional string name = 1; // file name, relative to root of source tree
|
||||
optional string package = 2; // e.g. "foo", "foo.bar", etc.
|
||||
|
||||
// Names of files imported by this file.
|
||||
repeated string dependency = 3;
|
||||
// Indexes of the public imported files in the dependency list above.
|
||||
repeated int32 public_dependency = 10;
|
||||
// Indexes of the weak imported files in the dependency list.
|
||||
// For Google-internal migration only. Do not use.
|
||||
repeated int32 weak_dependency = 11;
|
||||
|
||||
// All top-level definitions in this file.
|
||||
repeated DescriptorProto message_type = 4;
|
||||
repeated EnumDescriptorProto enum_type = 5;
|
||||
repeated ServiceDescriptorProto service = 6;
|
||||
repeated FieldDescriptorProto extension = 7;
|
||||
|
||||
optional FileOptions options = 8;
|
||||
|
||||
// This field contains optional information about the original source code.
|
||||
// You may safely remove this entire field whithout harming runtime
|
||||
// functionality of the descriptors -- the information is needed only by
|
||||
// development tools.
|
||||
optional SourceCodeInfo source_code_info = 9;
|
||||
}
|
||||
|
||||
// Describes a message type.
|
||||
message DescriptorProto {
|
||||
optional string name = 1;
|
||||
|
||||
repeated FieldDescriptorProto field = 2;
|
||||
repeated FieldDescriptorProto extension = 6;
|
||||
|
||||
repeated DescriptorProto nested_type = 3;
|
||||
repeated EnumDescriptorProto enum_type = 4;
|
||||
|
||||
message ExtensionRange {
|
||||
optional int32 start = 1;
|
||||
optional int32 end = 2;
|
||||
}
|
||||
repeated ExtensionRange extension_range = 5;
|
||||
|
||||
optional MessageOptions options = 7;
|
||||
}
|
||||
|
||||
// Describes a field within a message.
|
||||
message FieldDescriptorProto {
|
||||
enum Type {
|
||||
// 0 is reserved for errors.
|
||||
// Order is weird for historical reasons.
|
||||
TYPE_DOUBLE = 1;
|
||||
TYPE_FLOAT = 2;
|
||||
// Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if
|
||||
// negative values are likely.
|
||||
TYPE_INT64 = 3;
|
||||
TYPE_UINT64 = 4;
|
||||
// Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if
|
||||
// negative values are likely.
|
||||
TYPE_INT32 = 5;
|
||||
TYPE_FIXED64 = 6;
|
||||
TYPE_FIXED32 = 7;
|
||||
TYPE_BOOL = 8;
|
||||
TYPE_STRING = 9;
|
||||
TYPE_GROUP = 10; // Tag-delimited aggregate.
|
||||
TYPE_MESSAGE = 11; // Length-delimited aggregate.
|
||||
|
||||
// New in version 2.
|
||||
TYPE_BYTES = 12;
|
||||
TYPE_UINT32 = 13;
|
||||
TYPE_ENUM = 14;
|
||||
TYPE_SFIXED32 = 15;
|
||||
TYPE_SFIXED64 = 16;
|
||||
TYPE_SINT32 = 17; // Uses ZigZag encoding.
|
||||
TYPE_SINT64 = 18; // Uses ZigZag encoding.
|
||||
};
|
||||
|
||||
enum Label {
|
||||
// 0 is reserved for errors
|
||||
LABEL_OPTIONAL = 1;
|
||||
LABEL_REQUIRED = 2;
|
||||
LABEL_REPEATED = 3;
|
||||
// TODO(sanjay): Should we add LABEL_MAP?
|
||||
};
|
||||
|
||||
optional string name = 1;
|
||||
optional int32 number = 3;
|
||||
optional Label label = 4;
|
||||
|
||||
// If type_name is set, this need not be set. If both this and type_name
|
||||
// are set, this must be either TYPE_ENUM or TYPE_MESSAGE.
|
||||
optional Type type = 5;
|
||||
|
||||
// For message and enum types, this is the name of the type. If the name
|
||||
// starts with a '.', it is fully-qualified. Otherwise, C++-like scoping
|
||||
// rules are used to find the type (i.e. first the nested types within this
|
||||
// message are searched, then within the parent, on up to the root
|
||||
// namespace).
|
||||
optional string type_name = 6;
|
||||
|
||||
// For extensions, this is the name of the type being extended. It is
|
||||
// resolved in the same manner as type_name.
|
||||
optional string extendee = 2;
|
||||
|
||||
// For numeric types, contains the original text representation of the value.
|
||||
// For booleans, "true" or "false".
|
||||
// For strings, contains the default text contents (not escaped in any way).
|
||||
// For bytes, contains the C escaped value. All bytes >= 128 are escaped.
|
||||
// TODO(kenton): Base-64 encode?
|
||||
optional string default_value = 7;
|
||||
|
||||
optional FieldOptions options = 8;
|
||||
}
|
||||
|
||||
// Describes an enum type.
|
||||
message EnumDescriptorProto {
|
||||
optional string name = 1;
|
||||
|
||||
repeated EnumValueDescriptorProto value = 2;
|
||||
|
||||
optional EnumOptions options = 3;
|
||||
}
|
||||
|
||||
// Describes a value within an enum.
|
||||
message EnumValueDescriptorProto {
|
||||
optional string name = 1;
|
||||
optional int32 number = 2;
|
||||
|
||||
optional EnumValueOptions options = 3;
|
||||
}
|
||||
|
||||
// Describes a service.
|
||||
message ServiceDescriptorProto {
|
||||
optional string name = 1;
|
||||
repeated MethodDescriptorProto method = 2;
|
||||
|
||||
optional ServiceOptions options = 3;
|
||||
}
|
||||
|
||||
// Describes a method of a service.
|
||||
message MethodDescriptorProto {
|
||||
optional string name = 1;
|
||||
|
||||
// Input and output type names. These are resolved in the same way as
|
||||
// FieldDescriptorProto.type_name, but must refer to a message type.
|
||||
optional string input_type = 2;
|
||||
optional string output_type = 3;
|
||||
|
||||
optional MethodOptions options = 4;
|
||||
}
|
||||
|
||||
|
||||
// ===================================================================
|
||||
// Options
|
||||
|
||||
// Each of the definitions above may have "options" attached. These are
|
||||
// just annotations which may cause code to be generated slightly differently
|
||||
// or may contain hints for code that manipulates protocol messages.
|
||||
//
|
||||
// Clients may define custom options as extensions of the *Options messages.
|
||||
// These extensions may not yet be known at parsing time, so the parser cannot
|
||||
// store the values in them. Instead it stores them in a field in the *Options
|
||||
// message called uninterpreted_option. This field must have the same name
|
||||
// across all *Options messages. We then use this field to populate the
|
||||
// extensions when we build a descriptor, at which point all protos have been
|
||||
// parsed and so all extensions are known.
|
||||
//
|
||||
// Extension numbers for custom options may be chosen as follows:
|
||||
// * For options which will only be used within a single application or
|
||||
// organization, or for experimental options, use field numbers 50000
|
||||
// through 99999. It is up to you to ensure that you do not use the
|
||||
// same number for multiple options.
|
||||
// * For options which will be published and used publicly by multiple
|
||||
// independent entities, e-mail protobuf-global-extension-registry@google.com
|
||||
// to reserve extension numbers. Simply provide your project name (e.g.
|
||||
// Object-C plugin) and your porject website (if available) -- there's no need
|
||||
// to explain how you intend to use them. Usually you only need one extension
|
||||
// number. You can declare multiple options with only one extension number by
|
||||
// putting them in a sub-message. See the Custom Options section of the docs
|
||||
// for examples:
|
||||
// http://code.google.com/apis/protocolbuffers/docs/proto.html#options
|
||||
// If this turns out to be popular, a web service will be set up
|
||||
// to automatically assign option numbers.
|
||||
|
||||
|
||||
message FileOptions {
|
||||
|
||||
// Sets the Java package where classes generated from this .proto will be
|
||||
// placed. By default, the proto package is used, but this is often
|
||||
// inappropriate because proto packages do not normally start with backwards
|
||||
// domain names.
|
||||
optional string java_package = 1;
|
||||
|
||||
|
||||
// If set, all the classes from the .proto file are wrapped in a single
|
||||
// outer class with the given name. This applies to both Proto1
|
||||
// (equivalent to the old "--one_java_file" option) and Proto2 (where
|
||||
// a .proto always translates to a single class, but you may want to
|
||||
// explicitly choose the class name).
|
||||
optional string java_outer_classname = 8;
|
||||
|
||||
// If set true, then the Java code generator will generate a separate .java
|
||||
// file for each top-level message, enum, and service defined in the .proto
|
||||
// file. Thus, these types will *not* be nested inside the outer class
|
||||
// named by java_outer_classname. However, the outer class will still be
|
||||
// generated to contain the file's getDescriptor() method as well as any
|
||||
// top-level extensions defined in the file.
|
||||
optional bool java_multiple_files = 10 [default=false];
|
||||
|
||||
// If set true, then the Java code generator will generate equals() and
|
||||
// hashCode() methods for all messages defined in the .proto file. This is
|
||||
// purely a speed optimization, as the AbstractMessage base class includes
|
||||
// reflection-based implementations of these methods.
|
||||
optional bool java_generate_equals_and_hash = 20 [default=false];
|
||||
|
||||
// Generated classes can be optimized for speed or code size.
|
||||
enum OptimizeMode {
|
||||
SPEED = 1; // Generate complete code for parsing, serialization,
|
||||
// etc.
|
||||
CODE_SIZE = 2; // Use ReflectionOps to implement these methods.
|
||||
LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime.
|
||||
}
|
||||
optional OptimizeMode optimize_for = 9 [default=SPEED];
|
||||
|
||||
// Sets the Go package where structs generated from this .proto will be
|
||||
// placed. There is no default.
|
||||
optional string go_package = 11;
|
||||
|
||||
|
||||
|
||||
// Should generic services be generated in each language? "Generic" services
|
||||
// are not specific to any particular RPC system. They are generated by the
|
||||
// main code generators in each language (without additional plugins).
|
||||
// Generic services were the only kind of service generation supported by
|
||||
// early versions of proto2.
|
||||
//
|
||||
// Generic services are now considered deprecated in favor of using plugins
|
||||
// that generate code specific to your particular RPC system. Therefore,
|
||||
// these default to false. Old code which depends on generic services should
|
||||
// explicitly set them to true.
|
||||
optional bool cc_generic_services = 16 [default=false];
|
||||
optional bool java_generic_services = 17 [default=false];
|
||||
optional bool py_generic_services = 18 [default=false];
|
||||
|
||||
// The parser stores options it doesn't recognize here. See above.
|
||||
repeated UninterpretedOption uninterpreted_option = 999;
|
||||
|
||||
// Clients can define custom options in extensions of this message. See above.
|
||||
extensions 1000 to max;
|
||||
}
|
||||
|
||||
message MessageOptions {
|
||||
// Set true to use the old proto1 MessageSet wire format for extensions.
|
||||
// This is provided for backwards-compatibility with the MessageSet wire
|
||||
// format. You should not use this for any other reason: It's less
|
||||
// efficient, has fewer features, and is more complicated.
|
||||
//
|
||||
// The message must be defined exactly as follows:
|
||||
// message Foo {
|
||||
// option message_set_wire_format = true;
|
||||
// extensions 4 to max;
|
||||
// }
|
||||
// Note that the message cannot have any defined fields; MessageSets only
|
||||
// have extensions.
|
||||
//
|
||||
// All extensions of your type must be singular messages; e.g. they cannot
|
||||
// be int32s, enums, or repeated messages.
|
||||
//
|
||||
// Because this is an option, the above two restrictions are not enforced by
|
||||
// the protocol compiler.
|
||||
optional bool message_set_wire_format = 1 [default=false];
|
||||
|
||||
// Disables the generation of the standard "descriptor()" accessor, which can
|
||||
// conflict with a field of the same name. This is meant to make migration
|
||||
// from proto1 easier; new code should avoid fields named "descriptor".
|
||||
optional bool no_standard_descriptor_accessor = 2 [default=false];
|
||||
|
||||
// The parser stores options it doesn't recognize here. See above.
|
||||
repeated UninterpretedOption uninterpreted_option = 999;
|
||||
|
||||
// Clients can define custom options in extensions of this message. See above.
|
||||
extensions 1000 to max;
|
||||
}
|
||||
|
||||
message FieldOptions {
|
||||
// The ctype option instructs the C++ code generator to use a different
|
||||
// representation of the field than it normally would. See the specific
|
||||
// options below. This option is not yet implemented in the open source
|
||||
// release -- sorry, we'll try to include it in a future version!
|
||||
optional CType ctype = 1 [default = STRING];
|
||||
enum CType {
|
||||
// Default mode.
|
||||
STRING = 0;
|
||||
|
||||
CORD = 1;
|
||||
|
||||
STRING_PIECE = 2;
|
||||
}
|
||||
// The packed option can be enabled for repeated primitive fields to enable
|
||||
// a more efficient representation on the wire. Rather than repeatedly
|
||||
// writing the tag and type for each element, the entire array is encoded as
|
||||
// a single length-delimited blob.
|
||||
optional bool packed = 2;
|
||||
|
||||
|
||||
|
||||
// Should this field be parsed lazily? Lazy applies only to message-type
|
||||
// fields. It means that when the outer message is initially parsed, the
|
||||
// inner message's contents will not be parsed but instead stored in encoded
|
||||
// form. The inner message will actually be parsed when it is first accessed.
|
||||
//
|
||||
// This is only a hint. Implementations are free to choose whether to use
|
||||
// eager or lazy parsing regardless of the value of this option. However,
|
||||
// setting this option true suggests that the protocol author believes that
|
||||
// using lazy parsing on this field is worth the additional bookkeeping
|
||||
// overhead typically needed to implement it.
|
||||
//
|
||||
// This option does not affect the public interface of any generated code;
|
||||
// all method signatures remain the same. Furthermore, thread-safety of the
|
||||
// interface is not affected by this option; const methods remain safe to
|
||||
// call from multiple threads concurrently, while non-const methods continue
|
||||
// to require exclusive access.
|
||||
//
|
||||
//
|
||||
// Note that implementations may choose not to check required fields within
|
||||
// a lazy sub-message. That is, calling IsInitialized() on the outher message
|
||||
// may return true even if the inner message has missing required fields.
|
||||
// This is necessary because otherwise the inner message would have to be
|
||||
// parsed in order to perform the check, defeating the purpose of lazy
|
||||
// parsing. An implementation which chooses not to check required fields
|
||||
// must be consistent about it. That is, for any particular sub-message, the
|
||||
// implementation must either *always* check its required fields, or *never*
|
||||
// check its required fields, regardless of whether or not the message has
|
||||
// been parsed.
|
||||
optional bool lazy = 5 [default=false];
|
||||
|
||||
// Is this field deprecated?
|
||||
// Depending on the target platform, this can emit Deprecated annotations
|
||||
// for accessors, or it will be completely ignored; in the very least, this
|
||||
// is a formalization for deprecating fields.
|
||||
optional bool deprecated = 3 [default=false];
|
||||
|
||||
// EXPERIMENTAL. DO NOT USE.
|
||||
// For "map" fields, the name of the field in the enclosed type that
|
||||
// is the key for this map. For example, suppose we have:
|
||||
// message Item {
|
||||
// required string name = 1;
|
||||
// required string value = 2;
|
||||
// }
|
||||
// message Config {
|
||||
// repeated Item items = 1 [experimental_map_key="name"];
|
||||
// }
|
||||
// In this situation, the map key for Item will be set to "name".
|
||||
// TODO: Fully-implement this, then remove the "experimental_" prefix.
|
||||
optional string experimental_map_key = 9;
|
||||
|
||||
// For Google-internal migration only. Do not use.
|
||||
optional bool weak = 10 [default=false];
|
||||
|
||||
optional string interpreted_customtype = 616;
|
||||
|
||||
// The parser stores options it doesn't recognize here. See above.
|
||||
repeated UninterpretedOption uninterpreted_option = 999;
|
||||
|
||||
// Clients can define custom options in extensions of this message. See above.
|
||||
extensions 1000 to max;
|
||||
}
|
||||
|
||||
message EnumOptions {
|
||||
|
||||
// Set this option to false to disallow mapping different tag names to a same
|
||||
// value.
|
||||
optional bool allow_alias = 2 [default=true];
|
||||
|
||||
// The parser stores options it doesn't recognize here. See above.
|
||||
repeated UninterpretedOption uninterpreted_option = 999;
|
||||
|
||||
// Clients can define custom options in extensions of this message. See above.
|
||||
extensions 1000 to max;
|
||||
}
|
||||
|
||||
message EnumValueOptions {
|
||||
// The parser stores options it doesn't recognize here. See above.
|
||||
repeated UninterpretedOption uninterpreted_option = 999;
|
||||
|
||||
// Clients can define custom options in extensions of this message. See above.
|
||||
extensions 1000 to max;
|
||||
}
|
||||
|
||||
message ServiceOptions {
|
||||
|
||||
// Note: Field numbers 1 through 32 are reserved for Google's internal RPC
|
||||
// framework. We apologize for hoarding these numbers to ourselves, but
|
||||
// we were already using them long before we decided to release Protocol
|
||||
// Buffers.
|
||||
|
||||
// The parser stores options it doesn't recognize here. See above.
|
||||
repeated UninterpretedOption uninterpreted_option = 999;
|
||||
|
||||
// Clients can define custom options in extensions of this message. See above.
|
||||
extensions 1000 to max;
|
||||
}
|
||||
|
||||
message MethodOptions {
|
||||
|
||||
// Note: Field numbers 1 through 32 are reserved for Google's internal RPC
|
||||
// framework. We apologize for hoarding these numbers to ourselves, but
|
||||
// we were already using them long before we decided to release Protocol
|
||||
// Buffers.
|
||||
|
||||
// The parser stores options it doesn't recognize here. See above.
|
||||
repeated UninterpretedOption uninterpreted_option = 999;
|
||||
|
||||
// Clients can define custom options in extensions of this message. See above.
|
||||
extensions 1000 to max;
|
||||
}
|
||||
|
||||
|
||||
// A message representing a option the parser does not recognize. This only
|
||||
// appears in options protos created by the compiler::Parser class.
|
||||
// DescriptorPool resolves these when building Descriptor objects. Therefore,
|
||||
// options protos in descriptor objects (e.g. returned by Descriptor::options(),
|
||||
// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions
|
||||
// in them.
|
||||
message UninterpretedOption {
|
||||
// The name of the uninterpreted option. Each string represents a segment in
|
||||
// a dot-separated name. is_extension is true iff a segment represents an
|
||||
// extension (denoted with parentheses in options specs in .proto files).
|
||||
// E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents
|
||||
// "foo.(bar.baz).qux".
|
||||
message NamePart {
|
||||
required string name_part = 1;
|
||||
required bool is_extension = 2;
|
||||
}
|
||||
repeated NamePart name = 2;
|
||||
|
||||
// The value of the uninterpreted option, in whatever type the tokenizer
|
||||
// identified it as during parsing. Exactly one of these should be set.
|
||||
optional string identifier_value = 3;
|
||||
optional uint64 positive_int_value = 4;
|
||||
optional int64 negative_int_value = 5;
|
||||
optional double double_value = 6;
|
||||
optional bytes string_value = 7;
|
||||
optional string aggregate_value = 8;
|
||||
}
|
||||
|
||||
// ===================================================================
|
||||
// Optional source code info
|
||||
|
||||
// Encapsulates information about the original source file from which a
|
||||
// FileDescriptorProto was generated.
|
||||
message SourceCodeInfo {
|
||||
// A Location identifies a piece of source code in a .proto file which
|
||||
// corresponds to a particular definition. This information is intended
|
||||
// to be useful to IDEs, code indexers, documentation generators, and similar
|
||||
// tools.
|
||||
//
|
||||
// For example, say we have a file like:
|
||||
// message Foo {
|
||||
// optional string foo = 1;
|
||||
// }
|
||||
// Let's look at just the field definition:
|
||||
// optional string foo = 1;
|
||||
// ^ ^^ ^^ ^ ^^^
|
||||
// a bc de f ghi
|
||||
// We have the following locations:
|
||||
// span path represents
|
||||
// [a,i) [ 4, 0, 2, 0 ] The whole field definition.
|
||||
// [a,b) [ 4, 0, 2, 0, 4 ] The label (optional).
|
||||
// [c,d) [ 4, 0, 2, 0, 5 ] The type (string).
|
||||
// [e,f) [ 4, 0, 2, 0, 1 ] The name (foo).
|
||||
// [g,h) [ 4, 0, 2, 0, 3 ] The number (1).
|
||||
//
|
||||
// Notes:
|
||||
// - A location may refer to a repeated field itself (i.e. not to any
|
||||
// particular index within it). This is used whenever a set of elements are
|
||||
// logically enclosed in a single code segment. For example, an entire
|
||||
// extend block (possibly containing multiple extension definitions) will
|
||||
// have an outer location whose path refers to the "extensions" repeated
|
||||
// field without an index.
|
||||
// - Multiple locations may have the same path. This happens when a single
|
||||
// logical declaration is spread out across multiple places. The most
|
||||
// obvious example is the "extend" block again -- there may be multiple
|
||||
// extend blocks in the same scope, each of which will have the same path.
|
||||
// - A location's span is not always a subset of its parent's span. For
|
||||
// example, the "extendee" of an extension declaration appears at the
|
||||
// beginning of the "extend" block and is shared by all extensions within
|
||||
// the block.
|
||||
// - Just because a location's span is a subset of some other location's span
|
||||
// does not mean that it is a descendent. For example, a "group" defines
|
||||
// both a type and a field in a single declaration. Thus, the locations
|
||||
// corresponding to the type and field and their components will overlap.
|
||||
// - Code which tries to interpret locations should probably be designed to
|
||||
// ignore those that it doesn't understand, as more types of locations could
|
||||
// be recorded in the future.
|
||||
repeated Location location = 1;
|
||||
message Location {
|
||||
// Identifies which part of the FileDescriptorProto was defined at this
|
||||
// location.
|
||||
//
|
||||
// Each element is a field number or an index. They form a path from
|
||||
// the root FileDescriptorProto to the place where the definition. For
|
||||
// example, this path:
|
||||
// [ 4, 3, 2, 7, 1 ]
|
||||
// refers to:
|
||||
// file.message_type(3) // 4, 3
|
||||
// .field(7) // 2, 7
|
||||
// .name() // 1
|
||||
// This is because FileDescriptorProto.message_type has field number 4:
|
||||
// repeated DescriptorProto message_type = 4;
|
||||
// and DescriptorProto.field has field number 2:
|
||||
// repeated FieldDescriptorProto field = 2;
|
||||
// and FieldDescriptorProto.name has field number 1:
|
||||
// optional string name = 1;
|
||||
//
|
||||
// Thus, the above path gives the location of a field name. If we removed
|
||||
// the last element:
|
||||
// [ 4, 3, 2, 7 ]
|
||||
// this path refers to the whole field declaration (from the beginning
|
||||
// of the label to the terminating semicolon).
|
||||
repeated int32 path = 1 [packed=true];
|
||||
|
||||
// Always has exactly three or four elements: start line, start column,
|
||||
// end line (optional, otherwise assumed same as start line), end column.
|
||||
// These are packed into a single field for efficiency. Note that line
|
||||
// and column numbers are zero-based -- typically you will want to add
|
||||
// 1 to each before displaying to a user.
|
||||
repeated int32 span = 2 [packed=true];
|
||||
|
||||
// If this SourceCodeInfo represents a complete declaration, these are any
|
||||
// comments appearing before and after the declaration which appear to be
|
||||
// attached to the declaration.
|
||||
//
|
||||
// A series of line comments appearing on consecutive lines, with no other
|
||||
// tokens appearing on those lines, will be treated as a single comment.
|
||||
//
|
||||
// Only the comment content is provided; comment markers (e.g. //) are
|
||||
// stripped out. For block comments, leading whitespace and an asterisk
|
||||
// will be stripped from the beginning of each line other than the first.
|
||||
// Newlines are included in the output.
|
||||
//
|
||||
// Examples:
|
||||
//
|
||||
// optional int32 foo = 1; // Comment attached to foo.
|
||||
// // Comment attached to bar.
|
||||
// optional int32 bar = 2;
|
||||
//
|
||||
// optional string baz = 3;
|
||||
// // Comment attached to baz.
|
||||
// // Another line attached to baz.
|
||||
//
|
||||
// // Comment attached to qux.
|
||||
// //
|
||||
// // Another line attached to qux.
|
||||
// optional double qux = 4;
|
||||
//
|
||||
// optional string corge = 5;
|
||||
// /* Block comment attached
|
||||
// * to corge. Leading asterisks
|
||||
// * will be removed. */
|
||||
// /* Block comment attached to
|
||||
// * grault. */
|
||||
// optional int32 grault = 6;
|
||||
optional string leading_comments = 3;
|
||||
optional string trailing_comments = 4;
|
||||
}
|
||||
}
|
||||
+93
@@ -0,0 +1,93 @@
|
||||
// Copyright (c) 2013, Vastech SA (PTY) LTD. All rights reserved.
|
||||
// http://code.google.com/p/gogoprotobuf/gogoproto
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
package gogoproto;
|
||||
|
||||
import "src/third_party/gogoprotobuf/descriptor.proto";
|
||||
|
||||
extend google.protobuf.EnumOptions {
|
||||
optional bool goproto_enum_prefix = 62001;
|
||||
optional bool goproto_enum_stringer = 62021;
|
||||
optional bool enum_stringer = 62022;
|
||||
}
|
||||
|
||||
extend google.protobuf.FileOptions {
|
||||
optional bool goproto_getters_all = 63001;
|
||||
optional bool goproto_enum_prefix_all = 63002;
|
||||
optional bool goproto_stringer_all = 63003;
|
||||
optional bool verbose_equal_all = 63004;
|
||||
optional bool face_all = 63005;
|
||||
optional bool gostring_all = 63006;
|
||||
optional bool populate_all = 63007;
|
||||
optional bool stringer_all = 63008;
|
||||
optional bool union_all = 63009;
|
||||
|
||||
optional bool equal_all = 63013;
|
||||
optional bool description_all = 63014;
|
||||
optional bool testgen_all = 63015;
|
||||
optional bool benchgen_all = 63016;
|
||||
optional bool marshaler_all = 63017;
|
||||
optional bool unmarshaler_all = 63018;
|
||||
optional bool bufferto_all = 63019;
|
||||
optional bool sizer_all = 63020;
|
||||
|
||||
optional bool goproto_enum_stringer_all = 63021;
|
||||
optional bool enum_stringer_all = 63022;
|
||||
|
||||
optional bool unsafe_marshaler_all = 63023;
|
||||
optional bool unsafe_unmarshaler_all = 63024;
|
||||
}
|
||||
|
||||
extend google.protobuf.MessageOptions {
|
||||
optional bool goproto_getters = 64001;
|
||||
optional bool goproto_stringer = 64003;
|
||||
optional bool verbose_equal = 64004;
|
||||
optional bool face = 64005;
|
||||
optional bool gostring = 64006;
|
||||
optional bool populate = 64007;
|
||||
optional bool stringer = 67008;
|
||||
optional bool union = 64009;
|
||||
|
||||
optional bool equal = 64013;
|
||||
optional bool description = 64014;
|
||||
optional bool testgen = 64015;
|
||||
optional bool benchgen = 64016;
|
||||
optional bool marshaler = 64017;
|
||||
optional bool unmarshaler = 64018;
|
||||
optional bool bufferto = 64019;
|
||||
optional bool sizer = 64020;
|
||||
|
||||
optional bool unsafe_marshaler = 64023;
|
||||
optional bool unsafe_unmarshaler = 64024;
|
||||
}
|
||||
|
||||
extend google.protobuf.FieldOptions {
|
||||
optional bool nullable = 65001;
|
||||
optional bool embed = 65002;
|
||||
optional string customtype = 65003;
|
||||
optional string customname = 65004;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user