mirror of
https://github.com/clockworklabs/SpacetimeDB.git
synced 2026-05-14 11:48:28 -04:00
5e4b3bf490
* One-off query support (#49) * SpacetimeDBURI argument in place of host and ssl enabled bool (#52) * SpacetimeDBURI argument in place of host and ssl enabled bool * Small cleanup --------- Co-authored-by: John Detter <no-reply@boppygames.gg> * Add support for client address; re-run `spacetime generate` for quickstart client (#54) * README.md and License.txt updates (#53) * Update README.md * Add license.txt * Rename * Add LICENSE.txt with proper case --------- Co-authored-by: Derek Brinkmann <dbrinkmann@clockworklabs.io> * Add support for client address; re-run `spacetime generate` for quickstart client Re: https://github.com/clockworklabs/SpacetimeDB/pull/299 --------- Co-authored-by: dbrinkmanncw <109690865+dbrinkmanncw@users.noreply.github.com> Co-authored-by: Derek Brinkmann <dbrinkmann@clockworklabs.io> * Making Quickstart Work Again (#57) * Packaged nuget package, quickstart is now working again * Reset DBNAME --------- Co-authored-by: John Detter <no-reply@boppygames.gg> * OnUnhandledReducerError (#31) Co-authored-by: Steve <steve@codefics.com> Co-authored-by: Boppy <no-reply@boppygames.gg> --------- Co-authored-by: james gilles <jameshgilles@gmail.com> Co-authored-by: dbrinkmanncw <109690865+dbrinkmanncw@users.noreply.github.com> Co-authored-by: John Detter <no-reply@boppygames.gg> Co-authored-by: Phoebe Goldman <phoebe@goldman-tribe.org> Co-authored-by: Derek Brinkmann <dbrinkmann@clockworklabs.io> Co-authored-by: SteveBoytsun <100594800+SteveBoytsun@users.noreply.github.com> Co-authored-by: Steve <steve@codefics.com>
68 lines
1.6 KiB
C#
68 lines
1.6 KiB
C#
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
|
// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD.
|
|
|
|
using System;
|
|
using ClientApi;
|
|
using Newtonsoft.Json.Linq;
|
|
using SpacetimeDB;
|
|
|
|
namespace SpacetimeDB.Types
|
|
{
|
|
public enum ReducerType
|
|
{
|
|
None,
|
|
SendMessage,
|
|
SetName,
|
|
}
|
|
|
|
public partial class ReducerEvent : ReducerEventBase
|
|
{
|
|
public ReducerType Reducer { get; private set; }
|
|
|
|
public ReducerEvent(ReducerType reducer, string reducerName, ulong timestamp, SpacetimeDB.Identity identity, SpacetimeDB.Address? callerAddress, string errMessage, ClientApi.Event.Types.Status status, object args)
|
|
: base(reducerName, timestamp, identity, callerAddress, errMessage, status, args)
|
|
{
|
|
Reducer = reducer;
|
|
}
|
|
|
|
public SendMessageArgsStruct SendMessageArgs
|
|
{
|
|
get
|
|
{
|
|
if (Reducer != ReducerType.SendMessage) throw new SpacetimeDB.ReducerMismatchException(Reducer.ToString(), "SendMessage");
|
|
return (SendMessageArgsStruct)Args;
|
|
}
|
|
}
|
|
public SetNameArgsStruct SetNameArgs
|
|
{
|
|
get
|
|
{
|
|
if (Reducer != ReducerType.SetName) throw new SpacetimeDB.ReducerMismatchException(Reducer.ToString(), "SetName");
|
|
return (SetNameArgsStruct)Args;
|
|
}
|
|
}
|
|
|
|
public object[] GetArgsAsObjectArray()
|
|
{
|
|
switch (Reducer)
|
|
{
|
|
case ReducerType.SendMessage:
|
|
{
|
|
var args = SendMessageArgs;
|
|
return new object[] {
|
|
args.Text,
|
|
};
|
|
}
|
|
case ReducerType.SetName:
|
|
{
|
|
var args = SetNameArgs;
|
|
return new object[] {
|
|
args.Name,
|
|
};
|
|
}
|
|
default: throw new System.Exception($"Unhandled reducer case: {Reducer}. Please run SpacetimeDB code generator");
|
|
}
|
|
}
|
|
}
|
|
}
|