Beispiel #1
0
 static void Thread_Tick()
 {
     while (true)
     {
         try
         {
             m_Session.Tick();
         }
         catch (Exception e)
         {
             Debuger.LogWarning(e.Message + "\n" + e.StackTrace);
         }
         Thread.Sleep(33);
     }
 }
Beispiel #2
0
            public void HandMsg(KCPWork.ISession session, uint index, pb.Mail_UserMailInfo msg)
            {
                Debuger.LogWarning($"HandMsg: from={session.id},index={index},mail_id={msg.id}, content={msg.content}");

                int recv = int.Parse(msg.content);

                if (lastRecv == recv)
                {
                    lastRecv++;
                    msg.id      = 5201314;
                    msg.content = msg.content + "---回复!";
                    kcp.Send(session, 0, cmd, msg);
                }
                else
                {
                    throw new Exception($"lastRecv={lastRecv},recv={recv}!!!");
                }
            }
Beispiel #3
0
 public void HandMsgRsp(pb.Mail_UserMailInfo msg)
 {
     Debuger.LogWarning($"HandMsgRsp: mail_id={msg.id}, content={msg.content}");
 }