Contains several (more or less) useful static methods, mostly used for debugging.
More...
|
static List< MethodInfo > | GetMethods (Type type, Type attribute) |
|
static int | GetTickCount () |
| Gets the local machine's "milliseconds since start" value (precision is described in remarks). More...
|
|
static byte | StartBackgroundCalls (Func< bool > myThread, int millisecondsInterval=100, string taskName="") |
| Creates a background thread that calls the passed function in intervals, as long as that returns true. More...
|
|
static bool | StopBackgroundCalls (byte id) |
| Calls Abort on the thread with the given id (= index of the thread list) More...
|
|
static bool | StopAllBackgroundCalls () |
| Calls Abort on all threads that were started via StartBackgroundCalls. More...
|
|
static void | WriteStackTrace (System.Exception throwable, System.IO.TextWriter stream) |
| Writes the exception's stack trace to the received stream. More...
|
|
static void | WriteStackTrace (System.Exception throwable) |
| Writes the exception's stack trace to the received stream. Writes to: System.Diagnostics.Debug. More...
|
|
static string | DictionaryToString (IDictionary dictionary, bool includeTypes=true) |
| This method returns a string, representing the content of the given IDictionary. Returns "null" if parameter is null. More...
|
|
static string | DictionaryToString (NonAllocDictionary< byte, object > dictionary, bool includeTypes=true) |
|
static string | HashtableToString (Hashtable hash) |
|
static string | ByteArrayToString (byte[] list) |
| Converts a byte-array to string (useful as debugging output). Uses BitConverter.ToString(list) internally after a null-check of list. More...
|
|
static uint | CalculateCrc (byte[] buffer, int length) |
|
Contains several (more or less) useful static methods, mostly used for debugging.
◆ ByteArrayToString()
static string ExitGames.Client.Photon.SupportClass.ByteArrayToString |
( |
byte[] |
list | ) |
|
|
inlinestatic |
Converts a byte-array to string (useful as debugging output). Uses BitConverter.ToString(list) internally after a null-check of list.
- Parameters
-
list | Byte-array to convert to string. |
- Returns
- List of bytes as string.
◆ CalculateCrc()
static uint ExitGames.Client.Photon.SupportClass.CalculateCrc |
( |
byte[] |
buffer, |
|
|
int |
length |
|
) |
| |
|
inlinestatic |
◆ DictionaryToString() [1/2]
static string ExitGames.Client.Photon.SupportClass.DictionaryToString |
( |
IDictionary |
dictionary, |
|
|
bool |
includeTypes = true |
|
) |
| |
|
inlinestatic |
This method returns a string, representing the content of the given IDictionary. Returns "null" if parameter is null.
- Parameters
-
dictionary | IDictionary to return as string. |
includeTypes | |
◆ DictionaryToString() [2/2]
static string ExitGames.Client.Photon.SupportClass.DictionaryToString |
( |
NonAllocDictionary< byte, object > |
dictionary, |
|
|
bool |
includeTypes = true |
|
) |
| |
|
inlinestatic |
◆ GetMethods()
static List<MethodInfo> ExitGames.Client.Photon.SupportClass.GetMethods |
( |
Type |
type, |
|
|
Type |
attribute |
|
) |
| |
|
inlinestatic |
◆ GetTickCount()
static int ExitGames.Client.Photon.SupportClass.GetTickCount |
( |
| ) |
|
|
inlinestatic |
Gets the local machine's "milliseconds since start" value (precision is described in remarks).
This method uses Environment.TickCount (cheap but with only 16ms precision). PhotonPeer.LocalMsTimestampDelegate is available to set the delegate (unless already connected).
- Returns
- Fraction of the current time in Milliseconds (this is not a proper datetime timestamp).
◆ HashtableToString()
static string ExitGames.Client.Photon.SupportClass.HashtableToString |
( |
Hashtable |
hash | ) |
|
|
inlinestatic |
◆ IntegerMillisecondsDelegate()
delegate int ExitGames.Client.Photon.SupportClass.IntegerMillisecondsDelegate |
( |
| ) |
|
◆ StartBackgroundCalls()
static byte ExitGames.Client.Photon.SupportClass.StartBackgroundCalls |
( |
Func< bool > |
myThread, |
|
|
int |
millisecondsInterval = 100 , |
|
|
string |
taskName = "" |
|
) |
| |
|
inlinestatic |
Creates a background thread that calls the passed function in intervals, as long as that returns true.
With StopBackgroundCalls, you can stop threads started with this method. The resulting ThreadAbortException is caught and discarded.
- Parameters
-
myThread | The function to call. Must return true, if it should be called again. Returning false ends the thread. |
millisecondsInterval | Milliseconds to sleep between calls of myThread. Default: 100ms. |
taskName | An optional name for the task to help debugging. Null or empty won't set the thread.Name. |
◆ StopAllBackgroundCalls()
static bool ExitGames.Client.Photon.SupportClass.StopAllBackgroundCalls |
( |
| ) |
|
|
inlinestatic |
Calls Abort on all threads that were started via StartBackgroundCalls.
The resulting ThreadAbortException is caught and discarded.
- Returns
- True if any thread got aborted.
◆ StopBackgroundCalls()
static bool ExitGames.Client.Photon.SupportClass.StopBackgroundCalls |
( |
byte |
id | ) |
|
|
inlinestatic |
Calls Abort on the thread with the given id (= index of the thread list)
The resulting ThreadAbortException is caught and discarded.
- Parameters
-
id | The unique ID of the thread. |
- Returns
- True if the thread is canceled and false otherwise, e.g. if the thread with the given ID does not exist.
◆ WriteStackTrace() [1/2]
static void ExitGames.Client.Photon.SupportClass.WriteStackTrace |
( |
System.Exception |
throwable | ) |
|
|
inlinestatic |
Writes the exception's stack trace to the received stream. Writes to: System.Diagnostics.Debug.
- Parameters
-
throwable | Exception to obtain information from. |
◆ WriteStackTrace() [2/2]
static void ExitGames.Client.Photon.SupportClass.WriteStackTrace |
( |
System.Exception |
throwable, |
|
|
System.IO.TextWriter |
stream |
|
) |
| |
|
inlinestatic |
Writes the exception's stack trace to the received stream.
- Parameters
-
throwable | Exception to obtain information from. |
stream | Output sream used to write to. |
◆ IntegerMilliseconds
The documentation for this class was generated from the following file:
- D:/ExitGames/src/photon-sdk-dotnet-release-clean/PhotonDotNet/SupportClass.cs