コード例 #1
0
        public override void AddClient(IClient c)
        {
            if (c.GetType().Equals(typeof(IRCLib.Interfaces.IRC.IRCClient)))
            {
                if (clients.Contains(c))
                {
                    return;
                }

                bool asdf = Server.clientFriends.JoinChatRoom(chatID);
                if (!asdf)
                {
                    return;
                }

                while (string.IsNullOrEmpty(Server.clientFriends.GetChatRoomName(chatID)))
                {
                    System.Threading.Thread.Sleep(150);
                }

                int numClients = Server.clientFriends.GetFriendCountFromSource(chatID);
                for (int j = 0; j < numClients; j++)
                {
                    ulong asdff = Server.clientFriends.GetFriendFromSourceByIndex(chatID, j);

                    if (asdff == Server.clientUser.GetSteamID())
                    {
                        continue;
                    }

                    IClient cl = (BaseIRCLib.Server.GetServer() as Server).GetSteamClient(asdff);

                    if (cl == null)
                    {
                        if (Server.clientList.Clients.ContainsKey(asdff))
                        {
                            cl = Server.clientList.Clients[asdff];
                        }
                        else
                        {
                            cl = new IRCLib.Interfaces.Steam.SteamClient(asdff);
                        }

                        EPersonaState st = Server.clientFriends.GetFriendPersonaState(asdff);
                        cl.AwayMsg = (st == EPersonaState.k_EPersonaStateOnline ? "" : st.ToString().Remove(0, 15));
                        Database.GetDatabase().AddClient(cl);
                        Database.GetDatabase().GetChannel("&Friends").AddClient(cl);
                    }

                    if (clients.Contains(cl))
                    {
                        continue;
                    }

                    uint memberDetails      = 0;
                    uint localMemberDetails = 0;

                    if (Server.clientFriends.GetChatRoomMemberDetails(chatID, asdff, ref memberDetails, ref localMemberDetails))
                    {
                        if (memberDetails == 2 || memberDetails == 1)
                        {
                            ClientModes.Add(cl, "o");
                        }
                    }

                    base.AddClient(cl);
                }
            }
            else
            {
                uint memberDetails      = 0;
                uint localMemberDetails = 0;

                if (Server.clientFriends.GetChatRoomMemberDetails(chatID, (c as IRCLib.Interfaces.Steam.SteamClient).SteamID, ref memberDetails, ref localMemberDetails))
                {
                    if ((memberDetails == 2 || memberDetails == 1) && !ClientModes.ContainsKey(c))
                    {
                        ClientModes.Add(c, "o");
                    }
                }
            }

            base.AddClient(c);
        }
コード例 #2
0
        public override void AddClient(IClient c)
        {
            if (c.GetType().Equals(typeof(IRCLib.Interfaces.IRC.IRCClient)))
            {
                Server.clientFriends.JoinChatRoom(chatID);

                int numClients = Server.clientFriends.GetFriendCountFromSource(chatID);
                for (int j = 0; j < numClients; j++)
                {
                    ulong asdff = Server.clientFriends.GetFriendFromSourceByIndex(chatID, j);

                    if (asdff == Server.clientUser.GetSteamID())
                    {
                        continue;
                    }

                    IClient cl = (BaseIRCLib.Server.GetServer() as Server).GetSteamClient(asdff);

                    if (cl == null)
                    {
                        if (Server.clientList.Clients.ContainsKey(asdff))
                        {
                            cl = Server.clientList.Clients[asdff];
                        }
                        else
                        {
                            cl = new IRCLib.Interfaces.Steam.SteamClient(asdff);
                        }

                        Database.GetDatabase().AddClient(cl);
                        Database.GetDatabase().GetChannel("Friends").AddClient(cl);
                    }

                    if (clients.Contains(cl))
                    {
                        continue;
                    }

                    uint memberDetails      = 0;
                    uint localMemberDetails = 0;

                    if (Server.clientFriends.GetChatRoomMemberDetails(chatID, asdff, ref memberDetails, ref localMemberDetails))
                    {
                        if (memberDetails == 2)
                        {
                            ClientModes.Add(cl, "o");
                        }
                    }

                    base.AddClient(cl);
                }
            }
            else
            {
                uint memberDetails      = 0;
                uint localMemberDetails = 0;

                if (Server.clientFriends.GetChatRoomMemberDetails(chatID, (c as IRCLib.Interfaces.Steam.SteamClient).SteamID, ref memberDetails, ref localMemberDetails))
                {
                    if (memberDetails == 2)
                    {
                        ClientModes.Add(c, "o");
                    }
                }
            }

            base.AddClient(c);
        }