Exemplo n.º 1
0
 public void Check_ReceiveMessageCallBackEvent(byte command, string data, Socket _socket)
 {
     if (CheckIsOnLinePlayerMessage(_socket))
     {
         UnityPlayerOnClient player = unityPlayerOnClientList.Find(u => u.Socket == _socket);
         WeaveServerReceiveOnLineUnityPlayerMessageCallBackEvent(command, data, player);
     }
     else
     {
         WeaveOnLine onLine = weaveOnline.Find(w => w.Socket == _socket);
         WeaveServerReceiveSocketMessageCallBackEvent(command, data, onLine);
     }
 }
Exemplo n.º 2
0
        public UnityPlayerOnClient ConvertWeaveOnlineToUnityPlayerOnClient(WeaveOnLine wonline)
        {
            UnityPlayerOnClient uplayer = new UnityPlayerOnClient()
            {
                Obj    = wonline.Obj,
                Socket = wonline.Socket,
                Token  = wonline.Token,
                Name   = wonline.Name
            };



            return(uplayer);
        }
Exemplo n.º 3
0
        public void AddUnityPlayerClient_CheckSameItem(UnityPlayerOnClient item, string itemName)
        {
            System.Threading.Thread.Sleep(500);
            lock (this)
            {
                if (unityPlayerOnClientList.Find(i => i.Name == itemName) != null)
                {
                    return;
                }

                else
                {
                    unityPlayerOnClientList.Add(item);
                }
            }
        }
Exemplo n.º 4
0
        private void OnUnityPlayerLoginOK(string _u, Socket _socket)
        {
            WeaveOnLine onLineSocket = weaveOnline.Find(w => w.Socket == _socket);

            // throw new NotImplementedException();
            UnityPlayerOnClient gamer = new UnityPlayerOnClient()
            {
                UserName = _u,
                isLogin  = true,
                Name     = onLineSocket.Name,
                Obj      = onLineSocket.Obj,
                Socket   = _socket,
                Token    = onLineSocket.Token
            };

            WeaveServerGetUnityPlayerOnLineCallBackEvent(gamer);
        }
Exemplo n.º 5
0
        public bool CheckIsOnLinePlayerMessage(Socket _socket)
        {
            WeaveOnLine onLineSocket = weaveOnline.Find(w => w.Socket == _socket);

            if (unityPlayerOnClientList.Count == 0)
            {
                return(false);
            }
            else
            {
                UnityPlayerOnClient player = unityPlayerOnClientList.Find(u => u.Name == onLineSocket.Name);
                if (player != null)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
        }
Exemplo n.º 6
0
        public void CallWeaveServerGetUnityPlayerOffLineCallBackEvent(Socket _soc)
        {
            UnityPlayerOnClient unitygm = unityPlayerOnClientList.Find(p => p.Socket == _soc);

            WeaveServerGetUnityPlayerOffLineCallBackEvent(unitygm);
        }