How can i use the blockly event to implement multiplayer cooperation! - blockly

I've read the blockly's doc, i know that i can get the blockly event by
addChangeListener(event)
removeChangeListener(event)
these two functions. So i can get many types of blockly events, but how can i use these events to create a block.
So the situation is that client A get the block events from the server, A need to use these events to create a block.
So how to do this? Anyone know it?

personally, i've found this link to learn some thing abour the Blockly Realtime Collaboration: https://github.com/google/blockly-samples/tree/master/examples/blockly-rtc
this may be helpful, and i will update it if i find something more useful.

Related

How to decide what to name a stream in Rails Event Store

This is a bit of a newb question but I struggle with how to decide what a stream should be called and I can't seem to find documentation on how to go about it.
For instance, a lot of the examples in the documentation just have "Customer$1", "Customer$2", etc. I'm presuming Customer is the resource here and the integer is the customer ID?
For my use case, I have UnitAllocated and UnitDeallocated events happening for multiple different Operators. Ideally, I want to have a stream of unit allocations and unit deallocations for a given operator.
Should I embed the operator ID in the stream name as an easy way to tap into multiple stream for the same operator? Or is this the wrong way to go about this?

Can I set an order for the Event Handlers in Office.JS?

I am reacting to both types of events onSelectionChanged and BindingSelectionChanged in Excel, and I actually need onSelectionChanged to be resolved before BindingSelectionChanged. Is this possible, or what would be a workaround? I am using an offset now, so onSelectionChanged only does its job if is is >200ms after the timestamp set by BindingSelectionChanged. This works in practice, but is not perfect (there is no garantee that that time difference is always OK).
Unfortunately currently Excel JS event order isn't guaranteed and couldn't be enforced. You may go to Microsoft 365 Developer Platform Ideas Forum and see if this feature has already been requested or request a new feature.
Regarding your scenario, could you explain the purpose of using two onSelectionChanged events together? One workaround might be using just one of them and check if additional criteria are satisfied.

How to use message data outside the message event?

client.on('message ',function(message){
console.log(message)
});
In the above asynchronous code how do i use the message data outside the message event??
In general, you don't use it outside that callback. You put whatever code wants to use the message in that callback or in a function that you call from that callback.
Because client.on('message', ...) is event driven, you don't know when it's going to happen. So, if you store the data somewhere else and expect some future code to use it, there's no way for the rest of your code to know the data is now there and valid.
So, whatever code wants that message needs to be put inside this callback or inside a function you call from this callback. The usual model is that you process the data live in this callback when it arrives or you call some function to "push" the data to some other function so it can process the data.
There are certain (generally rare) circumstances where you collect the data and some future event will then process the data, but I'm guessing that's not what you're doing here. If it is, then you would just add this data to some collection that is part of some higher scope.
If you gave us more specifics on your real-world problem, we could be a lot more specific with suggestions for how to solve that particular problem. As your question is written now it's a generic question with no specific details so all we can do is offer a generic answer with no specific suggestions or details.
Since it looks like you're new here, new people here often tend to think they should write their question in a generic fashion with code they made up (pseudo code). That's usually a bad choice. If you show us your real problem and your real code, we can offer you in-depth specific solutions and code for your exact problem and we can offer you solutions or suggestions you didn't even know to ask about. You will get better answers if you show your real code with your real problem, not a generic version you made up just for stackoverflow.

Backbone.js: form fields are not being sent in the request

Please forgive the newb question, but I am not finding answers elsewhere... probably because I'm not sure what the question should really be.
I am VERY new to Backbone.js, and I am trying to figure out why changes in the page's form fields are not being sent in POST/PUT requests. The 'change' event IS firing, and the View is catching it, but the model does not have the fields it should have from the form. I haven't been able to find anything that deals with this, so I am fairly certain we have just done something very wrong in our app... but I don't know how to figure out what that might be.
I realize this is not the most complete question, so please let me know if more info is required. I am so new to this that I am not even sure what one might need to track this down.
Any help at all would be greatly appreciated. Thank you in advance,
vegtabill
With backbone.js, there is more than one way to do something. I personally update my model with the data from the view and then json serialize that data for transmission to the server side if I'm not using the REST capabilities build into backbone collections of models (i.e. the fetch, save, etc.) You can use the model.set() method to do this. I am fairly new to backbone too so please don't slam me if you take offense to my approach. I know there are others out there that know a lot more about this topic than me. This approach works for me and it enforces my personal goal of the model not having a reference to the view. That separation is important to me personally. To be more explicit, I listen for events on my view that I then use to update my model.

Is there a way to get download all the statistics on events at once from Flurry?

We are bumping into limitations with Flurry. We use events and parameters to track some game play info (like number of KO/map) but 1/ the limit of 15 parameters per event is a problem and 2/ the visualisation is not good (for instance Ko/map is shown by map so we have to open each event one after another).
We are trying to build a better visualisation with excel using the CSV files provided by Flurry, but then again we need to download the 50+ CSV files and it's really not convenient.
Is there a way to get all the information in one CSV or to get the information another way?
As a side note Flurry support is not answering any of our emails. :(
thanks for your help!
Have you tried checking out playtomic instead. Sounds like it might match your problem better.
They have an API to access your data. So you should be able to access it realtime.
You might also want to check out www.parse.com

Resources