منتدي اكواد

منتدي اكواد (https://code.vpscairo.com/index.php)
-   مشكلات السيرفيرات كونكر الشخصيه (https://code.vpscairo.com/forumdisplay.php?f=12)
-   -   ثغرة في ارينا السي بي اس هتجنني (https://code.vpscairo.com/showthread.php?t=2563)

انت عمري 2019-10-01 11:31 AM

ثغرة في ارينا السي بي اس هتجنني
 
السلام عليكم


عندي مشكلة او ثغرة مش عارف بس المهم عايز حلها لو سمحت



المشكلة عبارة عن ايه

دلوقتي انا عندي ارينا سي بي اس
لو انا روحت وحطيت اني اللعب علي 100 الف سي بي اس

بتيجي رسالة للجميع وبيتاخد مني ال100 الف سي بي اس والدنيا حلوة
طيب دلوقتي لما الرسالة بتجيلي ان فلان حط في الارينة مبلغ كذا فبدوس علي موافق بيخصم مني زي الخصم ال100 الف وبنخش احنا الاتنين جوا الارينة
تمام كدة لحد دلوقتي

لما تيجي للخصم الرسالة ان فلان حط في الارينة مثلا 100 الف سي بي اس اكيد لو دوست موافق وانا مش معاية مش هقدر اخش واكيد لما بدوس موافق وانا معاية قد

المدفوع بنخش مع بعض

المشكلة بقي ان لو دوست لا علي رهان الخصم

وروحت حطيت رهان 500 سي بي اس ودخل نفس الخصم الى كان مراهن ب100 الف سي بي اس

المشكلة بقي ان لو كسب الخصم الى حط رهان 500 سي بي اس يجيلو 100.500 يعني المفرود يكسب 500 زي الى هو دخل بيهم
لا دة بياخد السي بي اس كلو





المطلوب بعد اذنكم

عايز لم احط في الارينة مثلا 100 الف سي بي اس وخصم حط في الارينة 50 الف

لو وافق الخصم الى دفع 100 الف سي بي اس علي مبلغ الي الخصم حطه في الارينة الي هو 50 الف
عايز يتخصم فقط الى الخصم حطه ويرجع الباقي ويبقي احنا الاتنين بنافس بعضينا في الارينة علي ال100 الف الخصم حط 50 الف وانا كنت حاطط 100 الف
فلما انا وافقت اني اخش مع الخصم علي ال50 الف الى حطهم يرجعولي باقي السي بي اس مش يتلعب عليهم كلهم

مش ال150 الف كلهم



ملحوظه انا شغال علي سورس msg تقريبا بتاعي اليكس


ارجوا اني اكون قدرت اوصل المشكلة

ولكم مني جزيل الشكر والتقدير


Hassan Emprator 2019-10-01 04:56 PM

رد: ثغرة في ارينا السي بي اس هتجنني
 
وريني الكود الي في npc

Rider 2019-10-01 05:44 PM

رد: ثغرة في ارينا السي بي اس هتجنني
 
متابع

AbuMaryam 2019-10-01 08:14 PM

رد: ثغرة في ارينا السي بي اس هتجنني
 
مظنش انة ينفع تحدد القيمة الى هوا حاطتها انة يكسبها

فكرة الاتشالنج مبنية على الرهان

بحيث ان الاعب الاول يراهن ب مبلغ 100 مثلا
و الاعب التاني يراهن ب مبلغ 50 مثلا

يبقي كدة هيبقي عندنا مدخلين

1 - رهان الاعب الاول = 100 سي بي
2 - رهان الاعب الثاني = 50 سي بي

و ايآ كان الرقم الى كل واحد هيحطة هوا حر

الفائز مثلا ف الاتشالنج دة كان الاعب الثاني .

يبقي كدة الان بي سي هيكلمة ب الصيغة دي عشان يديلة الجائزة بتاعتة

الاعب الثاني =+ رهان الاعب الثاني
الاعب الثاني =+ رهان الاعب الاول
الاعب الاول=- رهان الاعب الاول
الاعب الاول.رسالة(انت خسرت الاتشالنج ضد الاعب الثاني ......)
الاعب الثاني.رسالة(مبروك يا بطل كسبت الاتشالنج ضد الاعب الاول ......)

يبقي كدة مش هينفع يكسب القيمة الى هوا حاطتها بس

هوا كدة هيرجعله فلوس الرهان بتاعتة الى كان مراهن بيها + فلوس الرهان بتاعت الاعب الى خسر


انا شرحتلك فكرة الاتشالنج ب البلدي و ب اختصار عشان تفهم الدنيا ماشية ازاي

وشوف بردو باقي ردود الاعضاء

يمكن حد يكون عندة فكرة احسن و يقدر يعملها

انت عمري 2019-10-01 09:58 PM

رد: ثغرة في ارينا السي بي اس هتجنني
 
دة لم بتكلم الانبي سي
كود PHP:

 case 200:
                    {
                        if (
client.Player.Level 100)
                        {
                            
data.AddText("sorry, you need to be at keast level 100.")
                        .
AddOption("Holy~Shit."255).AddAvatar(63).FinalizeDialog();
                        }
                        else
                        {
                            
data.AddText("Welcome, please insert the amount of cps u want to bet on.")
                       .
AddInput("minimum 500 CPS"201).AddOption("Passing~by."255).AddAvatar(63).FinalizeDialog();
                        }
                        break;
                    }
                case 
201:
                    {
                        
uint bet uint.Parse(Input);
                        if (
bet 500)
                        {
                            
client.Player.MessageBox("Minimum 500 CPs."nullnull);
                            break;
                        }
                        if (
Game.MsgTournaments.MsgSchedules.ArenaCpsBattle.Working)
                        {
                            
client.Player.MessageBox("Minimum 500 CPs."nullnull);
                            break;
                        }
                        foreach (var 
user in Database.Server.GamePoll.Values)
                        {
                            
user.Player.MessageBox("Cps Tournment War Started Bet " bet " Cps"=>
                            {
                                if (
Game.MsgTournaments.MsgSchedules.ArenaCpsBattle.SignUp(pbet) == false)
                                {
                                    
p.SendSysMesage("don't have requierments."MsgMessage.ChatMode.ServiceMsgMessage.MsgColor.yellow);
                                }
                            }, 
null15);
                        }
                        break;
                    } 








دة ملف MsgCpsArenaSingle.cs

كود PHP:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace 
Project_Terror_v2.Game.MsgTournaments
{
    public class 
MsgCpsArenaSingle
    
{
        public 
TournamentType Type TournamentType.MsgCpsArenaSingle;
        public 
bool Working falseJoined falseTeleported false;
        public const 
uint MapID 1760;
        public const 
uint MinCurrentBet 500;
        public 
CSAPlayer PlayerOne nullPlayerTwo null;
        public 
DateTime MatchStamp = new DateTime();
        public 
ProcesType Process getset; }
        public 
DateTime ScoreStamp = new DateTime();

        public 
void SendMapPacket(ServerSockets.Packet stream)
        {
            foreach (var 
user in MapPlayers())
                
user.Send(stream);
        }
        public 
Client.GameClient[] MapPlayers()
        {
            return 
Database.Server.ServerMaps[MapID].Values.Where(=> InTournament(p)).ToArray();
        }
        public 
bool InTournament(Client.GameClient user)
        {
            return 
user.Player.Map == MapID;
        }
        private 
void AnnounceScores(ServerSockets.Packet stream)
        {
            
ScoreStamp DateTime.Now.AddSeconds(2);
        }
        public 
MsgCpsArenaSingle(ProcesType _process ProcesType.Dead)
        {
            
Process _process;
        }

        public 
bool SignUp(Client.GameClient _useruint _bet)
        {
            if (
PlayerOne != null && PlayerTwo != null)
            {
                
_user.SendSysMesage("Tournment Completed.");
                return 
false;
            }
            if (
_bet MinCurrentBet)
                return 
false;
            if (
Joined)
                return 
false;
            if ((
_bet MinCurrentBet true false) == true)
            {
                
_bet MinCurrentBet;
            }
            if (
_user.Player.ConquerPoints _bet)
            {
                return 
false;
            }
            if(
PlayerOne == null)
            {
                
PlayerOne null;
                
PlayerOne = new CSAPlayer() { UID _user.Player.UIDBet _betTeleported false };
                
_user.Player.ConquerPoints -= _bet;
                return 
true;
            }
            else
//if player one selected already but player two is still null
            
{
                if (!
PlayerOne.Client.Socket.Alive)
                {
                    
PlayerOne null;
                    
PlayerOne = new CSAPlayer() { UID _user.Player.UIDBet _betTeleported false };
                    
_user.Player.ConquerPoints -= _bet;
                    return 
true;
                }
                if (
PlayerTwo == null)
                {
                    
PlayerTwo null;
                    
PlayerTwo = new CSAPlayer() { UID _user.Player.UIDBet _betTeleported false };
                    
_user.Player.ConquerPoints -= _bet;
                    
Process ProcesType.Idle;
                    return 
true;
                }
                else
                {
                    
_user.Player.MessageBox("Sorry Only 2 Members Avaliable Count."nullnull);
                }
            }
            return 
false;
        }

        public 
void CheckUp()
        {
            if (
Process == ProcesType.Dead)
            {
                foreach (var 
p in MapPlayers())
                {
                    
p.Teleport(2982321002);
                }
                return;
            }
            if (
Process == ProcesType.Idle)
            {
                if (
PlayerOne != null && PlayerTwo != null)
                {
                    if (
PlayerOne.Client.Socket.Alive && PlayerTwo.Client.Socket.Alive)
                    {
                        
SendPVPInvitation(30PlayerOne.Client);
                        
SendPVPInvitation(30PlayerTwo.Client);
                    }
                }
                else
                    return;
            }
            if (
Process == ProcesType.Alive)
            {
                if (!
PlayerOne.Client.Socket.Alive && PlayerTwo.Client.Socket.Alive)
                {
                    
End(PlayerTwo.UIDPlayerOne.UID);
                }
                else if (
PlayerOne.Client.Socket.Alive && !PlayerTwo.Client.Socket.Alive)
                {
                    
End(PlayerOne.UIDPlayerTwo.UID);
                }
                else if (!
PlayerOne.Client.Socket.Alive && !PlayerTwo.Client.Socket.Alive)
                {
                    
Process ProcesType.Dead;
                    
PlayerOne null;
                    
PlayerTwo null;
                }
                else
                { }
                if (
DateTime.Now >= ScoreStamp)
                {
                    
using (var rec = new ServerSockets.RecycledPacket())
                    {
                        var 
stream rec.GetStream();
                        
AnnounceScores(stream);
                    }
                }
                if (
DateTime.Now >= MatchStamp)
                {
                    if (
PlayerOne.Score PlayerTwo.Score)
                    {
                        
End(PlayerOne.UIDPlayerTwo.UID);
                    }
                    else if (
PlayerOne.Score PlayerTwo.Score)
                    {
                        
End(PlayerTwo.UIDPlayerOne.UID);
                    }
                    else
                    {
                        
MatchStamp.AddSeconds(30);
                        
PlayerOne.Client.Player.MessageBox("Fight Still For 30 Seconds More."nullnull30);
                        
PlayerTwo.Client.Player.MessageBox("Fight Still For 30 Seconds More."nullnull30);
                    }
                }
            }
        }
        public 
void End(uint Winneruint Loser)//ending match void  With Recall back
        
{
            if (
PlayerOne.UID == Winner && PlayerTwo.UID == Loser)
            {
                if (
PlayerOne.Client != null && PlayerTwo.Client != null)
                {
                    
PlayerOne.Client.Player.ConquerPoints += PlayerOne.Bet;
                    
PlayerOne.Client.Player.ConquerPoints += PlayerTwo.Bet;
                    
PlayerOne.Client.SendSysMesage("You won Elite PVP Cps Arena.");
                    
PlayerTwo.Client.SendSysMesage("You lost Elite PVP Cps Arena.");
                    
PlayerOne.Client.Teleport(2992921002);
                    
PlayerTwo.Client.Teleport(2992921002);
                    
PlayerOne null;
                    
PlayerTwo null;
                    
Process ProcesType.Dead;
                }
            }
            if (
PlayerTwo.UID == Winner && PlayerOne.UID == Loser)
            {
                if (
PlayerOne.Client != null && PlayerTwo.Client != null)
                {
                    
PlayerTwo.Client.Player.ConquerPoints += PlayerOne.Bet;
                    
PlayerTwo.Client.Player.ConquerPoints += PlayerTwo.Bet;
                    
PlayerTwo.Client.SendSysMesage("You won Elite PVP Cps Arena.");
                    
PlayerOne.Client.SendSysMesage("You lost Elite PVP Cps Arena.");
                    
PlayerOne.Client.Teleport(2992921002);
                    
PlayerTwo.Client.Teleport(2992921002);
                    
PlayerOne null;
                    
PlayerTwo null;
                    
Process ProcesType.Dead;
                }
            }
            
//giving Winner Cps
            //teleporting both outside
            //Ending war and stop invokation
            //turning Process to Dead
        
}
        public 
void Teleport(uint UID)
        {
            if (
PlayerOne == null || PlayerTwo == null)
                return;
            
ushort x 0;
            
ushort y 0;
            
Role.GameMap Map Database.Server.ServerMaps[MapID];
            
Map.GetRandCoord(ref xref y);
            if (
PlayerOne.UID == UID && PlayerOne.Client.Socket.Alive)
            {
                
PlayerOne.Client.Teleport(xyMapID);
                
PlayerOne.Client.Player.MessageBox("StartFighting Still Working For 100 Seconds."nullnull100);
                
PlayerOne.Client.Player.SetPkMode(Role.Flags.PKMode.PK);
                if (
MapPlayers().Length == 2)
                {
                    
Process ProcesType.Alive;
                    
MatchStamp DateTime.Now.AddSeconds(90);
                }
            }
            else if (
PlayerTwo.UID == UID && PlayerTwo.Client.Socket.Alive)
            {
                
PlayerTwo.Client.Teleport(xyMapID);
                
PlayerOne.Client.Player.MessageBox("StartFighting Still Working For 100 Seconds."nullnull100);
                
PlayerTwo.Client.Player.SetPkMode(Role.Flags.PKMode.PK);
                if (
MapPlayers().Length == 2)
                {
                    
Process ProcesType.Alive;
                    
MatchStamp DateTime.Now.AddSeconds(100);
                }
            }
            else
            {
            }
        }
        public 
void GiveUp(uint UID)
        {
            if (
PlayerOne.UID == UID && PlayerOne.Client.Socket.Alive)
            {
                
End(PlayerTwo.UIDUID);
            }
            if (
PlayerTwo.UID == UID && PlayerTwo.Client.Socket.Alive)
            {
                
End(PlayerOne.UIDUID);
            }
        }
        public 
void ResondInteract(uint UIDuint Damage)
        {
            if (
PlayerTwo != null && PlayerOne != null)
            {
                if (
PlayerOne.Client.Socket.Alive && PlayerTwo.Client.Socket.Alive)
                {
                    if (
UID == PlayerOne.UID)
                    {
                        
PlayerOne.Score += Damage;
                    }
                    if (
UID == PlayerTwo.UID)
                    {
                        
PlayerTwo.Score += Damage;
                    }
                }
            }
        }
        
internal static bool SendPVPInvitation(int SecoundsClient.GameClient clientGame.MsgServer.MsgStaticMessage.Messages messaj Game.MsgServer.MsgStaticMessage.Messages.None)
        {
#if Arabic
             
string Message "Cps Arena Betting Battle Match Started Want To Accept Or Give UP?";
#else
            
string Message "Cps Arena Betting Battle Match Started Want To Accept Or Give UP?";
#endif

            
using (var rec = new ServerSockets.RecycledPacket())
            {
                var 
stream rec.GetStream();

                var 
packet = new Game.MsgServer.MsgMessage(MessageMsgServer.MsgMessage.MsgColor.yellowMsgServer.MsgMessage.ChatMode.Center).GetArray(stream);
                    if (!
client.Player.OnMyOwnServer || client.IsConnectedInterServer())
                        return 
false;
                    
client.Send(packet);
                    
client.Player.MessageBox(Message, new Action<Client.GameClient>(user => MsgTournaments.MsgSchedules.ArenaCpsBattle.Teleport(user.Player.UID)), user => MsgTournaments.MsgSchedules.ArenaCpsBattle.GiveUp(user.Player.UID), Secoundsmessaj);
                    return 
true;
            }
        }
    }
    public class 
CSAPlayer
    
{
        public 
uint UID;
        public 
uint Bet;
        public 
uint Score;
        public 
bool Teleported;
        public 
string Name get { return Client.Player.Name; } }
        public 
Client.GameClient Client
        
{
            
get
            
{
                if (
this.UID == 0)
                    return 
null;
                if (
Database.Server.GamePoll.ContainsKey(this.UID))
                {
                    return 
Database.Server.GamePoll[this.UID];
                }
                return 
null;
            }
        }
    }



AbuMaryam 2019-10-01 11:47 PM

رد: ثغرة في ارينا السي بي اس هتجنني
 
ممكن تعدل البرايز بحيث ان كل لاعب يكسب الرهان الى راهن علية مش الي الاعب التاني راهن علية

جرب الفويد بتاع End دة و قولي النتيجة

كود PHP:

public void End(uint Winneruint Loser)//ending match void  With Recall back
        
{
            if (
PlayerOne.UID == Winner && PlayerTwo.UID == Loser)
            {
                if (
PlayerOne.Client != null && PlayerTwo.Client != null)
                {
                    
PlayerOne.Client.Player.ConquerPoints += PlayerOne.Bet;
                    
PlayerOne.Client.Player.ConquerPoints += PlayerOne.Bet;
                    
PlayerOne.Client.SendSysMesage("You won Elite PVP Cps Arena.");
                    
PlayerTwo.Client.SendSysMesage("You lost Elite PVP Cps Arena.");
                    
PlayerOne.Client.Teleport(2982321002);
                    
PlayerTwo.Client.Teleport(2982321002);
                    
PlayerOne null;
                    
PlayerTwo null;
                    
Process ProcesType.Dead;
                }
            }
            if (
PlayerTwo.UID == Winner && PlayerOne.UID == Loser)
            {
                if (
PlayerOne.Client != null && PlayerTwo.Client != null)
                {
                    
PlayerTwo.Client.Player.ConquerPoints += PlayerTwo.Bet;
                    
PlayerTwo.Client.Player.ConquerPoints += PlayerTwo.Bet;
                    
PlayerTwo.Client.SendSysMesage("You won Elite PVP Cps Arena.");
                    
PlayerOne.Client.SendSysMesage("You lost Elite PVP Cps Arena.");
                    
PlayerOne.Client.Teleport(2982321002);
                    
PlayerTwo.Client.Teleport(2982321002);
                    
PlayerOne null;
                    
PlayerTwo null;
                    
Process ProcesType.Dead;
                }
            }
            
//giving Winner Cps
            //teleporting both outside
            //Ending war and stop invokation
            //turning Process to Dead
        




الساعة الآن 05:09 PM

مرحبا بكم في منتدي اكواد لتطوير الالعاب