(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
Readme: In the following pseudo code, [] indicates a subroutine. | |
Sometimes I choose to write the subroutine inline under the [] in order to maintain context. | |
One important fact about the way rollbacks are handled here is that we are storing state for every frame. | |
In any real implementation you only need to store one game state at a time. Storing a game | |
state for every frame allows us to only rollback to the first frame where the predicted inputs don't match the true ones. | |
==Constants== | |
MAX_ROLLBACK_FRAMES := Any Positive Integer # Specifies the maximum number of frames that can be resimulated | |
FRAME_ADVANTAGE_LIMIT := Any Positive Integer # Specifies the number of frames the local client can progress ahead of the remote client before time synchronizing. |
class MyService : StatefulService | |
{ | |
private Task<IReliableDictionary<int, string>> AccountNames => StateManager.GetOrAddAsync<IReliableDictionary<int, string>>("AccountNames"); | |
private Task<IReliableDictionary<int, string>> AccountData => StateManager.GetOrAddAsync<IReliableDictionary<int, string>>("AccountData"); | |
public async Task<List<Account>> SearchAccountsByNameAsync(string name) | |
{ | |
using (var txn = StateManager.CreateTransaction()) | |
{ | |
var accountNames = await AccountNames; |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
<#@ template debug="true" hostspecific="true" language="C#" #> | |
<#@ output extension=".d.ts" #> | |
<# /* Update this line to match your version of SignalR */ #> | |
<#@ assembly name="$(SolutionDir)\packages\Microsoft.AspNet.SignalR.Core.2.0.0\lib\net45\Microsoft.AspNet.SignalR.Core.dll" #> | |
<# /* Load the current project's DLL to make sure the DefaultHubManager can find things */ #> | |
<#@ assembly name="$(TargetPath)" #> | |
<#@ assembly name="System.Core" #> | |
<#@ assembly name="System.Web" #> | |
<#@ assembly name="System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" #> | |
<#@ assembly name="System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" #> |
using System.Runtime.CompilerServices; | |
using Microsoft.FxCop.Sdk; | |
namespace Tier3.FxCop.TaskRules | |
{ | |
public class NameTaskReturningMethodAppropriately : BaseIntrospectionRule | |
{ | |
public NameTaskReturningMethodAppropriately() : | |
base("NameTaskReturningMethodAppropriately", | |
"Tier3.FxCop.Rules", |
namespace SqlFiltersAndRules | |
{ | |
using System; | |
using Microsoft.ServiceBus; | |
using Microsoft.ServiceBus.Messaging; | |
class Program | |
{ | |
static void Main(string[] args) | |
{ |
using System; | |
using System.Reflection; | |
using CommonDomain; | |
using CommonDomain.Core; | |
using CommonDomain.Persistence; | |
using CommonDomain.Persistence.EventStore; | |
using EventStore; | |
using EventStore.Dispatcher; |