39 lines
720 B
C#
39 lines
720 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace ChatRoomServer.Main
|
|
{
|
|
using FSLib.Network.SuperSocket.Protocols.WebSocket;
|
|
|
|
class ChatSession : WebSocketSession<ChatSession>
|
|
{
|
|
/// <summary>
|
|
/// 命令
|
|
/// </summary>
|
|
public string Command { get; private set; }
|
|
|
|
/// <summary>
|
|
/// ID
|
|
/// </summary>
|
|
public string Id { get; private set; }
|
|
|
|
/// <summary>
|
|
/// Called when [init].
|
|
/// </summary>
|
|
protected override void OnInit()
|
|
{
|
|
base.OnInit();
|
|
|
|
var path = Path.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
|
|
if (path.Length >= 2)
|
|
{
|
|
Command = path[0];
|
|
Id = path[1];
|
|
}
|
|
}
|
|
}
|
|
}
|