forked from Jackiu1997/pure_live
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
liuchuancong
committed
Dec 3, 2024
1 parent
174d6b3
commit 320ec8c
Showing
10 changed files
with
296 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import 'package:tars_dart/tars/codec/tars_struct.dart'; | ||
import 'package:tars_dart/tars/codec/tars_displayer.dart'; | ||
import 'package:tars_dart/tars/codec/tars_input_stream.dart'; | ||
import 'package:tars_dart/tars/codec/tars_output_stream.dart'; | ||
// ignore_for_file: no_leading_underscores_for_local_identifiers | ||
|
||
class GetCdnTokenReq extends TarsStruct { | ||
String url = ""; | ||
|
||
String cdnType = ""; | ||
|
||
String streamName = ""; | ||
|
||
int presenterUid = 0; | ||
|
||
@override | ||
void readFrom(TarsInputStream _is) { | ||
url = _is.read(url, 0, false); | ||
cdnType = _is.read(cdnType, 1, false); | ||
streamName = _is.read(streamName, 2, false); | ||
presenterUid = _is.read(presenterUid, 3, false); | ||
} | ||
|
||
@override | ||
void writeTo(TarsOutputStream _os) { | ||
_os.write(url, 0); | ||
_os.write(cdnType, 1); | ||
_os.write(streamName, 2); | ||
_os.write(presenterUid, 3); | ||
} | ||
|
||
@override | ||
Object deepCopy() { | ||
return GetCdnTokenReq() | ||
..url = url | ||
..cdnType = cdnType | ||
..streamName = streamName | ||
..presenterUid = presenterUid; | ||
} | ||
|
||
@override | ||
void displayAsString(StringBuffer sb, int level) { | ||
TarsDisplayer _ds = TarsDisplayer(sb, level: level); | ||
_ds.DisplayString(url, "url"); | ||
_ds.DisplayString(cdnType, "cdnType"); | ||
_ds.DisplayString(streamName, "streamName"); | ||
_ds.DisplayInt(presenterUid, "presenterUid"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import 'package:tars_dart/tars/codec/tars_struct.dart'; | ||
import 'package:tars_dart/tars/codec/tars_displayer.dart'; | ||
import 'package:tars_dart/tars/codec/tars_input_stream.dart'; | ||
import 'package:tars_dart/tars/codec/tars_output_stream.dart'; | ||
// ignore_for_file: no_leading_underscores_for_local_identifiers | ||
|
||
class GetCdnTokenResp extends TarsStruct { | ||
String url = ""; | ||
|
||
String cdnType = ""; | ||
|
||
String streamName = ""; | ||
|
||
int presenterUid = 0; | ||
|
||
String antiCode = ""; | ||
|
||
String sTime = ""; | ||
|
||
String flvAntiCode = ""; | ||
|
||
String hlsAntiCode = ""; | ||
|
||
@override | ||
void readFrom(TarsInputStream _is) { | ||
url = _is.read(url, 0, false); | ||
cdnType = _is.read(cdnType, 1, false); | ||
streamName = _is.read(streamName, 2, false); | ||
presenterUid = _is.read(presenterUid, 3, false); | ||
antiCode = _is.read(antiCode, 4, false); | ||
sTime = _is.read(sTime, 5, false); | ||
flvAntiCode = _is.read(flvAntiCode, 6, false); | ||
hlsAntiCode = _is.read(hlsAntiCode, 7, false); | ||
} | ||
|
||
@override | ||
void writeTo(TarsOutputStream _os) { | ||
_os.write(url, 0); | ||
_os.write(cdnType, 1); | ||
_os.write(streamName, 2); | ||
_os.write(presenterUid, 3); | ||
_os.write(antiCode, 4); | ||
_os.write(sTime, 5); | ||
_os.write(flvAntiCode, 6); | ||
_os.write(hlsAntiCode, 7); | ||
} | ||
|
||
@override | ||
Object deepCopy() { | ||
return GetCdnTokenResp() | ||
..url = url | ||
..cdnType = cdnType | ||
..streamName = streamName | ||
..presenterUid = presenterUid | ||
..antiCode = antiCode | ||
..sTime = sTime | ||
..flvAntiCode = flvAntiCode | ||
..hlsAntiCode = hlsAntiCode; | ||
} | ||
|
||
@override | ||
void displayAsString(StringBuffer sb, int level) { | ||
TarsDisplayer _ds = TarsDisplayer(sb, level: level); | ||
_ds.DisplayString(url, "url"); | ||
_ds.DisplayString(cdnType, "cdnType"); | ||
_ds.DisplayString(streamName, "streamName"); | ||
_ds.DisplayInt(presenterUid, "presenterUid"); | ||
_ds.DisplayString(antiCode, "antiCode"); | ||
_ds.DisplayString(sTime, "sTime"); | ||
_ds.DisplayString(flvAntiCode, "flvAntiCode"); | ||
_ds.DisplayString(hlsAntiCode, "hlsAntiCode"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
import 'package:tars_dart/tars/codec/tars_struct.dart'; | ||
import 'package:tars_dart/tars/codec/tars_input_stream.dart'; | ||
import 'package:tars_dart/tars/codec/tars_output_stream.dart'; | ||
// ignore_for_file: no_leading_underscores_for_local_identifiers | ||
|
||
class HYPushMessage extends TarsStruct { | ||
int pushType = 0; | ||
int uri = 0; | ||
List<int> msg = <int>[]; | ||
int protocolType = 0; | ||
|
||
@override | ||
void readFrom(TarsInputStream _is) { | ||
pushType = _is.read(pushType, 0, false); | ||
uri = _is.read(uri, 1, false); | ||
msg = _is.readBytes(2, false); | ||
protocolType = _is.read(protocolType, 3, false); | ||
} | ||
|
||
@override | ||
void writeTo(TarsOutputStream _os) {} | ||
|
||
@override | ||
Object deepCopy() { | ||
return HYPushMessage() | ||
..pushType = pushType | ||
..uri = uri | ||
..msg = List<int>.from(msg) | ||
..protocolType = protocolType; | ||
} | ||
|
||
@override | ||
void displayAsString(StringBuffer sb, int level) {} | ||
} | ||
|
||
class HYSender extends TarsStruct { | ||
int uid = 0; | ||
int lMid = 0; | ||
String nickName = ""; | ||
int gender = 0; | ||
|
||
@override | ||
void readFrom(TarsInputStream _is) { | ||
uid = _is.read(uid, 0, false); | ||
lMid = _is.read(lMid, 0, false); | ||
nickName = _is.read(nickName, 2, false); | ||
gender = _is.read(gender, 3, false); | ||
} | ||
|
||
@override | ||
void writeTo(TarsOutputStream _os) {} | ||
|
||
@override | ||
Object deepCopy() { | ||
return HYSender() | ||
..uid = uid | ||
..lMid = lMid | ||
..nickName = nickName | ||
..gender = gender; | ||
} | ||
|
||
@override | ||
void displayAsString(StringBuffer sb, int level) {} | ||
} | ||
|
||
class HYMessage extends TarsStruct { | ||
HYSender userInfo = HYSender(); | ||
String content = ""; | ||
HYBulletFormat bulletFormat = HYBulletFormat(); | ||
|
||
@override | ||
void readFrom(TarsInputStream _is) { | ||
userInfo = _is.readTarsStruct(userInfo, 0, false) as HYSender; | ||
content = _is.read(content, 3, false); | ||
bulletFormat = _is.readTarsStruct(bulletFormat, 6, false) as HYBulletFormat; | ||
} | ||
|
||
@override | ||
void writeTo(TarsOutputStream _os) {} | ||
|
||
@override | ||
Object deepCopy() { | ||
return HYMessage() | ||
..userInfo = userInfo.deepCopy() as HYSender | ||
..content = content | ||
..bulletFormat = bulletFormat.deepCopy() as HYBulletFormat; | ||
} | ||
|
||
@override | ||
void displayAsString(StringBuffer sb, int level) {} | ||
} | ||
|
||
class HYBulletFormat extends TarsStruct { | ||
int fontColor = 0; | ||
int fontSize = 4; | ||
int textSpeed = 0; | ||
int transitionType = 1; | ||
|
||
@override | ||
void readFrom(TarsInputStream _is) { | ||
fontColor = _is.read(fontColor, 0, false); | ||
fontSize = _is.read(fontSize, 1, false); | ||
textSpeed = _is.read(textSpeed, 2, false); | ||
transitionType = _is.read(transitionType, 3, false); | ||
} | ||
|
||
@override | ||
void writeTo(TarsOutputStream _os) {} | ||
|
||
@override | ||
Object deepCopy() { | ||
return HYBulletFormat() | ||
..fontColor = fontColor | ||
..fontSize = fontSize | ||
..textSpeed = textSpeed | ||
..transitionType = transitionType; | ||
} | ||
|
||
@override | ||
void displayAsString(StringBuffer sb, int level) {} | ||
} |
Oops, something went wrong.