Event System

Library
dicta updated 2y ago 0 MB engine 10
Event System

About Event System


public partial class MyClass
{
    public MyClass(){
        EventSystem.EventCommand.RegisterServerEvent<int, string>( "server:test_event", this.EventTest2 );
        EventSystem.EventCommand.RegisterGameEvent<int, string>( "game:test_event", this.EventTest );
    }

    public void EventTest(IClient client,int arg1, string arg2)
	{
		Log.Info( "eventExecuted" );
		Log.Info( arg1 );
		Log.Info( arg2 );
		//Call Server event with TriggerServerEvent
		EventSystem.EventCommand.TriggerServerEvent( "server:test_event", 1, "uno" );
	}


	public void EventTest2( IClient client, int arg1, string arg2 )
	{
		Log.Info( "eventExecuted" );
		Log.Info( arg1 );
		Log.Info( arg2 );
	}

}

//call Client Event with TriggerClientEvent
EventSystem.EventCommand.TriggerClientEvent( client, "game:test_event", 1,"uno");

You can put up to 6 arguments, I'm working on a version with websockets not necessarily useful but can be good for certain things.

You can declare your event on methods that are not static.

No usage statistics available
This package may be new or not widely used yet. Usage data becomes available as more users install and play with the package.
0 recorded entries
Rank Player Score Recorded
refresh
Discovering package leaderboards...
Package ID: dicta.event_system
Created: 2023-07-29 04:26 UTC
Updated: 2023-11-09 10:40 UTC
Type: library
Public: Yes
Version: 43141
files: 3
Size: 0.0 MB
Engine Version: 10
Asset Version ID: 43141
Version Created: 2023-11-09 10:40 UTC
Hash: -3477093424955541720
Manifest: Open manifest

more_horiz Additional Properties

Project Template:
new_releases Latest Update Nov 9, 2023
Changes on 2023-11-09
43141 Nov 9, 2023
Changes on 2023-11-09
29843 Aug 2, 2023
add Event system with command, websocket wip
28347 Jul 29, 2023
Event System wip
info Live API Passthrough & Removal Notice

This file manifest and asset metadata are retrieved live directly from the official Facepunch s&box public API. s&box Explorer does not host, store, or redistribute any package files. All download links route directly to Facepunch CDN servers.