diff --git a/protocol/C++/ProtoClient.h b/protocol/C++/ProtoClient.h index 1c29bd91..2bed8407 100644 --- a/protocol/C++/ProtoClient.h +++ b/protocol/C++/ProtoClient.h @@ -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;} @@ -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; } @@ -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; @@ -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; } @@ -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; diff --git a/protocol/CSharp/Proto4zReflection.cs b/protocol/CSharp/Proto4zReflection.cs index 8376826e..7de594ad 100644 --- a/protocol/CSharp/Proto4zReflection.cs +++ b/protocol/CSharp/Proto4zReflection.cs @@ -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); diff --git a/protocol/CSharp/ProtoClient.cs b/protocol/CSharp/ProtoClient.cs index 957b2f61..88aaec16 100644 --- a/protocol/CSharp/ProtoClient.cs +++ b/protocol/CSharp/ProtoClient.cs @@ -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 __encode() + { + var data = new System.Collections.Generic.List(); + 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 __encode() + { + var data = new System.Collections.Generic.List(); + 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 @@ -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 __encode() { var data = new System.Collections.Generic.List(); - 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; } } @@ -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; @@ -686,13 +753,13 @@ public System.Collections.Generic.List __encode() { var data = new System.Collections.Generic.List(); 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; } } @@ -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 __encode() { var data = new System.Collections.Generic.List(); - 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; } } @@ -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; @@ -749,13 +816,13 @@ public System.Collections.Generic.List __encode() { var data = new System.Collections.Generic.List(); 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; } } diff --git a/protocol/ProtoClient.xml b/protocol/ProtoClient.xml index f8cf2835..07ad3a6d 100644 --- a/protocol/ProtoClient.xml +++ b/protocol/ProtoClient.xml @@ -43,7 +43,13 @@ - + + + + + + + @@ -102,18 +108,18 @@ - + - + - + - + diff --git a/protocol/ProtoClient.xml.cache b/protocol/ProtoClient.xml.cache index 7122a96f..b016d0fd 100644 --- a/protocol/ProtoClient.xml.cache +++ b/protocol/ProtoClient.xml.cache @@ -1,12 +1,14 @@ -3f1cd4d4745210cc758e749326679ccf -68b285f61bac6ccd9d5bc80c83b795b9 -de399c44ec3666434f4227c5eef10569 -c2244fec8173308cddd77861255bf849 +aa7e8bcab1f4c725fced63b67b3184c8 +80c98e434cfc7f8eaa08675f4171e1a6 +f0e1e8e8dd9e0552dcc68b039a54c8a2 +765aa092293875cde3e67bcc380a7808 + + diff --git a/protocol/ProtoCommon.xml.cache b/protocol/ProtoCommon.xml.cache index cd285025..ce6edce9 100755 --- a/protocol/ProtoCommon.xml.cache +++ b/protocol/ProtoCommon.xml.cache @@ -3,7 +3,7 @@ aad8c22b116ae8990b506998033a047b 4c67e5e435e1a71beb2d286a773705f7 b94633216b01111bde083b6950765dfe -b402c4447d1162e87f5fa3405a729c5f +bad623f4d63688f820a5f3987a264550 diff --git a/protocol/lua/ProtoClient.lua b/protocol/lua/ProtoClient.lua index 81e5ff42..c37938dd 100644 --- a/protocol/lua/ProtoClient.lua +++ b/protocol/lua/ProtoClient.lua @@ -50,6 +50,19 @@ Proto4z.AttachAvatarResp[1] = {name="retCode", type="ui16" } Proto4z.AttachAvatarResp[2] = {name="baseInfo", type="AvatarBaseInfo" } Proto4z.AttachAvatarResp[3] = {name="props", type="AvatarPropMap" } +Proto4z.register(40022,"AvatarBaseInfoNotice") +Proto4z.AvatarBaseInfoNotice = {} +Proto4z.AvatarBaseInfoNotice.__protoID = 40022 +Proto4z.AvatarBaseInfoNotice.__protoName = "AvatarBaseInfoNotice" +Proto4z.AvatarBaseInfoNotice[1] = {name="baseInfo", type="AvatarBaseInfo" } + +Proto4z.register(40023,"AvatarPropMapNotice") +Proto4z.AvatarPropMapNotice = {} +Proto4z.AvatarPropMapNotice.__protoID = 40023 +Proto4z.AvatarPropMapNotice.__protoName = "AvatarPropMapNotice" +Proto4z.AvatarPropMapNotice[1] = {name="avatarID", type="ui64" } +Proto4z.AvatarPropMapNotice[2] = {name="props", type="AvatarPropMap" } + Proto4z.register(40007,"GetSceneTokenInfoReq") Proto4z.GetSceneTokenInfoReq = {} Proto4z.GetSceneTokenInfoReq.__protoID = 40007 @@ -131,24 +144,24 @@ Proto4z.register(40018,"ChangeIconIDReq") Proto4z.ChangeIconIDReq = {} Proto4z.ChangeIconIDReq.__protoID = 40018 Proto4z.ChangeIconIDReq.__protoName = "ChangeIconIDReq" -Proto4z.ChangeIconIDReq[1] = {name="iconID", type="i16" } +Proto4z.ChangeIconIDReq[1] = {name="iconID", type="i32" } Proto4z.register(40019,"ChangeIconIDResp") Proto4z.ChangeIconIDResp = {} Proto4z.ChangeIconIDResp.__protoID = 40019 Proto4z.ChangeIconIDResp.__protoName = "ChangeIconIDResp" Proto4z.ChangeIconIDResp[1] = {name="retCode", type="ui16" } -Proto4z.ChangeIconIDResp[2] = {name="iconID", type="i16" } +Proto4z.ChangeIconIDResp[2] = {name="iconID", type="i32" } Proto4z.register(40020,"ChangeModeIDReq") Proto4z.ChangeModeIDReq = {} Proto4z.ChangeModeIDReq.__protoID = 40020 Proto4z.ChangeModeIDReq.__protoName = "ChangeModeIDReq" -Proto4z.ChangeModeIDReq[1] = {name="modeID", type="i16" } +Proto4z.ChangeModeIDReq[1] = {name="modeID", type="i32" } Proto4z.register(40021,"ChangeModeIDResp") Proto4z.ChangeModeIDResp = {} Proto4z.ChangeModeIDResp.__protoID = 40021 Proto4z.ChangeModeIDResp.__protoName = "ChangeModeIDResp" Proto4z.ChangeModeIDResp[1] = {name="retCode", type="ui16" } -Proto4z.ChangeModeIDResp[2] = {name="modeID", type="i16" } +Proto4z.ChangeModeIDResp[2] = {name="modeID", type="i32" } diff --git a/source/docker/logic/avatarService.cpp b/source/docker/logic/avatarService.cpp index dd9c43d8..fd270962 100644 --- a/source/docker/logic/avatarService.cpp +++ b/source/docker/logic/avatarService.cpp @@ -208,8 +208,8 @@ void AvatarService::onChangeIconIDReq(const Tracing & trace, zsummer::proto4z::R rs >> req; _baseInfo._data.iconID = req.iconID; _baseInfo.writeToDB(); - ChangeIconIDResp resp(EC_SUCCESS, req.iconID); - toService(STClient, getServiceID(), resp); + toService(STClient, getServiceID(), AvatarBaseInfoNotice(_baseInfo._data)); + toService(STClient, getServiceID(), ChangeIconIDResp(EC_SUCCESS, req.iconID)); } void AvatarService::onChangeModeIDReq(const Tracing & trace, zsummer::proto4z::ReadStream &rs) { @@ -217,8 +217,8 @@ void AvatarService::onChangeModeIDReq(const Tracing & trace, zsummer::proto4z::R rs >> req; _baseInfo._data.modeID = req.modeID; _baseInfo.writeToDB(); - ChangeModeIDResp resp(EC_SUCCESS, req.modeID); - toService(STClient, getServiceID(), resp); + toService(STClient, getServiceID(), AvatarBaseInfoNotice(_baseInfo._data)); + toService(STClient, getServiceID(), ChangeModeIDResp(EC_SUCCESS, req.modeID)); }