public CharacterMoveController(ServerPlayer player) { m_facingRight = true; m_wallWalkTimer = 0; m_player = player; }
public CharacterInputProcessor(ServerPlayer player) { m_player = player; m_horMov = 0; m_verMov = 0; game = ServerGame.Inst; }
public void Fire(ServerPlayer player, FireInfo info) { GameObject projObj = (GameObject)Network.Instantiate(weaponPrefab, info.origin, Quaternion.identity, 2); projObj.GetComponent<Projectile>().Init(player, this, info); fireTimer = fireRate; ammo--; }
public CharacterRenderer(ServerPlayer player) { m_player = player; m_characterRenderer = m_player.GetComponent<SpriteRenderer>(); m_animator = m_player.GetComponent<Animator>(); normalMaterial = (Material)Resources.Load("Materials/Player/Normal", typeof(Material)); effectMaterials = (MaterialSet)Resources.Load("Materials/Player/effects", typeof(MaterialSet)); }
protected override void OnCollideToPlayer(ServerPlayer character, Vector2 point) { //When Hit My Player if (character) { if (owner == character.GetOwner()) return; if (character.IsDead()) return; DamageAround(new Vector2(transform.position.x, transform.position.y)); DestroyFromNetwork(); } }
// Use this for initialization void Start() { if (!Network.isServer) return; player = transform.parent.gameObject.GetComponent<ServerPlayer> (); contactingGrounds = new HashSet<GameObject> (); rayDirections = new Vector2[detectionPoints.Length]; rayDistances = new float[detectionPoints.Length]; for(int i = 0; i < detectionPoints.Length; i++) { rayDirections[i] = new Vector2(detectionPoints[i].localPosition.x, detectionPoints[i].localPosition.y); rayDistances[i] = rayDirections[i].magnitude; } }
// Use this for initialization void Start() { player = transform.parent.gameObject.GetComponent<ServerPlayer> (); contactingWalls = new HashSet<GameObject> (); walledEnv = facing == Facing.FRONT ? CharacterEnv.WALLED_FRONT : CharacterEnv.WALLED_BACK; rayRightDirections = new Vector2[detectionPoints.Length]; rayLeftDirections = new Vector2[detectionPoints.Length]; rayDistances = new float[detectionPoints.Length]; for(int i = 0; i < detectionPoints.Length; i++) { rayRightDirections[i] = new Vector2(detectionPoints[i].position.x - transform.position.x, detectionPoints[i].position.y - transform.position.y); rayLeftDirections[i] = new Vector2(-detectionPoints[i].position.x + transform.position.x, detectionPoints[i].position.y - transform.position.y); rayDistances[i] = rayRightDirections[i].magnitude; } }
protected override void OnCollideToPlayer(ServerPlayer character, Vector2 point) { //When Hit My Player if (character) { if (owner == character.GetOwner()) return; if (character.IsDead()) return; character.Damage(damage, new NetworkMessageInfo()); ImpactTarget(character.GetComponent<Rigidbody2D>(), impact); DestroyFromNetwork(); } }
public override void HandleCommand(BinaryReader reader, int playerNumber) { if (Main.netMode == 2) { var val = reader.ReadInt32(); var player = Main.player[playerNumber]; var splayer = player.GetServerPlayer(); var maxspawns = typeof(NPC).GetField("defaultMaxSpawns", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static); if (val < 0) { splayer.SendInfoMessage($"当前最大刷怪次数为:{(int)maxspawns.GetValue(null)}"); } else { maxspawns.SetValue(null, val); var s = $"玩家 {player.name} 设置最大刷怪次数为 {val}"; ServerPlayer.SendInfoMessageToAll(s); CommandBoardcast.ConsoleMessage(s); } } }
public void LoadGame(League league, ServerGame serverGame) { Items.Clear(); if (serverGame.Players.Count == 0 && serverGame.Game != null) // ServerGame is a fake, created from game; but ServerGame.Players is not filled in yet, so fill it in. { foreach (var player in serverGame.Game.Players()) { var serverPlayer = new ServerPlayer(); player.CopyTo(serverPlayer); if (league != null) { LeaguePlayer leagueplayer = league.LeaguePlayer(player); if (leagueplayer != null) { serverPlayer.Alias = leagueplayer.Name; } } serverGame.Players.Add(serverPlayer); } } if (serverGame.Players != null) { foreach (var player in serverGame.Players) { ListViewItem item = new ListViewItem(player.Pack, (int)player.Colour); item.SubItems.Add(player.Alias); item.SubItems.Add(player.Score.ToString(CultureInfo.CurrentCulture)); item.Tag = player; player.Item = item; Items.Add(item); } } ListView.Sort(); }
public override void HandleCommand(BinaryReader reader, int playerNumber) { // 服务器端 if (Main.netMode == 2) { var name = reader.ReadString(); var splayer = Main.player[playerNumber].GetServerPlayer(); if (splayer.Union == null) { splayer.SendMessageBox("你不在任何一个公会中", 120, Color.OrangeRed); return; } if (!ServerSideCharacter2.UnionManager.ContainsUnion(name)) { splayer.SendMessageBox("不存在这个名字的公会", 120, Color.OrangeRed); return; } if (splayer.Union.Name != name && !splayer.Group.IsSuperAdmin) { splayer.SendMessageBox("你只能解散/退出自己的公会", 180, Color.OrangeRed); return; } if (splayer.Union.Owner == splayer.Name || splayer.Group.IsSuperAdmin) { ServerSideCharacter2.UnionManager.RemoveUnion(name); splayer.SendMessageBox("公会解散成功", 180, Color.LimeGreen); var str = $"玩家 {splayer.Name} 解散了公会 {name}!"; ServerPlayer.SendInfoMessageToAll(str); CommandBoardcast.ConsoleMessage(str); } else { var union = splayer.Union; union.RemoveMember(splayer); splayer.SendMessageBox("退出公会成功", 180, Color.LimeGreen); CommandBoardcast.ConsoleMessage($"玩家 {splayer.Name} 退出了公会 {union.Name}"); } } }
private void FnSCEPNICH_0A(ServerPlayer player, MapEventType type, bool doMsgs) { int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0; L0000: // BEGIN; L0003 : ax = HasItem(player, 0xE3); L0011 : if (JumpEqual) { goto L003D; } L0013 : ax = IsFlagOn(player, FlagTypeMap, 0x01); L0026 : if (JumpEqual) { goto L003D; } L0028 : ax = IsFlagOn(player, FlagTypeMap, 0x02); L003B : if (JumpNotEqual) { goto L0055; } L003D : ax = IsFlagOn(player, FlagTypeMap, 0x03); L0050 : if (JumpNotEqual) { goto L0055; } L0052 : goto L00E0; L0055 : RemoveItem(player, 0xE3); L0061 : SetFlag(player, FlagTypeMap, 0x03, 0x01); L0076 : SetWallPassable(player, GetCurrentTile(player), 0x03, 0x01); L0090 : SetWallItem(player, 0x01, GetCurrentTile(player), 0x03); L00AA : ShowMessage(player, doMsgs, String06E3); // Cleowyn's Scepter is taken from you by spectral hands and is placed in a niche in the wall. L00B7 : ShowMessage(player, doMsgs, String073F); // The spirit of King Cleowyn whispers - L00C4 : ShowMessage(player, doMsgs, String0765); // 'Well done! The reward is yours for the taking, if you dare claim it. L00D1 : ShowMessage(player, doMsgs, String07AC); // The door to the tomb opens. L00DE : goto L0106; L00E0 : SetWallPassable(player, GetCurrentTile(player), 0x03, 0x00); L00F9 : ShowMessage(player, doMsgs, String07C8); // There is a niche in the wall which seems designed to hold a scepter. L0106 : return; // RETURN; }
private void FnSTRMNSTR_09(ServerPlayer player, MapEventType type, bool doMsgs) { int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0; L0000: // BEGIN; L0003 : Compare(PartyCount(player), 0x0001); L000E : if (JumpNotEqual) { goto L0025; } L0010 : AddEncounter(player, 0x01, 0x23); L0022 : goto L012E; L0025 : Compare(PartyCount(player), 0x0002); L0030 : if (JumpNotEqual) { goto L0059; } L0032 : AddEncounter(player, 0x01, 0x24); L0044 : AddEncounter(player, 0x02, 0x24); L0056 : goto L012E; L0059 : Compare(PartyCount(player), 0x0003); L0064 : if (JumpNotEqual) { goto L00C2; } L0066 : AddEncounter(player, 0x01, 0x24); L0078 : AddEncounter(player, 0x02, 0x24); L008A : AddEncounter(player, 0x03, 0x23); L009C : AddEncounter(player, 0x04, 0x23); L00AE : AddEncounter(player, 0x05, 0x26); L00C0 : goto L012E; L00C2 : AddEncounter(player, 0x01, 0x28); L00D4 : AddEncounter(player, 0x02, 0x25); L00E6 : AddEncounter(player, 0x03, 0x23); L00F8 : AddEncounter(player, 0x04, 0x27); L010A : AddEncounter(player, 0x05, 0x24); L011C : AddEncounter(player, 0x06, 0x28); L012E : return; // RETURN; }
public bool UseBuilding(ServerPlayer a_player, Vector3 a_distCheckPos, bool a_repair = false) { bool result = false; float num = 9999999f; int num2 = -1; Vector3 a = Vector3.zero; for (int i = 0; i < this.m_buildings.Count; i++) { if (null != this.m_buildings[i]) { a = this.m_buildings[i].transform.position; if (Buildings.IsDoor(this.m_buildings[i].m_type)) { a += this.m_buildings[i].transform.right; } float sqrMagnitude = (a - a_distCheckPos).sqrMagnitude; if (sqrMagnitude < num) { num2 = i; num = sqrMagnitude; } } } float num3 = (num2 == -1 || this.m_buildings[num2].m_type != 103) ? 2.4f : 1.2f; if (num < num3) { if (a_repair) { result = this.m_buildings[num2].Repair(a_player); } else { result = this.m_buildings[num2].Use(a_player); } } return(result); }
private void handleConnectionConfirmation(ClientConnectedMessage ccm) { if (client.getPlayer().name.Equals(ccm.name)) { client.setTime(ccm._TimeStamp); this.client.getPlayer().id = ccm.id; } else { if (!client.getOtherPlayers().ContainsKey(ccm.id)) { GameObject go = GameObject.Instantiate(client.otherPlayersPrefab); go.tag = "serverplayer"; ServerPlayer newPlayer = go.GetComponent <ServerPlayer>(); newPlayer.id = ccm.id; newPlayer.name = ccm.name; client.getOtherPlayers().Add(ccm.id, newPlayer); } // Else ignore } client.getOutgoingMessages().Add(new AckMessage(ccm._MessageId)); }
public void ExtractPlayersData() { try { if (!File.Exists(FileName)) { CommandBoardcast.ConsoleMessage(GameLanguage.GetText("creatingPlayerDoc")); ServerSideCharacter2.PlayerCollection = new PlayerCollection(); SavePlayersData(); return; } CommandBoardcast.ConsoleMessage(GameLanguage.GetText("readingPlayerDoc")); string data; using (var reader = new StreamReader(FileName, Encoding.UTF8)) { data = reader.ReadToEnd(); } var dict = JsonConvert.DeserializeObject <ServerPlayerInfo>(data); if (dict.Playerdata.Count > 0) { foreach (var player in dict.Playerdata) { var p = new ServerPlayer(); p.SetPlayerInfo(player.Value); p.LoadFromInfo(); ServerSideCharacter2.PlayerCollection.Add(p); } ServerSideCharacter2.PlayerCollection.SetID(dict.CurrentID); } CommandBoardcast.ConsoleMessage(GameLanguage.GetText("FinishReadPlayerDoc")); CommandBoardcast.ConsoleMessage($"共计 {ServerSideCharacter2.PlayerCollection.Count} 名玩家的存档"); } catch (Exception ex) { CommandBoardcast.ConsoleError(ex); } }
public bool ProcessUpdate() { Update(); ServerPlayer newPlayer = PopNewPlayer(); while (newPlayer != null) { lock (PlayerList) PlayerList.Add(newPlayer); PlayerAdded(newPlayer); newPlayer = PopNewPlayer(); } ServerPlayer[] locals = null; lock (PlayerList) { lock (NewPlayers) { if (PlayerList.Count == 0 && NewPlayers.Count == 0) { return(false); } } locals = PlayerList.ToArray(); } foreach (ServerPlayer player in locals) { player.Update(); UpdatePlayer(player); } return(true); }
private void FnMNRPLATC_14(ServerPlayer player, MapEventType type, bool doMsgs) { int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0; L0000: // BEGIN; L0003 : ShowPortrait(player, 0x0023); L0010 : RefreshCompareFlags(GetFlag(player, FlagTypeDungeon, FlagUsedHiddenMineKey)); L0023 : if (JumpEqual) { goto L008F; } L0025 : ShowMessage(player, doMsgs, String1094); // The dwarf miner greets you with youthful enthusiasm. L0032 : RefreshCompareFlags(GetFlag(player, FlagTypeDungeon, FlagMinerReward)); L0045 : if (JumpNotEqual) { goto L008D; } L0047 : SetFlag(player, FlagTypeDungeon, FlagMinerReward, 0x01); L005C : ShowMessage(player, doMsgs, String10C9); // You show signs of entering my caves! I thank-you for clearing my mines and repay you with treasure. L0069 : GiveItem(player, 0xBA); L0075 : GiveItem(player, 0xBA); L0081 : GiveItem(player, 0xBA); L008D : goto L00FB; L008F : ax = HasItem(player, 0xD7); // has the hidden mine key? L009D : if (JumpEqual) { goto L00BB; } L009F : ShowMessage(player, doMsgs, String112E); // The dwarf miner smiles as you approach. L00AC : ShowMessage(player, doMsgs, String1156); // 'Have you found my cave yet? It is by the water's edge.' L00B9 : goto L00FB; L00BB : ShowMessage(player, doMsgs, String1190); // An apprentice dwarf miner notices your arrival. L00C8 : ShowMessage(player, doMsgs, String11C0); // 'Adventurers! At last! I've heard tales from the elders about your deeds. I, too, have a cave, well hidden beyond the edges of the waters. L00D5 : ShowMessage(player, doMsgs, String124E); // Monsters have forced me from my home. I am not strong enough to fight them. L00E2 : ShowMessage(player, doMsgs, String129A); // Perhaps, if I give you the key to my small cave, you will do me a favor. Then I may repay you well some day.' L00EF : GiveItem(player, 0xD7); L00FB : return; // RETURN; }
private void FnSTRMNSTR_0D(ServerPlayer player, MapEventType type, bool doMsgs) { int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0; L0000: // BEGIN; L0003 : Compare(PartyCount(player), 0x0001); L000E : if (JumpEqual) { goto L001D; } L0010 : Compare(PartyCount(player), 0x0002); L001B : if (JumpNotEqual) { goto L0056; } L001D : AddEncounter(player, 0x01, 0x1F); L002F : AddEncounter(player, 0x02, 0x1F); L0041 : AddEncounter(player, 0x03, 0x1D); L0053 : goto L012B; L0056 : Compare(PartyCount(player), 0x0003); L0061 : if (JumpNotEqual) { goto L00BF; } L0063 : AddEncounter(player, 0x01, 0x1E); L0075 : AddEncounter(player, 0x02, 0x1D); L0087 : AddEncounter(player, 0x03, 0x1D); L0099 : AddEncounter(player, 0x04, 0x1E); L00AB : AddEncounter(player, 0x05, 0x20); L00BD : goto L012B; L00BF : AddEncounter(player, 0x01, 0x1F); L00D1 : AddEncounter(player, 0x02, 0x1F); L00E3 : AddEncounter(player, 0x03, 0x20); L00F5 : AddEncounter(player, 0x04, 0x20); L0107 : AddEncounter(player, 0x05, 0x1E); L0119 : AddEncounter(player, 0x06, 0x1E); L012B : return; // RETURN; }
public async override Task HandleVoid(JoinGameCommand request, CancellationToken cancellationToken) { var game = await gameRepository.GetByCode(request.GameCode.ToUpper()); var allPlayersClient = hubContextFacade.GetGroup(request.GameCode.ToUpper()); var callingPlayerClient = hubContextFacade.GetClient(request.ConnectionId); var player = game.Players.FirstOrDefault(player => player.Username == request.Username); if (player is not null && player.ConnectionId is not null) { throw new Exception($"Username {request.Username} has been taken in the game {request.GameCode}."); } if (player is null) { player = new ServerPlayer(request.Username, request.ConnectionId); game.Players.Add(player); } else { player.Status = PlayerStatus.Lobby; player.ConnectionId = request.ConnectionId; } await callingPlayerClient.GameJoined( gameStatus : game.Status, existingPlayersInGame : game.Players.Cast <Player>().ToList(), cardsInHand : player.CardsInHand, cardsOnTable : game.CardsOnTable, currentRoundNumber : game.RoundNumber, currentQuestion : game.CurrentQuestion, currentCardCzar : game.CurrentCardCzar); await allPlayersClient.PlayerJoined((Player)player); await hubContextFacade.JoinGroup(request.GameCode.ToUpper(), request.ConnectionId); }
private void FnSECDOOR_12(ServerPlayer player, MapEventType type, bool doMsgs) { int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0; L0000: // BEGIN; L0003 : Compare(HasUsedSkill(player, type, ref doMsgs, 0x0D), 0x0008); L0012 : if (JumpNotBelow) { goto L0063; } L0014 : RefreshCompareFlags(HasUsedSpell(player, type, ref doMsgs, 0x17)); L0022 : if (JumpNotEqual) { goto L0063; } L0024 : ax = HasUsedItem(player, type, ref doMsgs, 0xA2, 0xA2); L0037 : if (JumpNotEqual) { goto L0063; } L0039 : ax = HasUsedItem(player, type, ref doMsgs, 0xBD, 0xBD); L004C : if (JumpNotEqual) { goto L0063; } L004E : ax = HasUsedItem(player, type, ref doMsgs, 0xBE, 0xBE); L0061 : if (JumpEqual) { goto L009E; } L0063 : ShowMessage(player, doMsgs, String0A73); // You detect a secret door in the wall. L0070 : SetWallItem(player, 0x01, 0xED, 0x02); L0086 : SetWallPassable(player, 0xED, 0x02, 0x01); L009C : goto L00C0; L009E : ShowMessage(player, doMsgs, String0A99); // You see a blank wall. L00AB : SetWallPassable(player, 0xED, 0x02, 0x00); L00C0 : return; // RETURN; }
private void SetAggressor(Transform a_aggressor) { if (!Global.isServer || !(null != m_server) || !(null != a_aggressor)) { return; } bool flag = false; if (Time.time > m_nextDropTime) { int num = -1; int a_amount = 1; int num2 = Random.Range(0, 8); if (num2 == 0) { num = Items.GetRandomType(90f); a_amount = ((!Items.HasCondition(num)) ? 1 : Random.Range(1, 20)); } else if (3 > num2) { num = Random.Range(130, 134); } if (num != -1 && Items.IsValid(num)) { m_server.CreateFreeWorldItem(num, a_amount, a_aggressor.position); flag = true; } m_nextDropTime = Time.time + Random.Range(m_dropInterval * 0.6f, m_dropInterval * 1.4f); } if (!flag) { ServerPlayer playerByTransform = m_server.GetPlayerByTransform(a_aggressor); if (playerByTransform != null) { m_server.SendSpecialEvent(playerByTransform, eSpecialEvent.empty); } } }
public void KickMember(ServerPlayer player) { lock (this) { if (player == null) { return; } if (player.Name == Owner) { return; } if (Remove(player)) { string s = $"玩家 {player.Name} 被踢出了公会"; foreach (var member in Members) { var splayer = ServerSideCharacter2.PlayerCollection.Get(member); splayer?.SendInfoMessage(s); } } } }
public void AcceptCandidate(ServerPlayer player) { lock (this) { if (player.Union != null) { return; } if (!Candidates.Contains(player.Name)) { return; } Candidates.Remove(player.Name); AddMember(player); string s = $"欢迎 {player.Name} 加入公会"; foreach (var member in Members) { var splayer = ServerSideCharacter2.PlayerCollection.Get(member); splayer?.SendInfoMessage(s); } CommandBoardcast.ConsoleMessage($"玩家 {player.Name} 加入公会 {Name}"); } }
public void OnChangeWeatherCommand(ServerPlayer player, int weatherId = -1, bool immediately = true) { if (!Enum.IsDefined(typeof(WeatherType), weatherId)) { player.Notify("Ungültige WetterID angegeben (mögliche Werte: 0-14)!", NotificationType.Error); return; } _worldData.Weather = (WeatherType)weatherId; if (immediately) { /*await Task.Delay(500); * * var lambda = new AsyncFunctionCallback<IPlayer>(async (IPlayer p) => * { * p.Emit("World:SetWeatherImmediately"); * await Task.CompletedTask; * }); * * await Alt.ForEachPlayers(lambda);*/ } }
private void FnLKPKDORD_12(ServerPlayer player, MapEventType type, bool doMsgs) { int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0; L0000: // BEGIN; L0003 : ax = HasUsedItem(player, type, ref doMsgs, 0xC3, 0xC4); L0016 : if (JumpNotEqual) { goto L0029; } L0018 : Compare(HasUsedSkill(player, type, ref doMsgs, 0x0E), 0x0009); L0027 : if (JumpBelow) { goto L0074; } L0029 : SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x01); L0047 : SetWallItem(player, 0x01, GetCurrentTile(player), GetFacing(player)); L0065 : ShowMessage(player, doMsgs, String0CF5); // The lock of the door is quickly opened by your skillfulness. L0072 : goto L009E; L0074 : SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x00); L0091 : ShowMessage(player, doMsgs, String0D32); // The door is locked. L009E : return; // RETURN; }
private void FnLKPKDORA_0F(ServerPlayer player, MapEventType type, bool doMsgs) { int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0; L0000: // BEGIN; L0003 : ax = HasUsedItem(player, type, ref doMsgs, 0xBF, 0xC4); L0016 : if (JumpNotEqual) { goto L0029; } L0018 : Compare(HasUsedSkill(player, type, ref doMsgs, 0x0E), 0x0002); L0027 : if (JumpBelow) { goto L0074; } L0029 : SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x01); L0047 : SetWallItem(player, 0x01, GetCurrentTile(player), GetFacing(player)); L0065 : ShowMessage(player, doMsgs, String0C37); // Your skill at picking locks soon has the door open. L0072 : goto L009E; L0074 : SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x00); L0091 : ShowMessage(player, doMsgs, String0C6B); // The door is locked. L009E : return; // RETURN; }
protected virtual bool DoPlayerScore(ServerPlayer victim, ref ScoreInfo victimScoreDelta, ServerPlayer killer, ref ScoreInfo killerScoreDelta, BlowedUpReasons eventReason) { if (victim.ActualTeam == killer.ActualTeam && killer.ActualTeam != BZFlag.Data.Teams.TeamColors.RogueTeam) { killerScoreDelta.TeamKills = 1; } victimScoreDelta.Losses = 1; if (eventReason == BlowedUpReasons.GotShot || eventReason == BlowedUpReasons.GotRunOver) { if (killer.Info.CariedFlag != null && killer.Info.CariedFlag.Flag == FlagTypeList.Genocide && victim.ActualTeam != BZFlag.Data.Teams.TeamColors.RogueTeam) { killerScoreDelta.Wins = victim.Info.Team.Members.FindAll((x) => x.Info.Alive).Count; } else { killerScoreDelta.Wins = 1; } } return(!victimScoreDelta.Empty && !killerScoreDelta.Empty); }
private void KillAndResetPassengers() { for (int i = 0; i < 4; i++) { if (m_data.passengerIds[i] == -1) { continue; } if (null != m_server) { ServerPlayer playerByOnlineid = m_server.GetPlayerByOnlineid(m_data.passengerIds[i]); if (playerByOnlineid != null) { playerByOnlineid.ChangeHealthBy(-10000f); } } if (i == 0) { m_vehicle.AssignInput(0f, 0f, false); } m_data.passengerIds[i] = -1; } }
private void FnSTEPHIDE_05(ServerPlayer player, MapEventType type, bool doMsgs) { int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0; L0000: // BEGIN; L0003 : ax = HasItem(player, 0xD7); L0011 : if (JumpNotEqual) { goto L0028; } L0013 : RefreshCompareFlags(GetFlag(player, FlagTypeDungeon, FlagUsedHiddenMineKey)); L0026 : if (JumpEqual) { goto L0076; } L0028 : RemoveItem(player, 0xD7); L0034 : SetFlag(player, FlagTypeDungeon, FlagUsedHiddenMineKey, 0x01); L0049 : SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x01); L0067 : ShowMessage(player, doMsgs, String0539); // Your Hidden Mine Key makes the wall become transparent. L0074 : goto L0083; L0076 : ShowMessage(player, doMsgs, String0571); // There is something strange about this wall. L0083 : return; // RETURN; }
private void FnSTEPCYCL_03(ServerPlayer player, MapEventType type, bool doMsgs) { int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0; L0000: // BEGIN; L0003 : ax = HasItem(player, 0xD6); L0011 : if (JumpNotEqual) { goto L0028; } L0013 : RefreshCompareFlags(GetFlag(player, FlagTypeDungeon, FlagUsedCyclopsMineKey)); L0026 : if (JumpEqual) { goto L0071; } L0028 : SetWallPassable(player, GetCurrentTile(player), 0x00, 0x01); L0041 : RemoveItem(player, 0xD6); L004D : SetFlag(player, FlagTypeDungeon, FlagUsedCyclopsMineKey, 0x01); L0062 : ShowMessage(player, doMsgs, String047C); // Your Cyclops' Mine Key makes the tapestry translucent, revealing new passages to the southwest. L006F : goto L007E; L0071 : ShowMessage(player, doMsgs, String04DC); // The tapestry glows with the image of a Cyclops. L007E : return; // RETURN; }
private void FnAXSTOLOW_07(ServerPlayer player, bool isForwardMove) { int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0; L0000: // BEGIN; L0003 : ax = CheckLevel(player, 0x000C); L0011 : if (JumpNotEqual) { goto L0016; } L0013 : goto L00B7; L0016 : Compare(PartyCount(player), 0x0001); L0021 : if (JumpEqual) { goto L0026; } L0023 : goto L00B7; L0026 : Compare(GetFlag(player, 0x02, 0x00), 0x0001); L0039 : if (JumpNotEqual) { goto L004B; } 014A 003B FF 76 08 push word [bp + 0x8]
private void FnLKPKDOOR_06(ServerPlayer player, MapEventType type, bool doMsgs) { int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0; L0000: // BEGIN; L0003 : ax = HasUsedItem(player, type, ref doMsgs, 0xC2, 0xC4); L0016 : if (JumpNotEqual) { goto L0029; } L0018 : Compare(HasUsedSkill(player, type, ref doMsgs, 0x0E), 0x0005); L0027 : if (JumpBelow) { goto L006C; } L0029 : SetWallPassable(player, GetCurrentTile(player), 0x01, 0x01); L0043 : SetWallItem(player, 0x01, GetCurrentTile(player), 0x01); L005D : ShowMessage(player, doMsgs, String04EB); // You successfully picked the locked door. L006A : goto L0092; L006C : SetWallPassable(player, GetCurrentTile(player), 0x01, 0x00); L0085 : ShowMessage(player, doMsgs, String0514); // The door is locked. L0092 : return; // RETURN; }
private void FnLKPKDOOR_0A(ServerPlayer player, MapEventType type, bool doMsgs) { int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0; L0000: // BEGIN; L0003 : ax = HasUsedItem(player, type, ref doMsgs, 0xC0, 0xC4); L0016 : if (JumpNotEqual) { goto L0029; } L0018 : Compare(HasUsedSkill(player, type, ref doMsgs, 0x0E), 0x0004); L0027 : if (JumpBelow) { goto L0068; } L0029 : SetWallPassable(player, 0x6F, 0x03, 0x01); L003F : SetWallItem(player, 0x01, GetCurrentTile(player), 0x03); L0059 : ShowMessage(player, doMsgs, String046F); // You successfully picked the locked door. L0066 : goto L008A; L0068 : SetWallPassable(player, 0x6F, 0x03, 0x00); L007D : ShowMessage(player, doMsgs, String0498); // The door is locked. L008A : return; // RETURN; }
internal void HandleFlagTransfer(ServerPlayer player, MsgTransferFlag message) { if (message == null) { return; } if (player.PlayerID != message.ToID) { return; } ServerPlayer target = Players.GetPlayerByID(message.FromID); if (target.Info.CariedFlag == null) { return; } Logger.Log4("Player " + player.Callsign + " wants to grab flag " + target.Info.CariedFlag.Abreviation + " from " + target.Callsign); TransferFlag(target, player); }
private void FnSTEPMINE_04(ServerPlayer player, MapEventType type, bool doMsgs) { int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0; L0000: // BEGIN; L0003 : ax = HasItem(player, 0xD5); L0011 : if (JumpNotEqual) { goto L0028; } L0013 : RefreshCompareFlags(GetFlag(player, FlagTypeDungeon, FlagUsedDwarfMineKey)); L0026 : if (JumpEqual) { goto L0068; } L0028 : RemoveItem(player, 0xD5); L0034 : SetFlag(player, FlagTypeDungeon, FlagUsedDwarfMineKey, 0x01); L0049 : SetFloorItem(player, 0x9C, 0x00); L0059 : ShowMessage(player, doMsgs, String050C); // Your Dwarf Mine Key activated this platform. L0066 : goto L0079; L0068 : SetFloorItem(player, 0x9C, 0x03); L0079 : return; // RETURN; }
private void FnLKPKDOOR_18(ServerPlayer player, MapEventType type, bool doMsgs) { int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0; L0000: // BEGIN; L0003 : ax = HasUsedItem(player, type, ref doMsgs, 0xC1, 0xC4); L0016 : if (JumpNotEqual) { goto L0029; } L0018 : Compare(HasUsedSkill(player, type, ref doMsgs, 0x0E), 0x0006); L0027 : if (JumpBelow) { goto L0074; } L0029 : SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x01); L0047 : SetWallItem(player, 0x01, GetCurrentTile(player), GetFacing(player)); L0065 : ShowMessage(player, doMsgs, String0761); // You successfully picked the locked door. L0072 : goto L009E; L0074 : SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x00); L0091 : ShowMessage(player, doMsgs, String078A); // The door is locked. L009E : return; // RETURN; }
private void OnSwitchVoiceLevel(ServerPlayer player) { var currentLevel = player.VoiceLevel; switch (currentLevel) { case PlayerVoiceLevel.Mute: ChangeVoiceLevel(player, PlayerVoiceLevel.Whisper); break; case PlayerVoiceLevel.Whisper: ChangeVoiceLevel(player, PlayerVoiceLevel.Normal); break; case PlayerVoiceLevel.Normal: ChangeVoiceLevel(player, PlayerVoiceLevel.Shout); break; case PlayerVoiceLevel.Shout: ChangeVoiceLevel(player, PlayerVoiceLevel.Mute); break; } }
protected override void OnInit() { if (Network.isServer) { PlayerManager.Inst.Get(owner).OnFireRope(this); ropeSource = PlayerManager.Inst.Get(owner); stickInfo = new S2C.RopeStickInfo(); stickInfo.isSticked = false; } }
public Player GetPlayer(ServerPlayer serverPlayer) { return data.Find(x => x.serverPlayer == serverPlayer); }
public void GenerateSpawnPosition(ServerPlayer player) { player.Position = _mineserver.MapManager.GenerateSpawnPosition(); }
private void TrySendModifiedChunks(ServerPlayer player, NetworkWriter nw) { for (int i = 0; i < modifiedChunks.Count; i++) { Vec2i offset = modifiedChunks[i].Index - player.ChunkI; if (offset <= PLAYER_CHUNK_RANGE) { modifiedChunks[i].WriteSetChunk(nw); } } }
private void InstantiateNearbyChunks(ServerPlayer player) { Vec2i pChunkI = WorldToChunkI(player.transform.position); if (pChunkI != player.ChunkI) { foreach (ServerVC chunk in chunks.TryGetOutsideInside(player.ChunkI, pChunkI, PLAYER_CHUNK_RANGE)) { if (chunk != null) { if (!chunk.Instantiated) { InstantiateChunk(chunk); } } } player.ChunkI = pChunkI; } foreach (ServerVC chunk in chunks.WithinRange(pChunkI, PLAYER_CHUNK_RANGE)) { if (chunk != null) { chunk.Seen = true; if (!chunk.Instantiated) { InstantiateChunk(chunk); } } } }
public void RemovePlayer(ServerPlayer player, NetworkWriter nw) { int id = playersOnBoard.IndexOf(player); playersOnBoard.RemoveAt(id); player.currentVessel = null; if (playersOnBoard.Count == 0) { noPlayers = true; } if (GameManager.Instance.Initialized) { nw.SeekZero(); nw.Write((ushort)ServerMessageType.RemovePlayer); nw.Write((ushort)id); for (int i = 0; i < playersOnBoard.Count; i++) { //send } } }
protected override void OnCollideToPlayer(ServerPlayer character, Vector2 point) { if (stickInfo.isSticked) return; //When Hit My Player if (character) { if (owner == character.GetOwner()) return; if (character.IsDead()) return; ConnectRope(character); } }
public BuildController(ServerPlayer player) { m_player = player; }
// Use this for initialization void Start() { setting = null; player = transform.parent.gameObject.GetComponent<ServerPlayer>(); }
public void AddPlayer(ServerPlayer player) { m_players.Add(player); }
public bool CheckInBorder(ServerPlayer player) { if (!m_loadCompleted) return true; return CheckInBorder(player.transform); }
public void RemovePlayer(ServerPlayer player) { m_players.Remove(player); }
public void SetPlayer(ServerPlayer serverPlayer) { lastPressedPlayer = serverPlayer; }
public virtual void Init(ServerPlayer player, WeaponInfo weapon, FireInfo info) { owner = player.GetOwner(); direction = info.direction; GetComponent<Rigidbody2D>().AddForce(direction * GetPower(weapon), ForceMode2D.Impulse); long projID = ProjectileManager.Inst.GetUniqueKeyForNewProjectile(); ProjectileManager.Inst.Set(projID, this); Physics2D.IgnoreCollision(collider, player.GetComponent<Collider2D>()); OnInit(); BroadcastInit(); }
public RopeController(ServerPlayer player) { m_player = player; m_rope = null; }
void ConnectToOwner() { ownerPlayer = PlayerManager.Inst.Get(owner); ropeSource = PlayerManager.Inst.Get(owner); ropeSJ = gameObject.AddComponent<SpringJoint2D>(); ropeSJ.connectedBody = ownerPlayer.GetComponent<Rigidbody2D>(); ropeSJ.distance = 5f; ropeSJ.frequency = 2; ropeSJ.dampingRatio = 1; ownerPlayer.RopeFired(this); }
protected abstract void OnCollideToPlayer(ServerPlayer character, Vector2 point);
protected override void SetStatus(byte[] pckData, NetworkMessageInfo info) { S2C.RopeStatus pck = new S2C.RopeStatus(); pck.DeserializeFromBytes(pckData); owner = pck.owner; transform.position = pck.position; GetComponent<Rigidbody2D>().velocity = pck.velocity; ropeSource = PlayerManager.Inst.Get(owner); OnSetRopeStuck(pck.stickInfo); }
public void AddPlayer(ServerPlayer player, NetworkWriter nw) { base.AddPlayer(player, TileCenterToLocal(spawnerLocation), nw); }
void OnSetRopeStuck(S2C.RopeStickInfo info) { stickInfo = info; if (stickInfo.isSticked == false) return; IRopable ropable; switch(info.m_RID.m_type) { case ObjectType.TILE: ropable = TileManager.Inst.Get((ushort)info.m_RID.m_ID); break; case ObjectType.BUILDING: ropable = BuildingManager.Inst.Get((ushort)info.m_RID.m_ID); break; case ObjectType.PLAYER: ropable = PlayerManager.Inst.Get((int)info.m_RID.m_ID); break; /* case ObjectType.PROJECTILE: ropable = ProjectileManager.Inst.Get(info.m_RID.m_ID); break; */ default: return; } transform.position = stickInfo.position; GetComponent<Rigidbody2D>().velocity = new Vector2(0f, 0f); ropable.Roped(this, info.position); ropeTarget = ropable; ropeSource = PlayerManager.Inst.Get(owner); }
public void Init(ServerPlayer owner) { player = owner; weapons = new Dictionary<WeaponType, WeaponInfo>(); indexTypeDic = new Dictionary<int, WeaponType>(); }
public void AddPlayer(ServerPlayer player, Vector2 position, NetworkWriter nw) { if (!interiorExists) { AllocateInteriorSpace(); } player.transform.position = (Vector3)(interiorPosition + position); player.currentVessel = this; playersOnBoard.Add(player); player.ChunkI = WorldToChunkI((Vector2)player.transform.position); InstantiateNearbyChunks(player); noPlayers = false; timeEmpty = 0.0f; if (GameManager.Instance.Initialized) { WriteSyncVessel(nw); //send } if (GameManager.Instance.Initialized) { nw.SeekZero(); nw.Write((ushort)ServerMessageType.AddPlayer); nw.Write((ushort)(playersOnBoard.Count - 1)); nw.Write((Vector2)player.transform.position); //TODO: write player info here for (int i = 0; i < playersOnBoard.Count; i++) { //send } } }