Beispiel #1
0
 public void UpdateMessagingChannel(MessagingChannel messagingChannel)
 {
     mEventProcessor.QueueEvent(new Action(() => {
         mMessagingChannel      = messagingChannel;
         txtMessagingTitle.text = GetDisplayMemberNames(messagingChannel.GetMembers());
     }));
 }
            private void InitUIComponents(View rootView)
            {
                mListView            = rootView.FindViewById(Resource.Id.list) as ListView;
                mListView.Adapter    = mAdapter;
                mListView.ItemClick += (sender, e) => {
                    MessagingChannel messagingChannel = mAdapter[e.Position];
                    if (OnMessagingChannelSelected != null)
                    {
                        OnMessagingChannelSelected(this, new MessagingChannelEventArgs(messagingChannel));
                    }
                };
                mListView.ItemLongClick += (sender, e) => {
                    MessagingChannel messagingChannel = mAdapter[e.Position];
                    var builder = new Android.App.AlertDialog.Builder(this.Activity);
                    builder.SetTitle("Leave");
                    builder.SetMessage("Do you want to leave this channel?");
                    builder.SetPositiveButton("Leave", (sender_child, e_child) => {
                        mAdapter.Remove(e.Position);
                        mAdapter.NotifyDataSetChanged();
                        SendBirdSDK.EndMessaging(messagingChannel.GetUrl());
                    });
                    builder.SetNeutralButton("Hide", (sender_child, e_child) => {
                        mAdapter.Remove(e.Position);
                        mAdapter.NotifyDataSetChanged();
                        SendBirdSDK.HideMessaging(messagingChannel.GetUrl());
                    });
                    builder.SetNegativeButton("Cancel", (EventHandler <DialogClickEventArgs>)null);

                    var dialog = builder.Create();
                    dialog.Show();
                };
            }
 public NotificationsListener(MessagingChannel channel)
 {
     _channel = channel;
     $"Created notifications listener".Log(channel.ChannelName);
     channel.OnMessage += ParseRawData;
     channel.OnError   += (err) => System.Console.WriteLine(err);
 }
Beispiel #4
0
        static void Main(string[] args)
        {
            WindowCreateInfo wci = new WindowCreateInfo
            {
                X            = 100,
                Y            = 100,
                WindowWidth  = 1280,
                WindowHeight = 720,
                WindowTitle  = "Tortuga Demo"
            };
            GraphicsDeviceOptions options = new GraphicsDeviceOptions(
                debug: false,
                swapchainDepthFormat: PixelFormat.R16_UNorm,
                syncToVerticalBlank: true,
                resourceBindingModel: ResourceBindingModel.Improved,
                preferDepthRangeZeroToOne: true,
                preferStandardClipSpaceYDirection: true);

#if DEBUG
            options.Debug = true;
#endif

            _editorMenu = new EditorMenu();

            Message <TransformMessageApplier>();
            Message <InputForceApplier>();
            Message <SimpleCameraMover>();
            Message <ClientEntityAssignmentApplier>();
            Message <VoxelSpaceMessageApplier>();
            Message <VoxelGridMessageApplier>();
            Message <VoxelGridChangeMessageApplier>();
            Message <EntityRemover>();
            Message <VoxelEditReceiver>();
            Message <VoxelSpaceLoadReciever>();
            Message <ComponentSyncMessageApplier <EntityMetaData> >();

            _messageTargetMap = new MessageTargetMap(_byType, _byNum);

            _clientMessagingChannel = new MessagingChannel(_messageTargetMap);
            _client          = new ClunkerClientApp(new ResourceLoader(), _messageTargetMap, _clientMessagingChannel);
            _client.Started += _client_Started;

            _server          = new ClunkerServerApp();
            _server.Started += _server_Started;

            var serverTask = _server.Start();
            _client.Start(wci, options).Wait();
        }
Beispiel #5
0
        private void UpdateMessagingChannel(MessagingChannel messagingChannel)
        {
            mMessagingChannel   = messagingChannel;
            mTxtChannelUrl.Text = GetDisplayMemberNames(messagingChannel.GetMembers());

            Dictionary <string, long> readStatus = new Dictionary <string, long> ();

            foreach (var member in messagingChannel.GetMembers())
            {
                long currentStatus = 0L;
                mSendBirdMessagingAdapter.mReadStatus.TryGetValue(member.GetId(), out currentStatus);
                readStatus.Add(member.GetId(), Math.Max(currentStatus, messagingChannel.GetLastReadMills(member.GetId())));
            }
            mSendBirdMessagingAdapter.ResetReadStatus(readStatus);
            mSendBirdMessagingAdapter.mMembers = messagingChannel.GetMembers();
        }
Beispiel #6
0
    public void OnQueryMessagingChannelList(List <MessagingChannel> messagingChannels, bool loadMore = false)
    {
        mEventProcessor.QueueEvent(new Action(() => {
            if (!loadMore)
            {
                foreach (UnityEngine.Object btnMessagingChannel in btnMessagingChannels)
                {
                    GameObject.Destroy(btnMessagingChannel);
                }
                btnMessagingChannels.Clear();
            }

            foreach (MessagingChannel messagingChannel in messagingChannels)
            {
                GameObject btnMessagingChannel = Instantiate(channelListItemPrefab) as GameObject;
                btnMessagingChannel.GetComponent <Image>().sprite = uiTheme.channelButtonOff;
                btnMessagingChannel.GetComponent <Image>().type   = Image.Type.Sliced;

                if (messagingChannel.GetUrl() == selectedChannelUrl)
                {
                    btnMessagingChannel.GetComponent <Image>().overrideSprite = uiTheme.channelButtonOn;
                    btnMessagingChannel.GetComponentInChildren <Text>().color = uiTheme.channelButtonOnColor;
                }
                else
                {
                    btnMessagingChannel.GetComponent <Image>().overrideSprite = null;
                    btnMessagingChannel.GetComponentInChildren <Text>().color = uiTheme.channelButtonOffColor;
                }

                Text text = btnMessagingChannel.GetComponentInChildren <Text> ();
                text.text = string.Format("{0} ({1})", GetDisplayMemberNames(messagingChannel.GetMembers()), messagingChannel.unreadMessageCount);

                btnMessagingChannel.transform.SetParent(messagingChannelListGridPanel.transform);
                btnMessagingChannel.transform.localScale = Vector3.one;
                btnMessagingChannels.Add(btnMessagingChannel);

                MessagingChannel finalMessagingChannel = messagingChannel;
                btnMessagingChannel.GetComponent <Button>().onClick.AddListener(() => {
                    mEventProcessor.QueueEvent(new Action(() => {
                        messagingChannelListPanel.SetActive(false);
                        messagingPanel.SetActive(true);
                        JoinMessaging(finalMessagingChannel.GetUrl());
                    }));
                });
            }
        }));
    }
        public static void SendAlertMessage(string subject, string body, string smsBody = null,
                                            MessagingChannel channel = MessagingChannel.EMAIL | MessagingChannel.CHAT)
        {
            try
            {
                body = string.Format("{0} at {1}", body, DateTime.Now.ToLongDateString() + " " + DateTime.Now.ToLongTimeString());

                if (channel.HasFlag(MessagingChannel.EMAIL))
                {
                    GmailSender.SendMail(_gUser, _mailTo, subject, body, false, 3);
                }

                //if (channel.HasFlag(MessagingChannel.CHAT))
                //    Gtalk.Send(_chatTo, subject + "-----" + body);
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
            }
        }
Beispiel #8
0
 public InputForceApplierInputSystem(MessagingChannel serverChannel, World world)
 {
     _serverChannel = serverChannel;
 }
 public ClunkerClientApp(ResourceLoader resourceLoader, MessageTargetMap messageTargetMap, MessagingChannel messagingChannel)
 {
     Resources = resourceLoader;
 }
 public SimpleCameraMoverInputSystem(MessagingChannel serverChannel, World world) : base(world)
 {
     _serverChannel = serverChannel;
 }
Beispiel #11
0
 public VoxelSpaceLoader(MessagingChannel serverChannel, World world)
 {
     _serverChannel    = serverChannel;
     _selectedEntities = world.GetEntities().With <SelectedEntityFlag>().AsSet();
     _cameraEntities   = world.GetEntities().With <Camera>().AsSet();
 }