Пример #1
0
 private void SendCreateGameToSingle(PVEGame game, IGamePlayer gamePlayer)
 {
     GSPacketIn pkg = new GSPacketIn((byte)ePackageType.GAME_CMD);
     pkg.WriteByte((byte)eTankCmdType.GAME_ROOM_INFO);
     pkg.WriteInt(game.Map.Info.ID);
     pkg.WriteInt((byte)game.RoomType);
     pkg.WriteInt((byte)game.GameType);
     pkg.WriteInt(game.TimeType);
     List<Player> players = game.GetAllFightPlayers();
     pkg.WriteInt(players.Count);
     foreach (Player p in players)
     {
         IGamePlayer gp = p.PlayerDetail;
         pkg.WriteInt(gp.PlayerCharacter.ID);
         pkg.WriteString(gp.PlayerCharacter.NickName);
         pkg.WriteBoolean(false);//_loc_10 = _loc_2.readBoolean();
         pkg.WriteByte(gp.PlayerCharacter.typeVIP);
         pkg.WriteInt(gp.PlayerCharacter.VIPLevel);
         pkg.WriteBoolean(gp.PlayerCharacter.Sex);
         pkg.WriteInt(gp.PlayerCharacter.Hide);
         pkg.WriteString(gp.PlayerCharacter.Style);
         pkg.WriteString(gp.PlayerCharacter.Colors);
         pkg.WriteString(gp.PlayerCharacter.Skin);
         pkg.WriteInt(gp.PlayerCharacter.Grade);
         pkg.WriteInt(gp.PlayerCharacter.Repute);
         if (gp.MainWeapon == null)
         {
             pkg.WriteInt(0);
         }
         else
         {
             pkg.WriteInt(gp.MainWeapon.TemplateID);
             pkg.WriteInt(gp.MainWeapon.RefineryLevel);
             pkg.WriteString(gp.MainWeapon.Name);
             pkg.WriteDateTime(DateTime.MinValue);
         }
         if (gp.SecondWeapon == null)
         {
             pkg.WriteInt(0);
         }
         else
         {
             pkg.WriteInt(gp.SecondWeapon.TemplateID);
         }
         pkg.WriteInt(gp.PlayerCharacter.ConsortiaID);
         pkg.WriteString(gp.PlayerCharacter.ConsortiaName);
         pkg.WriteInt(0);//_loc_8.badgeID = _loc_2.readInt();
         pkg.WriteInt(0);//_loc_14 = _loc_2.readInt();
         pkg.WriteInt(0);//_loc_15 = _loc_2.readInt();
         pkg.WriteBoolean(false);//_loc_8.DailyLeagueFirst = _loc_2.readBoolean();
         pkg.WriteInt(0);//_loc_8.DailyLeagueLastScore = _loc_2.readInt();
         pkg.WriteInt(p.Team);
         pkg.WriteInt(p.Id);
         pkg.WriteInt(p.MaxBlood);
         pkg.WriteBoolean(p.Ready);
     }
     int index = game.SessionId - 1;
     MissionInfo missionInfo = game.Misssions[index];
     pkg.WriteString(missionInfo.Name);
     pkg.WriteString(missionInfo.Name);
     pkg.WriteString(missionInfo.Success);
     pkg.WriteString(missionInfo.Failure);
     pkg.WriteString(missionInfo.Description);
     pkg.WriteInt(game.TotalMissionCount);
     pkg.WriteInt(index);
     gamePlayer.SendTCP(pkg);
 }
Пример #2
0
        private void SendCreateGameToSingle(PVEGame game, IGamePlayer gamePlayer)
        {
            GSPacketIn pkg = new GSPacketIn((byte)ePackageType.GAME_CMD);
            pkg.WriteByte((byte)eTankCmdType.GAME_ROOM_INFO);
            pkg.WriteInt(game.Map.Info.ID);
            pkg.WriteInt((byte)game.RoomType);
            pkg.WriteInt((byte)game.GameType);
            pkg.WriteInt(game.TimeType);
            List<Player> players = game.GetAllFightPlayers();
            pkg.WriteInt(players.Count);
            foreach (Player p in players)
            {
                IGamePlayer gp = p.PlayerDetail;
                pkg.WriteInt(gp.PlayerCharacter.ID);
                //zoneid
                //pkg.WriteInt(4);
                pkg.WriteString(gp.PlayerCharacter.NickName);
                //isvip
                pkg.WriteBoolean(true);
                pkg.WriteInt(5);
                pkg.WriteBoolean(gp.PlayerCharacter.Sex);
                pkg.WriteInt(gp.PlayerCharacter.Hide);
                pkg.WriteString(gp.PlayerCharacter.Style);
                pkg.WriteString(gp.PlayerCharacter.Colors);
                pkg.WriteString(gp.PlayerCharacter.Skin);
                pkg.WriteInt(gp.PlayerCharacter.Grade);
                pkg.WriteInt(gp.PlayerCharacter.Repute);
                if (gp.MainWeapon == null)
                {
                    pkg.WriteInt(0);
                }
                else
                {
                    pkg.WriteInt(gp.MainWeapon.TemplateID);
                    pkg.WriteInt(0);
                    pkg.WriteString("");
                    pkg.WriteDateTime(DateTime.MinValue);
                }
                pkg.WriteInt(0);
                pkg.WriteInt(gp.PlayerCharacter.ConsortiaID);
                pkg.WriteString(gp.PlayerCharacter.ConsortiaName);
                pkg.WriteInt(gp.PlayerCharacter.ConsortiaLevel);
                pkg.WriteInt(gp.PlayerCharacter.ConsortiaRepute);

                pkg.WriteInt(p.Team);
                pkg.WriteInt(p.Id);
                pkg.WriteInt(p.MaxBlood);
                pkg.WriteBoolean(p.Ready);
            }

            MissionInfo missionInfo = game.Misssions[game.SessionId - 1];
            pkg.WriteString(missionInfo.Name);
            pkg.WriteString(missionInfo.Name);
            pkg.WriteString(missionInfo.Success);
            pkg.WriteString(missionInfo.Failure);
            pkg.WriteString(missionInfo.Description);
            pkg.WriteInt(game.TotalMissionCount);
            pkg.WriteInt(game.SessionId - 1);
            gamePlayer.SendTCP(pkg);
        }
Пример #3
0
 private void SendCreateGameToSingle(PVEGame game, IGamePlayer gamePlayer)
 {
     GSPacketIn pkg = new GSPacketIn((byte)ePackageType.GAME_CMD);
     pkg.WriteByte((byte)eTankCmdType.GAME_ROOM_INFO);
     pkg.WriteInt(game.Map.Info.ID);
     pkg.WriteInt((byte)game.RoomType);
     pkg.WriteInt((byte)game.GameType);
     pkg.WriteInt(game.TimeType);
     List<Player> players = game.GetAllFightPlayers();
     pkg.WriteInt(players.Count);
     foreach (Player p in players)
     {
         IGamePlayer gp = p.PlayerDetail;
         pkg.WriteInt(gp.PlayerCharacter.ID);
         pkg.WriteString(gp.PlayerCharacter.NickName);
         pkg.WriteBoolean(false);//_loc_10 = _loc_2.readBoolean();
         pkg.WriteByte(gp.PlayerCharacter.typeVIP);
         pkg.WriteInt(gp.PlayerCharacter.VIPLevel);
         pkg.WriteBoolean(gp.PlayerCharacter.Sex);
         pkg.WriteInt(gp.PlayerCharacter.Hide);
         pkg.WriteString(gp.PlayerCharacter.Style);
         pkg.WriteString(gp.PlayerCharacter.Colors);
         pkg.WriteString(gp.PlayerCharacter.Skin);
         pkg.WriteInt(gp.PlayerCharacter.Grade);
         pkg.WriteInt(gp.PlayerCharacter.Repute);
         if (gp.MainWeapon == null)
         {
             pkg.WriteInt(0);
         }
         else
         {
             pkg.WriteInt(gp.MainWeapon.TemplateID);
             pkg.WriteInt(gp.MainWeapon.RefineryLevel);
             pkg.WriteString(gp.MainWeapon.Name);
             pkg.WriteDateTime(DateTime.MinValue);
         }
         if (gp.SecondWeapon == null)
         {
             pkg.WriteInt(0);
         }
         else
         {
             pkg.WriteInt(gp.SecondWeapon.TemplateID);
         }
         pkg.WriteInt(gp.PlayerCharacter.ConsortiaID);
         pkg.WriteString(gp.PlayerCharacter.ConsortiaName);
         pkg.WriteInt(0);//_loc_8.badgeID = _loc_2.readInt();
         pkg.WriteInt(0);//_loc_14 = _loc_2.readInt();
         pkg.WriteInt(0);//_loc_15 = _loc_2.readInt();
         pkg.WriteBoolean(false);//_loc_8.DailyLeagueFirst = _loc_2.readBoolean();
         pkg.WriteInt(0);//_loc_8.DailyLeagueLastScore = _loc_2.readInt();
         pkg.WriteInt(p.Team);
         pkg.WriteInt(p.Id);
         pkg.WriteInt(p.MaxBlood);
         pkg.WriteBoolean(p.Ready);
     }
     int index = game.SessionId - 1;
     /*
     if ((index == 0) || (index > Missions.Count))
     {
         StringBuilder sb = new StringBuilder();
         foreach (MissionInfo mi in Missions.Values)
         {
             sb.Append(mi.Id).Append(",");
         }
         log.Error(string.Format("PVEGame.SendCreateGameToSingle KeyNotFoundException, game.SessionId : {0}, index : {1}, Missions.Ids : {2}, Missions.Count : {3}", new object[] { game.SessionId, index, sb.ToString(), this.Missions.Count }));
         if (index == 0)
         {
             index = 1;
         }
         if (index == Missions.Count)
         {
             index = Missions.Count;
         }
     }
     */
     MissionInfo missionInfo = game.Misssions[index];
     pkg.WriteString(missionInfo.Name);
     pkg.WriteString(missionInfo.Name);
     pkg.WriteString(missionInfo.Success);
     pkg.WriteString(missionInfo.Failure);
     pkg.WriteString(missionInfo.Description);
     pkg.WriteInt(game.TotalMissionCount);
     pkg.WriteInt(index);
     gamePlayer.SendTCP(pkg);
 }