Skip to content

Commit

Permalink
协议更新 客户端换模型
Browse files Browse the repository at this point in the history
  • Loading branch information
zsummer committed Sep 5, 2016
1 parent 6b48761 commit 9c8f34f
Show file tree
Hide file tree
Showing 8 changed files with 202 additions and 42 deletions.
84 changes: 76 additions & 8 deletions protocol/C++/ProtoClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,74 @@ inline zsummer::log4z::Log4zStream & operator << (zsummer::log4z::Log4zStream &
return stm;
}

struct AvatarBaseInfoNotice
{
static const unsigned short getProtoID() { return 40022;}
static const std::string getProtoName() { return "AvatarBaseInfoNotice";}
AvatarBaseInfo baseInfo;
AvatarBaseInfoNotice()
{
}
AvatarBaseInfoNotice(const AvatarBaseInfo & baseInfo)
{
this->baseInfo = baseInfo;
}
};
inline zsummer::proto4z::WriteStream & operator << (zsummer::proto4z::WriteStream & ws, const AvatarBaseInfoNotice & data)
{
ws << data.baseInfo;
return ws;
}
inline zsummer::proto4z::ReadStream & operator >> (zsummer::proto4z::ReadStream & rs, AvatarBaseInfoNotice & data)
{
rs >> data.baseInfo;
return rs;
}
inline zsummer::log4z::Log4zStream & operator << (zsummer::log4z::Log4zStream & stm, const AvatarBaseInfoNotice & info)
{
stm << "[\n";
stm << "baseInfo=" << info.baseInfo << "\n";
stm << "]\n";
return stm;
}

struct AvatarPropMapNotice
{
static const unsigned short getProtoID() { return 40023;}
static const std::string getProtoName() { return "AvatarPropMapNotice";}
unsigned long long avatarID;
AvatarPropMap props;
AvatarPropMapNotice()
{
avatarID = 0;
}
AvatarPropMapNotice(const unsigned long long & avatarID, const AvatarPropMap & props)
{
this->avatarID = avatarID;
this->props = props;
}
};
inline zsummer::proto4z::WriteStream & operator << (zsummer::proto4z::WriteStream & ws, const AvatarPropMapNotice & data)
{
ws << data.avatarID;
ws << data.props;
return ws;
}
inline zsummer::proto4z::ReadStream & operator >> (zsummer::proto4z::ReadStream & rs, AvatarPropMapNotice & data)
{
rs >> data.avatarID;
rs >> data.props;
return rs;
}
inline zsummer::log4z::Log4zStream & operator << (zsummer::log4z::Log4zStream & stm, const AvatarPropMapNotice & info)
{
stm << "[\n";
stm << "avatarID=" << info.avatarID << "\n";
stm << "props=" << info.props << "\n";
stm << "]\n";
return stm;
}

struct GetSceneTokenInfoReq
{
static const unsigned short getProtoID() { return 40007;}
Expand Down Expand Up @@ -670,12 +738,12 @@ struct ChangeIconIDReq
{
static const unsigned short getProtoID() { return 40018;}
static const std::string getProtoName() { return "ChangeIconIDReq";}
short iconID;
int iconID;
ChangeIconIDReq()
{
iconID = 0;
}
ChangeIconIDReq(const short & iconID)
ChangeIconIDReq(const int & iconID)
{
this->iconID = iconID;
}
Expand Down Expand Up @@ -703,13 +771,13 @@ struct ChangeIconIDResp
static const unsigned short getProtoID() { return 40019;}
static const std::string getProtoName() { return "ChangeIconIDResp";}
unsigned short retCode;
short iconID;
int iconID;
ChangeIconIDResp()
{
retCode = 0;
iconID = 0;
}
ChangeIconIDResp(const unsigned short & retCode, const short & iconID)
ChangeIconIDResp(const unsigned short & retCode, const int & iconID)
{
this->retCode = retCode;
this->iconID = iconID;
Expand Down Expand Up @@ -740,12 +808,12 @@ struct ChangeModeIDReq
{
static const unsigned short getProtoID() { return 40020;}
static const std::string getProtoName() { return "ChangeModeIDReq";}
short modeID;
int modeID;
ChangeModeIDReq()
{
modeID = 0;
}
ChangeModeIDReq(const short & modeID)
ChangeModeIDReq(const int & modeID)
{
this->modeID = modeID;
}
Expand Down Expand Up @@ -773,13 +841,13 @@ struct ChangeModeIDResp
static const unsigned short getProtoID() { return 40021;}
static const std::string getProtoName() { return "ChangeModeIDResp";}
unsigned short retCode;
short modeID;
int modeID;
ChangeModeIDResp()
{
retCode = 0;
modeID = 0;
}
ChangeModeIDResp(const unsigned short & retCode, const short & modeID)
ChangeModeIDResp(const unsigned short & retCode, const int & modeID)
{
this->retCode = retCode;
this->modeID = modeID;
Expand Down
4 changes: 4 additions & 0 deletions protocol/CSharp/Proto4zReflection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,16 @@ static Reflection()
_idToName.Add(50001, "AttachSceneResp");
_nameToID.Add("AvatarBaseInfo", 1004);
_idToName.Add(1004, "AvatarBaseInfo");
_nameToID.Add("AvatarBaseInfoNotice", 40022);
_idToName.Add(40022, "AvatarBaseInfoNotice");
_nameToID.Add("AvatarOffline", 2023);
_idToName.Add(2023, "AvatarOffline");
_nameToID.Add("AvatarPreview", 1003);
_idToName.Add(1003, "AvatarPreview");
_nameToID.Add("AvatarPropInfo", 1014);
_idToName.Add(1014, "AvatarPropInfo");
_nameToID.Add("AvatarPropMapNotice", 40023);
_idToName.Add(40023, "AvatarPropMapNotice");
_nameToID.Add("BuffData", 10005);
_idToName.Add(10005, "BuffData");
_nameToID.Add("BuffInfo", 10008);
Expand Down
99 changes: 83 additions & 16 deletions protocol/CSharp/ProtoClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,73 @@ public int __decode(byte[] binData, ref int pos)
}
}

public class AvatarBaseInfoNotice: Proto4z.IProtoObject
{
//proto id
public const ushort protoID = 40022;
static public ushort getProtoID() { return 40022; }
static public string getProtoName() { return "AvatarBaseInfoNotice"; }
//members
public AvatarBaseInfo baseInfo;
public AvatarBaseInfoNotice()
{
baseInfo = new AvatarBaseInfo();
}
public AvatarBaseInfoNotice(AvatarBaseInfo baseInfo)
{
this.baseInfo = baseInfo;
}
public System.Collections.Generic.List<byte> __encode()
{
var data = new System.Collections.Generic.List<byte>();
if (this.baseInfo == null) this.baseInfo = new AvatarBaseInfo();
data.AddRange(this.baseInfo.__encode());
return data;
}
public int __decode(byte[] binData, ref int pos)
{
this.baseInfo = new AvatarBaseInfo();
this.baseInfo.__decode(binData, ref pos);
return pos;
}
}

public class AvatarPropMapNotice: Proto4z.IProtoObject
{
//proto id
public const ushort protoID = 40023;
static public ushort getProtoID() { return 40023; }
static public string getProtoName() { return "AvatarPropMapNotice"; }
//members
public ulong avatarID;
public AvatarPropMap props;
public AvatarPropMapNotice()
{
avatarID = 0;
props = new AvatarPropMap();
}
public AvatarPropMapNotice(ulong avatarID, AvatarPropMap props)
{
this.avatarID = avatarID;
this.props = props;
}
public System.Collections.Generic.List<byte> __encode()
{
var data = new System.Collections.Generic.List<byte>();
data.AddRange(Proto4z.BaseProtoObject.encodeUI64(this.avatarID));
if (this.props == null) this.props = new AvatarPropMap();
data.AddRange(this.props.__encode());
return data;
}
public int __decode(byte[] binData, ref int pos)
{
this.avatarID = Proto4z.BaseProtoObject.decodeUI64(binData, ref pos);
this.props = new AvatarPropMap();
this.props.__decode(binData, ref pos);
return pos;
}
}

public class GetSceneTokenInfoReq: Proto4z.IProtoObject
{
//proto id
Expand Down Expand Up @@ -641,24 +708,24 @@ public class ChangeIconIDReq: Proto4z.IProtoObject
static public ushort getProtoID() { return 40018; }
static public string getProtoName() { return "ChangeIconIDReq"; }
//members
public short iconID;
public int iconID;
public ChangeIconIDReq()
{
iconID = 0;
}
public ChangeIconIDReq(short iconID)
public ChangeIconIDReq(int iconID)
{
this.iconID = iconID;
}
public System.Collections.Generic.List<byte> __encode()
{
var data = new System.Collections.Generic.List<byte>();
data.AddRange(Proto4z.BaseProtoObject.encodeI16(this.iconID));
data.AddRange(Proto4z.BaseProtoObject.encodeI32(this.iconID));
return data;
}
public int __decode(byte[] binData, ref int pos)
{
this.iconID = Proto4z.BaseProtoObject.decodeI16(binData, ref pos);
this.iconID = Proto4z.BaseProtoObject.decodeI32(binData, ref pos);
return pos;
}
}
Expand All @@ -671,13 +738,13 @@ public class ChangeIconIDResp: Proto4z.IProtoObject
static public string getProtoName() { return "ChangeIconIDResp"; }
//members
public ushort retCode;
public short iconID;
public int iconID;
public ChangeIconIDResp()
{
retCode = 0;
iconID = 0;
}
public ChangeIconIDResp(ushort retCode, short iconID)
public ChangeIconIDResp(ushort retCode, int iconID)
{
this.retCode = retCode;
this.iconID = iconID;
Expand All @@ -686,13 +753,13 @@ public System.Collections.Generic.List<byte> __encode()
{
var data = new System.Collections.Generic.List<byte>();
data.AddRange(Proto4z.BaseProtoObject.encodeUI16(this.retCode));
data.AddRange(Proto4z.BaseProtoObject.encodeI16(this.iconID));
data.AddRange(Proto4z.BaseProtoObject.encodeI32(this.iconID));
return data;
}
public int __decode(byte[] binData, ref int pos)
{
this.retCode = Proto4z.BaseProtoObject.decodeUI16(binData, ref pos);
this.iconID = Proto4z.BaseProtoObject.decodeI16(binData, ref pos);
this.iconID = Proto4z.BaseProtoObject.decodeI32(binData, ref pos);
return pos;
}
}
Expand All @@ -704,24 +771,24 @@ public class ChangeModeIDReq: Proto4z.IProtoObject
static public ushort getProtoID() { return 40020; }
static public string getProtoName() { return "ChangeModeIDReq"; }
//members
public short modeID;
public int modeID;
public ChangeModeIDReq()
{
modeID = 0;
}
public ChangeModeIDReq(short modeID)
public ChangeModeIDReq(int modeID)
{
this.modeID = modeID;
}
public System.Collections.Generic.List<byte> __encode()
{
var data = new System.Collections.Generic.List<byte>();
data.AddRange(Proto4z.BaseProtoObject.encodeI16(this.modeID));
data.AddRange(Proto4z.BaseProtoObject.encodeI32(this.modeID));
return data;
}
public int __decode(byte[] binData, ref int pos)
{
this.modeID = Proto4z.BaseProtoObject.decodeI16(binData, ref pos);
this.modeID = Proto4z.BaseProtoObject.decodeI32(binData, ref pos);
return pos;
}
}
Expand All @@ -734,13 +801,13 @@ public class ChangeModeIDResp: Proto4z.IProtoObject
static public string getProtoName() { return "ChangeModeIDResp"; }
//members
public ushort retCode;
public short modeID;
public int modeID;
public ChangeModeIDResp()
{
retCode = 0;
modeID = 0;
}
public ChangeModeIDResp(ushort retCode, short modeID)
public ChangeModeIDResp(ushort retCode, int modeID)
{
this.retCode = retCode;
this.modeID = modeID;
Expand All @@ -749,13 +816,13 @@ public System.Collections.Generic.List<byte> __encode()
{
var data = new System.Collections.Generic.List<byte>();
data.AddRange(Proto4z.BaseProtoObject.encodeUI16(this.retCode));
data.AddRange(Proto4z.BaseProtoObject.encodeI16(this.modeID));
data.AddRange(Proto4z.BaseProtoObject.encodeI32(this.modeID));
return data;
}
public int __decode(byte[] binData, ref int pos)
{
this.retCode = Proto4z.BaseProtoObject.decodeUI16(binData, ref pos);
this.modeID = Proto4z.BaseProtoObject.decodeI16(binData, ref pos);
this.modeID = Proto4z.BaseProtoObject.decodeI32(binData, ref pos);
return pos;
}
}
Expand Down
16 changes: 11 additions & 5 deletions protocol/ProtoClient.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,13 @@
<member name="props" type="AvatarPropMap" desc=""/>
</packet>


<packet name="AvatarBaseInfoNotice" desc= "">
<member name="baseInfo" type="AvatarBaseInfo" desc=""/>
</packet>
<packet name="AvatarPropMapNotice" desc= "">
<member name="avatarID" type="ui64" desc=""/>
<member name="props" type="AvatarPropMap" desc=""/>
</packet>


<!------------------------------------ battle --------------------------------------------->
Expand Down Expand Up @@ -102,18 +108,18 @@
</packet>

<packet name="ChangeIconIDReq" desc= "">
<member name="iconID" type="i16" desc=""/>
<member name="iconID" type="i32" desc=""/>
</packet>
<packet name="ChangeIconIDResp" desc= "">
<member name="retCode" type="ui16" desc=""/>
<member name="iconID" type="i16" desc=""/>
<member name="iconID" type="i32" desc=""/>
</packet>
<packet name="ChangeModeIDReq" desc= "">
<member name="modeID" type="i16" desc=""/>
<member name="modeID" type="i32" desc=""/>
</packet>
<packet name="ChangeModeIDResp" desc= "">
<member name="retCode" type="ui16" desc=""/>
<member name="modeID" type="i16" desc=""/>
<member name="modeID" type="i32" desc=""/>
</packet>

</Proto>
Expand Down
Loading

0 comments on commit 9c8f34f

Please sign in to comment.