예제 #1
0
        public void SendData(UserInfo info, int id, params object[] buff)
        {
            NetData data = info.net;
            int     code = id;
            int     pos  = data.cmdUse.IndexOf(code);

            byte[] v;
            if (pos == -1)
            {
                data.cmdUse.Add((int)code);
                data.cmdData.Add(v = buildPacket(id, Object2Byte(buff)));
                data.cmdTimeout.Add(TimeOut);
            }
            else
            {
                data.cmdData[pos]    = v = buildPacket(id, Object2Byte(buff));
                data.cmdTimeout[pos] = TimeOut;
            }
            Search.Send(v, v.Length, new IPEndPoint(info.ip, port));
        }
예제 #2
0
 public UserInfo(int id, long ip)
 {
     this.id = id;
     this.ip = ip;
     net     = new NetData();
 }