Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

Engine.VoiceChatRoom


00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
//==============================================================================
//	Contains information about a single voice chat room on the server
//
//	If public channel - owner will be GameInfo.VoiceReplicationInfo
//	If private channel - owner is client's PlayerReplicationInfo
//
//	Written by Ron Prestenback
//	© 2003, Epic Games, Inc.  All Rights Reserved
//==============================================================================
class VoiceChatRoom extends Info
    config(User)
    abstract
    notplaceable
    native;

enum EJoinChatResult
{
    JCR_Invalid,                    // Unspecified error (replication hasn't finished, etc.)
    JCR_Member,                     // Already a member
    JCR_NeedPassword,               // Password protected
    JCR_WrongPassword,              // Incorrect password specified in join request
    JCR_Banned,                     // Player is banned from this channel
    JCR_Full,                       // Channel is full
    JCR_NotAllowed,                 // Improper join (opposite teams, etc.)
    JCR_Success                     // Successful join
};

var GameReplicationInfo GRI;
var VoiceChatReplicationInfo VoiceChatManager;

// Cascading channels - any communication sent to parent channel will also be sent to child channels
var VoiceChatRoom        Parent;
var array<VoiceChatRoom> Children;

var string Password;    // Password for this chatroom - ignored if public

// Channel index ensures that the server and client always reference the same chatroom
// If this is a player channel, it will be the PlayerReplication.PlayerID + number of public channels
var int ChannelIndex;
var bool bLocal;                    // - not yet implemented

var private int TeamIndex;

// =====================================================================================================================
// =====================================================================================================================
//  Query Functions
// =====================================================================================================================
// =====================================================================================================================

simulated function array<PlayerReplicationInfo> GetMembers();
simulated function int    GetMaxChatters()                          { return VoiceChatManager.MaxChatters; }
simulated function int    GetMask()                                 { return 0;              }
simulated function string GetPassword()                             { return "";             }
simulated function bool   ValidMask()                               { return GetMask() > 0;  }
simulated function string GetTitle()                                { return "";             }
simulated function int    GetTeam()                                 { return TeamIndex;      }
simulated function bool   IsPublicChannel()                         { return true;           }
simulated function bool   IsTeamChannel()                           { return false;          }
simulated function bool   IsPrivateChannel()                        { return false;          }
simulated function bool   CanJoinChannel(PlayerReplicationInfo PRI) { return true;           }
simulated function bool   IsFull()                                  { return false;          }
simulated event    bool   IsMember(PlayerReplicationInfo PRI, optional bool bNoCascade)
{
    local int i;

    if ( bNoCascade )
        return false;

    for (i = 0; i < Children.Length; i++)
    {
        if ( Children[i] != None && Children[i].IsMember(PRI) )
            return true;
    }

    return false;
}

// =====================================================================================================================
// =====================================================================================================================
//  Joins / Leaves
// =====================================================================================================================
// =====================================================================================================================

// Does not actually add the player to this channel - handles authentication & access control
function EJoinChatResult JoinChannel(PlayerReplicationInfo NewPRI, string InPassword) { return JCR_Success;  }
function bool LeaveChannel(PlayerReplicationInfo LeavingPRI)                        { return true; }

// Actually adds the PlayerReplicationInfo to this channel's virtual member list
function AddMember(PlayerReplicationInfo PRI);
function RemoveMember(PlayerReplicationInfo PRI);

// =====================================================================================================================
// =====================================================================================================================
//  Utility Functions
// =====================================================================================================================
// =====================================================================================================================

simulated function SetTeam( int NewTeam )                   { TeamIndex = NewTeam; }
simulated function SetMemberMask( int NewMask );
simulated function SetChannelPassword( string InPassword )  { Password = InPassword; }

// Registers a cascaded channel
simulated function bool AddChild(VoiceChatRoom NewChild)     { return true;  }
simulated function bool RemoveChild(VoiceChatRoom Child)     { return false; }

// Called from VoiceReplicationInfo when a player changes team
simulated function bool NotifyTeamChange(PlayerReplicationInfo PRI, int NewTeamIndex) { return false; }

defaultproperties
{
     ChannelIndex=-1
     TeamIndex=255
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Mon 23/10/2006 20:25:16.000 - Creation time: Wed 7/2/2007 19:16:58.515 - Created with UnCodeX