예제 #1
0
        public void FillActorTypes()
        {
            int noOfActors = PInvokeDeclarations.GetNoOfActorTypes();

            //Clear currently all the resources
            var items = ActorTypesComboBox.Items;

            items.Clear();


            m_actorTypeList = new string[noOfActors];

            GameActorInfo actorInfo = new GameActorInfo();
            int           sizeofRP  = Marshal.SizeOf(typeof(GameActorInfo));
            IntPtr        pRP       = Marshal.AllocHGlobal(sizeofRP * noOfActors);

            Marshal.StructureToPtr(actorInfo, pRP, false);
            PInvokeDeclarations.GetAllActorTypes(pRP);

            for (int index = 0; index < noOfActors; index++)
            {
                actorInfo = (GameActorInfo)Marshal.PtrToStructure(pRP + (index * Marshal.SizeOf(typeof(GameActorInfo))), typeof(GameActorInfo));
                m_actorTypeList[index] = actorInfo.actorName;
                m_actorList.AddItem(actorInfo.actorName);
            }

            Marshal.FreeHGlobal(pRP);
        }
    // Token: 0x06001C8A RID: 7306
    public static string ToCustomString(this GameActorInfo info)
    {
        StringBuilder stringBuilder = new StringBuilder();

        stringBuilder.AppendFormat("Name: {0} - {1}/{2}\n", info.PlayerName, info.Cmid, info.PlayerId);
        stringBuilder.AppendLine("Play: " + CmunePrint.Flag <PlayerStates>(info.PlayerState));
        stringBuilder.AppendLine(string.Concat(new object[]
        {
            "CurrentWeapon: ",
            info.CurrentWeaponSlot,
            "/",
            info.CurrentWeaponID
        }));
        stringBuilder.AppendLine(string.Concat(new object[]
        {
            "Life: ",
            info.Health,
            "/",
            info.ArmorPoints
        }));
        stringBuilder.AppendLine("Team: " + info.TeamID);
        stringBuilder.AppendLine("Color: " + info.SkinColor);
        stringBuilder.AppendLine("Weapons: " + CmunePrint.Values(new object[]
        {
            info.Weapons
        }));
        stringBuilder.AppendLine("Gear: " + CmunePrint.Values(new object[]
        {
            info.Gear
        }));
        return(stringBuilder.ToString());
    }
예제 #3
0
 // Token: 0x060019CB RID: 6603 RVA: 0x00089024 File Offset: 0x00087224
 protected override void OnPlayerJoinedGame(GameActorInfo player, PlayerMovement position)
 {
     Debug.Log(string.Concat(new object[]
     {
         "OnPlayerJoinedGame ",
         player.PlayerName,
         " ",
         GameState.Current.MatchState.CurrentStateId
     }));
     GameState.Current.Players[player.Cmid] = player;
     if (player.Cmid == PlayerDataManager.Cmid)
     {
         GameState.Current.PlayerData.Player     = player;
         GameState.Current.PlayerData.Team.Value = player.TeamID;
     }
     else
     {
         GameState.Current.RemotePlayerStates.AddCharacterInfo(player, position);
     }
     if (GameState.Current.MatchState.CurrentStateId != GameStateId.None && !player.IsSpectator)
     {
         GameState.Current.InstantiateAvatar(player);
     }
     GameState.Current.UpdateTeamCounter();
 }
예제 #4
0
 // Token: 0x06001A9B RID: 6811 RVA: 0x0008B208 File Offset: 0x00089408
 private void ConfigureAvatar(GameActorInfo info, CharacterConfig character, bool isLocal)
 {
     if (character != null && info != null)
     {
         if (isLocal)
         {
             this.Player.SetCurrentCharacterConfig(character);
             this.Player.MoveController.IsLowGravity = GameFlags.IsFlagSet(GameFlags.GAME_FLAGS.LowGravity, this.RoomData.GameFlags);
             character.Initialize(this.PlayerData, this.Avatar);
         }
         else
         {
             global::Avatar avatar = new global::Avatar(new Loadout(info.Gear, info.Weapons), false);
             avatar.SetDecorator(global::AvatarBuilder.CreateRemoteAvatar(avatar.Loadout.GetAvatarGear(), info.SkinColor));
             character.Initialize(this.RemotePlayerStates.GetState(info.PlayerId), avatar);
             GameData.Instance.OnHUDStreamMessage.Fire(info, LocalizedStrings.JoinedTheGame, null);
         }
         if (!info.IsAlive)
         {
             character.SetDead(Vector3.zero, BodyPart.Body, 0, UberstrikeItemClass.WeaponMachinegun);
         }
     }
     else
     {
         Debug.LogError(string.Format("OnAvatarLoaded failed because loaded Avatar is {0} and Info is {1}", character != null, info != null));
     }
 }
 // Token: 0x06001842 RID: 6210 RVA: 0x000824E8 File Offset: 0x000806E8
 public void SetCharacterInfo(GameActorInfo info)
 {
     if (info != null)
     {
         this.SetAvatarLabel((!string.IsNullOrEmpty(info.ClanTag)) ? ("[" + info.ClanTag + "] " + info.PlayerName) : info.PlayerName);
         this._info = info;
     }
 }
    // Token: 0x060016B1 RID: 5809 RVA: 0x0007DE30 File Offset: 0x0007C030
    private void OnPlayerKilled(GameActorInfo shooter, GameActorInfo target, UberstrikeItemClass weapon, BodyPart bodyPart)
    {
        if (target == null)
        {
            return;
        }
        if (shooter != null && shooter.Cmid == PlayerDataManager.Cmid && target.Cmid != PlayerDataManager.Cmid)
        {
            bool flag = Time.time < this.lastKillTime + 10f;
            this.killCounter  = ((!flag) ? 1 : (this.killCounter + 1));
            this.lastKillTime = Time.time;
            if (weapon == UberstrikeItemClass.WeaponMelee)
            {
                AutoMonoBehaviour <SfxManager> .Instance.Play2dAudioClip(GameAudio.Smackdown, 0UL, 1f, 1f);
            }
            else if (bodyPart == BodyPart.Head)
            {
                AutoMonoBehaviour <SfxManager> .Instance.Play2dAudioClip(GameAudio.HeadShot, 0UL, 1f, 1f);
            }
            else if (bodyPart == BodyPart.Nuts)
            {
                AutoMonoBehaviour <SfxManager> .Instance.Play2dAudioClip(GameAudio.GotNutshotKill, 0UL, 1f, 1f);

                AutoMonoBehaviour <SfxManager> .Instance.Play2dAudioClip(GameAudio.NutShot, 0UL, 1f, 1f);
            }
            string textBig = string.Empty;
            if (this.killCounter == 2)
            {
                textBig = "DOUBLE KILL";
                AutoMonoBehaviour <SfxManager> .Instance.Play2dAudioClip(GameAudio.DoubleKill, 1000UL, 1f, 1f);
            }
            else if (this.killCounter == 3)
            {
                textBig = "TRIPLE KILL";
                AutoMonoBehaviour <SfxManager> .Instance.Play2dAudioClip(GameAudio.TripleKill, 1000UL, 1f, 1f);
            }
            else if (this.killCounter == 4)
            {
                textBig = "QUAD KILL";
                AutoMonoBehaviour <SfxManager> .Instance.Play2dAudioClip(GameAudio.QuadKill, 1000UL, 1f, 1f);
            }
            else if (this.killCounter == 5)
            {
                textBig = "MEGA KILL";
                AutoMonoBehaviour <SfxManager> .Instance.Play2dAudioClip(GameAudio.MegaKill, 1000UL, 1f, 1f);
            }
            else if (this.killCounter > 5)
            {
                textBig = "UBER KILL";
                if (this.killCounter == 6)
                {
                    AutoMonoBehaviour <SfxManager> .Instance.Play2dAudioClip(GameAudio.UberKill, 1000UL, 1f, 1f);
                }
            }
            this.Show(textBig, "You killed " + target.PlayerName, 1f);
        }
    }
 // Token: 0x06001338 RID: 4920 RVA: 0x00021C28 File Offset: 0x0001FE28
 private void PlayerJoinedGame(byte[] _bytes)
 {
     using (MemoryStream memoryStream = new MemoryStream(_bytes))
     {
         GameActorInfo  player   = GameActorInfoProxy.Deserialize(memoryStream);
         PlayerMovement position = PlayerMovementProxy.Deserialize(memoryStream);
         this.OnPlayerJoinedGame(player, position);
     }
 }
예제 #8
0
 // Token: 0x06001B22 RID: 6946 RVA: 0x0008BFAC File Offset: 0x0008A1AC
 public RemoteCharacterState(GameActorInfo info, PlayerMovement update)
 {
     this.debugger = new PositionSyncDebugger();
     this.Player   = info;
     this.sampler.Reset(update.Position);
     this.PositionUpdate(update, 0);
     this.HorizontalRotation = Quaternion.Euler(0f, this.hRotationTarget, 0f);
     this.VerticalRotation   = this.vRotationTarget;
 }
        // Token: 0x060010C2 RID: 4290 RVA: 0x00016D94 File Offset: 0x00014F94
        public static GameActorInfo Deserialize(Stream bytes)
        {
            int           num           = Int32Proxy.Deserialize(bytes);
            GameActorInfo gameActorInfo = new GameActorInfo();

            gameActorInfo.AccessLevel = EnumProxy <MemberAccessLevel> .Deserialize(bytes);

            gameActorInfo.ArmorPointCapacity = ByteProxy.Deserialize(bytes);
            gameActorInfo.ArmorPoints        = ByteProxy.Deserialize(bytes);
            gameActorInfo.Channel            = EnumProxy <ChannelType> .Deserialize(bytes);

            if ((num & 1) != 0)
            {
                gameActorInfo.ClanTag = StringProxy.Deserialize(bytes);
            }
            gameActorInfo.Cmid = Int32Proxy.Deserialize(bytes);
            gameActorInfo.CurrentFiringMode = EnumProxy <FireMode> .Deserialize(bytes);

            gameActorInfo.CurrentWeaponSlot = ByteProxy.Deserialize(bytes);
            gameActorInfo.Deaths            = Int16Proxy.Deserialize(bytes);
            if ((num & 2) != 0)
            {
                gameActorInfo.FunctionalItems = ListProxy <int> .Deserialize(bytes, new ListProxy <int> .Deserializer <int>(Int32Proxy.Deserialize));
            }
            if ((num & 4) != 0)
            {
                gameActorInfo.Gear = ListProxy <int> .Deserialize(bytes, new ListProxy <int> .Deserializer <int>(Int32Proxy.Deserialize));
            }
            gameActorInfo.Health   = Int16Proxy.Deserialize(bytes);
            gameActorInfo.Kills    = Int16Proxy.Deserialize(bytes);
            gameActorInfo.Level    = Int32Proxy.Deserialize(bytes);
            gameActorInfo.Ping     = UInt16Proxy.Deserialize(bytes);
            gameActorInfo.PlayerId = ByteProxy.Deserialize(bytes);
            if ((num & 8) != 0)
            {
                gameActorInfo.PlayerName = StringProxy.Deserialize(bytes);
            }
            gameActorInfo.PlayerState = EnumProxy <PlayerStates> .Deserialize(bytes);

            if ((num & 16) != 0)
            {
                gameActorInfo.QuickItems = ListProxy <int> .Deserialize(bytes, new ListProxy <int> .Deserializer <int>(Int32Proxy.Deserialize));
            }
            gameActorInfo.Rank      = ByteProxy.Deserialize(bytes);
            gameActorInfo.SkinColor = ColorProxy.Deserialize(bytes);
            gameActorInfo.StepSound = EnumProxy <SurfaceType> .Deserialize(bytes);

            gameActorInfo.TeamID = EnumProxy <TeamID> .Deserialize(bytes);

            if ((num & 32) != 0)
            {
                gameActorInfo.Weapons = ListProxy <int> .Deserialize(bytes, new ListProxy <int> .Deserializer <int>(Int32Proxy.Deserialize));
            }
            return(gameActorInfo);
        }
예제 #10
0
    // Token: 0x06000AA5 RID: 2725 RVA: 0x00044520 File Offset: 0x00042720
    private void GroupDrawUser(float vOffset, float width, GameActorInfo user, bool allowSelfSelection = false)
    {
        int  cmid = PlayerDataManager.Cmid;
        Rect rect = new Rect(3f, vOffset, width - 3f, 24f);

        if (this._selectedCmid == user.Cmid)
        {
            GUI.color = new Color(ColorScheme.UberStrikeBlue.r, ColorScheme.UberStrikeBlue.g, ColorScheme.UberStrikeBlue.b, 0.5f);
            GUI.Label(rect, GUIContent.none, BlueStonez.box_white);
            GUI.color = Color.white;
        }
        bool enabled = GUI.enabled;

        GUI.Label(new Rect(10f, vOffset + 3f, 16f, 16f), this.GetIcon(user), GUIStyle.none);
        GUI.Label(new Rect(23f, vOffset + 3f, 16f, 16f), UberstrikeIconsHelper.GetIconForChannel(user.Channel), GUIStyle.none);
        TeamID teamID = user.TeamID;

        if (teamID != TeamID.BLUE)
        {
            if (teamID != TeamID.RED)
            {
                GUI.color = Color.white;
            }
            else
            {
                GUI.color = ColorScheme.GuiTeamRed;
            }
        }
        else
        {
            GUI.color = ColorScheme.GuiTeamBlue;
        }
        GUI.Label(new Rect(44f, vOffset, width - 66f, 24f), user.PlayerName, BlueStonez.label_interparkmed_10pt_left);
        GUI.color = Color.white;
        if (user.Cmid != cmid && GUI.Button(new Rect(rect.width - 17f, vOffset + 1f, 18f, 18f), GUIContent.none, BlueStonez.button_context))
        {
            this._selectedCmid = user.Cmid;
            this._playerMenu.Show(Event.current.mousePosition, new CommUser(user));
        }
        GUI.Box(rect.Expand(0, -1), GUIContent.none, BlueStonez.dropdown_list);
        if (MouseInput.IsMouseClickIn(rect, 0))
        {
            if (this._selectedCmid != user.Cmid && (allowSelfSelection || user.Cmid != cmid))
            {
                this._selectedCmid = user.Cmid;
            }
        }
        else if (MouseInput.IsMouseClickIn(rect, 1))
        {
            this._playerMenu.Show(Event.current.mousePosition, new CommUser(user));
        }
        GUI.enabled = enabled;
    }
예제 #11
0
 // Token: 0x06000AA4 RID: 2724 RVA: 0x000089B6 File Offset: 0x00006BB6
 private Texture2D GetIcon(GameActorInfo info)
 {
     if (info.IsSpectator)
     {
         return(CommunicatorIcons.PresenceOnline);
     }
     if (!info.IsAlive)
     {
         return(CommunicatorIcons.SkullCrossbonesIcon);
     }
     return(CommunicatorIcons.PresencePlaying);
 }
예제 #12
0
 // Token: 0x06001AD7 RID: 6871 RVA: 0x0008B978 File Offset: 0x00089B78
 public void Set(PlayerStates state, bool on)
 {
     if (on)
     {
         GameActorInfo player = this.Player;
         player.PlayerState |= state;
         if (state != PlayerStates.Paused)
         {
             if (state != PlayerStates.Sniping)
             {
                 if (state == PlayerStates.Shooting)
                 {
                     this.Actions.AutomaticFire(true);
                 }
             }
             else
             {
                 this.Actions.SniperMode(true);
             }
         }
         else
         {
             this.Actions.PausePlayer(true);
         }
     }
     else
     {
         GameActorInfo player2 = this.Player;
         player2.PlayerState &= ~state;
         if (state != PlayerStates.Paused)
         {
             if (state != PlayerStates.Sniping)
             {
                 if (state == PlayerStates.Shooting)
                 {
                     this.Actions.AutomaticFire(false);
                 }
             }
             else
             {
                 this.Actions.SniperMode(false);
             }
         }
         else
         {
             this.Actions.PausePlayer(false);
         }
     }
 }
예제 #13
0
 // Token: 0x060015DF RID: 5599 RVA: 0x0007A824 File Offset: 0x00078A24
 public void AddMessage(GameActorInfo player1, string actionString, GameActorInfo player2)
 {
     this.items.Enqueue(new HUDDesktopEventStream.Item
     {
         Label1            = ((!string.IsNullOrEmpty(player1.ClanTag)) ? ("[" + player1.ClanTag + "] " + player1.PlayerName) : player1.PlayerName),
         Label1EffectColor = HUDDesktopEventStream.GetPlayerColor(player1),
         Label2            = actionString,
         Label3            = ((player2 != null) ? ((!string.IsNullOrEmpty(player2.ClanTag)) ? ("[" + player2.ClanTag + "] " + player2.PlayerName) : player2.PlayerName) : string.Empty),
         Label3EffectColor = HUDDesktopEventStream.GetPlayerColor(player2),
         TimeEnd           = Time.time + this.displayTime
     });
     if (this.items.Count > this.maxItems)
     {
         this.items.Dequeue();
     }
     this.ApplyChanges();
 }
예제 #14
0
 // Token: 0x06001A2F RID: 6703 RVA: 0x00089B88 File Offset: 0x00087D88
 public TrainingRoom()
 {
     GameState.Current.MatchState.RegisterState(GameStateId.PregameLoadout, new PregameLoadoutState(GameState.Current.MatchState));
     GameState.Current.MatchState.RegisterState(GameStateId.MatchRunning, new OfflineMatchState(GameState.Current.MatchState));
     GameState.Current.PlayerState.RegisterState(PlayerStateId.Playing, new PlayerPlayingState(GameState.Current.PlayerState));
     GameState.Current.PlayerState.RegisterState(PlayerStateId.Killed, new PlayerKilledOfflineState(GameState.Current.PlayerState));
     GameState.Current.PlayerState.RegisterState(PlayerStateId.Paused, new PlayerPausedState(GameState.Current.PlayerState));
     GameState.Current.PlayerState.RegisterState(PlayerStateId.Overview, new PlayerOverviewState(GameState.Current.PlayerState));
     GameState.Current.Actions.KillPlayer = delegate()
     {
         if (GameState.Current.IsInGame)
         {
             GameState.Current.PlayerKilled(0, PlayerDataManager.Cmid, (UberstrikeItemClass)0, (BodyPart)0, Vector3.zero);
         }
     };
     GameState.Current.Actions.ExplosionHitDamage = delegate(int targetCmid, ushort damage, Vector3 force, byte slot, byte distance)
     {
         GameStateHelper.PlayerHit(targetCmid, damage, BodyPart.Body, force);
         if (GameState.Current.PlayerData.Health <= 0)
         {
             GameState.Current.PlayerData.Set(PlayerStates.Dead, true);
             GameState.Current.PlayerKilled(targetCmid, targetCmid, Singleton <WeaponController> .Instance.GetCurrentWeapon().View.ItemClass, BodyPart.Body, force);
         }
     };
     GameState.Current.Actions.JoinTeam = delegate(TeamID team)
     {
         GameActorInfo gameActorInfo = new GameActorInfo
         {
             Cmid      = PlayerDataManager.Cmid,
             SkinColor = PlayerDataManager.SkinColor
         };
         GameState.Current.PlayerData.Player           = gameActorInfo;
         GameState.Current.Players[gameActorInfo.Cmid] = gameActorInfo;
         GameState.Current.InstantiateAvatar(gameActorInfo);
         GameState.Current.MatchState.SetState(GameStateId.MatchRunning);
         UnityRuntime.StartRoutine(this.ShowTrainingGameMessages());
     };
     TabScreenPanelGUI.SortPlayersByRank = new Action <IEnumerable <GameActorInfo> >(GameStateHelper.SortDeathMatchPlayers);
     AutoMonoBehaviour <UnityRuntime> .Instance.OnUpdate += this.OnUpdate;
     GameStateHelper.EnterGameMode();
     GameState.Current.MatchState.SetState(GameStateId.PregameLoadout);
 }
예제 #15
0
    // Token: 0x06001A8E RID: 6798 RVA: 0x0008A94C File Offset: 0x00088B4C
    public void PlayerKilled(int shooter, int target, UberstrikeItemClass weaponClass, BodyPart bodyPart, Vector3 direction)
    {
        CharacterConfig characterConfig;

        if (this.Avatars.TryGetValue(target, out characterConfig) && !characterConfig.IsDead)
        {
            this.Avatars[target].SetDead(direction, BodyPart.Body, target, weaponClass);
            GameActorInfo valueOrDefault  = this.Players.GetValueOrDefault(shooter, null);
            GameActorInfo valueOrDefault2 = this.Players.GetValueOrDefault(target, null);
            if (valueOrDefault2 == null)
            {
                Debug.LogError("Kill target is null " + target);
            }
            GameData.Instance.OnPlayerKilled.Fire(valueOrDefault, valueOrDefault2, weaponClass, bodyPart);
            if (target == PlayerDataManager.Cmid)
            {
                global::EventHandler.Global.Fire(new GameEvents.PlayerDied());
            }
        }
    }
 // Token: 0x060019FF RID: 6655 RVA: 0x00089A40 File Offset: 0x00087C40
 protected override void OnPlayerJoinedGame(GameActorInfo player, PlayerMovement position)
 {
     Debug.Log("OnPlayerJoinedGame " + player.PlayerName);
     GameState.Current.Players[player.Cmid] = player;
     if (player.Cmid == PlayerDataManager.Cmid)
     {
         GameState.Current.PlayerData.Player = player;
     }
     else
     {
         GameState.Current.RemotePlayerStates.AddCharacterInfo(player, position);
     }
     if (player.IsSpectator && player.Cmid == PlayerDataManager.Cmid)
     {
         GameState.Current.PlayerData.Set(PlayerStates.Spectator, true);
     }
     else if (GameState.Current.MatchState.CurrentStateId != GameStateId.None && !player.IsSpectator)
     {
         GameState.Current.InstantiateAvatar(player);
     }
     GameState.Current.UpdateTeamCounter();
 }
예제 #17
0
 // Token: 0x06001A9A RID: 6810 RVA: 0x0008B164 File Offset: 0x00089364
 public void InstantiateAvatar(GameActorInfo info)
 {
     if (!this.Avatars.ContainsKey(info.Cmid))
     {
         if (info.Cmid == PlayerDataManager.Cmid)
         {
             CharacterConfig characterConfig = PrefabManager.Instance.InstantiateLocalCharacter();
             this.Avatars.Add(info.Cmid, characterConfig);
             this.ConfigureAvatar(info, characterConfig, true);
         }
         else
         {
             CharacterConfig characterConfig2 = PrefabManager.Instance.InstantiateRemoteCharacter();
             this.Avatars.Add(info.Cmid, characterConfig2);
             this.ConfigureAvatar(info, characterConfig2, false);
         }
     }
     else
     {
         Debug.LogError(string.Format("Failed call of InstantiateAvatar {0} because already existing!", info.Cmid));
     }
 }
예제 #18
0
    // Token: 0x060015E4 RID: 5604 RVA: 0x0007AA7C File Offset: 0x00078C7C
    public static void HandleKilledMessage(GameActorInfo shooter, GameActorInfo target, UberstrikeItemClass weapon, BodyPart bodyPart)
    {
        bool flag = GameState.Current.GameMode == GameModeType.None;

        if (flag)
        {
            return;
        }
        if (target == null)
        {
            return;
        }
        if (shooter == null || shooter == target)
        {
            GameData.Instance.OnHUDStreamMessage.Fire(target, LocalizedStrings.NKilledThemself, null);
        }
        else
        {
            string v = string.Empty;
            if (weapon == UberstrikeItemClass.WeaponMelee)
            {
                v = "smacked";
            }
            else if (bodyPart == BodyPart.Head)
            {
                v = "headshot";
            }
            else if (bodyPart == BodyPart.Nuts)
            {
                v = "nutshot";
            }
            else
            {
                v = "killed";
            }
            GameData.Instance.OnHUDStreamMessage.Fire(shooter, v, target);
        }
    }
예제 #19
0
    // Token: 0x06001A3E RID: 6718 RVA: 0x0008A1DC File Offset: 0x000883DC
    public TryInShopRoom()
    {
        GameState.Current.MatchState.RegisterState(GameStateId.MatchRunning, new OfflineMatchState(GameState.Current.MatchState));
        GameState.Current.PlayerState.RegisterState(PlayerStateId.Playing, new PlayerPlayingState(GameState.Current.PlayerState));
        GameState.Current.PlayerState.RegisterState(PlayerStateId.Paused, new PlayerPausedState(GameState.Current.PlayerState));
        GameState.Current.Actions.DirectHitDamage = delegate(int targetCmid, ushort damage, BodyPart part, Vector3 force, byte slot, byte bullets)
        {
            GameState.Current.Player.MoveController.ApplyForce(force, CharacterMoveController.ForceType.Additive);
        };
        AutoMonoBehaviour <UnityRuntime> .Instance.OnUpdate += this.OnUpdate;
        GameStateHelper.EnterGameMode();
        GameActorInfo gameActorInfo = new GameActorInfo
        {
            Cmid      = PlayerDataManager.Cmid,
            SkinColor = PlayerDataManager.SkinColor
        };

        GameState.Current.PlayerData.Player           = gameActorInfo;
        GameState.Current.Players[gameActorInfo.Cmid] = gameActorInfo;
        GameState.Current.InstantiateAvatar(gameActorInfo);
        MenuPageManager.Instance.UnloadCurrentPage();
        GameState.Current.MatchState.SetState(GameStateId.MatchRunning);
    }
예제 #20
0
 // Token: 0x060015E3 RID: 5603 RVA: 0x0007A9DC File Offset: 0x00078BDC
 public static Color GetPlayerColor(GameActorInfo player)
 {
     if (player == null)
     {
         return(Color.white);
     }
     if (player.Cmid == PlayerDataManager.Cmid)
     {
         return(Color.green.SetAlpha(0.549019635f));
     }
     if (GameState.Current.GameMode == GameModeType.DeathMatch)
     {
         return(new Color(0.5019608f, 0.5019608f, 0.5019608f, 0.549019635f));
     }
     if (player.TeamID == TeamID.BLUE)
     {
         return(GUIUtils.ColorBlue.SetAlpha(0.549019635f));
     }
     if (player.TeamID == TeamID.RED)
     {
         return(GUIUtils.ColorRed.SetAlpha(0.549019635f));
     }
     return(Color.black);
 }
 // Token: 0x06001B0C RID: 6924 RVA: 0x00011F7C File Offset: 0x0001017C
 public void AddCharacterInfo(GameActorInfo player, PlayerMovement position)
 {
     this.remoteStates[player.PlayerId] = new RemoteCharacterState(player, position);
 }
예제 #22
0
 // Token: 0x060009A0 RID: 2464 RVA: 0x00008072 File Offset: 0x00006272
 private float GetKDR(GameActorInfo player)
 {
     return(((player.Kills <= 0) ? 1f : ((float)player.Kills)) / ((player.Deaths <= 0) ? 1f : ((float)player.Deaths)));
 }
예제 #23
0
 // Token: 0x06001312 RID: 4882
 protected abstract void OnPlayerJoinedGame(GameActorInfo player, PlayerMovement position);
        // Token: 0x060010C1 RID: 4289 RVA: 0x00016B78 File Offset: 0x00014D78
        public static void Serialize(Stream stream, GameActorInfo instance)
        {
            int num = 0;

            using (MemoryStream memoryStream = new MemoryStream())
            {
                EnumProxy <MemberAccessLevel> .Serialize(memoryStream, instance.AccessLevel);

                ByteProxy.Serialize(memoryStream, instance.ArmorPointCapacity);
                ByteProxy.Serialize(memoryStream, instance.ArmorPoints);
                EnumProxy <ChannelType> .Serialize(memoryStream, instance.Channel);

                if (instance.ClanTag != null)
                {
                    StringProxy.Serialize(memoryStream, instance.ClanTag);
                }
                else
                {
                    num |= 1;
                }
                Int32Proxy.Serialize(memoryStream, instance.Cmid);
                EnumProxy <FireMode> .Serialize(memoryStream, instance.CurrentFiringMode);

                ByteProxy.Serialize(memoryStream, instance.CurrentWeaponSlot);
                Int16Proxy.Serialize(memoryStream, instance.Deaths);
                if (instance.FunctionalItems != null)
                {
                    ListProxy <int> .Serialize(memoryStream, instance.FunctionalItems, new ListProxy <int> .Serializer <int>(Int32Proxy.Serialize));
                }
                else
                {
                    num |= 2;
                }
                if (instance.Gear != null)
                {
                    ListProxy <int> .Serialize(memoryStream, instance.Gear, new ListProxy <int> .Serializer <int>(Int32Proxy.Serialize));
                }
                else
                {
                    num |= 4;
                }
                Int16Proxy.Serialize(memoryStream, instance.Health);
                Int16Proxy.Serialize(memoryStream, instance.Kills);
                Int32Proxy.Serialize(memoryStream, instance.Level);
                UInt16Proxy.Serialize(memoryStream, instance.Ping);
                ByteProxy.Serialize(memoryStream, instance.PlayerId);
                if (instance.PlayerName != null)
                {
                    StringProxy.Serialize(memoryStream, instance.PlayerName);
                }
                else
                {
                    num |= 8;
                }
                EnumProxy <PlayerStates> .Serialize(memoryStream, instance.PlayerState);

                if (instance.QuickItems != null)
                {
                    ListProxy <int> .Serialize(memoryStream, instance.QuickItems, new ListProxy <int> .Serializer <int>(Int32Proxy.Serialize));
                }
                else
                {
                    num |= 16;
                }
                ByteProxy.Serialize(memoryStream, instance.Rank);
                ColorProxy.Serialize(memoryStream, instance.SkinColor);
                EnumProxy <SurfaceType> .Serialize(memoryStream, instance.StepSound);

                EnumProxy <TeamID> .Serialize(memoryStream, instance.TeamID);

                if (instance.Weapons != null)
                {
                    ListProxy <int> .Serialize(memoryStream, instance.Weapons, new ListProxy <int> .Serializer <int>(Int32Proxy.Serialize));
                }
                else
                {
                    num |= 32;
                }
                Int32Proxy.Serialize(stream, ~num);
                memoryStream.WriteTo(stream);
            }
        }
예제 #25
0
 // Token: 0x06001A84 RID: 6788 RVA: 0x00011A30 File Offset: 0x0000FC30
 public bool TryGetActorInfo(int cmid, out GameActorInfo player)
 {
     return(this.Players.TryGetValue(cmid, out player) && player != null);
 }
예제 #26
0
 // Token: 0x06000A76 RID: 2678 RVA: 0x0000881E File Offset: 0x00006A1E
 public CommUser(GameActorInfo user)
 {
     this.Cmid    = user.Cmid;
     this.Name    = user.PlayerName;
     this.ActorId = user.Cmid;
 }