本文整理汇总了C#中StatusCode.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# StatusCode.ToString方法的具体用法?C# StatusCode.ToString怎么用?C# StatusCode.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StatusCode
的用法示例。
在下文中一共展示了StatusCode.ToString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnPeerStatusCallback
public void OnPeerStatusCallback(Game game, StatusCode returnCode)
{
switch (returnCode)
{
case StatusCode.Connect:
{
break;
}
case StatusCode.Disconnect:
case StatusCode.DisconnectByServer:
case StatusCode.DisconnectByServerLogic:
case StatusCode.DisconnectByServerUserLimit:
case StatusCode.TimeoutDisconnect:
{
game.SetDisconnected(returnCode);
break;
}
default:
{
game.DebugReturn(DebugLevel.ERROR, returnCode.ToString());
break;
}
}
}
示例2: OnStatusChanged
public void OnStatusChanged(StatusCode statusCode)
{
Debug.Log("OnStatusChanged:" + statusCode.ToString());
switch (statusCode)
{
case StatusCode.Connect:
stopwatch.Stop();
Debug.Log(string.Format("连线成功,耗时:{0}秒",stopwatch.Elapsed.TotalSeconds.ToString()));
stopwatch.Reset();
break;
case StatusCode.Disconnect:
Debug.Log("断线");
break;
case StatusCode.DisconnectByServerUserLimit:
Debug.Log("人数达上线");
break;
case StatusCode.ExceptionOnConnect:
Debug.Log("连线时意外错误");
break;
case StatusCode.DisconnectByServer:
Debug.Log("被Server强制断线");
break;
case StatusCode.TimeoutDisconnect:
Debug.Log("超时断线");
break;
case StatusCode.Exception:
case StatusCode.ExceptionOnReceive:
Debug.Log("其他例外");
break;
}
}
示例3: OnStatusChanged
public void OnStatusChanged(StatusCode statusCode)
{
Debug.Log (statusCode.ToString ());
switch (statusCode)
{
case StatusCode.Connect: // connect success
Debug.Log("connect success");
break;
case StatusCode.Disconnect: // disconnected
Debug.Log("disconnect from server");
break;
case StatusCode.DisconnectByServerUserLimit: // limit on connected user
Debug.Log ("room full");
break;
case StatusCode.ExceptionOnConnect: // error on connection
Debug.Log("connection error");
break;
case StatusCode.DisconnectByServer: // disconnected by server
Debug.Log("disconnect by server");
break;
case StatusCode.TimeoutDisconnect: // disconnected while timeout
Debug.Log("time out");
break;
case StatusCode.Exception: // other exception
case StatusCode.ExceptionOnReceive:
Debug.Log("unexpect error");
break;
}
}
示例4: GetStatusLine
private string GetStatusLine(StatusCode code)
{
// TODO: Create the response status line and return it
string statusLine = string.Empty;
statusLine = "HTTP/1.1 " + ((int)code).ToString() + " " + code.ToString() + "\r\n";
return statusLine;
}
示例5: OnStatusChanged
public void OnStatusChanged(StatusCode statusCode)
{
// connected to Photon Server
if (statusCode == StatusCode.Connect) {
connected = true;
}
// log status change
Debug.Log("Status change" + statusCode.ToString());
}
示例6: SendUpdate
private async void SendUpdate(string controller, StatusCode statusCode, string message)
{
JObject obj = new JObject(
new JProperty("controller", controller),
new JProperty("code", statusCode.ToString()),
new JProperty("message", message)
);
byte[] bytes = Encoding.UTF8.GetBytes(obj.ToString());
ArraySegment<byte> segment = new ArraySegment<byte>(bytes);
await Socket.SendAsync(segment, WebSocketMessageType.Text, true, CancellationToken.None);
}
示例7: OnStatusChanged
public void OnStatusChanged(StatusCode statusCode)
{
switch (statusCode)
{
// 连接成功
case StatusCode.Connect:
Utility.Log("Connect Success!");
break;
// 断线
case StatusCode.Disconnect:
// 服务器未开启
Utility.Log("Disconnect!");
break;
// 人数上线
case StatusCode.ExceptionOnConnect:
Utility.Log("超过Photon授权人数上线");
break;
// 服务器强制断开
case StatusCode.DisconnectByServer:
Utility.Log("服务器强制断开");
break;
// 超时断线
case StatusCode.TimeoutDisconnect:
Utility.Log("超时断线");
break;
// 其他原因
case StatusCode.Exception:
Utility.Log("Exception");
break;
// 收到异常处理
case StatusCode.ExceptionOnReceive:
// 服务器未开启
Utility.Log("ExceptionOnReceive");
break;
default:
Utility.Log(statusCode.ToString());
break;
}
}
示例8: OnStatusChanged
public void OnStatusChanged(StatusCode statusCode)
{
print(statusCode.ToString());
switch (statusCode)
{
case StatusCode.Connect:
Peer.EstablishEncryption();
break;
case StatusCode.Disconnect:
case StatusCode.DisconnectByServer:
case StatusCode.DisconnectByServerLogic:
case StatusCode.DisconnectByServerUserLimit:
case StatusCode.ExceptionOnConnect:
case StatusCode.TimeoutDisconnect:
Controller.OnDisconnect("" + statusCode);
State = new Disconnected(_instance);
break;
case StatusCode.EncryptionEstablished:
State = new Connected(_instance);
break;
default:
Controller.OnUnexpectedStatusCode(statusCode);
State = new Disconnected(_instance);
break;
}
}
示例9: GetStatusLine
private string GetStatusLine(StatusCode code)
{
// TODO: Create the response status line and return it
string statusLine = string.Format("HTTP/1.1 ", ((int)code).ToString(), code.ToString());
return statusLine;
}
示例10: GetDealByProcessDate
public List<DA_TRN> GetDealByProcessDate(DateTime processdate, StatusCode statuscode)
{
List<DA_TRN> trans = null;
using (EFUnitOfWork unitOfWork = new EFUnitOfWork())
{
trans = unitOfWork.DA_TRNRepository.GetAllByEngineDateStatusCode(processdate, statuscode.ToString());
}
return trans;
}
示例11: OnStatusChanged
public void OnStatusChanged(StatusCode statusCode)
{
switch (statusCode) {
case StatusCode.Connect:
Debug.Log("Connected to server!");
break;
case StatusCode.Disconnect:
Debug.Log("Disconnected to server!");
break;
default:
Debug.Log("Unknown status: " + statusCode.ToString());
break;
}
}
示例12: OnStatusChanged
public void OnStatusChanged(StatusCode statusCode)
{
if (this.DebugOut >= DebugLevel.INFO)
{
this.DebugReturn(DebugLevel.INFO, string.Format("OnStatusChanged: {0}", statusCode.ToString()));
}
switch (statusCode)
{
case StatusCode.Connect:
if (this.State == global::PeerState.ConnectingToGameserver)
{
if (this.DebugOut >= DebugLevel.ALL)
{
this.DebugReturn(DebugLevel.ALL, "Connected to gameserver.");
}
this.State = global::PeerState.ConnectedToGameserver;
}
else
{
if (this.DebugOut >= DebugLevel.ALL)
{
this.DebugReturn(DebugLevel.ALL, "Connected to masterserver.");
}
if (this.State == global::PeerState.Connecting)
{
SendMonoMessage(PhotonNetworkingMessage.OnConnectedToPhoton);
this.State = global::PeerState.Connected;
}
else
{
this.State = global::PeerState.ConnectedComingFromGameserver;
}
}
if (this.requestSecurity)
{
this.EstablishEncryption();
}
else
{
if (!this.OpAuthenticate(this.mAppId, this.mAppVersion))
{
this.externalListener.DebugReturn(DebugLevel.ERROR, "Error Authenticating! Did not work.");
}
}
break;
case StatusCode.Disconnect:
if (this.State == global::PeerState.DisconnectingFromMasterserver)
{
if (this.nodeId != 0)
{
Debug.Log("connecting to game on node " + this.nodeId);
}
this.Connect(this.mGameserver, this.mAppId, this.nodeId);
this.State = global::PeerState.ConnectingToGameserver;
}
else if (this.State == global::PeerState.DisconnectingFromGameserver)
{
// don't preselect node
this.nodeId = 0;
this.Connect(this.masterServerAddress, this.mAppId, 0);
this.State = global::PeerState.ConnectingToMasterserver;
}
else
{
this.LeftRoomCleanup();
this.State = global::PeerState.PeerCreated;
SendMonoMessage(PhotonNetworkingMessage.OnDisconnectedFromPhoton);
}
break;
case StatusCode.ExceptionOnConnect:
this.State = global::PeerState.PeerCreated;
DisconnectCause cause = (DisconnectCause)statusCode;
SendMonoMessage(PhotonNetworkingMessage.OnFailedToConnectToPhoton, cause);
break;
case StatusCode.Exception:
this.State = global::PeerState.PeerCreated;
if (!string.IsNullOrEmpty(this.mGameserver) && this.mGameserver.StartsWith("127.0.0.1"))
{
this.DebugReturn(DebugLevel.WARNING, "Connection to game server failed and address is: 127.0.0.1. This might be a misconfiguration in the game server.");
}
cause = (DisconnectCause)statusCode;
SendMonoMessage(PhotonNetworkingMessage.OnConnectionFail, cause);
this.Disconnect();
break;
case StatusCode.InternalReceiveException:
case StatusCode.TimeoutDisconnect:
case StatusCode.DisconnectByServer:
case StatusCode.DisconnectByServerLogic:
case StatusCode.DisconnectByServerUserLimit:
this.State = global::PeerState.PeerCreated;
//.........这里部分代码省略.........
示例13: OnPeerStatusCallback
/// <summary>
/// The on peer status callback.
/// </summary>
/// <param name="game">
/// The game.
/// </param>
/// <param name="returnCode">
/// The return code.
/// </param>
public void OnPeerStatusCallback(Game game, StatusCode returnCode)
{
game.DebugReturn(DebugLevel.ERROR, returnCode.ToString());
}
示例14: OnStatusChanged
public void OnStatusChanged(StatusCode returnCode)
{
try
{
if (this.listener.IsDebugLogEnabled)
{
this.listener.LogDebug(string.Format("{0}: received callback {1}", this.avatar.Id, returnCode));
}
switch (returnCode)
{
case StatusCode.Connect:
this.SetConnected();
this.EnterWorld();
break;
case StatusCode.Disconnect:
case StatusCode.DisconnectByServer:
case StatusCode.DisconnectByServerLogic:
case StatusCode.DisconnectByServerUserLimit:
case StatusCode.TimeoutDisconnect:
this.SetDisconnected(returnCode);
break;
default:
this.DebugReturn(DebugLevel.ERROR, returnCode.ToString());
break;
}
}
catch (Exception e)
{
this.listener.LogError(e);
}
}
示例15: OnStatusChanged
public void OnStatusChanged(StatusCode statusCode)
{
switch (statusCode)
{
case StatusCode.Connect:
Debug.Log("Connected to server!");
break;
case StatusCode.Disconnect:
Debug.Log("Disconnected from server!");
break;
case StatusCode.TimeoutDisconnect:
Debug.Log("TimeoutDisconnected from server!");
break;
case StatusCode.DisconnectByServer:
Debug.Log("DisconnectedByServer from server!");
break;
case StatusCode.DisconnectByServerUserLimit:
Debug.Log("DisconnectedByLimit from server!");
break;
case StatusCode.DisconnectByServerLogic:
Debug.Log("DisconnectedByLogic from server!");
break;
case StatusCode.EncryptionEstablished:
break;
case StatusCode.EncryptionFailedToEstablish:
break;
default:
Debug.Log("Unknown status:" + statusCode.ToString());
break;
}
}