Class OdinClient
Client Wrapper for ODIN ffi OdinNative.Core.OdinLibrary.NativeMethods
Assembly: cs.temp.dll.dll
Implements:
Odin.IDisposable
Properties
Rooms
A collection of all OdinNative.Wrapper.Room.Room
EndPoint
Connection EndPoint. Default from OdinEditorConfig.
AccessKey
Client AccessKey for all new rooms. Default from OdinHandler config.
UserData
Methods
Create(Uri)
Creates a new initialized instance for ODIN ffi C# Wrapper
Returns
OdinNative.Wrapper.OdinClient: OdinClient wrapper
Parameters
Type | Name | Description |
---|---|---|
Odin.Uri | server | Odin Server/Gateway |
Create(Uri, string)
Creates a new initialized instance for ODIN ffi C# Wrapper
Returns
OdinNative.Wrapper.OdinClient: OdinClient wrapper
Parameters
Type | Name | Description |
---|---|---|
Odin.Uri | server | Odin Server |
System.String | accessKey | Odin access key |
Create(Uri, string, OdinConnectionPoolSettings)
Creates a new initialized instance for ODIN ffi C# Wrapper
Returns
OdinNative.Wrapper.OdinClient: OdinClient wrapper
Parameters
Type | Name | Description |
---|---|---|
Odin.Uri | server | Odin Server |
System.String | accessKey | Odin access key |
Odin.NativeBindings.OdinConnectionPoolSettings | settings | Custom settings |
OnNativeDatagramReceived(ulong, ushort, IntPtr, uint, MarshalByRefObject)
Parameters
Type | Name |
---|---|
System.UInt64 | room_id |
System.UInt16 | media_id |
Odin.IntPtr | bytesPtr |
System.UInt32 | bytes_length |
Odin.MarshalByRefObject | user_data |
OnNativeRPCReceived(ulong, IntPtr, uint, MarshalByRefObject)
Parameters
Type | Name |
---|---|
System.UInt64 | room_id |
Odin.IntPtr | bytesPtr |
System.UInt32 | bytes_length |
Odin.MarshalByRefObject | user_data |
ReloadLibrary(bool)
Internal library reload
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | init | Idicates to initialize the library again after release |
CreateAccessKey()
Create a example access key that can be registered on 4Players (see https://developers.4players.io/odin/)
Returns
System.String
: access key string or empty### CreateToken(string, string)
Create a example token to join a room. For production use a token server!
Returns
System.String
: token string or empty
Parameters
Type | Name | Description |
---|---|---|
System.String | accesskey | Key to generate a token from |
System.String | body | token body |
GenerateToken(string, out string)
Create a example token to join a room. For production use a token server!
Returns
System.Boolean
: true on success or false
Parameters
Type | Name | Description |
---|---|---|
System.String | body | token body |
System.String | token | token string |
CreateRoom(uint, bool)
Create a room for the set gateway.
Returns
OdinNative.Wrapper.Room.Room: Room object with a connection
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | samplerate | room default samplerate fallback |
System.Boolean | stereo | room default stereo flag fallback |
JoinRoom(string, uint, bool, bool)
Create and join a OdinNative.Wrapper.Room.Room
Returns
OdinNative.Wrapper.Room.Room: room or null
Parameters
Type | Name | Description |
---|---|---|
System.String | token | token |
System.UInt32 | samplerate | |
System.Boolean | stereo | |
System.Boolean | handleRoom | true will add the room to OdinNative.Wrapper.Room.RoomCollection of the client |
JoinRoom(string, string, byte[], float, float, float, uint, bool, bool)
Create and join a OdinNative.Wrapper.Room.Room
Returns
OdinNative.Wrapper.Room.Room: room or null
Parameters
Type | Name | Description |
---|---|---|
System.String | token | token |
System.String | roomName | room alias |
System.Byte[] | userData | initial userdata |
System.Single | positionX | server culling position X |
System.Single | positionY | server culling position Y |
System.Single | positionZ | |
System.UInt32 | samplerate | |
System.Boolean | stereo | |
System.Boolean | handleRoom | true will add the room to OdinNative.Wrapper.Room.RoomCollection of the client |
Join(Room, string)
Join a object of base OdinNative.Wrapper.Room.Room
Returns
System.Boolean
Parameters
Type | Name | Description |
---|---|---|
OdinNative.Wrapper.Room.Room | room | base type OdinNative.Wrapper.Room.Room |
System.String | token |
Join(Room, string, string, byte[], float, float)
Join a object of base OdinNative.Wrapper.Room.Room
Returns
System.Boolean
: room or null
Parameters
Type | Name | Description |
---|---|---|
OdinNative.Wrapper.Room.Room | room | base type OdinNative.Wrapper.Room.Room |
System.String | token | token |
System.String | roomName | room alias |
System.Byte[] | userData | initial userdata |
System.Single | positionX | server culling position X |
System.Single | positionY | server culling position Y |
CloseRoom(ulong)
Close a room by Id
Returns
System.Boolean
: true on success or false
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | roomId | room id |
CloseRoom(Room)
Close a room
Returns
System.Boolean
: true on success or false
Parameters
Type | Name | Description |
---|---|---|
OdinNative.Wrapper.Room.Room | room | room to close |
FreeRoom(ulong)
Close and remove a room by Id
Returns
System.Boolean
: true on success or false
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | roomId | room id |
FreeRoom(Room)
Close and remove a room
Returns
System.Boolean
: true on success or false
Parameters
Type | Name |
---|---|
OdinNative.Wrapper.Room.Room | room |
BroadcastSendMessage(string)
Send a message to all rooms with the default encoding UTF8
Parameters
Type | Name | Description |
---|---|---|
System.String | message | UTF8 string |
CloseRooms()
Completely closes all OdinNative.Wrapper.Room.Room associated.
FreeRooms()
Free all OdinNative.Wrapper.Room.Room associated.
Dispose(bool)
On dispose will free all OdinNative.Wrapper.Room.Room and
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | Indicates to dispose the library |
~OdinClient()
Default deconstructor
Dispose()
On dispose will free all OdinNative.Wrapper.Room.Room and
Implements
Odin.IDisposable