Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions vrchat_dart/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 5.0.0

- BREAKING: Websocket messages are the generated models from `vrchat_dart_generated` 1.23.0. `VrcStreamingEvent` and the hand-written streaming models are removed. `vrcEventStream` emits the model for each `type`, or `VrcStreamingError` for a pipeline error frame.
- Updates `vrchat_dart_generated` to 1.23.0

## 4.1.0

- Updates `vrchat_dart_generated` to 1.22.0
Expand Down
43 changes: 16 additions & 27 deletions vrchat_dart/example/bin/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -140,32 +140,21 @@ void main() async {
api.streaming.start();
}

void handleVrcEvent(VrcStreamingEvent event) {
final String message;
switch (event.type) {
case VrcStreamingEventType.error:
case VrcStreamingEventType.friendOnline:
case VrcStreamingEventType.friendOffline:
case VrcStreamingEventType.friendActive:
case VrcStreamingEventType.friendAdd:
case VrcStreamingEventType.friendDelete:
case VrcStreamingEventType.friendUpdate:
case VrcStreamingEventType.friendLocation:
case VrcStreamingEventType.userUpdate:
case VrcStreamingEventType.userLocation:
case VrcStreamingEventType.notificationReceived:
case VrcStreamingEventType.notificationResponse:
case VrcStreamingEventType.notificationHide:
message = '${event.type.name}: ${jsonEncode(event)}';
case VrcStreamingEventType.notificationSeen:
event as NotificationSeenEvent;
message = 'NotificationSeen: ${event.notificationId}';
case VrcStreamingEventType.notificationClear:
message = 'NotificationClear';
case VrcStreamingEventType.unknown:
event as UnknownEvent;
message = 'Unknown [VrcStreamingEvent] received: ${event.rawString}';
void handleVrcEvent(Object event) {
switch (event) {
case VrcStreamingError(:final message):
print('Websocket error: $message');
case WebsocketMessageUnknown(:final type):
print('Unknown websocket message: $type');
case WebsocketFriendOnline(:final userId, :final location):
print('Friend online: $userId at $location');
case WebsocketSeeNotification(:final content):
print('Notification seen: $content');
case WebsocketHideNotification(:final content):
print('Notification hidden: $content');
case WebsocketClearNotification():
print('Notifications cleared');
default:
print(event);
}

print(message);
}
21 changes: 0 additions & 21 deletions vrchat_dart/lib/src/model/streaming/serializers.dart

This file was deleted.

69 changes: 0 additions & 69 deletions vrchat_dart/lib/src/model/streaming/streamed_current_user.dart

This file was deleted.

51 changes: 0 additions & 51 deletions vrchat_dart/lib/src/model/streaming/streamed_current_user.g.dart

This file was deleted.

Loading
Loading