mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
These methods arent used, they should be commented along with the other error generator parts. (#764)
* These methods arent used, they should be commented along with the other error generator parts. * Delete the comment
This commit is contained in:
parent
959be9338a
commit
9d064c8013
@ -416,48 +416,6 @@ static void OnError(int connectionId, Exception exception)
|
||||
Debug.LogException(exception);
|
||||
}
|
||||
|
||||
static void GenerateConnectError(byte error)
|
||||
{
|
||||
Debug.LogError("Mirror Server Connect Error: " + error);
|
||||
GenerateError(null, error);
|
||||
}
|
||||
|
||||
/* TODO use or remove
|
||||
static void GenerateDataError(NetworkConnection conn, byte error)
|
||||
{
|
||||
NetworkError dataError = (NetworkError)error;
|
||||
Debug.LogError("Mirror Server Data Error: " + dataError);
|
||||
GenerateError(conn, error);
|
||||
}
|
||||
|
||||
static void GenerateDisconnectError(NetworkConnection conn, byte error)
|
||||
{
|
||||
NetworkError disconnectError = (NetworkError)error;
|
||||
Debug.LogError("Mirror Server Disconnect Error: " + disconnectError + " conn:[" + conn + "]:" + conn.connectionId);
|
||||
GenerateError(conn, error);
|
||||
}
|
||||
*/
|
||||
|
||||
static void GenerateError(NetworkConnection conn, byte error)
|
||||
{
|
||||
int msgId = MessagePacker.GetId<ErrorMessage>();
|
||||
if (handlers.ContainsKey(msgId))
|
||||
{
|
||||
ErrorMessage msg = new ErrorMessage
|
||||
{
|
||||
value = error
|
||||
};
|
||||
|
||||
// write the message to a local buffer
|
||||
NetworkWriter writer = new NetworkWriter();
|
||||
msg.Serialize(writer);
|
||||
|
||||
// pass a reader (attached to local buffer) to handler
|
||||
NetworkReader reader = new NetworkReader(writer.ToArray());
|
||||
conn.InvokeHandler(msgId, reader);
|
||||
}
|
||||
}
|
||||
|
||||
[EditorBrowsable(EditorBrowsableState.Never), Obsolete("Use RegisterHandler<T> instead")]
|
||||
public static void RegisterHandler(int msgType, NetworkMessageDelegate handler)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user