/// <summary> /// 删除用户 /// </summary> /// <param name="connectionId">connectionId</param> public void DelUser(string connectionId, SocketEnum socketEnum) { User user = Users.Where(s => s.UserSocket.WebSocketConnectionId == connectionId).First(); user?.UserSocket.WebSocket.Abort(); Users = Users.Where(s => s.UserSocket.WebSocketConnectionId != connectionId).ToList(); }
/// <summary> /// 处理前端传来的信息判断要执行什么操作 /// </summary> /// <param name="astrMessage">信息</param> /// <param name="aobjSocketSession">websocket连接Session</param> public void handlerMessage(string astrMessage, WebSocketSession aobjSocketSession) { SocketEntity socketEntity = JsonConvert.DeserializeObject <SocketEntity>(astrMessage); System.Diagnostics.Debug.WriteLine(socketEntity); SocketEnum socketEnum = (SocketEnum)Enum.Parse(typeof(SocketEnum), socketEntity.Tag); System.Diagnostics.Debug.WriteLine(socketEnum); switch (socketEnum) { case SocketEnum.ac: handlerControllerAction(socketEntity, aobjSocketSession); break; case SocketEnum.c: updateSessionKey(socketEntity, aobjSocketSession); break; case SocketEnum.i: InRoom(socketEntity); break; case SocketEnum.q: break; } }
public TubeRelicStruct(int cid, string name, string nameKor, SocketEnum socket, TubeGradeEnum grade, string company, string abnormalValue, float distance) { this.cid = cid; this.name = name; this.nameKor = nameKor; this.socket = socket; this.grade = grade; this.company = company; this.abnormalValue = abnormalValue; this.distance = distance; }
public TubeCoolerStruct(int cid, string name, string nameKor, SocketEnum socket, TubeGradeEnum grade, string company, float cooltime, float hp, float steam) { this.cid = cid; this.name = name; this.nameKor = nameKor; this.socket = socket; this.grade = grade; this.company = company; this.cooltime = cooltime; this.hp = hp; this.steam = steam; }
public TubeEnhancerStruct(int cid, string name, string nameKor, SocketEnum socket, TubeGradeEnum grade, bool meleeSocket, bool rangeSocket, bool bounceSocket, bool dashSocket, float range, int abnormalValue) { this.cid = cid; this.name = name; this.nameKor = nameKor; this.socket = socket; this.grade = grade; this.meleeSocket = meleeSocket; this.rangeSocket = rangeSocket; this.bounceSocket = bounceSocket; this.dashSocket = dashSocket; this.range = range; this.abnormalValue = abnormalValue; }
public void Init(List <Tube> tubes, SocketEnum socket) { this.tubes = tubes; if (tubes == null || tubes.Count <= 0) { tubeIcon.Init(null); discription.SetActive(false); return; } index = 0; this.socket = socket; tubeIcon.Init(CurrentTube); UpdateUI(); }
public TubeStyleStruct(int cid, string name, string nameKor, SocketEnum socket, TubeGradeEnum grade, string company, float range, AttackTypeEnum attackType, string position, float damage, int combo, bool hold, string holdmotion, float coolTime) { this.cid = cid; this.name = name; this.nameKor = nameKor; this.socket = socket; this.grade = grade; this.company = company; this.range = range; this.attackType = attackType; this.position = position; this.damage = damage; this.combo = combo; this.hold = hold; this.holdmotion = holdmotion; this.coolTime = coolTime; }
public virtual int GetCount(SocketEnum socket) { return(tubes.FindAll(t => t.Socket == socket).Count); }