Exemple #1
0
        private void HandleUserPrivateMsg(GSPacketIn pkg, int playerid)
        {
            ServerClient client = LoginMgr.GetServerClient(playerid);

            if (client != null)
            {
                client.SendTCP(pkg);
            }
        }
        private void HandleUserPrivateMsg(GSPacketIn pkg, int playerid)
        {
            ServerClient serverClient = LoginMgr.GetServerClient(playerid);

            if (serverClient == null)
            {
                return;
            }
            serverClient.SendTCP(pkg);
        }
Exemple #3
0
 public void SendToALL(GSPacketIn pkg, ServerClient except)
 {
     ServerClient[] list = this.GetAllClients();
     if (list != null)
     {
         ServerClient[] array = list;
         for (int i = 0; i < array.Length; i++)
         {
             ServerClient client = array[i];
             if (client != except)
             {
                 client.SendTCP(pkg);
             }
         }
     }
 }
Exemple #4
0
 public void SendToALL(GSPacketIn pkg, ServerClient except)
 {
     ServerClient[] allClients = this.GetAllClients();
     if (allClients != null)
     {
         ServerClient[] array = allClients;
         for (int i = 0; i < array.Length; i++)
         {
             ServerClient serverClient = array[i];
             if (serverClient != except)
             {
                 serverClient.SendTCP(pkg);
             }
         }
     }
 }
 public bool MailNotice(int playerID)
 {
     try
     {
         ServerClient client = LoginMgr.GetServerClient(playerID);
         if (client != null)
         {
             GSPacketIn pkgMsg = new GSPacketIn((byte)ePackageType.MAIL_RESPONSE);
             pkgMsg.WriteInt(playerID);
             pkgMsg.WriteInt((int)eMailRespose.Receiver);
             client.SendTCP(pkgMsg);
             return(true);
         }
     }
     catch {}
     return(false);
 }
Exemple #6
0
        /// <summary>
        /// 用户的私有消息
        /// </summary>
        /// <param name="pkg"></param>
        private void HandleUserPrivateMsg(GSPacketIn pkg, int playerid)
        {
            ServerClient client = LoginMgr.GetServerClient(playerid);

            if (client != null)
            {
                client.SendTCP(pkg);
            }
            //else
            //{
            //    int id = pkg.ClientID;
            //    string nickName = pkg.ReadString();
            //    GSPacketIn packet = new GSPacketIn((byte)ePackageType.SYS_MESS);
            //    packet.WriteInt(1);
            //    packet.WriteInt(id);
            //    packet.WriteString(nickName);
            //}
        }
        public void HandleChatPersonal(GSPacketIn pkg)
        {
            ServerClient serverClient = LoginMgr.GetServerClient(pkg.ReadInt());

            if (serverClient != null)
            {
                serverClient.SendTCP(pkg);
            }
            else
            {
                int        clientId = pkg.ClientID;
                string     str      = pkg.ReadString();
                GSPacketIn pkg1     = new GSPacketIn((short)38);
                pkg1.WriteInt(1);
                pkg1.WriteInt(clientId);
                pkg1.WriteString(str);
                this.SendTCP(pkg1);
            }
        }
Exemple #8
0
 public bool MailNotice(int playerID)
 {
     try
     {
         ServerClient serverClient = LoginMgr.GetServerClient(playerID);
         if (serverClient != null)
         {
             GSPacketIn gSPacketIn = new GSPacketIn(117);
             gSPacketIn.WriteInt(playerID);
             gSPacketIn.WriteInt(1);
             serverClient.SendTCP(gSPacketIn);
             return(true);
         }
     }
     catch
     {
     }
     return(false);
 }
Exemple #9
0
 public int NoticeServerUpdate(int serverId, int type)
 {
     ServerClient[] allClients = this.GetAllClients();
     if (allClients != null)
     {
         ServerClient[] array = allClients;
         for (int i = 0; i < array.Length; i++)
         {
             ServerClient serverClient = array[i];
             if (serverClient.Info.ID == serverId)
             {
                 GSPacketIn gSPacketIn = new GSPacketIn(11);
                 gSPacketIn.WriteInt(type);
                 serverClient.SendTCP(gSPacketIn);
                 return(0);
             }
         }
     }
     return(1);
 }
Exemple #10
0
        /// <summary>
        /// 私聊
        /// </summary>
        /// <param name="pkg"></param>
        public void HandleChatPersonal(GSPacketIn pkg)
        {
            int          playerid = pkg.ReadInt();
            ServerClient client   = LoginMgr.GetServerClient(playerid);

            if (client != null)
            {
                client.SendTCP(pkg);
            }
            else
            {
                int        id       = pkg.ClientID;
                string     nickName = pkg.ReadString();
                GSPacketIn packet   = new GSPacketIn((byte)ePackageType.SYS_MESS);
                packet.WriteInt(1);
                packet.WriteInt(id);
                packet.WriteString(nickName);
                SendTCP(packet);
            }
        }
Exemple #11
0
        public static bool MailNotice(int playerID)
        {
            bool result;

            try
            {
                ServerClient client = LoginMgr.GetServerClient(playerID);
                if (client != null)
                {
                    GSPacketIn pkgMsg = new GSPacketIn(117);
                    pkgMsg.WriteInt(playerID);
                    pkgMsg.WriteInt(1);
                    client.SendTCP(pkgMsg);
                    result = true;
                    return(result);
                }
            }
            catch
            {
            }
            result = false;
            return(result);
        }
Exemple #12
0
        public int RateUpdate(int serverId)
        {
            ServerClient[] list = this.GetAllClients();
            int            result;

            if (list != null)
            {
                ServerClient[] array = list;
                for (int i = 0; i < array.Length; i++)
                {
                    ServerClient client = array[i];
                    if (client.Info.ID == serverId)
                    {
                        GSPacketIn pkg = new GSPacketIn(177);
                        pkg.WriteInt(serverId);
                        client.SendTCP(pkg);
                        result = 0;
                        return(result);
                    }
                }
            }
            result = 1;
            return(result);
        }