protected void HandleClientReady(MessageHandler messageHandler) { var userName = messageHandler.ReadMessage <StringMessage>(); Log.Info(this, $"Handle message {nameof(HandleClientReady)}"); ClientReadyEvent?.Invoke(this, (messageHandler.connectionId, userName.value)); SetPlayerReady(messageHandler.connectionId, messageHandler.reader); }
protected void READY(dynamic data) { botUser = new SelfUser(); botUser.bot = Convert.ToBoolean(data.d.user.bot); botUser.username = Convert.ToString(data.d.user.username); botUser.ID = Convert.ToInt64(data.d.user.id); botUser.avatar = Convert.ToString(data.d.user.avatar); session_id = Convert.ToString(data.d.session_id); ConnectionStatus = Connection.EVERYTHING_IS_FINE; ClientReadyEvent?.Invoke(this, new ClientReadyEventArgs(botUser)); }