diff --git a/AxibugEmuOnline.Client/Assets/Script/App.cs b/AxibugEmuOnline.Client/Assets/Script/App.cs index 6fe6ab8..cf88d71 100644 --- a/AxibugEmuOnline.Client/Assets/Script/App.cs +++ b/AxibugEmuOnline.Client/Assets/Script/App.cs @@ -29,6 +29,7 @@ namespace AxibugEmuOnline.Client.ClientCore public static AppRoom roomMgr; public static AppSettings settings; public static FilterManager filter; + public static AppShare share; #region Mono public static TickLoop tickLoop; private static CoroutineRunner coRunner; @@ -55,6 +56,7 @@ namespace AxibugEmuOnline.Client.ClientCore nesRomLib = new RomLib(EnumPlatform.NES); CacheMgr = new CacheManager(); roomMgr = new AppRoom(); + share = new AppShare(); filter = new FilterManager(initer.m_filterVolume, initer.m_filterPreview,initer.m_xmbBg); var go = new GameObject("[AppAxibugEmuOnline]"); GameObject.DontDestroyOnLoad(go); @@ -66,7 +68,7 @@ namespace AxibugEmuOnline.Client.ClientCore //PSV 等平台需要手动创建目录 PersistentDataPathDir(); } - + var importNode = GameObject.Find("IMPORTENT"); if (importNode != null) GameObject.DontDestroyOnLoad(importNode); diff --git a/AxibugEmuOnline.Client/Assets/Script/Event/EEvent.cs b/AxibugEmuOnline.Client/Assets/Script/Event/EEvent.cs index 4740143..c296d94 100644 --- a/AxibugEmuOnline.Client/Assets/Script/Event/EEvent.cs +++ b/AxibugEmuOnline.Client/Assets/Script/Event/EEvent.cs @@ -10,6 +10,9 @@ //更新其他用户信息 OnOtherUserInfoUpdate, + //当收藏数发生变化 + OnDoStars, + //用户列表,登录和离开 OnUserListAllUpdate, OnUserLogin, diff --git a/AxibugEmuOnline.Client/Assets/Script/Manager/AppShare.cs b/AxibugEmuOnline.Client/Assets/Script/Manager/AppShare.cs new file mode 100644 index 0000000..993722e --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Script/Manager/AppShare.cs @@ -0,0 +1,46 @@ +using AxibugEmuOnline.Client.ClientCore; +using AxibugEmuOnline.Client.Common; +using AxibugEmuOnline.Client.Event; +using AxibugEmuOnline.Client.Network; +using AxibugProtobuf; + +namespace AxibugEmuOnline.Client.Manager +{ + public class AppShare + { + public AppShare() + { + NetMsg.Instance.RegNetMsgEvent((int)CommandID.CmdGameMark, RecvGameStar); + } + + /// + /// 发送收藏 + /// + /// + /// [0]收藏[1]取消收藏 + public void SendGameStar(int RomID, PlatformType Platform, int Motion) + { + Protobuf_Game_Mark req = new Protobuf_Game_Mark() + { + State = Motion, + RomID = RomID, + PlatformType = Platform + }; + + App.log.Info($"LeavnRoom"); + App.network.SendToServer((int)CommandID.CmdGameMark, ProtoBufHelper.Serizlize(req)); + } + + /// + /// 离开房间成功 + /// + /// + void RecvGameStar(byte[] reqData) + { + Protobuf_Game_Mark_RESP msg = ProtoBufHelper.DeSerizlize(reqData); + + Eventer.Instance.PostEvent(EEvent.OnDoStars, msg.PlatformType, msg.RomID); + } + + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client/Assets/Script/Manager/AppShare.cs.meta b/AxibugEmuOnline.Client/Assets/Script/Manager/AppShare.cs.meta new file mode 100644 index 0000000..590b389 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Script/Manager/AppShare.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8a704bd24172e02428eeba6b94674011 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Script/Protobuf/ProtobufAxibugEmuOnline.cs b/AxibugEmuOnline.Client/Assets/Script/Protobuf/ProtobufAxibugEmuOnline.cs index e8ba8c7..55073cb 100644 --- a/AxibugEmuOnline.Client/Assets/Script/Protobuf/ProtobufAxibugEmuOnline.cs +++ b/AxibugEmuOnline.Client/Assets/Script/Protobuf/ProtobufAxibugEmuOnline.cs @@ -87,35 +87,42 @@ namespace AxibugProtobuf { "UCIcChpQcm90b2J1Zl9Sb29tX1BsYXllcl9SZWFkeSIqChhQcm90b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k9SX0RFRkFV", - "TBAAEgwKCEVSUk9SX09LEAESGAoURVJST1JfUk9PTV9OT1RfRk9VTkQQChIl", - "CiFFUlJPUl9ST09NX1NMT1RfUkVBRExZX0hBRF9QTEFZRVIQCxIhCh1FUlJP", - "Ul9ST09NX0NBTlRfRE9fQ1VSUl9TVEFURRAyKkAKCUxvZ2luVHlwZRINCglV", - "c2VEZXZpY2UQABIOCgpVc2VBY2NvdW50EAESFAoQVXNlSGFvWXVlQWNjb3Vu", - "dBACKksKCkRldmljZVR5cGUSFgoSRGV2aWNlVHlwZV9EZWZhdWx0EAASBgoC", - "UEMQARILCgdBbmRyb2lkEAISBwoDSU9TEAMSBwoDUFNWEAQqcAoNUm9vbUdh", - "bWVTdGF0ZRISCg5Ob25lX0dhbWVTdGF0ZRAAEgwKCE9ubHlIb3N0EAESEQoN", - "V2FpdFJhd1VwZGF0ZRACEg0KCVdhaXRSZWFkeRADEgkKBVBhdXNlEAQSEAoM", - "SW5PbmxpbmVHYW1lEAUqTgoRTG9naW5SZXN1bHRTdGF0dXMSIQodTG9naW5S", - "ZXN1bHRTdGF0dXNfQmFzZURlZmF1bHQQABIGCgJPSxABEg4KCkFjY291bnRF", - "cnIQAkICSAFiBnByb3RvMw==")); + "GAIgASgFEhEKCVJhd0JpdG1hcBgDIAEoDCJmChJQcm90b2J1Zl9HYW1lX01h", + "cmsSDQoFUm9tSUQYASABKAUSDQoFc3RhdGUYAiABKAUSMgoMUGxhdGZvcm1U", + "eXBlGAMgASgOMhwuQXhpYnVnUHJvdG9idWYuUGxhdGZvcm1UeXBlIlwKF1By", + "b3RvYnVmX0dhbWVfTWFya19SRVNQEg0KBVJvbUlEGAEgASgFEjIKDFBsYXRm", + "b3JtVHlwZRgCIAEoDjIcLkF4aWJ1Z1Byb3RvYnVmLlBsYXRmb3JtVHlwZSr+", + "BAoJQ29tbWFuZElEEg4KCkNNRF9ERUZBVUwQABIMCghDTURfUElORxABEgwK", + "CENNRF9QT05HEAISDgoJQ01E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9ST01fRE9OVF9IQURfU1RBUhCUAypACglM", + "b2dpblR5cGUSDQoJVXNlRGV2aWNlEAASDgoKVXNlQWNjb3VudBABEhQKEFVz", + "ZUhhb1l1ZUFjY291bnQQAipLCgpEZXZpY2VUeXBlEhYKEkRldmljZVR5cGVf", + "RGVmYXVsdBAAEgYKAlBDEAESCwoHQW5kcm9pZBACEgcKA0lPUxADEgcKA1BT", + "VhAEKiAKDFBsYXRmb3JtVHlwZRIHCgNBbGwQABIHCgNOZXMQASpwCg1Sb29t", + "R2FtZVN0YXRlEhIKDk5vbmVfR2FtZVN0YXRlEAASDAoIT25seUhvc3QQARIR", + "Cg1XYWl0UmF3VXBkYXRlEAISDQoJV2FpdFJlYWR5EAMSCQoFUGF1c2UQBBIQ", + "CgxJbk9ubGluZUdhbWUQBSpOChFMb2dpblJlc3VsdFN0YXR1cxIhCh1Mb2dp", + "blJlc3VsdFN0YXR1c19CYXNlRGVmYXVsdBAAEgYKAk9LEAESDgoKQWNjb3Vu", + "dEVychACQgJIAWIGcHJvdG8z")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, - new pbr::GeneratedClrTypeInfo(new[] {typeof(global::AxibugProtobuf.CommandID), typeof(global::AxibugProtobuf.ErrorCode), typeof(global::AxibugProtobuf.LoginType), typeof(global::AxibugProtobuf.DeviceType), typeof(global::AxibugProtobuf.RoomGameState), typeof(global::AxibugProtobuf.LoginResultStatus), }, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(new[] {typeof(global::AxibugProtobuf.CommandID), typeof(global::AxibugProtobuf.ErrorCode), typeof(global::AxibugProtobuf.LoginType), typeof(global::AxibugProtobuf.DeviceType), typeof(global::AxibugProtobuf.PlatformType), typeof(global::AxibugProtobuf.RoomGameState), typeof(global::AxibugProtobuf.LoginResultStatus), }, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_ChatMsg), global::AxibugProtobuf.Protobuf_ChatMsg.Parser, new[]{ "ChatMsg" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_ChatMsg_RESP), global::AxibugProtobuf.Protobuf_ChatMsg_RESP.Parser, new[]{ "NickName", "ChatMsg", "Date" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_Ping), global::AxibugProtobuf.Protobuf_Ping.Parser, new[]{ "Seed" }, null, null, null, null), @@ -151,7 +158,9 @@ namespace AxibugProtobuf { new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_Room_HostPlayer_UpdateStateRaw_RESP), global::AxibugProtobuf.Protobuf_Room_HostPlayer_UpdateStateRaw_RESP.Parser, null, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_Room_Player_Ready), global::AxibugProtobuf.Protobuf_Room_Player_Ready.Parser, null, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_Room_Get_Screen), global::AxibugProtobuf.Protobuf_Room_Get_Screen.Parser, new[]{ "RoomID" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_Room_Get_Screen_RESP), global::AxibugProtobuf.Protobuf_Room_Get_Screen_RESP.Parser, new[]{ "RoomID", "FrameID", "RawBitmap" }, null, null, null, null) + new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_Room_Get_Screen_RESP), global::AxibugProtobuf.Protobuf_Room_Get_Screen_RESP.Parser, new[]{ "RoomID", "FrameID", "RawBitmap" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_Game_Mark), global::AxibugProtobuf.Protobuf_Game_Mark.Parser, new[]{ "RomID", "State", "PlatformType" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_Game_Mark_RESP), global::AxibugProtobuf.Protobuf_Game_Mark_RESP.Parser, new[]{ "RomID", "PlatformType" }, null, null, null, null) })); } #endregion @@ -277,6 +286,10 @@ namespace AxibugProtobuf { ///画面采集 /// [pbr::OriginalName("CMD_Screen")] CmdScreen = 7001, + /// + ///房间列表 上行 | 下行 对应 Protobuf_Game_Mark | Protobuf_Game_Mark_RESP + /// + [pbr::OriginalName("CMD_GAME_MARK")] CmdGameMark = 10101, } public enum ErrorCode { @@ -295,11 +308,19 @@ namespace AxibugProtobuf { /// ///加入目标位置已经有人 /// - [pbr::OriginalName("ERROR_ROOM_SLOT_READLY_HAD_PLAYER")] ErrorRoomSlotReadlyHadPlayer = 11, + [pbr::OriginalName("ERROR_ROOM_SLOT_ALREADLY_HAD_PLAYER")] ErrorRoomSlotAlreadlyHadPlayer = 11, /// ///当前房间状态不允许本操作 /// [pbr::OriginalName("ERROR_ROOM_CANT_DO_CURR_STATE")] ErrorRoomCantDoCurrState = 50, + /// + ///已经收藏 + /// + [pbr::OriginalName("ERROR_ROM_ALREADY_HAD_STAR")] ErrorRomAlreadyHadStar = 403, + /// + ///并没有收藏 + /// + [pbr::OriginalName("ERROR_ROM_DONT_HAD_STAR")] ErrorRomDontHadStar = 404, } public enum LoginType { @@ -328,6 +349,11 @@ namespace AxibugProtobuf { [pbr::OriginalName("PSV")] Psv = 4, } + public enum PlatformType { + [pbr::OriginalName("All")] All = 0, + [pbr::OriginalName("Nes")] Nes = 1, + } + public enum RoomGameState { /// ///缺省 @@ -8139,6 +8165,473 @@ namespace AxibugProtobuf { } + public sealed partial class Protobuf_Game_Mark : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Protobuf_Game_Mark()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AxibugProtobuf.ProtobufAxibugEmuOnlineReflection.Descriptor.MessageTypes[36]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Protobuf_Game_Mark() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Protobuf_Game_Mark(Protobuf_Game_Mark other) : this() { + romID_ = other.romID_; + state_ = other.state_; + platformType_ = other.platformType_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Protobuf_Game_Mark Clone() { + return new Protobuf_Game_Mark(this); + } + + /// Field number for the "RomID" field. + public const int RomIDFieldNumber = 1; + private int romID_; + /// + ///RomID + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int RomID { + get { return romID_; } + set { + romID_ = value; + } + } + + /// Field number for the "state" field. + public const int StateFieldNumber = 2; + private int state_; + /// + ///[0]收藏 [1]取消收藏 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int State { + get { return state_; } + set { + state_ = value; + } + } + + /// Field number for the "PlatformType" field. + public const int PlatformTypeFieldNumber = 3; + private global::AxibugProtobuf.PlatformType platformType_ = global::AxibugProtobuf.PlatformType.All; + /// + ///平台类型 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AxibugProtobuf.PlatformType PlatformType { + get { return platformType_; } + set { + platformType_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as Protobuf_Game_Mark); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(Protobuf_Game_Mark other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (RomID != other.RomID) return false; + if (State != other.State) return false; + if (PlatformType != other.PlatformType) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (RomID != 0) hash ^= RomID.GetHashCode(); + if (State != 0) hash ^= State.GetHashCode(); + if (PlatformType != global::AxibugProtobuf.PlatformType.All) hash ^= PlatformType.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (RomID != 0) { + output.WriteRawTag(8); + output.WriteInt32(RomID); + } + if (State != 0) { + output.WriteRawTag(16); + output.WriteInt32(State); + } + if (PlatformType != global::AxibugProtobuf.PlatformType.All) { + output.WriteRawTag(24); + output.WriteEnum((int) PlatformType); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (RomID != 0) { + output.WriteRawTag(8); + output.WriteInt32(RomID); + } + if (State != 0) { + output.WriteRawTag(16); + output.WriteInt32(State); + } + if (PlatformType != global::AxibugProtobuf.PlatformType.All) { + output.WriteRawTag(24); + output.WriteEnum((int) PlatformType); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (RomID != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(RomID); + } + if (State != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(State); + } + if (PlatformType != global::AxibugProtobuf.PlatformType.All) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) PlatformType); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(Protobuf_Game_Mark other) { + if (other == null) { + return; + } + if (other.RomID != 0) { + RomID = other.RomID; + } + if (other.State != 0) { + State = other.State; + } + if (other.PlatformType != global::AxibugProtobuf.PlatformType.All) { + PlatformType = other.PlatformType; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + RomID = input.ReadInt32(); + break; + } + case 16: { + State = input.ReadInt32(); + break; + } + case 24: { + PlatformType = (global::AxibugProtobuf.PlatformType) input.ReadEnum(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + RomID = input.ReadInt32(); + break; + } + case 16: { + State = input.ReadInt32(); + break; + } + case 24: { + PlatformType = (global::AxibugProtobuf.PlatformType) input.ReadEnum(); + break; + } + } + } + } + #endif + + } + + public sealed partial class Protobuf_Game_Mark_RESP : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Protobuf_Game_Mark_RESP()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AxibugProtobuf.ProtobufAxibugEmuOnlineReflection.Descriptor.MessageTypes[37]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Protobuf_Game_Mark_RESP() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Protobuf_Game_Mark_RESP(Protobuf_Game_Mark_RESP other) : this() { + romID_ = other.romID_; + platformType_ = other.platformType_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Protobuf_Game_Mark_RESP Clone() { + return new Protobuf_Game_Mark_RESP(this); + } + + /// Field number for the "RomID" field. + public const int RomIDFieldNumber = 1; + private int romID_; + /// + ///RomID + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int RomID { + get { return romID_; } + set { + romID_ = value; + } + } + + /// Field number for the "PlatformType" field. + public const int PlatformTypeFieldNumber = 2; + private global::AxibugProtobuf.PlatformType platformType_ = global::AxibugProtobuf.PlatformType.All; + /// + ///平台类型 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AxibugProtobuf.PlatformType PlatformType { + get { return platformType_; } + set { + platformType_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as Protobuf_Game_Mark_RESP); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(Protobuf_Game_Mark_RESP other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (RomID != other.RomID) return false; + if (PlatformType != other.PlatformType) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (RomID != 0) hash ^= RomID.GetHashCode(); + if (PlatformType != global::AxibugProtobuf.PlatformType.All) hash ^= PlatformType.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (RomID != 0) { + output.WriteRawTag(8); + output.WriteInt32(RomID); + } + if (PlatformType != global::AxibugProtobuf.PlatformType.All) { + output.WriteRawTag(16); + output.WriteEnum((int) PlatformType); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (RomID != 0) { + output.WriteRawTag(8); + output.WriteInt32(RomID); + } + if (PlatformType != global::AxibugProtobuf.PlatformType.All) { + output.WriteRawTag(16); + output.WriteEnum((int) PlatformType); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (RomID != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(RomID); + } + if (PlatformType != global::AxibugProtobuf.PlatformType.All) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) PlatformType); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(Protobuf_Game_Mark_RESP other) { + if (other == null) { + return; + } + if (other.RomID != 0) { + RomID = other.RomID; + } + if (other.PlatformType != global::AxibugProtobuf.PlatformType.All) { + PlatformType = other.PlatformType; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + RomID = input.ReadInt32(); + break; + } + case 16: { + PlatformType = (global::AxibugProtobuf.PlatformType) input.ReadEnum(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + RomID = input.ReadInt32(); + break; + } + case 16: { + PlatformType = (global::AxibugProtobuf.PlatformType) input.ReadEnum(); + break; + } + } + } + } + #endif + + } + #endregion } diff --git a/AxibugEmuOnline.Server/Manager/AppSrv.cs b/AxibugEmuOnline.Server/Manager/AppSrv.cs index 91c6a5e..e69b3fd 100644 --- a/AxibugEmuOnline.Server/Manager/AppSrv.cs +++ b/AxibugEmuOnline.Server/Manager/AppSrv.cs @@ -16,6 +16,7 @@ namespace AxibugEmuOnline.Server public static UserManager g_UserMgr; public static IOCPNetWork g_SocketMgr; public static RoomManager g_Room; + public static GameShareManager g_GameShareMgr; public static void InitServer(int port) { @@ -28,8 +29,9 @@ namespace AxibugEmuOnline.Server g_Login = new LoginManager(); g_Chat = new ChatManager(); g_UserMgr = new UserManager(); - g_SocketMgr = new IOCPNetWork(1024, 4096*2); + g_SocketMgr = new IOCPNetWork(1024, 4096 * 2); g_Room = new RoomManager(); + g_GameShareMgr = new GameShareManager(); g_SocketMgr.Init(); g_SocketMgr.Start(new IPEndPoint(IPAddress.Any.Address, port)); diff --git a/AxibugEmuOnline.Server/Manager/GameShareManager.cs b/AxibugEmuOnline.Server/Manager/GameShareManager.cs new file mode 100644 index 0000000..a7ffb7f --- /dev/null +++ b/AxibugEmuOnline.Server/Manager/GameShareManager.cs @@ -0,0 +1,104 @@ +using AxibugEmuOnline.Server.Common; +using AxibugEmuOnline.Server.Event; +using AxibugEmuOnline.Server.NetWork; +using AxibugProtobuf; +using MySql.Data.MySqlClient; +using System.Net.Sockets; +using static AxibugEmuOnline.Server.RoomManager; + +namespace AxibugEmuOnline.Server.Manager +{ + public class GameShareManager + { + public GameShareManager() + { + NetMsg.Instance.RegNetMsgEvent((int)CommandID.CmdGameMark, RecvGameMark); + } + + public void RecvGameMark(Socket _socket, byte[] reqData) + { + Protobuf_Game_Mark msg = ProtoBufHelper.DeSerizlize(reqData); + ClientInfo _c = AppSrv.g_ClientMgr.GetClientForSocket(_socket); + Protobuf_Game_Mark_RESP respData = new Protobuf_Game_Mark_RESP(); + + MySqlConnection conn = Haoyue_SQLPoolManager.DequeueSQLConn("RecvGameMark"); + try + { + string query = "SELECT id from rom_stars where uid = ?uid and romid = ?platform and platform = ?romid"; + bool bHad = false; + using (var command = new MySqlCommand(query, conn)) + { + // 设置参数值 + command.Parameters.AddWithValue("?uid", _c.UID); + command.Parameters.AddWithValue("?platform", 1); + command.Parameters.AddWithValue("?romid", msg.RomID); + using (var reader = command.ExecuteReader()) + { + while (reader.Read()) + { + if (reader.GetInt32(0) > 0) + bHad = true; + } + } + } + + if (msg.State == 0) + { + if (bHad) + { + AppSrv.g_ClientMgr.ClientSend(_c, (int)CommandID.CmdGameMark, (int)ErrorCode.ErrorRomAlreadyHadStar, ProtoBufHelper.Serizlize(respData)); + return; + } + else + { + query = "INSERT INTO `haoyue_emu`.`rom_stars` (`uid`, `platform`, `romid`) VALUES (?uid, ?platform, ?romid);"; + using (var command = new MySqlCommand(query, conn)) + { + // 设置参数值 + command.Parameters.AddWithValue("?uid", _c.UID); + command.Parameters.AddWithValue("?platform", (int)msg.PlatformType); + command.Parameters.AddWithValue("?romid", msg.RomID); + command.ExecuteNonQuery(); + } + } + } + else//取消收藏 + { + if (bHad) + { + query = "DELETE from rom_stars where uid = ?uid and romid = ?romid and platform = ?platform"; + using (var command = new MySqlCommand(query, conn)) + { + // 设置参数值 + command.Parameters.AddWithValue("?uid", _c.UID); + command.Parameters.AddWithValue("?platform", (int)msg.PlatformType); + command.Parameters.AddWithValue("?romid", msg.RomID); + command.ExecuteNonQuery(); + } + } + else + { + AppSrv.g_ClientMgr.ClientSend(_c, (int)CommandID.CmdGameMark, (int)ErrorCode.ErrorRomDontHadStar, ProtoBufHelper.Serizlize(respData)); + return; + } + } + //更新收藏数 + query = "update romlist_nes set stars = (SELECT COUNT(id) from rom_stars where rom_stars.romid = ?romid and rom_stars.platform = ?platform) where romlist_nes.id = ?romid"; + using (var command = new MySqlCommand(query, conn)) + { + command.Parameters.AddWithValue("?platform", (int)msg.PlatformType); + command.Parameters.AddWithValue("?romid", msg.RomID); + command.ExecuteNonQuery(); + } + + } + catch (Exception e) + { + } + Haoyue_SQLPoolManager.EnqueueSQLConn(conn); + respData.PlatformType = msg.PlatformType; + respData.RomID = msg.RomID; + AppSrv.g_ClientMgr.ClientSend(_c, (int)CommandID.CmdGameMark, (int)ErrorCode.ErrorOk, ProtoBufHelper.Serizlize(respData)); + } + } +} diff --git a/AxibugEmuOnline.Server/Manager/RoomManager.cs b/AxibugEmuOnline.Server/Manager/RoomManager.cs index d49fb49..26370b7 100644 --- a/AxibugEmuOnline.Server/Manager/RoomManager.cs +++ b/AxibugEmuOnline.Server/Manager/RoomManager.cs @@ -105,7 +105,7 @@ namespace AxibugEmuOnline.Server } public void RoomLog(long uid, int platform, int RoomID, int RomID, RoomLogType state) { - MySqlConnection conn = Haoyue_SQLPoolManager.DequeueSQLConn("ModifyNikeName"); + MySqlConnection conn = Haoyue_SQLPoolManager.DequeueSQLConn("RoomLog"); try { string query = "INSERT INTO `haoyue_emu`.`room_log` (`uid`, `platform`, `romid`,`roomid`, `state`) VALUES ( ?uid, ?platform, ?romid, ?roomid, ?state);"; @@ -831,7 +831,7 @@ namespace AxibugEmuOnline.Server int oldPlayerCount = GetPlayerCount(); if (GetPlayerUIDByIdx(PlayerNum, out long hadUID)) { - errcode = ErrorCode.ErrorRoomSlotReadlyHadPlayer; + errcode = ErrorCode.ErrorRoomSlotAlreadlyHadPlayer; return false; } AppSrv.g_Log.Debug($"Join _c.UID->{_c.UID} RoomID->{RoomID}"); diff --git a/AxibugEmuOnline.Server/Protobuf/ProtobufAxibugEmuOnline.cs b/AxibugEmuOnline.Server/Protobuf/ProtobufAxibugEmuOnline.cs index e8ba8c7..55073cb 100644 --- a/AxibugEmuOnline.Server/Protobuf/ProtobufAxibugEmuOnline.cs +++ b/AxibugEmuOnline.Server/Protobuf/ProtobufAxibugEmuOnline.cs @@ -87,35 +87,42 @@ namespace AxibugProtobuf { "UCIcChpQcm90b2J1Zl9Sb29tX1BsYXllcl9SZWFkeSIqChhQcm90b2J1Zl9S", "b29tX0dldF9TY3JlZW4SDgoGUm9vbUlEGAEgASgFIlMKHVByb3RvYnVmX1Jv", "b21fR2V0X1NjcmVlbl9SRVNQEg4KBlJvb21JRBgBIAEoBRIPCgdGcmFtZUlE", - "GAIgASgFEhEKCVJhd0JpdG1hcBgDIAEoDCrqBAoJQ29tbWFuZElEEg4KCkNN", - "RF9ERUZBVUwQABIMCghDTURfUElORxABEgwKCENNRF9QT05HEAISDgoJQ01E", - "X0xPR0lOENEPEhgKE0NNRF9VU0VSX09OTElORUxJU1QQuBcSEgoNQ01EX1VT", - "R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ASBgoC", - "UEMQARILCgdBbmRyb2lkEAISBwoDSU9TEAMSBwoDUFNWEAQqcAoNUm9vbUdh", - "bWVTdGF0ZRISCg5Ob25lX0dhbWVTdGF0ZRAAEgwKCE9ubHlIb3N0EAESEQoN", - "V2FpdFJhd1VwZGF0ZRACEg0KCVdhaXRSZWFkeRADEgkKBVBhdXNlEAQSEAoM", - "SW5PbmxpbmVHYW1lEAUqTgoRTG9naW5SZXN1bHRTdGF0dXMSIQodTG9naW5S", - "ZXN1bHRTdGF0dXNfQmFzZURlZmF1bHQQABIGCgJPSxABEg4KCkFjY291bnRF", - "cnIQAkICSAFiBnByb3RvMw==")); + "GAIgASgFEhEKCVJhd0JpdG1hcBgDIAEoDCJmChJQcm90b2J1Zl9HYW1lX01h", + "cmsSDQoFUm9tSUQYASABKAUSDQoFc3RhdGUYAiABKAUSMgoMUGxhdGZvcm1U", + "eXBlGAMgASgOMhwuQXhpYnVnUHJvdG9idWYuUGxhdGZvcm1UeXBlIlwKF1By", + "b3RvYnVmX0dhbWVfTWFya19SRVNQEg0KBVJvbUlEGAEgASgFEjIKDFBsYXRm", + "b3JtVHlwZRgCIAEoDjIcLkF4aWJ1Z1Byb3RvYnVmLlBsYXRmb3JtVHlwZSr+", + "BAoJQ29tbWFuZElEEg4KCkNNRF9ERUZBVUwQABIMCghDTURfUElORxABEgwK", + "CENNRF9QT05HEAISDgoJQ01EX0xPR0lOENEPEhgKE0NNRF9VU0VSX09OTElO", + "RUxJU1QQuBcSEgoNQ01EX1VTRVJfSk9JThDXFxITCg5DTURfVVNFUl9MRUFW", + "RRDYFxIaChVDTURfVVNFUl9TVEFURV9VUERBVEUQ2RcSGAoTQ01EX01vZGlm", + "eV9OaWNrTmFtZRCdGBIcChdDTURfVXBkYXRlX1NlbGZVc2VySW5mbxCmGBId", + "ChhDTURfVXBkYXRlX090aGVyVXNlckluZm8QqBgSEAoLQ01EX0NIQVRNU0cQ", + "oR8SEgoNQ01EX1Jvb21fTGlzdBCJJxIZ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XRlEAASDAoIT25seUhvc3QQARIR", + "Cg1XYWl0UmF3VXBkYXRlEAISDQoJV2FpdFJlYWR5EAMSCQoFUGF1c2UQBBIQ", + "CgxJbk9ubGluZUdhbWUQBSpOChFMb2dpblJlc3VsdFN0YXR1cxIhCh1Mb2dp", + "blJlc3VsdFN0YXR1c19CYXNlRGVmYXVsdBAAEgYKAk9LEAESDgoKQWNjb3Vu", + "dEVychACQgJIAWIGcHJvdG8z")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, - new pbr::GeneratedClrTypeInfo(new[] {typeof(global::AxibugProtobuf.CommandID), typeof(global::AxibugProtobuf.ErrorCode), typeof(global::AxibugProtobuf.LoginType), typeof(global::AxibugProtobuf.DeviceType), typeof(global::AxibugProtobuf.RoomGameState), typeof(global::AxibugProtobuf.LoginResultStatus), }, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(new[] {typeof(global::AxibugProtobuf.CommandID), typeof(global::AxibugProtobuf.ErrorCode), typeof(global::AxibugProtobuf.LoginType), typeof(global::AxibugProtobuf.DeviceType), typeof(global::AxibugProtobuf.PlatformType), typeof(global::AxibugProtobuf.RoomGameState), typeof(global::AxibugProtobuf.LoginResultStatus), }, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_ChatMsg), global::AxibugProtobuf.Protobuf_ChatMsg.Parser, new[]{ "ChatMsg" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_ChatMsg_RESP), global::AxibugProtobuf.Protobuf_ChatMsg_RESP.Parser, new[]{ "NickName", "ChatMsg", "Date" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_Ping), global::AxibugProtobuf.Protobuf_Ping.Parser, new[]{ "Seed" }, null, null, null, null), @@ -151,7 +158,9 @@ namespace AxibugProtobuf { new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_Room_HostPlayer_UpdateStateRaw_RESP), global::AxibugProtobuf.Protobuf_Room_HostPlayer_UpdateStateRaw_RESP.Parser, null, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_Room_Player_Ready), global::AxibugProtobuf.Protobuf_Room_Player_Ready.Parser, null, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_Room_Get_Screen), global::AxibugProtobuf.Protobuf_Room_Get_Screen.Parser, new[]{ "RoomID" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_Room_Get_Screen_RESP), global::AxibugProtobuf.Protobuf_Room_Get_Screen_RESP.Parser, new[]{ "RoomID", "FrameID", "RawBitmap" }, null, null, null, null) + new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_Room_Get_Screen_RESP), global::AxibugProtobuf.Protobuf_Room_Get_Screen_RESP.Parser, new[]{ "RoomID", "FrameID", "RawBitmap" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_Game_Mark), global::AxibugProtobuf.Protobuf_Game_Mark.Parser, new[]{ "RomID", "State", "PlatformType" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_Game_Mark_RESP), global::AxibugProtobuf.Protobuf_Game_Mark_RESP.Parser, new[]{ "RomID", "PlatformType" }, null, null, null, null) })); } #endregion @@ -277,6 +286,10 @@ namespace AxibugProtobuf { ///画面采集 /// [pbr::OriginalName("CMD_Screen")] CmdScreen = 7001, + /// + ///房间列表 上行 | 下行 对应 Protobuf_Game_Mark | Protobuf_Game_Mark_RESP + /// + [pbr::OriginalName("CMD_GAME_MARK")] CmdGameMark = 10101, } public enum ErrorCode { @@ -295,11 +308,19 @@ namespace AxibugProtobuf { /// ///加入目标位置已经有人 /// - [pbr::OriginalName("ERROR_ROOM_SLOT_READLY_HAD_PLAYER")] ErrorRoomSlotReadlyHadPlayer = 11, + [pbr::OriginalName("ERROR_ROOM_SLOT_ALREADLY_HAD_PLAYER")] ErrorRoomSlotAlreadlyHadPlayer = 11, /// ///当前房间状态不允许本操作 /// [pbr::OriginalName("ERROR_ROOM_CANT_DO_CURR_STATE")] ErrorRoomCantDoCurrState = 50, + /// + ///已经收藏 + /// + [pbr::OriginalName("ERROR_ROM_ALREADY_HAD_STAR")] ErrorRomAlreadyHadStar = 403, + /// + ///并没有收藏 + /// + [pbr::OriginalName("ERROR_ROM_DONT_HAD_STAR")] ErrorRomDontHadStar = 404, } public enum LoginType { @@ -328,6 +349,11 @@ namespace AxibugProtobuf { [pbr::OriginalName("PSV")] Psv = 4, } + public enum PlatformType { + [pbr::OriginalName("All")] All = 0, + [pbr::OriginalName("Nes")] Nes = 1, + } + public enum RoomGameState { /// ///缺省 @@ -8139,6 +8165,473 @@ namespace AxibugProtobuf { } + public sealed partial class Protobuf_Game_Mark : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Protobuf_Game_Mark()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AxibugProtobuf.ProtobufAxibugEmuOnlineReflection.Descriptor.MessageTypes[36]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Protobuf_Game_Mark() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Protobuf_Game_Mark(Protobuf_Game_Mark other) : this() { + romID_ = other.romID_; + state_ = other.state_; + platformType_ = other.platformType_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Protobuf_Game_Mark Clone() { + return new Protobuf_Game_Mark(this); + } + + /// Field number for the "RomID" field. + public const int RomIDFieldNumber = 1; + private int romID_; + /// + ///RomID + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int RomID { + get { return romID_; } + set { + romID_ = value; + } + } + + /// Field number for the "state" field. + public const int StateFieldNumber = 2; + private int state_; + /// + ///[0]收藏 [1]取消收藏 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int State { + get { return state_; } + set { + state_ = value; + } + } + + /// Field number for the "PlatformType" field. + public const int PlatformTypeFieldNumber = 3; + private global::AxibugProtobuf.PlatformType platformType_ = global::AxibugProtobuf.PlatformType.All; + /// + ///平台类型 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AxibugProtobuf.PlatformType PlatformType { + get { return platformType_; } + set { + platformType_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as Protobuf_Game_Mark); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(Protobuf_Game_Mark other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (RomID != other.RomID) return false; + if (State != other.State) return false; + if (PlatformType != other.PlatformType) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (RomID != 0) hash ^= RomID.GetHashCode(); + if (State != 0) hash ^= State.GetHashCode(); + if (PlatformType != global::AxibugProtobuf.PlatformType.All) hash ^= PlatformType.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (RomID != 0) { + output.WriteRawTag(8); + output.WriteInt32(RomID); + } + if (State != 0) { + output.WriteRawTag(16); + output.WriteInt32(State); + } + if (PlatformType != global::AxibugProtobuf.PlatformType.All) { + output.WriteRawTag(24); + output.WriteEnum((int) PlatformType); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (RomID != 0) { + output.WriteRawTag(8); + output.WriteInt32(RomID); + } + if (State != 0) { + output.WriteRawTag(16); + output.WriteInt32(State); + } + if (PlatformType != global::AxibugProtobuf.PlatformType.All) { + output.WriteRawTag(24); + output.WriteEnum((int) PlatformType); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (RomID != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(RomID); + } + if (State != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(State); + } + if (PlatformType != global::AxibugProtobuf.PlatformType.All) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) PlatformType); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(Protobuf_Game_Mark other) { + if (other == null) { + return; + } + if (other.RomID != 0) { + RomID = other.RomID; + } + if (other.State != 0) { + State = other.State; + } + if (other.PlatformType != global::AxibugProtobuf.PlatformType.All) { + PlatformType = other.PlatformType; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + RomID = input.ReadInt32(); + break; + } + case 16: { + State = input.ReadInt32(); + break; + } + case 24: { + PlatformType = (global::AxibugProtobuf.PlatformType) input.ReadEnum(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + RomID = input.ReadInt32(); + break; + } + case 16: { + State = input.ReadInt32(); + break; + } + case 24: { + PlatformType = (global::AxibugProtobuf.PlatformType) input.ReadEnum(); + break; + } + } + } + } + #endif + + } + + public sealed partial class Protobuf_Game_Mark_RESP : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Protobuf_Game_Mark_RESP()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AxibugProtobuf.ProtobufAxibugEmuOnlineReflection.Descriptor.MessageTypes[37]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Protobuf_Game_Mark_RESP() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Protobuf_Game_Mark_RESP(Protobuf_Game_Mark_RESP other) : this() { + romID_ = other.romID_; + platformType_ = other.platformType_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Protobuf_Game_Mark_RESP Clone() { + return new Protobuf_Game_Mark_RESP(this); + } + + /// Field number for the "RomID" field. + public const int RomIDFieldNumber = 1; + private int romID_; + /// + ///RomID + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int RomID { + get { return romID_; } + set { + romID_ = value; + } + } + + /// Field number for the "PlatformType" field. + public const int PlatformTypeFieldNumber = 2; + private global::AxibugProtobuf.PlatformType platformType_ = global::AxibugProtobuf.PlatformType.All; + /// + ///平台类型 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AxibugProtobuf.PlatformType PlatformType { + get { return platformType_; } + set { + platformType_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as Protobuf_Game_Mark_RESP); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(Protobuf_Game_Mark_RESP other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (RomID != other.RomID) return false; + if (PlatformType != other.PlatformType) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (RomID != 0) hash ^= RomID.GetHashCode(); + if (PlatformType != global::AxibugProtobuf.PlatformType.All) hash ^= PlatformType.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (RomID != 0) { + output.WriteRawTag(8); + output.WriteInt32(RomID); + } + if (PlatformType != global::AxibugProtobuf.PlatformType.All) { + output.WriteRawTag(16); + output.WriteEnum((int) PlatformType); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (RomID != 0) { + output.WriteRawTag(8); + output.WriteInt32(RomID); + } + if (PlatformType != global::AxibugProtobuf.PlatformType.All) { + output.WriteRawTag(16); + output.WriteEnum((int) PlatformType); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (RomID != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(RomID); + } + if (PlatformType != global::AxibugProtobuf.PlatformType.All) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) PlatformType); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(Protobuf_Game_Mark_RESP other) { + if (other == null) { + return; + } + if (other.RomID != 0) { + RomID = other.RomID; + } + if (other.PlatformType != global::AxibugProtobuf.PlatformType.All) { + PlatformType = other.PlatformType; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + RomID = input.ReadInt32(); + break; + } + case 16: { + PlatformType = (global::AxibugProtobuf.PlatformType) input.ReadEnum(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + RomID = input.ReadInt32(); + break; + } + case 16: { + PlatformType = (global::AxibugProtobuf.PlatformType) input.ReadEnum(); + break; + } + } + } + } + #endif + + } + #endregion } diff --git a/AxibugEmuOnline.Web/Controllers/ApiController.cs b/AxibugEmuOnline.Web/Controllers/ApiController.cs index 182cecc..ec4f92a 100644 --- a/AxibugEmuOnline.Web/Controllers/ApiController.cs +++ b/AxibugEmuOnline.Web/Controllers/ApiController.cs @@ -107,7 +107,6 @@ namespace AxibugEmuOnline.Web.Controllers return new JsonResult(resp); } - [HttpGet] public JsonResult RomInfo(int Ptype, int RomID) { @@ -115,7 +114,7 @@ namespace AxibugEmuOnline.Web.Controllers Resp_RomInfo resp = new Resp_RomInfo(); MySqlConnection conn = Haoyue_SQLPoolManager.DequeueSQLConn("NesRomList"); { - string query = $"SELECT id,`Name`,GameType,Note,RomUrl,ImgUrl,`Hash` FROM romlist_nes where id = ?romid;"; + string query = $"SELECT id,`Name`,GameType,Note,RomUrl,ImgUrl,`Hash`,`playcount`,`stars` FROM romlist_nes where id = ?romid;"; using (var command = new MySqlCommand(query, conn)) { // òֵ @@ -132,7 +131,8 @@ namespace AxibugEmuOnline.Web.Controllers resp.url = !reader.IsDBNull(4) ? reader.GetString(4) : string.Empty; resp.imgUrl = !reader.IsDBNull(5) ? reader.GetString(5) : string.Empty; resp.hash = !reader.IsDBNull(6) ? reader.GetString(6) : string.Empty; - resp.stars = 0; + resp.playcount = reader.GetInt32(7); + resp.stars = reader.GetInt32(8); } } } diff --git a/ProtobufCore/out/CS/ProtobufAxibugEmuOnline.cs b/ProtobufCore/out/CS/ProtobufAxibugEmuOnline.cs index e8ba8c7..55073cb 100644 --- a/ProtobufCore/out/CS/ProtobufAxibugEmuOnline.cs +++ b/ProtobufCore/out/CS/ProtobufAxibugEmuOnline.cs @@ -87,35 +87,42 @@ namespace AxibugProtobuf { "UCIcChpQcm90b2J1Zl9Sb29tX1BsYXllcl9SZWFkeSIqChhQcm90b2J1Zl9S", "b29tX0dldF9TY3JlZW4SDgoGUm9vbUlEGAEgASgFIlMKHVByb3RvYnVmX1Jv", "b21fR2V0X1NjcmVlbl9SRVNQEg4KBlJvb21JRBgBIAEoBRIPCgdGcmFtZUlE", - "GAIgASgFEhEKCVJhd0JpdG1hcBgDIAEoDCrqBAoJQ29tbWFuZElEEg4KCkNN", - "RF9ERUZBVUwQABIMCghDTURfUElORxABEgwKCENNRF9QT05HEAISDgoJQ01E", - "X0xPR0lOENEPEhgKE0NNRF9VU0VSX09OTElORUxJU1QQuBcSEgoNQ01EX1VT", - "RVJfSk9JThDXFxITCg5DTURfVVNFUl9MRUFWRRDYFxIaChVDTURfVVNFUl9T", - "VEFURV9VUERBVEUQ2RcSGAoTQ01EX01vZGlmeV9OaWNrTmFtZRCdGBIcChdD", - "TURfVXBkYXRlX1NlbGZVc2VySW5mbxCmGBIdChhDTURfVXBkYXRlX090aGVy", - "VXNlckluZm8QqBgSEAoLQ01EX0NIQVRNU0cQoR8SEgoNQ01EX1Jvb21fTGlz", - "dBCJJxIZChRDTURfUm9vbV9MaXN0X1VwZGF0ZRCKJxIYChNDTURfUm9vbV9H", - "ZXRfU2NyZWVuEJMnEhQKD0NNRF9Sb29tX0NyZWF0ZRDtJxISCg1DTURfUm9v", - "bV9Kb2luEPEn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ZXJJbnB1dBD6LhIdChhDTURfUk9PTV9T", + "WU5fUGxheWVySW5wdXQQ/y4SDwoKQ01EX1NjcmVlbhDZNhISCg1DTURfR0FN", + "RV9NQVJLEPVOKtABCglFcnJvckNvZGUSEAoMRVJST1JfREVGQVVMEAASDAoI", + "RVJST1JfT0sQARIYChRFUlJPUl9ST09NX05PVF9GT1VORBAKEicKI0VSUk9S", + "X1JPT01fU0xPVF9BTFJFQURMWV9IQURfUExBWUVSEAsSIQodRVJST1JfUk9P", + "TV9DQU5UX0RPX0NVUlJfU1RBVEUQMhIfChpFUlJPUl9ST01fQUxSRUFEWV9I", + "QURfU1RBUhCTAxIcChdFUlJPUl9ST01fRE9OVF9IQURfU1RBUhCUAypACglM", + "b2dpblR5cGUSDQoJVXNlRGV2aWNlEAASDgoKVXNlQWNjb3VudBABEhQKEFVz", + "ZUhhb1l1ZUFjY291bnQQAipLCgpEZXZpY2VUeXBlEhYKEkRldmljZVR5cGVf", + "RGVmYXVsdBAAEgYKAlBDEAESCwoHQW5kcm9pZBACEgcKA0lPUxADEgcKA1BT", + "VhAEKiAKDFBsYXRmb3JtVHlwZRIHCgNBbGwQABIHCgNOZXMQASpwCg1Sb29t", + "R2FtZVN0YXRlEhIKDk5vbmVfR2FtZVN0YXRlEAASDAoIT25seUhvc3QQARIR", + "Cg1XYWl0UmF3VXBkYXRlEAISDQoJV2FpdFJlYWR5EAMSCQoFUGF1c2UQBBIQ", + "CgxJbk9ubGluZUdhbWUQBSpOChFMb2dpblJlc3VsdFN0YXR1cxIhCh1Mb2dp", + "blJlc3VsdFN0YXR1c19CYXNlRGVmYXVsdBAAEgYKAk9LEAESDgoKQWNjb3Vu", + "dEVychACQgJIAWIGcHJvdG8z")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, - new pbr::GeneratedClrTypeInfo(new[] {typeof(global::AxibugProtobuf.CommandID), typeof(global::AxibugProtobuf.ErrorCode), typeof(global::AxibugProtobuf.LoginType), typeof(global::AxibugProtobuf.DeviceType), typeof(global::AxibugProtobuf.RoomGameState), typeof(global::AxibugProtobuf.LoginResultStatus), }, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(new[] {typeof(global::AxibugProtobuf.CommandID), typeof(global::AxibugProtobuf.ErrorCode), typeof(global::AxibugProtobuf.LoginType), typeof(global::AxibugProtobuf.DeviceType), typeof(global::AxibugProtobuf.PlatformType), typeof(global::AxibugProtobuf.RoomGameState), typeof(global::AxibugProtobuf.LoginResultStatus), }, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_ChatMsg), global::AxibugProtobuf.Protobuf_ChatMsg.Parser, new[]{ "ChatMsg" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_ChatMsg_RESP), global::AxibugProtobuf.Protobuf_ChatMsg_RESP.Parser, new[]{ "NickName", "ChatMsg", "Date" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_Ping), global::AxibugProtobuf.Protobuf_Ping.Parser, new[]{ "Seed" }, null, null, null, null), @@ -151,7 +158,9 @@ namespace AxibugProtobuf { new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_Room_HostPlayer_UpdateStateRaw_RESP), global::AxibugProtobuf.Protobuf_Room_HostPlayer_UpdateStateRaw_RESP.Parser, null, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_Room_Player_Ready), global::AxibugProtobuf.Protobuf_Room_Player_Ready.Parser, null, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_Room_Get_Screen), global::AxibugProtobuf.Protobuf_Room_Get_Screen.Parser, new[]{ "RoomID" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_Room_Get_Screen_RESP), global::AxibugProtobuf.Protobuf_Room_Get_Screen_RESP.Parser, new[]{ "RoomID", "FrameID", "RawBitmap" }, null, null, null, null) + new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_Room_Get_Screen_RESP), global::AxibugProtobuf.Protobuf_Room_Get_Screen_RESP.Parser, new[]{ "RoomID", "FrameID", "RawBitmap" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_Game_Mark), global::AxibugProtobuf.Protobuf_Game_Mark.Parser, new[]{ "RomID", "State", "PlatformType" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_Game_Mark_RESP), global::AxibugProtobuf.Protobuf_Game_Mark_RESP.Parser, new[]{ "RomID", "PlatformType" }, null, null, null, null) })); } #endregion @@ -277,6 +286,10 @@ namespace AxibugProtobuf { ///画面采集 /// [pbr::OriginalName("CMD_Screen")] CmdScreen = 7001, + /// + ///房间列表 上行 | 下行 对应 Protobuf_Game_Mark | Protobuf_Game_Mark_RESP + /// + [pbr::OriginalName("CMD_GAME_MARK")] CmdGameMark = 10101, } public enum ErrorCode { @@ -295,11 +308,19 @@ namespace AxibugProtobuf { /// ///加入目标位置已经有人 /// - [pbr::OriginalName("ERROR_ROOM_SLOT_READLY_HAD_PLAYER")] ErrorRoomSlotReadlyHadPlayer = 11, + [pbr::OriginalName("ERROR_ROOM_SLOT_ALREADLY_HAD_PLAYER")] ErrorRoomSlotAlreadlyHadPlayer = 11, /// ///当前房间状态不允许本操作 /// [pbr::OriginalName("ERROR_ROOM_CANT_DO_CURR_STATE")] ErrorRoomCantDoCurrState = 50, + /// + ///已经收藏 + /// + [pbr::OriginalName("ERROR_ROM_ALREADY_HAD_STAR")] ErrorRomAlreadyHadStar = 403, + /// + ///并没有收藏 + /// + [pbr::OriginalName("ERROR_ROM_DONT_HAD_STAR")] ErrorRomDontHadStar = 404, } public enum LoginType { @@ -328,6 +349,11 @@ namespace AxibugProtobuf { [pbr::OriginalName("PSV")] Psv = 4, } + public enum PlatformType { + [pbr::OriginalName("All")] All = 0, + [pbr::OriginalName("Nes")] Nes = 1, + } + public enum RoomGameState { /// ///缺省 @@ -8139,6 +8165,473 @@ namespace AxibugProtobuf { } + public sealed partial class Protobuf_Game_Mark : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Protobuf_Game_Mark()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AxibugProtobuf.ProtobufAxibugEmuOnlineReflection.Descriptor.MessageTypes[36]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Protobuf_Game_Mark() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Protobuf_Game_Mark(Protobuf_Game_Mark other) : this() { + romID_ = other.romID_; + state_ = other.state_; + platformType_ = other.platformType_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Protobuf_Game_Mark Clone() { + return new Protobuf_Game_Mark(this); + } + + /// Field number for the "RomID" field. + public const int RomIDFieldNumber = 1; + private int romID_; + /// + ///RomID + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int RomID { + get { return romID_; } + set { + romID_ = value; + } + } + + /// Field number for the "state" field. + public const int StateFieldNumber = 2; + private int state_; + /// + ///[0]收藏 [1]取消收藏 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int State { + get { return state_; } + set { + state_ = value; + } + } + + /// Field number for the "PlatformType" field. + public const int PlatformTypeFieldNumber = 3; + private global::AxibugProtobuf.PlatformType platformType_ = global::AxibugProtobuf.PlatformType.All; + /// + ///平台类型 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AxibugProtobuf.PlatformType PlatformType { + get { return platformType_; } + set { + platformType_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as Protobuf_Game_Mark); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(Protobuf_Game_Mark other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (RomID != other.RomID) return false; + if (State != other.State) return false; + if (PlatformType != other.PlatformType) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (RomID != 0) hash ^= RomID.GetHashCode(); + if (State != 0) hash ^= State.GetHashCode(); + if (PlatformType != global::AxibugProtobuf.PlatformType.All) hash ^= PlatformType.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (RomID != 0) { + output.WriteRawTag(8); + output.WriteInt32(RomID); + } + if (State != 0) { + output.WriteRawTag(16); + output.WriteInt32(State); + } + if (PlatformType != global::AxibugProtobuf.PlatformType.All) { + output.WriteRawTag(24); + output.WriteEnum((int) PlatformType); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (RomID != 0) { + output.WriteRawTag(8); + output.WriteInt32(RomID); + } + if (State != 0) { + output.WriteRawTag(16); + output.WriteInt32(State); + } + if (PlatformType != global::AxibugProtobuf.PlatformType.All) { + output.WriteRawTag(24); + output.WriteEnum((int) PlatformType); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (RomID != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(RomID); + } + if (State != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(State); + } + if (PlatformType != global::AxibugProtobuf.PlatformType.All) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) PlatformType); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(Protobuf_Game_Mark other) { + if (other == null) { + return; + } + if (other.RomID != 0) { + RomID = other.RomID; + } + if (other.State != 0) { + State = other.State; + } + if (other.PlatformType != global::AxibugProtobuf.PlatformType.All) { + PlatformType = other.PlatformType; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + RomID = input.ReadInt32(); + break; + } + case 16: { + State = input.ReadInt32(); + break; + } + case 24: { + PlatformType = (global::AxibugProtobuf.PlatformType) input.ReadEnum(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + RomID = input.ReadInt32(); + break; + } + case 16: { + State = input.ReadInt32(); + break; + } + case 24: { + PlatformType = (global::AxibugProtobuf.PlatformType) input.ReadEnum(); + break; + } + } + } + } + #endif + + } + + public sealed partial class Protobuf_Game_Mark_RESP : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Protobuf_Game_Mark_RESP()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AxibugProtobuf.ProtobufAxibugEmuOnlineReflection.Descriptor.MessageTypes[37]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Protobuf_Game_Mark_RESP() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Protobuf_Game_Mark_RESP(Protobuf_Game_Mark_RESP other) : this() { + romID_ = other.romID_; + platformType_ = other.platformType_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Protobuf_Game_Mark_RESP Clone() { + return new Protobuf_Game_Mark_RESP(this); + } + + /// Field number for the "RomID" field. + public const int RomIDFieldNumber = 1; + private int romID_; + /// + ///RomID + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int RomID { + get { return romID_; } + set { + romID_ = value; + } + } + + /// Field number for the "PlatformType" field. + public const int PlatformTypeFieldNumber = 2; + private global::AxibugProtobuf.PlatformType platformType_ = global::AxibugProtobuf.PlatformType.All; + /// + ///平台类型 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::AxibugProtobuf.PlatformType PlatformType { + get { return platformType_; } + set { + platformType_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as Protobuf_Game_Mark_RESP); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(Protobuf_Game_Mark_RESP other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (RomID != other.RomID) return false; + if (PlatformType != other.PlatformType) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (RomID != 0) hash ^= RomID.GetHashCode(); + if (PlatformType != global::AxibugProtobuf.PlatformType.All) hash ^= PlatformType.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (RomID != 0) { + output.WriteRawTag(8); + output.WriteInt32(RomID); + } + if (PlatformType != global::AxibugProtobuf.PlatformType.All) { + output.WriteRawTag(16); + output.WriteEnum((int) PlatformType); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (RomID != 0) { + output.WriteRawTag(8); + output.WriteInt32(RomID); + } + if (PlatformType != global::AxibugProtobuf.PlatformType.All) { + output.WriteRawTag(16); + output.WriteEnum((int) PlatformType); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (RomID != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(RomID); + } + if (PlatformType != global::AxibugProtobuf.PlatformType.All) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) PlatformType); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(Protobuf_Game_Mark_RESP other) { + if (other == null) { + return; + } + if (other.RomID != 0) { + RomID = other.RomID; + } + if (other.PlatformType != global::AxibugProtobuf.PlatformType.All) { + PlatformType = other.PlatformType; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + RomID = input.ReadInt32(); + break; + } + case 16: { + PlatformType = (global::AxibugProtobuf.PlatformType) input.ReadEnum(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + RomID = input.ReadInt32(); + break; + } + case 16: { + PlatformType = (global::AxibugProtobuf.PlatformType) input.ReadEnum(); + break; + } + } + } + } + #endif + + } + #endregion } diff --git a/ProtobufCore/proto/protobuf_AxibugEmuOnline.proto b/ProtobufCore/proto/protobuf_AxibugEmuOnline.proto index 3634055..64b623b 100644 --- a/ProtobufCore/proto/protobuf_AxibugEmuOnline.proto +++ b/ProtobufCore/proto/protobuf_AxibugEmuOnline.proto @@ -64,6 +64,8 @@ enum CommandID //画面采集 CMD_Screen = 7001; //画面采集 | 同步广播 对应 Protobuf_Screnn_Frame + + CMD_GAME_MARK = 10101; //房间列表 上行 | 下行 对应 Protobuf_Game_Mark | Protobuf_Game_Mark_RESP } enum ErrorCode @@ -72,9 +74,12 @@ enum ErrorCode ERROR_OK = 1; //成功 ERROR_ROOM_NOT_FOUND = 10;//房间不存在 - ERROR_ROOM_SLOT_READLY_HAD_PLAYER=11;//加入目标位置已经有人 + ERROR_ROOM_SLOT_ALREADLY_HAD_PLAYER=11;//加入目标位置已经有人 ERROR_ROOM_CANT_DO_CURR_STATE =50;//当前房间状态不允许本操作 + + ERROR_ROM_ALREADY_HAD_STAR =403;//已经收藏 + ERROR_ROM_DONT_HAD_STAR =404;//并没有收藏 } enum LoginType @@ -93,6 +98,12 @@ enum DeviceType PSV = 4; } +enum PlatformType +{ + All = 0; + Nes = 1; +} + //enum RoomPlayerState //{ // None_PlayerState = 0;//缺省 @@ -352,4 +363,18 @@ message Protobuf_Room_Get_Screen_RESP int32 RoomID = 1;//房间ID int32 FrameID = 2;//帧编号 bytes RawBitmap = 3;//渲染层画面 +} + + +message Protobuf_Game_Mark +{ + int32 RomID = 1;//RomID + int32 state = 2;//[0]收藏 [1]取消收藏 + PlatformType PlatformType = 3;//平台类型 +} + +message Protobuf_Game_Mark_RESP +{ + int32 RomID = 1;//RomID + PlatformType PlatformType = 2;//平台类型 } \ No newline at end of file diff --git a/README_WEBAPI.md b/README_WEBAPI.md index 372c259..853b81d 100644 --- a/README_WEBAPI.md +++ b/README_WEBAPI.md @@ -138,8 +138,6 @@ Response: 序列化C#实体类示例 ``` - - class Resp_GameList { public int page { get; set; } @@ -148,18 +146,19 @@ Response: public List gameList { get; set; } } - public class Resp_RomInfo - { - public int orderid { get; set; } - public int id { get; set; } - public string romName { get; set;} - public string gType { get; set; } - public string desc { get; set; } - public string url { get; set; } - public string imgUrl { get; set; } - public string hash { get; set; } - public int stars { get; set; } - } + public class Resp_RomInfo + { + public int orderid { get; set; } + public int id { get; set; } + public string romName { get; set; } + public string gType { get; set; } + public string desc { get; set; } + public string url { get; set; } + public string imgUrl { get; set; } + public string hash { get; set; } + public int stars { get; set; } + public int playcount { get; set; } + } ```