public override void DoWrite(ByteWriter BW) { BW.AppendInt32(ActivePlayerIndex); BW.AppendInt32(TransformingUnitIndex); BW.AppendInt32(Map.ListPlayer[ActivePlayerIndex].ListSquad.IndexOf(ActiveSquad)); BW.AppendBoolean(ShowSquadMembers); }
public override void DoWrite(ByteWriter BW) { BW.AppendInt32(ActivePlayerIndex); BW.AppendInt32(ActiveSquadIndex); BW.AppendFloat(CursorPosition.X); BW.AppendFloat(CursorPosition.Y); BW.AppendFloat(CursorPosition.Z); }
public override void DoWrite(ByteWriter BW) { BW.AppendInt32(ActivePlayerIndex); BW.AppendInt32(ActiveSquadIndex); BW.AppendInt32(Target.Item1); BW.AppendInt32(Target.Item2); }
public override void DoWrite(ByteWriter BW) { BW.AppendBoolean(BattlePreview != null); if (BattlePreview != null) { BW.AppendInt32(BattlePreview.PlayerIndex); BW.AppendInt32(BattlePreview.SquadIndex); } }
public override void DoWrite(ByteWriter BW) { BW.AppendInt32(ActionMenuCursor); BW.AppendInt32(ListMapChangeChoice.Count); for (int C = 0; C < ListMapChangeChoice.Count; ++C) { BW.AppendString(ListMapChangeChoice[C].MapName); } }
public override void DoWrite(ByteWriter BW) { BW.AppendInt32(ActivePlayerIndex); BW.AppendInt32(ActivePlayer.ListCardInHand.Count); for (int C = 0; C < ActivePlayer.ListCardInHand.Count; ++C) { BW.AppendString(ActivePlayer.ListCardInHand[C].Path); } }
public override void DoWrite(ByteWriter BW) { BW.AppendInt32(ListMVChoice.Count); for (int M = 0; M < ListMVChoice.Count; ++M) { BW.AppendFloat(ListMVChoice[M].Position.X); BW.AppendFloat(ListMVChoice[M].Position.Y); BW.AppendInt32((int)ListMVChoice[M].Position.Z); } }
public override void DoWrite(ByteWriter BW) { BW.AppendInt32(ActivePlayerIndex); BW.AppendInt32(ActiveSquadIndex); BW.AppendFloat(LastPosition.X); BW.AppendFloat(LastPosition.Y); BW.AppendInt32((int)LastPosition.Z); BW.AppendFloat(LastCameraPosition.X); BW.AppendFloat(LastCameraPosition.Y); BW.AppendFloat(LastCameraPosition.Z); }
public override void DoWrite(ByteWriter BW) { BW.AppendInt32(ActivePlayerIndex); BW.AppendInt32(ActiveSquadIndex); BW.AppendInt32(ActiveSquad.CurrentLeader.AttackIndex); BW.AppendInt32(ListAttackChoice.Count); for (int A = 0; A < ListAttackChoice.Count; ++A) { BW.AppendFloat(ListAttackChoice[A].X); BW.AppendFloat(ListAttackChoice[A].Y); BW.AppendInt32((int)ListAttackChoice[A].Z); } }
public List <PlayerPOCO> GetFriendList(string ClientID) { List <PlayerPOCO> ListFriend = new List <PlayerPOCO>(); FilterDefinition <BsonDocument> IDFilter = Builders <BsonDocument> .Filter.Eq("_id", new ObjectId(ClientID)); BsonDocument result = PlayersCollection.Aggregate().Match(IDFilter).Lookup("TripleThunder", "Friends", "_id", "FriendsInfo").FirstOrDefault(); BsonArray Friends = result.GetValue("FriendsInfo").AsBsonArray; foreach (BsonDocument ActiveFriend in Friends) { PlayerPOCO FoundPlayer = new PlayerPOCO(); FoundPlayer.ID = ActiveFriend.GetValue("_id").AsObjectId.ToString(); string Name = ActiveFriend.GetValue("Name").AsString; FoundPlayer.Name = Name; ByteWriter BW = new ByteWriter(); BW.AppendString(Name); BW.AppendInt32(ActiveFriend.GetValue("Level").AsInt32); FoundPlayer.Info = BW.GetBytes(); BW.ClearWriteBuffer(); ListFriend.Add(FoundPlayer); } return(ListFriend); }
public override byte[] GetSnapshotData() { ByteWriter BW = new ByteWriter(); BW.AppendInt32(ListAllPlayer.Count); foreach (Player ActivePlayer in ListAllPlayer) { BW.AppendString(ActivePlayer.ConnectionID); BW.AppendString(ActivePlayer.Name); BW.AppendInt32(ActivePlayer.Team); BW.AppendBoolean(ActivePlayer.IsPlayerControlled); BW.AppendByte(ActivePlayer.Color.R); BW.AppendByte(ActivePlayer.Color.G); BW.AppendByte(ActivePlayer.Color.B); BW.AppendByte(ActivePlayer.LocalPlayerIndex); BW.AppendInt32(ActivePlayer.ListSquad.Count); foreach (Squad ActiveSquad in ActivePlayer.ListSquad) { BW.AppendFloat(ActiveSquad.X); BW.AppendFloat(ActiveSquad.Y); BW.AppendFloat(ActiveSquad.Z); BW.AppendBoolean(ActiveSquad.IsPlayerControlled); BW.AppendInt32(ActiveSquad.UnitsInSquad); for (int U = 0; U < ActiveSquad.UnitsInSquad; ++U) { Unit ActiveUnit = ActiveSquad.At(U); BW.AppendString(ActiveUnit.UnitTypeName); BW.AppendString(ActiveUnit.RelativePath); BW.AppendInt32(ActiveUnit.ArrayCharacterActive.Length); for (int C = 0; C < ActiveUnit.ArrayCharacterActive.Length; ++C) { BW.AppendString(ActiveUnit.ArrayCharacterActive[C].FullName); } } } } BW.AppendString(BattleMapPath); byte[] Data = BW.GetBytes(); BW.ClearWriteBuffer(); return(Data); }
public override void DoWrite(ByteWriter BW) { BW.AppendInt32(ActivePlayerIndex); BW.AppendInt32(ActiveSquadIndex); BW.AppendInt32(ActiveSquad.CurrentLeader.AttackIndex); BW.AppendInt32(ListAttackChoice.Count); for (int A = 0; A < ListAttackChoice.Count; ++A) { BW.AppendFloat(ListAttackChoice[A].X); BW.AppendFloat(ListAttackChoice[A].Y); BW.AppendInt32((int)ListAttackChoice[A].Z); } BW.AppendBoolean(BattlePreview != null); if (BattlePreview != null) { BW.AppendInt32(BattlePreview.PlayerIndex); BW.AppendInt32(BattlePreview.SquadIndex); } BW.AppendFloat(Map.CursorPosition.X); BW.AppendFloat(Map.CursorPosition.Y); BW.AppendFloat(Map.CursorPosition.Z); }
public override void DoWrite(ByteWriter BW) { BW.AppendInt32(ListBuildSpot.Count); for (int B = 0; B < ListBuildSpot.Count; ++B) { BW.AppendFloat(ListBuildSpot[B].X); BW.AppendFloat(ListBuildSpot[B].Y); BW.AppendFloat(ListBuildSpot[B].Z); } }
public void Write(ByteWriter BW) { BW.AppendString(Name); DoWrite(BW); BW.AppendInt32(ListNextChoice.Count); foreach (ActionPanel ActiveNextActionPanel in ListNextChoice) { ActiveNextActionPanel.Write(BW); } }
public override void DoWrite(ByteWriter BW) { BW.AppendInt32(ActivePlayerIndex); BW.AppendInt32(ActiveSquadIndex); BW.AppendByte((byte)ActiveSquad.CurrentLeader.BattleDefenseChoice); BW.AppendInt32(ActiveSquad.CurrentLeader.AttackIndex); BW.AppendInt32(TargetPlayerIndex); BW.AppendInt32(TargetSquadIndex); BW.AppendByte((byte)TargetSquad.CurrentLeader.BattleDefenseChoice); BW.AppendInt32(TargetSquad.CurrentLeader.AttackIndex); BW.AppendByte((byte)Map.BattleMenuStage); }
public PlayerPOCO LogInPlayer(string Login, string Password, string GameServerIP, int GameServerPort) { LocalPlayer FoundPlayer = FindPlayer(Login, Password); if (FoundPlayer == null && FindPlayer(Login, null) == null) { LocalPlayer NewPlayer = new LocalPlayer(); NewPlayer.ID = PlayerIDCount++.ToString(); NewPlayer.Login = Login; NewPlayer.Name = Login; NewPlayer.Password = Password; NewPlayer.LoggedIn = true; NewPlayer.Level = 1; NewPlayer.NumberOfFailedConnection = 0; FoundPlayer = NewPlayer; ListPlayer.Add(NewPlayer); } if (FoundPlayer == null) { return(LogInPlayer(Login + "1", Password, GameServerIP, GameServerPort)); } else { ByteWriter BW = new ByteWriter(); BW.AppendString(FoundPlayer.Name); BW.AppendInt32(FoundPlayer.Level); FoundPlayer.Info = BW.GetBytes(); BW.ClearWriteBuffer(); UpdatePlayerIsLoggedIn(FoundPlayer.ID, GameServerIP, GameServerPort); return(FoundPlayer); } }
public PlayerPOCO LogInPlayer(string Login, string Password, string GameServerIP, int GameServerPort) { FilterDefinition <BsonDocument> LastTimeCheckedFilter = Builders <BsonDocument> .Filter.Eq("Login", Login) & Builders <BsonDocument> .Filter.Eq("Password", Password); BsonDocument FoundPlayerDocument = PlayersCollection.Find(LastTimeCheckedFilter).FirstOrDefault(); if (FoundPlayerDocument == null && PlayersCollection.Find(Builders <BsonDocument> .Filter.Eq("Login", Login)).FirstOrDefault() == null) { BsonDocument document = new BsonDocument { { "Login", Login }, { "Name", Login }, { "Level", 1 }, { "Ranking", 1 }, { "License", 1 }, { "Guild", "" }, { "CharacterType", "Jack" }, { "GameServerIP", "" }, { "GameServerPort", 0 }, { "CommunicationServerIP", "" }, { "CommunicationServerPort", 0 }, { "Password", Password }, { "NumberOfFailedConnection", 0 }, { "Equipment", new BsonArray { new BsonDocument { { "Money", 0 }, { "EXP", 0 } } } }, { "Friends", new BsonArray { } } }; PlayersCollection.InsertOne(document); FoundPlayerDocument = PlayersCollection.Find(LastTimeCheckedFilter).FirstOrDefault(); } bool LoggedIn = !string.IsNullOrEmpty(FoundPlayerDocument.GetValue("GameServerIP").AsString); if (LoggedIn) { return(LogInPlayer(Login + "1", Password, GameServerIP, GameServerPort)); } else { PlayerPOCO FoundPlayer = new PlayerPOCO(); FoundPlayer.ID = FoundPlayerDocument.GetValue("_id").AsObjectId.ToString(); string Name = FoundPlayerDocument.GetValue("Name").AsString; FoundPlayer.Name = Name; ByteWriter BW = new ByteWriter(); BW.AppendString(Name); BW.AppendInt32(FoundPlayerDocument.GetValue("Level").AsInt32); FoundPlayer.Info = BW.GetBytes(); BW.ClearWriteBuffer(); UpdatePlayerIsLoggedIn(FoundPlayer.ID, GameServerIP, GameServerPort); return(FoundPlayer); } }
public override void DoWrite(ByteWriter BW) { BW.AppendInt32(ActivePlayerIndex); BW.AppendInt32(ActiveSquadIndex); BW.AppendByte((byte)ActiveSquad.CurrentLeader.BattleDefenseChoice); BW.AppendInt32(ActiveSquad.CurrentLeader.AttackIndex); BW.AppendInt32(TargetPlayerIndex); BW.AppendInt32(TargetSquadIndex); BW.AppendByte((byte)TargetSquad.CurrentLeader.BattleDefenseChoice); BW.AppendInt32(TargetSquad.CurrentLeader.AttackIndex); BW.AppendBoolean(IsDefending); BW.AppendByte((byte)Map.BattleMenuStage); if (Map.IsServer) { BW.AppendInt32(AttackingResult.ArrayResult.Length); for (int R = 0; R < AttackingResult.ArrayResult.Length; ++R) { BW.AppendInt32(AttackingResult.ArrayResult[R].Accuracy); BW.AppendInt32(AttackingResult.ArrayResult[R].AttackAttackerFinalEN); BW.AppendInt32(AttackingResult.ArrayResult[R].AttackDamage); BW.AppendBoolean(AttackingResult.ArrayResult[R].AttackMissed); BW.AppendBoolean(AttackingResult.ArrayResult[R].AttackShootDown); BW.AppendBoolean(AttackingResult.ArrayResult[R].AttackSwordCut); BW.AppendBoolean(AttackingResult.ArrayResult[R].AttackWasCritical); BW.AppendString(AttackingResult.ArrayResult[R].Barrier); BW.AppendBoolean(AttackingResult.ArrayResult[R].Shield); BW.AppendInt32(AttackingResult.ArrayResult[R].TargetPlayerIndex); BW.AppendInt32(AttackingResult.ArrayResult[R].TargetSquadIndex); BW.AppendInt32(AttackingResult.ArrayResult[R].TargetUnitIndex); } BW.AppendInt32(DefendingResult.ArrayResult.Length); for (int R = 0; R < DefendingResult.ArrayResult.Length; ++R) { BW.AppendInt32(DefendingResult.ArrayResult[R].Accuracy); BW.AppendInt32(DefendingResult.ArrayResult[R].AttackAttackerFinalEN); BW.AppendInt32(DefendingResult.ArrayResult[R].AttackDamage); BW.AppendBoolean(DefendingResult.ArrayResult[R].AttackMissed); BW.AppendBoolean(DefendingResult.ArrayResult[R].AttackShootDown); BW.AppendBoolean(DefendingResult.ArrayResult[R].AttackSwordCut); BW.AppendBoolean(DefendingResult.ArrayResult[R].AttackWasCritical); BW.AppendString(DefendingResult.ArrayResult[R].Barrier); BW.AppendBoolean(DefendingResult.ArrayResult[R].Shield); BW.AppendInt32(DefendingResult.ArrayResult[R].TargetPlayerIndex); BW.AppendInt32(DefendingResult.ArrayResult[R].TargetSquadIndex); BW.AppendInt32(DefendingResult.ArrayResult[R].TargetUnitIndex); } } else { } }
public override void DoWrite(ByteWriter BW) { BW.AppendInt32(ActivePlayerIndex); BW.AppendInt32(Movement); }
public override void DoWrite(ByteWriter BW) { BW.AppendInt32(ActivePlayerIndex); BW.AppendInt32(ActiveSquadIndex); BW.AppendInt32(ActionMenuSwitchSquadCursor); }
public override void DoWrite(ByteWriter BW) { BW.AppendInt32(ActivePlayerIndex); BW.AppendInt32(VisibleDiceValue); }
public override void DoWrite(ByteWriter BW) { BW.AppendInt32(ConfirmMenuChoice); }
public override void DoWrite(ByteWriter BW) { BW.AppendInt32(Map.BuildingMenuCursor); }
public override void DoWrite(ByteWriter BW) { BW.AppendBoolean(HasBeenSelected); BW.AppendInt32(StartingPlayerIndex); }
public override void DoWrite(ByteWriter BW) { BW.AppendInt32(SelectedUnitIndex); }
public override void DoWrite(ByteWriter BW) { BW.AppendFloat(PlayerUnit.X); BW.AppendFloat(PlayerUnit.Y); BW.AppendInt32((int)PlayerUnit.Z); }
public override void DoWrite(ByteWriter BW) { BW.AppendInt32(ActivePlayerIndex); BW.AppendInt32(CardCursorIndex); }
public override void DoWrite(ByteWriter BW) { BW.AppendInt32(ActivePlayerIndex); BW.AppendInt32(ActiveSquadIndex); BW.AppendInt32(ActiveSquad.CurrentLeader.AttackIndex); }
public override void DoWrite(ByteWriter BW) { BW.AppendInt32(ConstructionMenuIndex); }
public override void DoWrite(ByteWriter BW) { BW.AppendInt32(Index); }