Error Callback
The enum information and error callback method that may occur when using the chat.
Callback method
// Called when an error occurs while using chat.
public void OnError(ERROR_MESSAGE error, object param)
{
string message = error.ToString();
switch (error)
{
case ERROR_MESSAGE.CHAT_BAN:
{
ErrorMessageChatBanParam chatBanParam = param as ErrorMessageChatBanParam;
if (chatBanParam == null) return;
var banTime = System.DateTime.Now.AddSeconds(chatBanParam.RemainSeconds);
message = $"{error}: banned until {banTime:yyyy-MM-dd HH:mm:ss}";
}
break;
case ERROR_MESSAGE.CHANNEL_FULL:
case ERROR_MESSAGE.INVALID_PASSWORD:
case ERROR_MESSAGE.ALREADY_CREATED_CHANNEL:
case ERROR_MESSAGE.CHANNEL_GROUP_TOO_SHORT:
case ERROR_MESSAGE.CHANNEL_GROUP_TOO_LONG:
case ERROR_MESSAGE.CHANNEL_NAME_TOO_SHORT:
case ERROR_MESSAGE.CHANNEL_NAME_TOO_LONG:
case ERROR_MESSAGE.DUPLICATE_CHANNEL_GROUP:
case ERROR_MESSAGE.PASSWORD_TOO_LONG:
case ERROR_MESSAGE.CHANNEL_GROUP_FILTERED:
case ERROR_MESSAGE.CHANNEL_NAME_FILTERED:
{
ErrorMessageChannelParam channelParam = param as ErrorMessageChannelParam;
if (channelParam == null) return;
message = $"{error}: {channelParam.ChannelGroup} / {channelParam.ChannelName} / {channelParam.ChannelNumber}";
}
break;
default:
break;
}
UnityEngine.Debug.Log(message);
}
ErrorCode(enum)
| Value | Description | Param |
|---|---|---|
| UNKNOWN_ERROR | An unknown server error code was received. | NULL |
| NOT_AUTHENTICATION | This user is unauthenticated. | NULL |
| CHAT_SERVER_FULL | The chat server is full. | NULL |
| WHISPER_OFFLINE | The recipient of the whisper is offline. | NULL |
| TOO_MANY_REPORT | You exceeded the daily report limit. | NULL |
| NOT_MY_REPORT | You cannot report yourself. | NULL |
| INVALID_PARAMETER | You entered a wrong parameter value. | NULL |
| CHAT_BAN | You are currently banned from chat. | ErrorMessageChatBanParam |
| DISABLED_CHANNEL | The channel is not enabled. | NULL |
| MESSAGE_TOO_LONG | The chat message is too long. | NULL |
| MESSAGE_TOO_SHORT | The chat message is too short. | NULL |
| MESSAGE_FILTERED | The chat message has been filtered. | NULL |
| MESSAGE_SPAM | The chat message has been blocked due to spamming. | NULL |
| NOT_NICKNAME | Nickname is not set. | NULL |
| DISABLED_SERVICE | The service (whisper, guild chat, etc.) is not enabled. | NULL |
| CHANNEL_FULL | The channel is full. | ErrorMessageChannelParam |
| NOT_JOIN_CHANNEL | You are not in this channel. | NULL |
| ALREADY_CREATED_CHANNEL | The channel has already been created. (when creating a channel) | ErrorMessageChannelParam |
| DUPLICATE_CHANNEL_GROUP | The channel group already exists. (when creating a channel) | ErrorMessageChannelParam |
| CHANNEL_GROUP_TOO_LONG | The channel group is too long. (when creating a channel) | ErrorMessageChannelParam |
| CHANNEL_GROUP_TOO_SHORT | The channel group is too short. (when creating a channel) | ErrorMessageChannelParam |
| CHANNEL_GROUP_FILTERED | The channel group has been filtered. (when creating a channel) | ErrorMessageChannelParam |
| DUPLICATE_CHANNEL_NAME | The channel name already exists. (when creating a channel) | NULL |
| CHANNEL_NAME_TOO_LONG | The channel name is too long. (when creating a channel) | ErrorMessageChannelParam |
| CHANNEL_NAME_TOO_SHORT | The channel name is too short. (when creating a channel) | ErrorMessageChannelParam |
| CHANNEL_NAME_FILTERED | The channel name has been filtered. (when creating a channel) | ErrorMessageChannelParam |
| PASSWORD_TOO_LONG | The password is too long. (when creating a channel) | ErrorMessageChannelParam |
| INVALID_PASSWORD | The password you entered is incorrect. (when entering a channel) | ErrorMessageChannelParam |
| LIMIT_REPORT_MESSAGE_DAYS | This message cannot be reported because it is too old. | NULL |
| ALREADY_JOIN_CHANNEL | You are already in this channel. You cannot enter multiple open channels within the same channel group. | NULL |
| DUPLICATE_CONNECTION | Duplicate login occurred. | NULL |
| NOT_FOUND_BLOCK_URL | The URL for handling blocks between users has not been registered. (when using custom authentication) | NULL |
| FAILED_ADD_BLOCK_PLAYER | Failed to block user. | NULL |
| ALREADY_BLOCK_PLAYER | This user is already blocked. | NULL |
| FAILED_REMOVE_BLOCK_PLAYER | Failed to unblock user. | NULL |
| FAILED_UPDATE_AVATAR | Failed to update avatar. | NULL |
| FAILED_UPDATE_METADATA | Failed to update metadata. | NULL |
| FAILED_UPDATE_GAMER_NAME | Failed to change nickname. | NULL |
| FAILED_UPDATE_LANGUAGE | Failed to change language information. | NULL |
| NOT_BLOCK_USER_WHISPER | You cannot send whispers to a user you have blocked. | NULL |
| BLOCKED_RECIPIENT_WHISPER | You are blocked by the whisper request target. | NULL |
Param
public class ErrorMessageChatBanParam
{
// Time left until the chat ban is lifted (seconds)
public UInt64 RemainSeconds = 0;
}
public class ErrorMessageChannelParam
{
// Channel group
public string ChannelGroup = string.Empty;
// Channel name
public string ChannelName = string.Empty;
// Channel number
public UInt64 ChannelNumber = 0;
}