This commit is contained in:
ageer
2024-04-01 22:21:29 +08:00
parent cead269b19
commit dea23f13ef
552 changed files with 2144 additions and 154437 deletions

View File

@@ -1,83 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.huya.api;
import cn.hutool.core.util.ReUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import cn.hutool.http.HttpStatus;
import cn.hutool.http.HttpUtil;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import lombok.Cleanup;
import lombok.extern.slf4j.Slf4j;
import tech.ordinaryroad.live.chat.client.commons.base.exception.BaseException;
import tech.ordinaryroad.live.chat.client.huya.msg.dto.PropsItem;
import java.util.HashMap;
import java.util.Map;
import static tech.ordinaryroad.live.chat.client.commons.base.msg.BaseMsg.OBJECT_MAPPER;
/**
* API简易版
* <br/>
* <a href="https://a.msstatic.com/huya/h5player/room/2309271152/vplayerUI.js">vplayerUI.js</a>
* <br/>
* <a href="https://hd2.huya.com/fedbasic/huyabaselibs/taf-signal/taf-signal.global.0.0.4.prod.js">taf-signal.global.0.0.4.prod.js</a>
*
* @author mjz
* @date 2023/9/5
*/
@Slf4j
public class HuyaApis {
// TODO TimedCache
public static final Map<Integer, PropsItem> GIFT_ITEMS = new HashMap<>();
public static JsonNode roomInit(Object roomId) {
@Cleanup
HttpResponse response = createGetRequest("https://www.huya.com/" + roomId, null).execute();
if (response.getStatus() != HttpStatus.HTTP_OK) {
throw new BaseException("获取" + roomId + "真实房间ID失败");
}
String body = response.body();
String lSubChannelId = ReUtil.getGroup1("\"lp\"\\D+(\\d+)", body);
String lChannelId = ReUtil.getGroup1("\"lp\"\\D+(\\d+)", body);
String lYyid = ReUtil.getGroup1("\"yyid\"\\D+(\\d+)", body);
ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
objectNode.put("lSubChannelId", StrUtil.emptyToDefault(lSubChannelId, "0"));
objectNode.put("lChannelId", StrUtil.emptyToDefault(lChannelId, "0"));
objectNode.put("lYyid", lYyid);
return objectNode;
}
public static HttpRequest createGetRequest(String url, String cookies) {
return HttpUtil.createGet(url)
.cookie(cookies);
}
}

View File

@@ -1,148 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.huya.client;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.handler.codec.http.DefaultHttpHeaders;
import io.netty.handler.codec.http.websocketx.WebSocketClientHandshakerFactory;
import io.netty.handler.codec.http.websocketx.WebSocketFrame;
import io.netty.handler.codec.http.websocketx.WebSocketVersion;
import lombok.extern.slf4j.Slf4j;
import tech.ordinaryroad.live.chat.client.commons.base.listener.IBaseConnectionListener;
import tech.ordinaryroad.live.chat.client.huya.config.HuyaLiveChatClientConfig;
import tech.ordinaryroad.live.chat.client.huya.constant.HuyaCmdEnum;
import tech.ordinaryroad.live.chat.client.huya.listener.IHuyaConnectionListener;
import tech.ordinaryroad.live.chat.client.huya.listener.IHuyaMsgListener;
import tech.ordinaryroad.live.chat.client.huya.msg.base.IHuyaMsg;
import tech.ordinaryroad.live.chat.client.huya.netty.frame.factory.HuyaWebSocketFrameFactory;
import tech.ordinaryroad.live.chat.client.huya.netty.handler.HuyaBinaryFrameHandler;
import tech.ordinaryroad.live.chat.client.huya.netty.handler.HuyaConnectionHandler;
import tech.ordinaryroad.live.chat.client.servers.netty.client.base.BaseNettyClient;
import java.util.List;
import java.util.function.Consumer;
/**
* 虎牙直播间弹幕客户端
*
* @author mjz
* @date 2023/8/20
*/
@Slf4j
public class HuyaLiveChatClient extends BaseNettyClient<
HuyaLiveChatClientConfig,
HuyaCmdEnum,
IHuyaMsg,
IHuyaMsgListener,
HuyaConnectionHandler,
HuyaBinaryFrameHandler> {
public HuyaLiveChatClient(HuyaLiveChatClientConfig config, List<IHuyaMsgListener> msgListeners, IHuyaConnectionListener connectionListener, EventLoopGroup workerGroup) {
super(config, workerGroup, connectionListener);
addMsgListeners(msgListeners);
// 初始化
this.init();
}
public HuyaLiveChatClient(HuyaLiveChatClientConfig config, IHuyaMsgListener msgListener, IHuyaConnectionListener connectionListener, EventLoopGroup workerGroup) {
super(config, workerGroup, connectionListener);
addMsgListener(msgListener);
// 初始化
this.init();
}
public HuyaLiveChatClient(HuyaLiveChatClientConfig config, IHuyaMsgListener msgListener, IHuyaConnectionListener connectionListener) {
this(config, msgListener, connectionListener, new NioEventLoopGroup());
}
public HuyaLiveChatClient(HuyaLiveChatClientConfig config, IHuyaMsgListener msgListener) {
this(config, msgListener, null, new NioEventLoopGroup());
}
public HuyaLiveChatClient(HuyaLiveChatClientConfig config) {
this(config, null);
}
@Override
public HuyaConnectionHandler initConnectionHandler(IBaseConnectionListener<HuyaConnectionHandler> clientConnectionListener) {
return new HuyaConnectionHandler(
WebSocketClientHandshakerFactory.newHandshaker(getWebsocketUri(), WebSocketVersion.V13, null, true, new DefaultHttpHeaders(), getConfig().getMaxFramePayloadLength()),
HuyaLiveChatClient.this, clientConnectionListener
);
}
@Override
public HuyaBinaryFrameHandler initBinaryFrameHandler() {
return new HuyaBinaryFrameHandler(super.msgListeners, HuyaLiveChatClient.this);
}
@Override
public void sendDanmu(Object danmu, Runnable success, Consumer<Throwable> failed) {
if (!checkCanSendDanmu()) {
return;
}
if (danmu instanceof String) {
String msg = (String) danmu;
if (log.isDebugEnabled()) {
log.debug("{} huya发送弹幕 {}", getConfig().getRoomId(), danmu);
}
WebSocketFrame webSocketFrame = null;
try {
webSocketFrame = HuyaWebSocketFrameFactory.getInstance(getConfig().getRoomId()).createSendMessageReq(msg, getConfig().getVer(), getConfig().getCookie());
} catch (Exception e) {
log.error("huya弹幕包创建失败", e);
if (failed != null) {
failed.accept(e);
}
}
if (webSocketFrame == null) {
return;
}
send(webSocketFrame, () -> {
if (log.isDebugEnabled()) {
log.debug("huya弹幕发送成功 {}", danmu);
}
if (success != null) {
success.run();
}
finishSendDanmu();
}, throwable -> {
log.error("huya弹幕发送失败", throwable);
if (failed != null) {
failed.accept(throwable);
}
});
} else {
super.sendDanmu(danmu);
}
}
}

View File

@@ -1,84 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.huya.config;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import tech.ordinaryroad.live.chat.client.servers.netty.client.config.BaseNettyClientConfig;
/**
* 直播间弹幕客户端配置
*
* @author mjz
* @date 2023/9/5
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@SuperBuilder(toBuilder = true)
public class HuyaLiveChatClientConfig extends BaseNettyClientConfig {
public static final String VER = "2309271152";
@Builder.Default
// private String websocketUri = "wss://wsapi.huya.com:443";
private String websocketUri = "wss://cdnws.api.huya.com:443";
@Builder.Default
private int aggregatorMaxContentLength = 64 * 1024 * 1024;
@Builder.Default
private int maxFramePayloadLength = 64 * 1024 * 1024;
@Builder.Default
private String ver = VER;
@Builder.Default
private String exp = "15547.23738,16582.25335,32083.50834";
@Builder.Default
private String appSrc = "HUYA&ZH&2052";
public void setVer(String ver) {
String oldValue = this.ver;
this.ver = ver;
super.propertyChangeSupport.firePropertyChange("ver", oldValue, ver);
}
public void setExp(String exp) {
String oldValue = this.exp;
this.exp = exp;
super.propertyChangeSupport.firePropertyChange("exp", oldValue, exp);
}
public void setAppSrc(String appSrc) {
String oldValue = this.appSrc;
this.appSrc = appSrc;
super.propertyChangeSupport.firePropertyChange("appSrc", oldValue, appSrc);
}
}

View File

@@ -1,58 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.huya.constant;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
/**
* @author mjz
* @date 2023/10/2
*/
@Getter
@RequiredArgsConstructor
public enum HuyaClientTemplateTypeEnum {
TPL_PC(64),
TPL_WEB(32),
TPL_JIEDAI(16),
TPL_TEXAS(8),
TPL_MATCH(4),
TPL_HUYAAPP(2),
TPL_MIRROR(1),
;
private final int code;
public static HuyaClientTemplateTypeEnum getByCode(int code) {
for (HuyaClientTemplateTypeEnum value : values()) {
if (value.getCode() == code) {
return value;
}
}
return null;
}
}

View File

@@ -1,206 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.huya.constant;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
/**
* @author mjz
* @date 2023/10/2
*/
@Getter
@RequiredArgsConstructor
public enum HuyaCmdEnum {
NobleNotice(1001),
// NobleEnterNotice(1002),
NobleEnterNotice(1005),
NobleLevelNotice(1006),
MessageNotice(1400),
// ExpressionEmoticonNotice(1420),
ExpressionEmoticonNotice(1422),
OpenEmojiTrialNotice(1441),
SubscribeInfoNotify(3104),
PublicMessageAreaGuideWindow(6074),
// WeekStarPropsIds(6100),
WeekStarPropsIdsTab(6102),
/**
* <a href="https://dev.huya.com/docs/miniapp/dev/scenario/vip-event/">https://dev.huya.com/docs/miniapp/dev/scenario/vip-event/</a>
*/
VipEnterBanner(6110),
VipBarListStatInfo(6211),
EnterPushInfo(6200),
GameAdvertisement(6201),
ViewerListRsp(6203),
VipBarListRsp(6210),
UserWeekRankScoreInfo(6219),
WeekRankListRsp(6220),
WeekRankEnterBanner(6221),
FansSupportListRsp(6223),
FansRankListRsp(6230),
BadgeInfo(6231),
BadgeScoreChanged(6232),
FansInfoNotice(6233),
UserGiftNotice(6234),
WeekStarPropsIds(6235),
SuperFansExtendInfo(6245),
TrialFansBadgeScoreChanged(6246),
GuardianCountChangedNotice(6249),
GiftBarRsp(6250),
GrandCeremonyChampionPresenter(6260),
LotteryAnnounce(6289),
NewsTicker(6290),
SendItemSubBroadcastPacket(6501),
SendItemNoticeWordBroadcastPacket(6502),
ShowScreenSkinNotify(6640),
HideScreenSkinNotify(6641),
ActivetyBarrageNotice(6650),
BannerNotice(6291),
// OnTVPanel(6294),
OnTVPanel(6295),
OnTVData(6296),
OnTVEndNotice(6297),
OnTVBarrageNotice(6298),
CheckRoomStatus(6340),
SendItemNoticeGameBroadcastPacket(6507),
SendItemActivityNoticeBroadcastPacket(6508),
SendItemOtherBroadcastPacket(6514),
GiftStatusNotify(6515),
ActivitySpecialNoticeBroadcastPacket(6540),
UserDIYMountsChanged(6575),
ObtainDecoNotify(6590),
TreasureResultBroadcastPacket(6602),
TreasureUpdateNotice(6604),
TreasureLotteryResultNoticePacket(6605),
TreasureBoxPanel(6606),
TreasureBoxBigAwardNotice(6607),
ItemLotterySubNotice(6616),
ItemLotteryGameNotice(6617),
FansBadgeLevelUpNotice(6710),
FansPromoteNotice(6711),
ActCommPanelChangeNotify(6647),
MatchRaffleResultNotice(7055),
BatchGameInfoNotice(7500),
GameInfoChangeNotice(7501),
EndHistoryGameNotice(7502),
GameSettlementNotice(7503),
PresenterEndGameNotice(7504),
// PresenterLevelNotice(7708),
PresenterLevelNotice(7709),
EffectsConfChangeNoticeMsg(7772),
BeginLiveNotice(8000),
EndLiveNotice(8001),
StreamSettingNotice(8002),
LiveInfoChangedNotice(8004),
AttendeeCountNotice(8006),
ReplayPresenterInLiveNotify(9010),
RoomAuditWarningNotice(10039),
AuditorEnterLiveNotice(10040),
AuditorRoleChangeNotice(10041),
GetRoomAuditConfRsp(10042),
UserConsumePrivilegeChangeNotice(10047),
LinkMicStatusChangeNotice(42008),
InterveneCountRsp(44000),
UserLevelUpgradeNotice(1000106),
PushUserLevelTaskCompleteNotice(1130055),
GuardianPresenterInfoNotice(1020001),
SupportCampInfoRsp(1025300),
UserSupportCampRsp(1025301),
UserSupportEffectRsp(1025302),
WSRedirect(1025305),
HuYaUdbNotify(10220051),
infoBody(10220053),
UnionAuthPushMsg(10220054),
RMessageNotify(1025000),
PushPresenterAdNotice(1025493),
RoomAdInfo(1025504),
// PushAdInfo(1025562),
// PushAdInfo(1025564),
PushAdInfo(1025566),
// AdExtServer.PushOfflineInfo(1025569),
WSP2POpenNotify(1025307),
WSP2PCloseNotify(1025308),
LiveMeetingSyncNotice(1025601),
MakeFriendsPKInfo(1025604),
LiveRoomTransferNotice(1025605),
GetPugcVipListRsp(1025800),
PugcVipInfo(1025801),
StreamChangeNotice(100000),
PayLiveRoomNotice(1033001),
MatchEndNotice(1034001),
LiveRoomProfileChangedNotice(1035400),
ACOrderInfo(1060003),
// WEBACT.Message(108e4),
MultiPKNotice(1090007),
MultiPKPanelInfo(1090009),
AiBarrageDetectNotify(1100003),
FloatMomentNotice(1130050),
FloatBallNotice(1130052),
VoiceMuteJsonInfo(1200000),
PixelateInfo(1200001),
// MpsDeliverData(1210000),
MpsDeliverData(1220000),
ActivityMsgRsp(1010003),
// Message(1040000),
Message(1040002),
LiveEventMessage(1040003),
LiveViewLimitChangeNotice(1035100),
PrivilegeRenewalNotice(1035101),
MatchRecLiveInfo(1029001),
GetBattleTeamInfoRsp(1029002),
// MatchGuess.MatchCmdColorNotify(1025312),
GameStatusInfo(1130003),
MatchPlaybackPointNotice(1150001),
PushFaceDirectorCurrentProgram(1130070),
JoinSplitScreenNotice(1500001),
LeaveSplitScreenNotice(1500002),
GameLivePromoteNotify(1800009),
MotorcadeGatherBeginNotice(2000001),
MotorcadeGatherEndNotice(2000002),
MotorcadeGatherResponseNotice(2000003),
MotorcadeActivityPanel(2000041),
MessageRichTextNotice(2001231),
MultiVideoSyncNotice(2400001),
PassParcelChangeNotify(2400002),
MatchLiveCommentorChangeNotify(2400020),
MessageEasterEggNotice(2001203),
MessageEasterEggToastNotice(2001202),
UserFollowStrollIconNotice(2410001),
UserFollowStrollBarrageNotice(2410002),
// LiveMatch.MatchLiveRoomRecMsg(2500406),
;
private final long code;
public static HuyaCmdEnum getByCode(long code) {
for (HuyaCmdEnum value : HuyaCmdEnum.values()) {
if (value.code == code) {
return value;
}
}
return null;
}
}

View File

@@ -1,88 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.huya.constant;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
/**
* @author mjz
* @date 2023/10/10
*/
@Getter
@RequiredArgsConstructor
public enum HuyaDecorationAppTypeEnum {
kDecorationAppTypeCommon(100),
kDecorationAppTypeContentBubble(5000),
kDecorationAppTypeContentBubbleNew(5001),
kDecorationAppTypeEffectsMessenger(5002),
kDecorationAppTypeMsgInterConnect(5010),
kDecorationAppTypeMsgLocation(5011),
kDecorationAppTypeChannel(10000),
kDecorationAppTypeGuildAdmin(10090),
kDecorationAppTypeAdmin(10100),
kDecorationAppTypeDaiyanClub(10150),
kDecorationAppTypeNoble(10200),
KDecorationAppTypeGuildVip(10210),
kDecorationAppTypeGuard(10300),
kDecorationAppTypeDiamondUser_V2(10310),
kDecorationAppTypeTeamMedalV2(10350),
kDecorationAppTypeTrialFans(10399),
kDecorationAppTypeFans(10400),
kDecorationAppTypeWatchTogetherVip(10425),
kDecorationAppTypeTeamMedal(10450),
kDecorationAppTypeVIP(10500),
kDecorationAppTypeUserProfile(10560),
kDecorationAppTyperPurpleDiamond(10600),
kDecorationAppTypeStamp(10700),
KDecorationAppTypeNobleEmoticon(10800),
KDecorationAppTypeAnotherAi(10801),
KDecorationAppTypePresenter(10900),
KDecorationAppTypeFirstRecharge(11000),
kDecorationAppTypeCheckRoom(11100),
kDecorationAppTypeTWatch(11101),
kDecorationAppTypeEasterEgg(11102),
kDecorationAppTypeRepeatMessengeFilter(11103),
kDecorationAppTypeEasterEggCounter(11104),
kDecorationAppTypeACOrderIntimacy(12001),
kDecorationAppTypeSuperWord(13000),
kDecorationAppTypeDiamondUser(14000),
kDecorationAppTypeRedBag(15000),
kDecorationAppTypeUsrAvatarDeco(100009),
kDecorationAppTypeUsrBeautyId(100100),
;
private final int code;
public static HuyaDecorationAppTypeEnum getByCode(int code) {
for (HuyaDecorationAppTypeEnum value : values()) {
if (value.getCode() == code) {
return value;
}
}
return null;
}
}

View File

@@ -1,54 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.huya.constant;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
/**
* @author mjz
* @date 2023/10/10
*/
@Getter
@RequiredArgsConstructor
public enum HuyaDecorationViewTypeEnum {
kDecorationViewTypeCustomized(0),
kDecorationViewTypeText(1),
kDecorationViewTypeIcon(2),
kDecorationViewTypeSuperWord(4),
;
private final int code;
public static HuyaDecorationViewTypeEnum getByCode(int code) {
for (HuyaDecorationViewTypeEnum value : values()) {
if (value.getCode() == code) {
return value;
}
}
return null;
}
}

View File

@@ -1,51 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.huya.constant;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
/**
* @author mjz
* @date 2023/10/5
*/
@Getter
@RequiredArgsConstructor
public enum HuyaGenderEnum {
MALE(0),
FEMALE(1),
;
private final int code;
public static HuyaGenderEnum getByCode(int code) {
for (HuyaGenderEnum value : values()) {
if (value.getCode() == code) {
return value;
}
}
return null;
}
}

View File

@@ -1,54 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.huya.constant;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
/**
* @author mjz
* @date 2023/10/5
*/
@Getter
@RequiredArgsConstructor
public enum HuyaLiveSource {
PC_YY(0),
PC_HUYA(1),
MOBILE_HUYA(2),
WEB_HUYA(3),
;
private final int code;
public static HuyaLiveSource getByCode(int code){
for (HuyaLiveSource value : values()) {
if (value.getCode()==code) {
return value;
}
}
return null;
}
}

View File

@@ -1,97 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.huya.constant;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
/**
* @author mjz
* @date 2023/10/2
*/
@Getter
@RequiredArgsConstructor
public enum HuyaOperationEnum {
EWSCmd_NULL(0),
EWSCmd_RegisterReq(1),
EWSCmd_RegisterRsp(2),
EWSCmd_WupReq(3),
EWSCmd_WupRsp(4),
EWSCmdC2S_HeartBeat(5),
EWSCmdS2C_HeartBeatAck(6),
EWSCmdS2C_MsgPushReq(7),
EWSCmdC2S_DeregisterReq(8),
EWSCmdS2C_DeRegisterRsp(9),
EWSCmdC2S_VerifyCookieReq(10),
EWSCmdS2C_VerifyCookieRsp(11),
EWSCmdC2S_VerifyHuyaTokenReq(12),
EWSCmdS2C_VerifyHuyaTokenRsp(13),
EWSCmdC2S_UNVerifyReq(14),
EWSCmdS2C_UNVerifyRsp(15),
EWSCmdC2S_RegisterGroupReq(16),
EWSCmdS2C_RegisterGroupRsp(17),
EWSCmdC2S_UnRegisterGroupReq(18),
EWSCmdS2C_UnRegisterGroupRsp(19),
EWSCmdC2S_HeartBeatReq(20),
EWSCmdS2C_HeartBeatRsp(21),
EWSCmdS2C_MsgPushReq_V2(22),
EWSCmdC2S_UpdateUserExpsReq(23),
EWSCmdS2C_UpdateUserExpsRsp(24),
EWSCmdC2S_WSHistoryMsgReq(25),
EWSCmdS2C_WSHistoryMsgRsp(26),
EWSCmdS2C_EnterP2P(27),
EWSCmdS2C_EnterP2PAck(28),
EWSCmdS2C_ExitP2P(29),
EWSCmdS2C_ExitP2PAck(30),
EWSCmdC2S_SyncGroupReq(31),
EWSCmdS2C_SyncGroupRsp(32),
EWSCmdC2S_UpdateUserInfoReq(33),
EWSCmdS2C_UpdateUserInfoRsp(34),
EWSCmdC2S_MsgAckReq(35),
EWSCmdS2C_MsgAckRsp(36),
EWSCmdC2S_CloudGameReq(37),
EWSCmdS2C_CloudGamePush(38),
EWSCmdS2C_CloudGameRsp(39),
EWSCmdS2C_RpcReq(40),
EWSCmdC2S_RpcRsp(41),
EWSCmdS2C_RpcRspRsp(42),
EWSCmdC2S_GetStunPortReq(101),
EWSCmdS2C_GetStunPortRsp(102),
EWSCmdC2S_WebRTCOfferReq(103),
EWSCmdS2C_WebRTCOfferRsp(104),
EWSCmdC2S_SignalUpgradeReq(105),
EWSCmdS2C_SignalUpgradeRsp(106),
;
private final int code;
public static HuyaOperationEnum getByCode(int code) {
for (HuyaOperationEnum value : HuyaOperationEnum.values()) {
if (value.code == code) {
return value;
}
}
return null;
}
}

View File

@@ -1,62 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.huya.constant;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
/**
* @author mjz
* @date 2023/10/2
*/
@Getter
@RequiredArgsConstructor
public enum HuyaStreamLineTypeEnum {
STREAM_LINE_OLD_YY(0),
STREAM_LINE_WS(1),
STREAM_LINE_NEW_YY(2),
STREAM_LINE_AL(3),
STREAM_LINE_HUYA(4),
STREAM_LINE_TX(5),
STREAM_LINE_CDN(8),
STREAM_LINE_HW(6),
STREAM_LINE_BD(7),
STREAM_LINE_GG(9),
STREAM_LINE_CF(10),
STREAM_LINE_QUICK_HUYA(99),
;
private final int code;
public static HuyaStreamLineTypeEnum getByCode(int code) {
for (HuyaStreamLineTypeEnum value : values()) {
if (value.getCode() == code) {
return value;
}
}
return null;
}
}

View File

@@ -1,59 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.huya.constant;
import cn.hutool.core.util.StrUtil;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
/**
* @author mjz
* @date 2023/10/3
*/
@Getter
@RequiredArgsConstructor
public enum HuyaWupFunctionEnum {
doLaunch,
speak,
getPropsList,
OnUserHeartBeat,
getLivingInfo,
sendMessage,
;
public static HuyaWupFunctionEnum getByName(String name) {
if (StrUtil.isBlank(name)) {
return null;
}
for (HuyaWupFunctionEnum value : values()) {
if (value.name().equals(name)) {
return value;
}
}
return null;
}
}

View File

@@ -1,38 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.huya.listener;
import tech.ordinaryroad.live.chat.client.commons.base.listener.IBaseConnectionListener;
import tech.ordinaryroad.live.chat.client.huya.netty.handler.HuyaConnectionHandler;
/**
* 连接回调
*
* @author mjz
* @date 2023/9/5
*/
public interface IHuyaConnectionListener extends IBaseConnectionListener<HuyaConnectionHandler> {
}

View File

@@ -1,45 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.huya.listener;
import tech.ordinaryroad.live.chat.client.commons.base.listener.IBaseMsgListener;
import tech.ordinaryroad.live.chat.client.commons.base.listener.IDanmuMsgListener;
import tech.ordinaryroad.live.chat.client.commons.base.listener.IEnterRoomMsgListener;
import tech.ordinaryroad.live.chat.client.commons.base.listener.IGiftMsgListener;
import tech.ordinaryroad.live.chat.client.huya.constant.HuyaCmdEnum;
import tech.ordinaryroad.live.chat.client.huya.msg.MessageNoticeMsg;
import tech.ordinaryroad.live.chat.client.huya.msg.SendItemSubBroadcastPacketMsg;
import tech.ordinaryroad.live.chat.client.huya.msg.VipEnterBannerMsg;
import tech.ordinaryroad.live.chat.client.huya.netty.handler.HuyaBinaryFrameHandler;
/**
* @author mjz
* @date 2023/9/5
*/
public interface IHuyaMsgListener extends IBaseMsgListener<HuyaBinaryFrameHandler, HuyaCmdEnum>,
IDanmuMsgListener<HuyaBinaryFrameHandler, MessageNoticeMsg>,
IGiftMsgListener<HuyaBinaryFrameHandler, SendItemSubBroadcastPacketMsg>,
IEnterRoomMsgListener<HuyaBinaryFrameHandler, VipEnterBannerMsg> {
}

View File

@@ -1,138 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.huya.msg;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.qq.tars.protocol.tars.TarsInputStream;
import com.qq.tars.protocol.tars.TarsOutputStream;
import com.qq.tars.protocol.tars.support.TarsMethodInfo;
import com.qq.tars.protocol.util.TarsHelper;
import com.qq.tars.rpc.protocol.tars.TarsServantRequest;
import com.qq.tars.rpc.protocol.tup.UniAttribute;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufUtil;
import io.netty.buffer.Unpooled;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import tech.ordinaryroad.live.chat.client.commons.base.exception.BaseException;
import tech.ordinaryroad.live.chat.client.commons.base.msg.BaseMsg;
import tech.ordinaryroad.live.chat.client.huya.msg.base.BaseHuyaMsg;
import tech.ordinaryroad.live.chat.client.huya.util.HuyaCodecUtil;
import java.util.HashMap;
import java.util.Map;
/**
* @author mjz
* @date 2023/10/2
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public abstract class BaseWup extends BaseHuyaMsg {
private TarsServantRequest tarsServantRequest = new TarsServantRequest(null) {{
setMethodInfo(new TarsMethodInfo());
}};
private UniAttribute uniAttribute = new UniAttribute();
public BaseWup(TarsInputStream is) {
this.readFrom(is);
}
@Override
public void writeTo(TarsOutputStream os) {
// os.write(this.tarsServantRequest.getVersion(), 1);
os.write(TarsHelper.VERSION3, 1);
os.write(this.tarsServantRequest.getPacketType(), 2);
os.write(this.tarsServantRequest.getMessageType(), 3);
os.write(this.tarsServantRequest.getRequestId(), 4);
os.write(this.tarsServantRequest.getServantName(), 5);
os.write(this.tarsServantRequest.getFunctionName(), 6);
os.write(this.uniAttribute.encode(), 7);
os.write(this.tarsServantRequest.getTimeout(), 8);
os.write(this.tarsServantRequest.getContext(), 9);
os.write(this.tarsServantRequest.getStatus(), 10);
}
@Override
public void readFrom(TarsInputStream is) {
this.tarsServantRequest.setVersion(is.read(this.tarsServantRequest.getVersion(), 1, false));
this.tarsServantRequest.setPacketType(is.read(this.tarsServantRequest.getPacketType(), 2, false));
this.tarsServantRequest.setMessageType(is.read(this.tarsServantRequest.getMessageType(), 3, false));
this.tarsServantRequest.setRequestId(is.read(this.tarsServantRequest.getRequestId(), 4, false));
this.tarsServantRequest.setServantName(is.read(this.tarsServantRequest.getServantName(), 5, false));
this.tarsServantRequest.setFunctionName(is.read(this.tarsServantRequest.getFunctionName(), 6, false));
this.uniAttribute.decode(is.read(new byte[]{}, 7, false));
this.tarsServantRequest.setTimeout(is.read(this.tarsServantRequest.getTimeout(), 8, false));
this.tarsServantRequest.setContext(is.readMap(this.tarsServantRequest.getContext(), 9, false));
this.tarsServantRequest.setStatus(is.readMap(this.tarsServantRequest.getStatus(), 10, false));
}
public byte[] encode() {
TarsOutputStream wupTarsOutputStream = new TarsOutputStream();
this.writeTo(wupTarsOutputStream);
ByteBuf buffer = Unpooled.buffer();
buffer.writeInt(4 + wupTarsOutputStream.getByteBuffer().position());
buffer.writeBytes(wupTarsOutputStream.toByteArray());
return ByteBufUtil.getBytes(buffer);
}
public void decode(byte[] bytes) {
ByteBuf byteBuf = Unpooled.wrappedBuffer(bytes);
int size = byteBuf.readInt();
if (size < 4) {
return;
}
bytes = new byte[byteBuf.readableBytes()];
byteBuf.readBytes(bytes);
this.readFrom(HuyaCodecUtil.newUtf8TarsInputStream(bytes));
}
@Override
public String toString() {
Map<String, Object> map = new HashMap<>();
map.put("version", this.tarsServantRequest.getVersion());
map.put("packetType", this.tarsServantRequest.getPacketType());
map.put("messageType", this.tarsServantRequest.getMessageType());
map.put("requestId", this.tarsServantRequest.getRequestId());
map.put("servantName", this.tarsServantRequest.getServantName());
map.put("functionName", this.tarsServantRequest.getFunctionName());
map.put("timeout", this.tarsServantRequest.getTimeout());
map.put("context", this.tarsServantRequest.getContext());
map.put("status", this.tarsServantRequest.getStatus());
try {
return BaseMsg.OBJECT_MAPPER.writeValueAsString(map);
} catch (JsonProcessingException e) {
throw new BaseException(e);
}
}
}

View File

@@ -1,105 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.huya.msg;
import com.qq.tars.protocol.tars.TarsInputStream;
import com.qq.tars.protocol.tars.TarsOutputStream;
import com.qq.tars.protocol.tars.TarsStructBase;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.util.HashMap;
import java.util.Map;
/**
* @author mjz
* @date 2023/9/5
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class ConnectParaInfo extends TarsStructBase {
private long lUid = 0;
private String sGuid = "";
private String sUA = "";
private String sAppSrc = "";
private String sMid = "";
private String sExp = "";
private int iTokenType = 0;
private String sToken = "";
private String sCookie = "";
private String sTraceId = "";
private Map<String, String> mCustomHeaders = new HashMap<String, String>() {{
put("", "");
}};
@Override
public void writeTo(TarsOutputStream os) {
os.write(this.lUid, 0);
os.write(this.sGuid, 1);
os.write(this.sUA, 2);
os.write(this.sAppSrc, 3);
os.write(this.sMid, 4);
os.write(this.sExp, 5);
os.write(this.iTokenType, 6);
os.write(this.sToken, 7);
os.write(this.sCookie, 8);
os.write(this.sTraceId, 9);
os.write(this.mCustomHeaders, 10);
}
@Override
public void readFrom(TarsInputStream is) {
this.lUid = is.read(this.lUid, 0, false);
this.sGuid = is.read(this.sGuid, 1, false);
this.sUA = is.read(this.sUA, 2, false);
this.sAppSrc = is.read(this.sAppSrc, 3, false);
this.sMid = is.read(this.sMid, 4, false);
this.sExp = is.read(this.sExp, 5, false);
this.iTokenType = is.read(this.iTokenType, 6, false);
this.sToken = is.read(this.sToken, 7, false);
this.sCookie = is.read(this.sCookie, 8, false);
this.sTraceId = is.read(this.sTraceId, 9, false);
this.mCustomHeaders = is.readMap(this.mCustomHeaders, 10, false);
}
public static ConnectParaInfo newWSConnectParaInfo(String ver, String sExp, String appSrc) {
ConnectParaInfo wsConnectParaInfo = new ConnectParaInfo();
// wsConnectParaInfo.sGuid = UUID.fastUUID().toString(true);
wsConnectParaInfo.sUA = String.format("webh5&%s&websocket", ver);
wsConnectParaInfo.sAppSrc = appSrc;
wsConnectParaInfo.sExp = sExp;
wsConnectParaInfo.mCustomHeaders = new HashMap<String, String>() {{
put("HUYA_NET", "0");
put("HUYA_VSDKUA", wsConnectParaInfo.sUA);
}};
return wsConnectParaInfo;
}
}

View File

@@ -1,78 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.huya.msg;
import cn.hutool.core.collection.CollUtil;
import com.qq.tars.protocol.tars.TarsInputStream;
import com.qq.tars.protocol.tars.TarsOutputStream;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import tech.ordinaryroad.live.chat.client.huya.constant.HuyaOperationEnum;
import tech.ordinaryroad.live.chat.client.huya.msg.base.BaseHuyaMsg;
import tech.ordinaryroad.live.chat.client.huya.msg.dto.LiveProxyValue;
import java.util.List;
/**
* @author mjz
* @date 2023/10/5
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class LiveLaunchRsp extends BaseHuyaMsg {
private String sGuid = "";
private int iTime;
private List<LiveProxyValue> vProxyList = CollUtil.newArrayList(new LiveProxyValue());
private int eAccess;
private String sClientIp = "";
@Override
public void writeTo(TarsOutputStream os) {
os.write(this.sGuid, 0);
os.write(this.iTime, 1);
os.write(this.vProxyList, 2);
os.write(this.eAccess, 3);
os.write(this.sClientIp, 4);
}
@Override
public void readFrom(TarsInputStream is) {
this.sGuid = is.read(this.sGuid, 0, false);
this.iTime = is.read(this.iTime, 1, false);
this.vProxyList = is.readArray(this.vProxyList, 2, false);
this.eAccess = is.read(this.eAccess, 3, false);
this.sClientIp = is.read(this.sClientIp, 4, false);
}
@Override
public HuyaOperationEnum getOperationEnum() {
return HuyaOperationEnum.EWSCmd_WupRsp;
}
}

View File

@@ -1,197 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.huya.msg;
import cn.hutool.core.collection.CollUtil;
import com.qq.tars.protocol.tars.TarsInputStream;
import com.qq.tars.protocol.tars.TarsOutputStream;
import com.qq.tars.protocol.tars.TarsStructBase;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import tech.ordinaryroad.live.chat.client.commons.base.msg.IDanmuMsg;
import tech.ordinaryroad.live.chat.client.huya.constant.HuyaOperationEnum;
import tech.ordinaryroad.live.chat.client.huya.msg.base.BaseHuyaMsg;
import tech.ordinaryroad.live.chat.client.huya.msg.dto.*;
import tech.ordinaryroad.live.chat.client.huya.util.HuyaCodecUtil;
import java.util.List;
import java.util.Optional;
/**
* @author mjz
* @date 2023/10/2
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class MessageNoticeMsg extends BaseHuyaMsg implements IDanmuMsg {
private SenderInfo tUserInfo = new SenderInfo();
private long lTid;
private long lSid;
private String sContent = "";
private int iShowMode;
private ContentFormat tFormat = new ContentFormat();
private BulletFormat tBulletFormat = new BulletFormat();
private int iTermType;
private List<DecorationInfo> vDecorationPrefix = CollUtil.newArrayList(new DecorationInfo());
private List<DecorationInfo> vDecorationSuffix = CollUtil.newArrayList(new DecorationInfo());
private List<UidNickName> vAtSomeone = CollUtil.newArrayList(new UidNickName());
private long lPid;
private List<DecorationInfo> vBulletPrefix = CollUtil.newArrayList(new DecorationInfo());
private String sIconUrl = "";
private int iType;
private List<DecorationInfo> vBulletSuffix = CollUtil.newArrayList(new DecorationInfo());
private List<MessageTagInfo> vTagInfo = CollUtil.newArrayList(new MessageTagInfo());
private SendMessageFormat tSenceFormat = new SendMessageFormat();
private MessageContentExpand tContentExpand = new MessageContentExpand();
private int iMessageMode;
// region 额外属性
private BadgeInfo badgeInfo;
// endregion
public MessageNoticeMsg(TarsInputStream is) {
this.readFrom(is);
}
@Override
public void writeTo(TarsOutputStream os) {
os.write(this.tUserInfo, 0);
os.write(this.lTid, 1);
os.write(this.lSid, 2);
os.write(this.sContent, 3);
os.write(this.iShowMode, 4);
os.write(this.tFormat, 5);
os.write(this.tBulletFormat, 6);
os.write(this.iTermType, 7);
os.write(this.vDecorationPrefix, 8);
os.write(this.vDecorationSuffix, 9);
os.write(this.vAtSomeone, 10);
os.write(this.lPid, 11);
os.write(this.vBulletPrefix, 12);
os.write(this.sIconUrl, 13);
os.write(this.iType, 14);
os.write(this.vBulletSuffix, 15);
os.write(this.vTagInfo, 16);
os.write(this.tSenceFormat, 17);
os.write(this.tContentExpand, 18);
os.write(this.iMessageMode, 19);
}
@Override
public void readFrom(TarsInputStream is) {
this.tUserInfo = (SenderInfo) is.directRead(this.tUserInfo, 0, true);
this.lTid = is.read(this.lTid, 1, true);
this.lSid = is.read(this.lSid, 2, true);
this.sContent = is.readString(3, true);
this.iShowMode = is.read(this.iShowMode, 4, true);
this.tFormat = (ContentFormat) is.directRead(this.tFormat, 5, true);
this.tBulletFormat = (BulletFormat) is.directRead(this.tBulletFormat, 6, true);
this.iTermType = is.read(this.iTermType, 7, true);
this.vDecorationPrefix = is.readArray(this.vDecorationPrefix, 8, true);
this.vDecorationSuffix = is.readArray(this.vDecorationSuffix, 9, true);
this.vAtSomeone = is.readArray(this.vAtSomeone, 10, true);
this.lPid = is.read(this.lPid, 11, true);
this.vBulletPrefix = is.readArray(this.vBulletPrefix, 12, false);
this.sIconUrl = is.read(this.sIconUrl, 13, false);
this.iType = is.read(this.iType, 14, false);
this.vBulletSuffix = is.readArray(this.vBulletSuffix, 15, false);
this.vTagInfo = is.readArray(this.vTagInfo, 16, false);
this.tSenceFormat = (SendMessageFormat) is.directRead(this.tSenceFormat, 17, false);
this.tContentExpand = (MessageContentExpand) is.directRead(this.tContentExpand, 18, false);
this.iMessageMode = is.read(this.iMessageMode, 19, false);
// 解析额外属性
for (DecorationInfo decorationPrefix : vDecorationPrefix) {
Optional<? extends TarsStructBase> optional = HuyaCodecUtil.decodeDecorationInfo(decorationPrefix);
if (optional.isPresent()) {
TarsStructBase tarsStructBase = optional.get();
if (tarsStructBase instanceof BadgeInfo) {
this.badgeInfo = (BadgeInfo) tarsStructBase;
break;
}
}
}
}
@Override
public HuyaOperationEnum getOperationEnum() {
return HuyaOperationEnum.EWSCmdS2C_MsgPushReq;
}
@Override
public String getBadgeName() {
if (this.badgeInfo == null) {
return "";
}
return this.badgeInfo.getSBadgeName();
}
@Override
public byte getBadgeLevel() {
if (this.badgeInfo == null) {
return 0;
}
return (byte) this.badgeInfo.getIBadgeLevel();
}
@Override
public String getUid() {
if (this.tUserInfo == null) {
return null;
}
return Long.toString(this.tUserInfo.getLUid());
}
@Override
public String getUsername() {
if (this.tUserInfo == null) {
return "";
}
return this.tUserInfo.getSNickName();
}
@Override
public String getUserAvatar() {
if (this.tUserInfo == null) {
return "";
}
return this.tUserInfo.getSAvatarUrl();
}
@Override
public String getContent() {
return this.sContent;
}
}

View File

@@ -1,84 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.huya.msg;
import com.qq.tars.protocol.tars.TarsInputStream;
import com.qq.tars.protocol.tars.TarsOutputStream;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import tech.ordinaryroad.live.chat.client.huya.constant.HuyaOperationEnum;
import tech.ordinaryroad.live.chat.client.huya.msg.base.BaseHuyaCmdMsg;
/**
* @author mjz
* @date 2023/10/2
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class PushMessage extends BaseHuyaCmdMsg {
private int ePushType;
private byte[] dataBytes;
private int iProtocolType;
private String sGroupId = "";
private long lMsgId;
private int iMsgTag;
public PushMessage(TarsInputStream is) {
this.readFrom(is);
}
@Override
public void writeTo(TarsOutputStream os) {
os.write(this.ePushType, 0);
os.write(super.getLUri(), 1);
os.write(this.dataBytes, 2);
os.write(this.iProtocolType, 3);
os.write(this.sGroupId, 4);
os.write(this.lMsgId, 5);
os.write(this.iMsgTag, 6);
}
@Override
public void readFrom(TarsInputStream is) {
this.ePushType = is.read(this.ePushType, 0, true);
super.setLUri(is.read(super.getLUri(), 1, true));
this.dataBytes = is.read(this.dataBytes, 2, true);
this.iProtocolType = is.read(this.iProtocolType, 3, true);
this.sGroupId = is.read(this.sGroupId, 4, true);
this.lMsgId = is.read(this.lMsgId, 5, true);
this.iMsgTag = is.read(this.iMsgTag, 6, true);
}
@Override
public HuyaOperationEnum getOperationEnum() {
return HuyaOperationEnum.EWSCmdS2C_MsgPushReq_V2;
}
}

View File

@@ -1,73 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.huya.msg;
import cn.hutool.core.collection.CollUtil;
import com.qq.tars.protocol.tars.TarsInputStream;
import com.qq.tars.protocol.tars.TarsOutputStream;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import tech.ordinaryroad.live.chat.client.huya.constant.HuyaOperationEnum;
import tech.ordinaryroad.live.chat.client.huya.msg.base.BaseHuyaMsg;
import tech.ordinaryroad.live.chat.client.huya.msg.dto.MsgItem;
import java.util.List;
/**
* @author mjz
* @date 2023/10/5
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class PushMessage_V2 extends BaseHuyaMsg {
private String sGroupId;
private List<MsgItem> vMsgItem = CollUtil.newArrayList(new MsgItem());
public PushMessage_V2(TarsInputStream is) {
this.readFrom(is);
}
@Override
public void writeTo(TarsOutputStream os) {
os.write(this.sGroupId, 0);
os.write(this.vMsgItem, 1);
}
@Override
public void readFrom(TarsInputStream is) {
this.sGroupId = is.read(this.sGroupId, 0, true);
this.vMsgItem = is.readArray(this.vMsgItem, 1, true);
}
@Override
public HuyaOperationEnum getOperationEnum() {
return HuyaOperationEnum.EWSCmdS2C_MsgPushReq_V2;
}
}

View File

@@ -1,72 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.huya.msg;
import cn.hutool.core.collection.CollUtil;
import com.qq.tars.protocol.tars.TarsInputStream;
import com.qq.tars.protocol.tars.TarsOutputStream;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import tech.ordinaryroad.live.chat.client.huya.constant.HuyaOperationEnum;
import tech.ordinaryroad.live.chat.client.huya.msg.base.BaseHuyaMsg;
import java.util.List;
/**
* @author mjz
* @date 2023/10/5
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class RegisterGroupRsp extends BaseHuyaMsg {
private int iResCode;
private List<String> vSupportP2PGroupId = CollUtil.newArrayList("");
public RegisterGroupRsp(TarsInputStream is) {
this.readFrom(is);
}
@Override
public void writeTo(TarsOutputStream os) {
os.write(this.iResCode, 0);
os.write(this.vSupportP2PGroupId, 1);
}
@Override
public void readFrom(TarsInputStream is) {
this.iResCode = is.read(this.iResCode, 0, true);
this.vSupportP2PGroupId = is.readArray(this.vSupportP2PGroupId, 1, true);
}
@Override
public HuyaOperationEnum getOperationEnum() {
return HuyaOperationEnum.EWSCmdS2C_RegisterGroupRsp;
}
}

View File

@@ -1,75 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.huya.msg;
import com.qq.tars.protocol.tars.TarsInputStream;
import com.qq.tars.protocol.tars.TarsOutputStream;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import tech.ordinaryroad.live.chat.client.huya.constant.HuyaOperationEnum;
import tech.ordinaryroad.live.chat.client.huya.msg.base.BaseHuyaMsg;
/**
* @author mjz
* @date 2023/10/5
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class RegisterRsp extends BaseHuyaMsg {
private int iResCode;
private long lRequestId;
private String sMessage = "";
private String sBCConnHost = "";
public RegisterRsp(TarsInputStream is) {
this.readFrom(is);
}
@Override
public void writeTo(TarsOutputStream os) {
os.write(this.iResCode, 0);
os.write(this.lRequestId, 1);
os.write(this.sMessage, 2);
os.write(this.sBCConnHost, 3);
}
@Override
public void readFrom(TarsInputStream is) {
this.iResCode = is.read(this.iResCode, 0, true);
this.lRequestId = is.read(this.lRequestId, 1, true);
this.sMessage = is.read(this.sMessage, 2, true);
this.sBCConnHost = is.read(this.sBCConnHost, 3, true);
}
@Override
public HuyaOperationEnum getOperationEnum() {
return HuyaOperationEnum.EWSCmd_RegisterRsp;
}
}

View File

@@ -1,283 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.huya.msg;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.qq.tars.protocol.tars.TarsInputStream;
import com.qq.tars.protocol.tars.TarsOutputStream;
import com.qq.tars.protocol.tars.TarsStructBase;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import tech.ordinaryroad.live.chat.client.commons.base.msg.IGiftMsg;
import tech.ordinaryroad.live.chat.client.huya.constant.HuyaOperationEnum;
import tech.ordinaryroad.live.chat.client.huya.msg.base.BaseHuyaMsg;
import tech.ordinaryroad.live.chat.client.huya.msg.dto.*;
import tech.ordinaryroad.live.chat.client.huya.util.HuyaCodecUtil;
import java.util.List;
import java.util.Optional;
/**
* @author mjz
* @date 2023/10/2
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class SendItemSubBroadcastPacketMsg extends BaseHuyaMsg implements IGiftMsg {
private int iItemType;
private String strPayId = "";
private int iItemCount;
private long lPresenterUid;
private long lSenderUid;
private String sPresenterNick = "";
private String sSenderNick = "";
private String sSendContent = "";
private int iItemCountByGroup;
private int iItemGroup;
private int iSuperPupleLevel;
private int iComboScore;
private int iDisplayInfo;
private int iEffectType;
private String iSenderIcon = "";
private String iPresenterIcon = "";
private int iTemplateType;
private String sExpand = "";
private boolean bBusi;
private int iColorEffectType;
private String sPropsName = "";
private short iAccpet = 0;
private short iEventType = 0;
private UserIdentityInfo userInfo = new UserIdentityInfo();
private long lRoomId = 0;
private long lHomeOwnerUid = 0;
// private int streamerInfo = new D.StreamerNode;
private int iPayType = -1;
private int iNobleLevel = 0;
private NobleLevelInfo tNobleLevel = new NobleLevelInfo();
private ItemEffectInfo tEffectInfo = new ItemEffectInfo();
private List<Long> vExUid = CollUtil.newArrayList(-1L);
private int iComboStatus = 0;
private int iPidColorType = 0;
private int iMultiSend = 0;
private int iVFanLevel = 0;
private int iUpgradeLevel = 0;
private String sCustomText = "";
private DIYBigGiftEffect tDIYEffect = new DIYBigGiftEffect();
private long lComboSeqId = 0;
private long lPayTotal = 0;
// private int vBizData = new V.Vector(new D.ItemEffectBizData);
// region 额外属性
private BadgeInfo badgeInfo;
private PropsItem propsItem = PropsItem.DEFAULT;
// endregion
public SendItemSubBroadcastPacketMsg(TarsInputStream is) {
this.readFrom(is);
}
@Override
public void writeTo(TarsOutputStream os) {
os.write(this.iItemType, 0);
os.write(this.strPayId, 1);
os.write(this.iItemCount, 2);
os.write(this.lPresenterUid, 3);
os.write(this.lSenderUid, 4);
os.write(this.sPresenterNick, 5);
os.write(this.sSenderNick, 6);
os.write(this.sSendContent, 7);
os.write(this.iItemCountByGroup, 8);
os.write(this.iItemGroup, 9);
os.write(this.iSuperPupleLevel, 10);
os.write(this.iComboScore, 11);
os.write(this.iDisplayInfo, 12);
os.write(this.iEffectType, 13);
os.write(this.iSenderIcon, 14);
os.write(this.iPresenterIcon, 15);
os.write(this.iTemplateType, 16);
os.write(this.sExpand, 17);
os.write(this.bBusi, 18);
os.write(this.iColorEffectType, 19);
os.write(this.sPropsName, 20);
os.write(this.iAccpet, 21);
os.write(this.iEventType, 22);
os.write(this.userInfo, 23);
os.write(this.lRoomId, 24);
os.write(this.lHomeOwnerUid, 25);
// os.write(this.streamerInfo, 26);
os.write(this.iPayType, 27);
os.write(this.iNobleLevel, 28);
os.write(this.tNobleLevel, 29);
os.write(this.tEffectInfo, 30);
os.write(this.vExUid, 31);
os.write(this.iComboStatus, 32);
os.write(this.iPidColorType, 33);
os.write(this.iMultiSend, 34);
os.write(this.iVFanLevel, 35);
os.write(this.iUpgradeLevel, 36);
os.write(this.sCustomText, 37);
os.write(this.tDIYEffect, 38);
os.write(this.lComboSeqId, 39);
os.write(this.lPayTotal, 41);
// os.write(this.vBizData, 42);
}
@Override
public void readFrom(TarsInputStream is) {
this.iItemType = is.read(this.iItemType, 0, true);
this.strPayId = is.read(this.strPayId, 1, true);
this.iItemCount = is.read(this.iItemCount, 2, true);
this.lPresenterUid = is.read(this.lPresenterUid, 3, true);
this.lSenderUid = is.read(this.lSenderUid, 4, true);
this.sPresenterNick = is.read(this.sPresenterNick, 5, true);
this.sSenderNick = is.read(this.sSenderNick, 6, true);
this.sSendContent = is.read(this.sSendContent, 7, true);
this.iItemCountByGroup = is.read(this.iItemCountByGroup, 8, true);
this.iItemGroup = is.read(this.iItemGroup, 9, true);
this.iSuperPupleLevel = is.read(this.iSuperPupleLevel, 10, true);
this.iComboScore = is.read(this.iComboScore, 11, true);
this.iDisplayInfo = is.read(this.iDisplayInfo, 12, true);
this.iEffectType = is.read(this.iEffectType, 13, true);
this.iSenderIcon = is.read(this.iSenderIcon, 14, true);
this.iPresenterIcon = is.read(this.iPresenterIcon, 15, true);
this.iTemplateType = is.read(this.iTemplateType, 16, true);
this.sExpand = is.read(this.sExpand, 17, true);
this.bBusi = is.read(this.bBusi, 18, true);
this.iColorEffectType = is.read(this.iColorEffectType, 19, true);
this.sPropsName = is.read(this.sPropsName, 20, true);
this.iAccpet = is.read(this.iAccpet, 21, true);
this.iEventType = is.read(this.iEventType, 22, true);
this.userInfo = (UserIdentityInfo) is.directRead(this.userInfo, 23, true);
this.lRoomId = is.read(this.lRoomId, 24, true);
this.lHomeOwnerUid = is.read(this.lHomeOwnerUid, 25, true);
// this.streamerInfo = is.read(this.streamerInfo, 26, true);
this.iPayType = is.read(this.iPayType, 27, true);
this.iNobleLevel = is.read(this.iNobleLevel, 28, true);
this.tNobleLevel = (NobleLevelInfo) is.directRead(this.tNobleLevel, 29, true);
this.tEffectInfo = (ItemEffectInfo) is.directRead(this.tEffectInfo, 30, true);
this.vExUid = is.readArray(this.vExUid, 31, true);
this.iComboStatus = is.read(this.iComboStatus, 32, true);
this.iPidColorType = is.read(this.iPidColorType, 33, true);
this.iMultiSend = is.read(this.iMultiSend, 34, true);
this.iVFanLevel = is.read(this.iVFanLevel, 35, true);
this.iUpgradeLevel = is.read(this.iUpgradeLevel, 36, true);
this.sCustomText = is.read(this.sCustomText, 37, true);
this.tDIYEffect = (DIYBigGiftEffect) is.directRead(this.tDIYEffect, 38, true);
this.lComboSeqId = is.read(this.lComboSeqId, 39, true);
this.lPayTotal = is.read(this.lPayTotal, 41, true);
// this.vBizData = is.read(this.vBizData, 42, true);
// 解析额外属性
for (DecorationInfo decorationPrefix : userInfo.getVDecorationPrefix()) {
Optional<? extends TarsStructBase> optional = HuyaCodecUtil.decodeDecorationInfo(decorationPrefix);
if (optional.isPresent()) {
TarsStructBase tarsStructBase = optional.get();
if (tarsStructBase instanceof BadgeInfo) {
this.badgeInfo = (BadgeInfo) tarsStructBase;
break;
}
}
}
}
@Override
public String getUid() {
return Long.toString(this.lSenderUid);
}
@Override
public String getUsername() {
return this.sSenderNick;
}
@Override
public String getUserAvatar() {
return this.iSenderIcon;
}
@Override
public String getGiftName() {
return this.sPropsName;
}
@Override
public String getGiftImg() {
if (this.propsItem == null) {
return "";
}
List<PropsIdentity> vPropsIdentity = this.propsItem.getVPropsIdentity();
if (vPropsIdentity.isEmpty()) {
return "";
}
PropsIdentity propsIdentity = vPropsIdentity.get(0);
String sPropsWeb = propsIdentity.getSPropsWeb();
if (StrUtil.isBlank(sPropsWeb)) {
return "";
}
return sPropsWeb.substring(0, sPropsWeb.indexOf("&"));
}
@Override
public String getGiftId() {
return Long.toString(this.iItemType);
}
@Override
public int getGiftCount() {
return this.iItemCount;
}
/**
* 100 对应 1虎牙币
*/
@Override
public int getGiftPrice() {
return (int) (this.lPayTotal / this.iItemCount);
}
@Override
public String getReceiveUid() {
return Long.toString(this.lPresenterUid);
}
@Override
public String getReceiveUsername() {
return this.sPresenterNick;
}
@Override
public HuyaOperationEnum getOperationEnum() {
return HuyaOperationEnum.EWSCmdS2C_MsgPushReq;
}
}

View File

@@ -1,88 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.huya.msg;
import com.qq.tars.protocol.tars.TarsInputStream;
import com.qq.tars.protocol.tars.TarsOutputStream;
import com.qq.tars.protocol.tars.TarsStructBase;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
/**
* @author mjz
* @date 2023/10/3
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class UserInfo extends TarsStructBase {
private long lUid = 0;
private boolean bAnonymous = true;
private String sGuid = "";
private String sToken = "";
private long lTid = 0;
private long lSid = 0;
private long lGroupId = 0;
private long lGroupType = 0;
private String sAppId = "";
private String sUA = "";
@Override
public void writeTo(TarsOutputStream os) {
os.write(this.lUid, 0);
os.write(this.bAnonymous, 1);
os.write(this.sGuid, 2);
os.write(this.sToken, 3);
os.write(this.lTid, 4);
os.write(this.lSid, 5);
os.write(this.lGroupId, 6);
os.write(this.lGroupType, 7);
os.write(this.sAppId, 8);
os.write(this.sUA, 9);
}
@Override
public void readFrom(TarsInputStream is) {
this.lUid = is.read(this.lUid, 0, true);
this.bAnonymous = is.read(this.bAnonymous, 1, true);
this.sGuid = is.read(this.sGuid, 2, true);
this.sToken = is.read(this.sToken, 3, true);
this.lTid = is.read(this.lTid, 4, true);
this.lSid = is.read(this.lSid, 5, true);
this.lGroupId = is.read(this.lGroupId, 6, true);
this.lGroupType = is.read(this.lGroupType, 7, true);
this.sAppId = is.read(this.sAppId, 8, true);
this.sUA = is.read(this.sUA, 9, true);
}
@Override
public TarsStructBase newInit() {
return this;
}
}

View File

@@ -1,66 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.huya.msg;
import com.qq.tars.protocol.tars.TarsInputStream;
import com.qq.tars.protocol.tars.TarsOutputStream;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import tech.ordinaryroad.live.chat.client.huya.constant.HuyaOperationEnum;
import tech.ordinaryroad.live.chat.client.huya.msg.base.BaseHuyaMsg;
/**
* @author mjz
* @date 2023/10/5
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class VerifyCookieRsp extends BaseHuyaMsg {
private int iValidate;
public VerifyCookieRsp(TarsInputStream is) {
this.readFrom(is);
}
@Override
public void writeTo(TarsOutputStream os) {
os.write(0, this.iValidate);
}
@Override
public void readFrom(TarsInputStream is) {
this.iValidate = is.read(this.iValidate, 0, true);
}
@Override
public HuyaOperationEnum getOperationEnum() {
return HuyaOperationEnum.EWSCmdS2C_VerifyCookieRsp;
}
}

View File

@@ -1,144 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.huya.msg;
import cn.hutool.core.collection.CollUtil;
import com.qq.tars.protocol.tars.TarsInputStream;
import com.qq.tars.protocol.tars.TarsOutputStream;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import tech.ordinaryroad.live.chat.client.commons.base.msg.IEnterRoomMsg;
import tech.ordinaryroad.live.chat.client.huya.constant.HuyaOperationEnum;
import tech.ordinaryroad.live.chat.client.huya.msg.base.BaseHuyaMsg;
import tech.ordinaryroad.live.chat.client.huya.msg.dto.*;
import java.util.List;
/**
* @author mjz
* @date 2023/12/27
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class VipEnterBannerMsg extends BaseHuyaMsg implements IEnterRoomMsg {
private long lUid;
private String sNickName = "";
private long lPid;
private NobleInfo tNobleInfo = new NobleInfo();
private GuardInfo tGuardInfo = new GuardInfo();
private WeekRankInfo tWeekRankInfo = new WeekRankInfo();
private String sLogoURL = "";
private boolean bFromNearby;
private String sLocation = "";
private DecorationInfoRsp tDecorationInfo = new DecorationInfoRsp();
private WeekRankInfo tWeekHeartStirRankInfo = new WeekRankInfo();
private WeekRankInfo tWeekHeartBlockRankInfo = new WeekRankInfo();
private int iMasterRank;
private ACEnterBanner tACInfo = new ACEnterBanner();
private List<CommEnterBanner> vCommEnterBanner = CollUtil.newArrayList(new CommEnterBanner());
private UserRidePetInfo tRidePetInfo = new UserRidePetInfo();
public VipEnterBannerMsg(TarsInputStream is) {
this.readFrom(is);
}
@Override
public void writeTo(TarsOutputStream os) {
os.write(this.lUid, 0);
os.write(this.sNickName, 1);
os.write(this.lPid, 2);
os.write(this.tNobleInfo, 3);
os.write(this.tGuardInfo, 4);
os.write(this.tWeekRankInfo, 5);
os.write(this.sLogoURL, 6);
os.write(this.bFromNearby, 7);
os.write(this.sLocation, 8);
os.write(this.tDecorationInfo, 9);
os.write(this.tWeekHeartStirRankInfo, 10);
os.write(this.tWeekHeartBlockRankInfo, 11);
os.write(this.iMasterRank, 12);
os.write(this.tACInfo, 13);
os.write(this.vCommEnterBanner, 14);
os.write(this.tRidePetInfo, 15);
}
@Override
public void readFrom(TarsInputStream is) {
this.lUid = is.read(this.lUid, 0, false);
this.sNickName = is.read(this.sNickName, 1, false);
this.lPid = is.read(this.lPid, 2, false);
this.tNobleInfo = (NobleInfo) is.directRead(this.tNobleInfo, 3, false);
this.tGuardInfo = (GuardInfo) is.directRead(this.tGuardInfo, 4, false);
this.tWeekRankInfo = (WeekRankInfo) is.directRead(this.tWeekRankInfo, 5, false);
this.sLogoURL = is.read(this.sLogoURL, 6, false);
this.bFromNearby = is.read(this.bFromNearby, 7, false);
this.sLocation = is.read(this.sLocation, 8, false);
this.tDecorationInfo = (DecorationInfoRsp) is.directRead(this.tDecorationInfo, 9, false);
this.tWeekHeartStirRankInfo = (WeekRankInfo) is.directRead(this.tWeekHeartStirRankInfo, 10, false);
this.tWeekHeartBlockRankInfo = (WeekRankInfo) is.directRead(this.tWeekHeartBlockRankInfo, 11, false);
this.iMasterRank = is.read(this.iMasterRank, 12, false);
this.tACInfo = (ACEnterBanner) is.directRead(this.tACInfo, 13, false);
this.vCommEnterBanner = is.readArray(this.vCommEnterBanner, 14, false);
this.tRidePetInfo = (UserRidePetInfo) is.directRead(this.tRidePetInfo, 15, false);
}
@Override
public String getBadgeName() {
// TODO
return null;
}
@Override
public byte getBadgeLevel() {
// TODO
return 0;
}
@Override
public String getUid() {
return Long.toString(lUid);
}
@Override
public String getUsername() {
return sNickName;
}
@Override
public String getUserAvatar() {
// TODO
return IEnterRoomMsg.super.getUserAvatar();
}
@Override
public HuyaOperationEnum getOperationEnum() {
return HuyaOperationEnum.EWSCmdS2C_MsgPushReq;
}
}

View File

@@ -1,84 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.huya.msg;
import com.qq.tars.protocol.tars.TarsInputStream;
import com.qq.tars.protocol.tars.TarsOutputStream;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import tech.ordinaryroad.live.chat.client.huya.constant.HuyaOperationEnum;
import tech.ordinaryroad.live.chat.client.huya.msg.base.BaseHuyaMsg;
/**
* @author mjz
* @date 2023/10/2
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class WebSocketCommand extends BaseHuyaMsg {
private int operation;
private byte[] vData;
private long lRequestId;
private String traceId = "";
private int iEncryptType;
private long lTime;
private String sMD5 = "";
public WebSocketCommand(TarsInputStream is) {
this.readFrom(is);
}
@Override
public void writeTo(TarsOutputStream os) {
os.write(this.operation, 0);
os.write(this.vData, 1);
os.write(this.lRequestId, 2);
os.write(this.traceId, 3);
os.write(this.iEncryptType, 4);
os.write(this.lTime, 5);
os.write(this.sMD5, 6);
}
@Override
public void readFrom(TarsInputStream is) {
this.operation = is.read(this.operation, 0, true);
this.vData = is.read(this.vData, 1, true);
this.lRequestId = is.read(this.lRequestId, 2, true);
this.traceId = is.read(this.traceId, 3, true);
this.iEncryptType = is.read(this.iEncryptType, 4, true);
this.lTime = is.read(this.lTime, 5, true);
this.sMD5 = is.read(this.sMD5, 6, true);
}
@Override
public HuyaOperationEnum getOperationEnum() {
return HuyaOperationEnum.getByCode(operation);
}
}

View File

@@ -1,45 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.huya.msg;
import lombok.NoArgsConstructor;
import tech.ordinaryroad.live.chat.client.huya.constant.HuyaOperationEnum;
/**
* @author mjz
* @date 2023/10/3
*/
@NoArgsConstructor
public class WupRsp extends BaseWup {
public WupRsp(byte[] vData) {
super.decode(vData);
}
@Override
public HuyaOperationEnum getOperationEnum() {
return HuyaOperationEnum.EWSCmd_WupRsp;
}
}

View File

@@ -1,79 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.huya.msg.base;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.StrUtil;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.qq.tars.protocol.tars.TarsStructBase;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import tech.ordinaryroad.live.chat.client.commons.base.exception.BaseException;
import tech.ordinaryroad.live.chat.client.commons.base.msg.BaseMsg;
import tech.ordinaryroad.live.chat.client.huya.constant.HuyaCmdEnum;
/**
* @author mjz
* @date 2023/10/2
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public abstract class BaseHuyaCmdMsg extends TarsStructBase implements IHuyaCmdMsg {
private long lUri;
@Override
public String getCmd() {
return StrUtil.nullToEmpty(StrUtil.toStringOrNull(this.lUri));
}
@Override
public void setCmd(String cmd) {
this.lUri = NumberUtil.parseLong(cmd);
}
@Override
public HuyaCmdEnum getCmdEnum() {
return HuyaCmdEnum.getByCode(this.lUri);
}
@Override
public TarsStructBase newInit() {
return this;
}
@Override
public String toString() {
try {
return BaseMsg.OBJECT_MAPPER.writeValueAsString(this);
} catch (JsonProcessingException e) {
throw new BaseException(e);
}
}
}

View File

@@ -1,51 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.huya.msg.base;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.qq.tars.protocol.tars.TarsStructBase;
import tech.ordinaryroad.live.chat.client.commons.base.exception.BaseException;
import tech.ordinaryroad.live.chat.client.commons.base.msg.BaseMsg;
/**
* @author mjz
* @date 2023/10/2
*/
public abstract class BaseHuyaMsg extends TarsStructBase implements IHuyaMsg {
@Override
public TarsStructBase newInit() {
return this;
}
@Override
public String toString() {
try {
return BaseMsg.OBJECT_MAPPER.writeValueAsString(this);
} catch (JsonProcessingException e) {
throw new BaseException(e);
}
}
}

View File

@@ -1,35 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.huya.msg.base;
import tech.ordinaryroad.live.chat.client.commons.base.msg.ICmdMsg;
import tech.ordinaryroad.live.chat.client.huya.constant.HuyaCmdEnum;
/**
* @author mjz
* @date 2023/10/2
*/
public interface IHuyaCmdMsg extends IHuyaMsg, ICmdMsg<HuyaCmdEnum> {
}

View File

@@ -1,38 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.huya.msg.base;
import com.fasterxml.jackson.annotation.JsonIgnore;
import tech.ordinaryroad.live.chat.client.commons.base.msg.IMsg;
import tech.ordinaryroad.live.chat.client.huya.constant.HuyaOperationEnum;
/**
* @author mjz
* @date 2023/8/26
*/
public interface IHuyaMsg extends IMsg {
@JsonIgnore
HuyaOperationEnum getOperationEnum();
}

View File

@@ -1,70 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.huya.msg.dto;
import com.qq.tars.protocol.tars.TarsInputStream;
import com.qq.tars.protocol.tars.TarsOutputStream;
import com.qq.tars.protocol.tars.TarsStructBase;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
/**
* @author mjz
* @date 2023/12/27
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class ACEnterBanner extends TarsStructBase {
private int iWeekHeartStirRank;
private int iWeekHeartBlockRank;
private int iMasterRank;
private int iACWeekRank;
@Override
public void writeTo(TarsOutputStream os) {
os.write(this.iWeekHeartStirRank, 0);
os.write(this.iWeekHeartBlockRank, 1);
os.write(this.iMasterRank, 2);
os.write(this.iACWeekRank, 3);
}
@Override
public void readFrom(TarsInputStream is) {
is.read(this.iWeekHeartStirRank, 0, false);
is.read(this.iWeekHeartBlockRank, 1, false);
is.read(this.iMasterRank, 2, false);
is.read(this.iACWeekRank, 3, false);
}
@Override
public TarsStructBase newInit() {
return this;
}
}

View File

@@ -1,119 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.huya.msg.dto;
import com.qq.tars.protocol.tars.TarsInputStream;
import com.qq.tars.protocol.tars.TarsOutputStream;
import com.qq.tars.protocol.tars.TarsStructBase;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
/**
* @author mjz
* @date 2023/10/10
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class BadgeInfo extends TarsStructBase {
private long lUid;
private long lBadgeId;
private String sPresenterNickName = "";
private String sBadgeName = "";
private int iBadgeLevel;
private int iRank;
private int iScore;
private int iNextScore;
private int iQuotaUsed;
private int iQuota;
private long lQuotaTS;
private long lOpenTS;
private int iVFlag;
private String sVLogo = "";
private PresenterChannelInfo tChannelInfo = new PresenterChannelInfo();
private String sPresenterLogo = "";
private long lVExpiredTS;
private int iBadgeType;
private FaithInfo tFaithInfo = new FaithInfo();
private SuperFansInfo tSuperFansInfo = new SuperFansInfo();
private int iBaseQuota;
private long lVConsumRank;
private int iCustomBadgeFlag;
private int iAgingDays;
private int iDayScore;
private CustomBadgeDynamicExternal tExternal = new CustomBadgeDynamicExternal();
private int iExtinguished;
private int iExtinguishDays;
private int iBadgeCate;
private int iLiveFlag;
@Override
public void writeTo(TarsOutputStream os) {
}
@Override
public void readFrom(TarsInputStream is) {
this.lUid = is.read(this.lUid, 0, false);
this.lBadgeId = is.read(this.lBadgeId, 1, false);
this.sPresenterNickName = is.read(this.sPresenterNickName, 2, false);
this.sBadgeName = is.read(this.sBadgeName, 3, false);
this.iBadgeLevel = is.read(this.iBadgeLevel, 4, false);
this.iRank = is.read(this.iRank, 5, false);
this.iScore = is.read(this.iScore, 6, false);
this.iNextScore = is.read(this.iNextScore, 7, false);
this.iQuotaUsed = is.read(this.iQuotaUsed, 8, false);
this.iQuota = is.read(this.iQuota, 9, false);
this.lQuotaTS = is.read(this.lQuotaTS, 10, false);
this.lOpenTS = is.read(this.lOpenTS, 11, false);
this.iVFlag = is.read(this.iVFlag, 12, false);
this.sVLogo = is.read(this.sVLogo, 13, false);
this.tChannelInfo = (PresenterChannelInfo) is.directRead(this.tChannelInfo, 14, false);
this.sPresenterLogo = is.read(this.sPresenterLogo, 15, false);
this.lVExpiredTS = is.read(this.lVExpiredTS, 16, false);
this.iBadgeType = is.read(this.iBadgeType, 17, false);
this.tFaithInfo = (FaithInfo) is.directRead(this.tFaithInfo, 18, false);
this.tSuperFansInfo = (SuperFansInfo) is.directRead(this.tSuperFansInfo, 19, false);
this.iBaseQuota = is.read(this.iBaseQuota, 20, false);
this.lVConsumRank = is.read(this.lVConsumRank, 21, false);
this.iCustomBadgeFlag = is.read(this.iCustomBadgeFlag, 22, false);
this.iAgingDays = is.read(this.iAgingDays, 23, false);
this.iDayScore = is.read(this.iDayScore, 24, false);
this.tExternal = (CustomBadgeDynamicExternal) is.directRead(this.tExternal, 25, false);
this.iExtinguished = is.read(this.iExtinguished, 26, false);
this.iExtinguishDays = is.read(this.iExtinguishDays, 27, false);
this.iBadgeCate = is.read(this.iBadgeCate, 28, false);
this.iLiveFlag = is.read(this.iLiveFlag, 29, false);
}
@Override
public TarsStructBase newInit() {
return this;
}
}

View File

@@ -1,85 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.huya.msg.dto;
import com.qq.tars.protocol.tars.TarsInputStream;
import com.qq.tars.protocol.tars.TarsOutputStream;
import com.qq.tars.protocol.tars.TarsStructBase;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
/**
* @author mjz
* @date 2023/10/5
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class BulletBorderGroundFormat extends TarsStructBase {
private int iEnableUse;
private int iBorderThickness;
private int iBorderColour = -1;
private int iBorderDiaphaneity = 100;
private int iGroundColour = -1;
private int iGroundColourDiaphaneity = 100;
private String sAvatarDecorationUrl = "";
private int iFontColor = -1;
private int iTerminalFlag = -1;
@Override
public void writeTo(TarsOutputStream os) {
os.write(this.iEnableUse, 0);
os.write(this.iBorderThickness, 1);
os.write(this.iBorderColour, 2);
os.write(this.iBorderDiaphaneity, 3);
os.write(this.iGroundColour, 4);
os.write(this.iGroundColourDiaphaneity, 5);
os.write(this.sAvatarDecorationUrl, 6);
os.write(this.iFontColor, 7);
os.write(this.iTerminalFlag, 8);
}
@Override
public void readFrom(TarsInputStream is) {
this.iEnableUse = is.read(this.iEnableUse, 0, false);
this.iBorderThickness = is.read(this.iBorderThickness, 1, false);
this.iBorderColour = is.read(this.iBorderColour, 2, false);
this.iBorderDiaphaneity = is.read(this.iBorderDiaphaneity, 3, false);
this.iGroundColour = is.read(this.iGroundColour, 4, false);
this.iGroundColourDiaphaneity = is.read(this.iGroundColourDiaphaneity, 5, false);
this.sAvatarDecorationUrl = is.read(this.sAvatarDecorationUrl, 6, false);
this.iFontColor = is.read(this.iFontColor, 7, false);
this.iTerminalFlag = is.read(this.iTerminalFlag, 8, false);
}
@Override
public TarsStructBase newInit() {
return this;
}
}

View File

@@ -1,89 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.huya.msg.dto;
import cn.hutool.core.collection.CollUtil;
import com.qq.tars.protocol.tars.TarsInputStream;
import com.qq.tars.protocol.tars.TarsOutputStream;
import com.qq.tars.protocol.tars.TarsStructBase;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.util.List;
/**
* @author mjz
* @date 2023/10/2
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class BulletFormat extends TarsStructBase {
private int iFontColor = -1;
private int iFontSize = 4;
private int iTextSpeed = 0;
private int iTransitionType = 1;
private int iPopupStyle = 0;
private BulletBorderGroundFormat tBorderGroundFormat = new BulletBorderGroundFormat();
private List<Integer> vGraduatedColor = CollUtil.newArrayList(0);
private int iAvatarFlag = 0;
private int iAvatarTerminalFlag = -1;
@Override
public void writeTo(TarsOutputStream os) {
os.write(this.iFontColor, 0);
os.write(this.iFontSize, 1);
os.write(this.iTextSpeed, 2);
os.write(this.iTransitionType, 3);
os.write(this.iPopupStyle, 4);
os.write(this.tBorderGroundFormat, 5);
os.write(this.vGraduatedColor, 6);
os.write(this.iAvatarFlag, 7);
os.write(this.iAvatarTerminalFlag, 8);
}
@Override
public void readFrom(TarsInputStream is) {
this.iFontColor = is.read(this.iFontColor, 0, false);
this.iFontSize = is.read(this.iFontSize, 1, false);
this.iTextSpeed = is.read(this.iTextSpeed, 2, false);
this.iTransitionType = is.read(this.iTransitionType, 3, false);
this.iPopupStyle = is.read(this.iPopupStyle, 4, false);
this.tBorderGroundFormat = (BulletBorderGroundFormat) is.directRead(this.tBorderGroundFormat, 5, false);
this.vGraduatedColor = is.readArray(this.vGraduatedColor, 6, false);
this.iAvatarFlag = is.read(this.iAvatarFlag, 7, false);
this.iAvatarTerminalFlag = is.read(this.iAvatarTerminalFlag, 8, false);
}
@Override
public TarsStructBase newInit() {
return this;
}
}

View File

@@ -1,67 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.huya.msg.dto;
import com.qq.tars.protocol.tars.TarsInputStream;
import com.qq.tars.protocol.tars.TarsOutputStream;
import com.qq.tars.protocol.tars.TarsStructBase;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
/**
* @author mjz
* @date 2023/12/27
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class ChannelPair extends TarsStructBase {
private long lTid;
private long lSid;
private long lPid;
@Override
public void writeTo(TarsOutputStream os) {
os.write(this.lTid, 0);
os.write(this.lSid, 1);
os.write(this.lPid, 2);
}
@Override
public void readFrom(TarsInputStream is) {
this.lTid = is.read(this.lTid, 0, false);
this.lSid = is.read(this.lSid, 1, false);
this.lPid = is.read(this.lPid, 2, false);
}
@Override
public TarsStructBase newInit() {
return this;
}
}

View File

@@ -1,67 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.huya.msg.dto;
import com.qq.tars.protocol.tars.TarsInputStream;
import com.qq.tars.protocol.tars.TarsOutputStream;
import com.qq.tars.protocol.tars.TarsStructBase;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
/**
* @author mjz
* @date 2023/12/27
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class CommEnterBanner extends TarsStructBase {
private int iBannerUri;
private int iViewType;
private byte[] vData;
@Override
public void writeTo(TarsOutputStream os) {
os.write(this.iBannerUri, 0);
os.write(this.iViewType, 1);
os.write(this.vData, 2);
}
@Override
public void readFrom(TarsInputStream is) {
this.iBannerUri = is.read(this.iBannerUri, 0, false);
this.iViewType = is.read(this.iViewType, 1, false);
this.vData = is.read(this.vData, 2, false);
}
@Override
public TarsStructBase newInit() {
return this;
}
}

View File

@@ -1,76 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.huya.msg.dto;
import com.qq.tars.protocol.tars.TarsInputStream;
import com.qq.tars.protocol.tars.TarsOutputStream;
import com.qq.tars.protocol.tars.TarsStructBase;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
/**
* @author mjz
* @date 2023/10/2
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class ContentFormat extends TarsStructBase {
private int iFontColor = -1;
private int iFontSize = 4;
private int iPopupStyle = 0;
private int iNickNameFontColor = -1;
private int iDarkFontColor = -1;
private int iDarkNickNameFontColor = -1;
@Override
public void writeTo(TarsOutputStream os) {
os.write(this.iFontColor, 0);
os.write(this.iFontSize, 1);
os.write(this.iPopupStyle, 2);
os.write(this.iNickNameFontColor, 3);
os.write(this.iDarkFontColor, 4);
os.write(this.iDarkNickNameFontColor, 5);
}
@Override
public void readFrom(TarsInputStream is) {
this.iFontColor = is.read(this.iFontColor, 0, false);
this.iFontSize = is.read(this.iFontSize, 1, false);
this.iPopupStyle = is.read(this.iPopupStyle, 2, false);
this.iNickNameFontColor = is.read(this.iNickNameFontColor, 3, false);
this.iDarkFontColor = is.read(this.iDarkFontColor, 4, false);
this.iDarkNickNameFontColor = is.read(this.iDarkNickNameFontColor, 5, false);
}
@Override
public TarsStructBase newInit() {
return this;
}
}

View File

@@ -1,64 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.huya.msg.dto;
import com.qq.tars.protocol.tars.TarsInputStream;
import com.qq.tars.protocol.tars.TarsOutputStream;
import com.qq.tars.protocol.tars.TarsStructBase;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
/**
* @author mjz
* @date 2023/10/10
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class CustomBadgeDynamicExternal extends TarsStructBase {
private String sFloorExter = "";
private int iFansIdentity;
@Override
public void writeTo(TarsOutputStream os) {
os.write(this.sFloorExter, 0);
os.write(this.iFansIdentity, 1);
}
@Override
public void readFrom(TarsInputStream is) {
this.sFloorExter = is.read(this.sFloorExter, 0, false);
this.iFansIdentity = is.read(this.iFansIdentity, 1, false);
}
@Override
public TarsStructBase newInit() {
return this;
}
}

View File

@@ -1,70 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.huya.msg.dto;
import com.qq.tars.protocol.tars.TarsInputStream;
import com.qq.tars.protocol.tars.TarsOutputStream;
import com.qq.tars.protocol.tars.TarsStructBase;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
/**
* @author mjz
* @date 2023/10/10
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class DIYBigGiftEffect extends TarsStructBase {
private String sResourceUrl = "";
private String sResourceAttr = "";
private String sWebResourceUrl = "";
private String sPCResourceUrl = "";
@Override
public void writeTo(TarsOutputStream os) {
os.write(this.sResourceUrl, 0);
os.write(this.sResourceAttr, 1);
os.write(this.sWebResourceUrl, 2);
os.write(this.sPCResourceUrl, 3);
}
@Override
public void readFrom(TarsInputStream is) {
this.sResourceUrl = is.read(this.sResourceUrl, 0, false);
this.sResourceAttr = is.read(this.sResourceAttr, 1, false);
this.sWebResourceUrl = is.read(this.sWebResourceUrl, 2, false);
this.sPCResourceUrl = is.read(this.sPCResourceUrl, 3, false);
}
@Override
public TarsStructBase newInit() {
return this;
}
}

View File

@@ -1,67 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.huya.msg.dto;
import com.qq.tars.protocol.tars.TarsInputStream;
import com.qq.tars.protocol.tars.TarsOutputStream;
import com.qq.tars.protocol.tars.TarsStructBase;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
/**
* @author mjz
* @date 2023/10/3
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class DecorationInfo extends TarsStructBase {
private int iAppId = 0;
private int iViewType = 0;
private byte[] vData;
@Override
public void writeTo(TarsOutputStream os) {
os.write(this.iAppId, 0);
os.write(this.iViewType, 1);
os.write(this.vData, 2);
}
@Override
public void readFrom(TarsInputStream is) {
this.iAppId = is.read(this.iAppId, 0, true);
this.iViewType = is.read(this.iViewType, 1, true);
this.vData = is.read(this.vData, 2, true);
}
@Override
public TarsStructBase newInit() {
return this;
}
}

View File

@@ -1,88 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.huya.msg.dto;
import cn.hutool.core.collection.CollUtil;
import com.qq.tars.protocol.tars.TarsInputStream;
import com.qq.tars.protocol.tars.TarsOutputStream;
import com.qq.tars.protocol.tars.TarsStructBase;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.util.List;
/**
* @author mjz
* @date 2023/12/27
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class DecorationInfoRsp extends TarsStructBase {
private List<DecorationInfo> vDecorationPrefix = CollUtil.newArrayList(new DecorationInfo());
private List<DecorationInfo> vDecorationSuffix = CollUtil.newArrayList(new DecorationInfo());
private ContentFormat tFormat = new ContentFormat();
private BulletFormat tBulletFormat = new BulletFormat();
private List<ChannelPair> vForwardChannels = CollUtil.newArrayList(new ChannelPair());
private int iModifyMask;
private List<DecorationInfo> vBulletPrefix = CollUtil.newArrayList(new DecorationInfo());
private SenderInfo tUserInfo = new SenderInfo();
private List<DecorationInfo> vBulletSuffix = CollUtil.newArrayList(new DecorationInfo());
@Override
public void writeTo(TarsOutputStream os) {
os.write(this.vDecorationPrefix, 0);
os.write(this.vDecorationSuffix, 1);
os.write(this.tFormat, 2);
os.write(this.tBulletFormat, 3);
os.write(this.vForwardChannels, 4);
os.write(this.iModifyMask, 5);
os.write(this.vBulletPrefix, 6);
os.write(this.tUserInfo, 7);
os.write(this.vBulletSuffix, 8);
}
@Override
public void readFrom(TarsInputStream is) {
this.vDecorationPrefix = is.readArray(this.vDecorationPrefix, 0, false);
this.vDecorationSuffix = is.readArray(this.vDecorationSuffix, 1, false);
this.tFormat = (ContentFormat) is.directRead(this.tFormat, 2, false);
this.tBulletFormat = (BulletFormat) is.directRead(this.tBulletFormat, 3, false);
this.vForwardChannels = is.readArray(this.vForwardChannels, 4, false);
this.iModifyMask = is.read(this.iModifyMask, 5, false);
this.vBulletPrefix = is.readArray(this.vBulletPrefix, 6, false);
this.tUserInfo = (SenderInfo) is.directRead(this.tUserInfo, 7, false);
this.vBulletSuffix = is.readArray(this.vBulletSuffix, 8, false);
}
@Override
public TarsStructBase newInit() {
return this;
}
}

View File

@@ -1,73 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.huya.msg.dto;
import com.qq.tars.protocol.tars.TarsInputStream;
import com.qq.tars.protocol.tars.TarsOutputStream;
import com.qq.tars.protocol.tars.TarsStructBase;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
/**
* @author mjz
* @date 2023/10/5
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class DeviceInfo extends TarsStructBase {
private String sIMEI = "";
private String sAPN = "";
private String sNetType = "";
private String sDeviceId = "";
private String sMId = "";
@Override
public void writeTo(TarsOutputStream os) {
os.write(this.sIMEI, 0);
os.write(this.sAPN, 1);
os.write(this.sNetType, 2);
os.write(this.sDeviceId, 3);
os.write(this.sMId, 4);
}
@Override
public void readFrom(TarsInputStream is) {
this.sIMEI = is.read(this.sIMEI, 0, false);
this.sAPN = is.read(this.sAPN, 1, false);
this.sNetType = is.read(this.sNetType, 2, false);
this.sDeviceId = is.read(this.sDeviceId, 3, false);
this.sMId = is.read(this.sMId, 4, false);
}
@Override
public TarsStructBase newInit() {
return this;
}
}

View File

@@ -1,91 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.huya.msg.dto;
import com.qq.tars.protocol.tars.TarsInputStream;
import com.qq.tars.protocol.tars.TarsOutputStream;
import com.qq.tars.protocol.tars.TarsStructBase;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
/**
* @author mjz
* @date 2023/10/3
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class DisplayInfo extends TarsStructBase {
private int iMarqueeScopeMin = 0;
private int iMarqueeScopeMax = 0;
private int iCurrentVideoNum = 0;
private int iCurrentVideoMin = 0;
private int iCurrentVideoMax = 0;
private int iAllVideoNum = 0;
private int iAllVideoMin = 0;
private int iAllVideoMax = 0;
private int iCurrentScreenNum = 0;
private int iCurrentScreenMin = 0;
private int iCurrentScreenMax = 0;
@Override
public void writeTo(TarsOutputStream os) {
os.write(this.iMarqueeScopeMin, 1);
os.write(this.iMarqueeScopeMax, 2);
os.write(this.iCurrentVideoNum, 3);
os.write(this.iCurrentVideoMin, 4);
os.write(this.iCurrentVideoMax, 5);
os.write(this.iAllVideoNum, 6);
os.write(this.iAllVideoMin, 7);
os.write(this.iAllVideoMax, 8);
os.write(this.iCurrentScreenNum, 9);
os.write(this.iCurrentScreenMin, 10);
os.write(this.iCurrentScreenMax, 11);
}
@Override
public void readFrom(TarsInputStream is) {
this.iMarqueeScopeMin = is.read(this.iMarqueeScopeMin, 1, true);
this.iMarqueeScopeMax = is.read(this.iMarqueeScopeMax, 2, true);
this.iCurrentVideoNum = is.read(this.iCurrentVideoNum, 3, true);
this.iCurrentVideoMin = is.read(this.iCurrentVideoMin, 4, true);
this.iCurrentVideoMax = is.read(this.iCurrentVideoMax, 5, true);
this.iAllVideoNum = is.read(this.iAllVideoNum, 6, true);
this.iAllVideoMin = is.read(this.iAllVideoMin, 7, true);
this.iAllVideoMax = is.read(this.iAllVideoMax, 8, true);
this.iCurrentScreenNum = is.read(this.iCurrentScreenNum, 9, true);
this.iCurrentScreenMin = is.read(this.iCurrentScreenMin, 10, true);
this.iCurrentScreenMax = is.read(this.iCurrentScreenMax, 11, true);
}
@Override
public TarsStructBase newInit() {
return this;
}
}

View File

@@ -1,67 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.huya.msg.dto;
import cn.hutool.core.collection.CollUtil;
import com.qq.tars.protocol.tars.TarsInputStream;
import com.qq.tars.protocol.tars.TarsOutputStream;
import com.qq.tars.protocol.tars.TarsStructBase;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.util.List;
/**
* @author mjz
* @date 2023/10/10
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class FaithInfo extends TarsStructBase {
private String sFaithName = "";
private List<FaithPresenter> vPresenter = CollUtil.newArrayList(new FaithPresenter());
@Override
public void writeTo(TarsOutputStream os) {
os.write(this.sFaithName, 0);
os.write(this.vPresenter, 1);
}
@Override
public void readFrom(TarsInputStream is) {
this.sFaithName = is.read(this.sFaithName, 0, false);
this.vPresenter = is.readArray(this.vPresenter, 1, false);
}
@Override
public TarsStructBase newInit() {
return this;
}
}

View File

@@ -1,64 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.huya.msg.dto;
import com.qq.tars.protocol.tars.TarsInputStream;
import com.qq.tars.protocol.tars.TarsOutputStream;
import com.qq.tars.protocol.tars.TarsStructBase;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
/**
* @author mjz
* @date 2023/10/10
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class FaithPresenter extends TarsStructBase {
private long lPid;
private String sLogo = "";
@Override
public void writeTo(TarsOutputStream os) {
os.write(this.lPid, 0);
os.write(this.sLogo, 1);
}
@Override
public void readFrom(TarsInputStream is) {
this.lPid = is.read(this.lPid, 0, false);
this.sLogo = is.read(this.sLogo, 1, false);
}
@Override
public TarsStructBase newInit() {
return this;
}
}

View File

@@ -1,94 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.huya.msg.dto;
import com.qq.tars.protocol.tars.TarsInputStream;
import com.qq.tars.protocol.tars.TarsOutputStream;
import com.qq.tars.protocol.tars.TarsStructBase;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
/**
* @author mjz
* @date 2023/12/27
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class GuardInfo extends TarsStructBase {
private long lUid;
private long lPid;
private int iGuardLevel;
private long lEndTime;
private String sAttr = "";
private String sIcon = "";
private int iGuardType;
private long lStartTime;
private long lCommemorateDay;
private int iAccompanyDay;
private String sNewAttr = "";
private String sEnterText = "";
@Override
public void writeTo(TarsOutputStream os) {
os.write(this.lUid, 0);
os.write(this.lPid, 1);
os.write(this.iGuardLevel, 2);
os.write(this.lEndTime, 3);
os.write(this.sAttr, 4);
os.write(this.sIcon, 5);
os.write(this.iGuardType, 6);
os.write(this.lStartTime, 7);
os.write(this.lCommemorateDay, 8);
os.write(this.iAccompanyDay, 9);
os.write(this.sNewAttr, 10);
os.write(this.sEnterText, 11);
}
@Override
public void readFrom(TarsInputStream is) {
this.lUid = is.read(this.lUid, 0, false);
this.lPid = is.read(this.lPid, 1, false);
this.iGuardLevel = is.read(this.iGuardLevel, 2, false);
this.lEndTime = is.read(this.lEndTime, 3, false);
this.sAttr = is.read(this.sAttr, 4, false);
this.sIcon = is.read(this.sIcon, 5, false);
this.iGuardType = is.read(this.iGuardType, 6, false);
this.lStartTime = is.read(this.lStartTime, 7, false);
this.lCommemorateDay = is.read(this.lCommemorateDay, 8, false);
this.iAccompanyDay = is.read(this.iAccompanyDay, 9, false);
this.sNewAttr = is.read(this.sNewAttr, 10, false);
this.sEnterText = is.read(this.sEnterText, 11, false);
}
@Override
public TarsStructBase newInit() {
return this;
}
}

View File

@@ -1,70 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.huya.msg.dto;
import com.qq.tars.protocol.tars.TarsInputStream;
import com.qq.tars.protocol.tars.TarsOutputStream;
import com.qq.tars.protocol.tars.TarsStructBase;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
/**
* @author mjz
* @date 2023/10/10
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class ItemEffectInfo extends TarsStructBase {
private int iPriceLevel;
private int iStreamDuration;
private int iShowType;
private int iStreamId;
@Override
public void writeTo(TarsOutputStream os) {
os.write(this.iPriceLevel, 0);
os.write(this.iStreamDuration, 1);
os.write(this.iShowType, 2);
os.write(this.iStreamId, 3);
}
@Override
public void readFrom(TarsInputStream is) {
this.iPriceLevel = is.read(this.iPriceLevel, 0, false);
this.iStreamDuration = is.read(this.iStreamDuration, 1, false);
this.iShowType = is.read(this.iShowType, 2, false);
this.iStreamId = is.read(this.iStreamId, 3, false);
}
@Override
public TarsStructBase newInit() {
return this;
}
}

View File

@@ -1,73 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.huya.msg.dto;
import com.qq.tars.protocol.tars.TarsInputStream;
import com.qq.tars.protocol.tars.TarsOutputStream;
import com.qq.tars.protocol.tars.TarsStructBase;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
/**
* @author mjz
* @date 2023/10/5
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class LiveAppUAEx extends TarsStructBase {
private String sIMEI = "";
private String sAPN = "";
private String sNetType = "";
private String sDeviceId = "";
private String sMId = "";
@Override
public void writeTo(TarsOutputStream os) {
os.write(this.sIMEI, 1);
os.write(this.sAPN, 2);
os.write(this.sNetType, 3);
os.write(this.sDeviceId, 4);
os.write(this.sMId, 5);
}
@Override
public void readFrom(TarsInputStream is) {
this.sIMEI = is.read(this.sIMEI, 1, false);
this.sAPN = is.read(this.sAPN, 2, false);
this.sNetType = is.read(this.sNetType, 3, false);
this.sDeviceId = is.read(this.sDeviceId, 4, false);
this.sMId = is.read(this.sMId, 5, false);
}
@Override
public TarsStructBase newInit() {
return this;
}
}

Some files were not shown because too many files have changed in this diff Show More