|
You last visited: Today at 15:54
Advertisement
Warrock - Code Snippets
Discussion on Warrock - Code Snippets within the WarRock forum part of the Shooter category.
12/08/2012, 12:04
|
#556
|
elite*gold: 130
Join Date: Apr 2012
Posts: 221
Received Thanks: 153
|
@AeroMan
Could you proberbly make a private version for Rexiles?
So that Admins can manage the users ( kick / ban / spectate / ... ) them easily?
I can send and handle all packets, so the server / client communication isn't a problem.
Thanks in advance.
|
|
|
12/08/2012, 13:46
|
#557
|
elite*gold: 297
Join Date: Dec 2010
Posts: 1,129
Received Thanks: 1,687
|
Quote:
Originally Posted by xXrussXx
Workt nich win 8 64 ... sowie alle draw box funktionen ...
|
Use DrawPrimitive instead of DrawPrimitivUP. It's not just faster and more stable, it also works more reliably.
|
|
|
12/08/2012, 22:25
|
#558
|
elite*gold: 0
Join Date: Mar 2012
Posts: 194
Received Thanks: 311
|
Quote:
Originally Posted by Supremex3
@AeroMan
Could you proberbly make a private version for Rexiles?
So that Admins can manage the users ( kick / ban / spectate / ... ) them easily?
I can send and handle all packets, so the server / client communication isn't a problem.
Thanks in advance.
|
How do you mean?
|
|
|
12/09/2012, 19:11
|
#559
|
elite*gold: 297
Join Date: Dec 2010
Posts: 1,129
Received Thanks: 1,687
|
Advanced Packet Processing
Hey guys,
here is the newly-built class for packet processing Yazzn and me wrote.
You can download the files here:
Packet.hpp -  Packet.cpp -
The header file contains a description of every function.
-- underScore
Code:
//
// Packet.hpp
//
// Created by underScore and Yazzn on 09. December 2012.
// Copyright (c) 2012 WR-Cheats.net. All Rights reserved.
//
// THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
#ifndef __PACKET_HPP__
#define __PACKET_HPP__
#include <stdexcept>
#include <sstream>
#include <vector>
#include <windows.h>
#ifdef USE_ATOMIC_LOCK
#include <mutex>
#endif
#pragma comment (lib, "ws2_32.lib")
#pragma comment (lib, "Winmm.lib")
//
// Packet
//
// A tool for managing packets as from the free2play game War Rock.
// Finalized packets are formatted like this:
// <timestamp> <identifier> <parameter-0> .. <parameter-n> \n
// Note that n is greater or equal to zero.
// Define USE_ATOMIC_LOCK to avoid multithreading failure on Packet::send
//
class Packet
{
public:
typedef unsigned short Identifier;
typedef unsigned long Timestamp;
typedef enum
{
ParameterTypeInteger,
ParameterTypeFloat,
ParameterTypeText
} ParameterType;
typedef struct
{
ParameterType type;
union
{
int asInteger;
float asFloat;
char *asText;
} value;
/**
* @symbol public: const std::string Packet::Parameter::toString const
* @return Parameter.value converted to an object of type std::string
**/
const std::string toString () const;
} Parameter;
private:
static const char CHAR_GROUP_SEPERATOR = '\x1D';
#ifdef USE_ATOMIC_LOCK
static std::mutex _atomicLock;
#endif
Identifier _identifier;
Timestamp _timestamp;
std::vector<Parameter> _parameterList;
bool _finalized;
std::string _finalizedPacket;
/**
* @param text: Parameter as zero terminated string
* @return Type of the given parameter as ParameterType
* Finds out which type fits the given string best by matching expressions
**/
ParameterType findType (const char *text) const;
public:
static const size_t INDEX_ERROR = 0xFFFFFFFF;
/**
* Initializes a new object of type Packet
**/
Packet ();
/**
* Frees an object of type Packet
**/
~Packet ();
/**
* @param finalizedPacket: A finalized packet string to be analysed
* @param xorKey: The key to decrypt the finalized packet string with
* @return this-pointer
* Initializes the object based on a finalized packet string
**/
Packet *initWithFinalizedPacket (const std::string &finalizedPacket,
const BYTE xorKey);
/**
* @param socket: The socket to receive data from
* @param length: The number of bytes to receive
* @param flags: Flags to pass to ::recv
* @param xorKey: The key to decrypt the received packet with
* @return this-pointer
* Initializes the object based on received data
**/
Packet *initWithRecv(const SOCKET socket,
const size_t length,
const int flags,
const BYTE xorKey);
/**
* @param packet: The packet to copy data from
* @return this-pointer
* Initializes the object as a copy of another Packet
**/
Packet *initWithPacket (const Packet &packet);
/**
* @param identifier: The packets identifier
* @return this-pointer
* Initializes the object with just an identifier
**/
Packet *initWithIdentifier (const Identifier identifier);
/**
* Resets the packets data to zero and unfinalizes it
*/
void reset ();
/**
* @param xorKey: The key to encrypt the packet with
* Finalizes the packet to a string
**/
void finalize (const BYTE xorKey);
/**
* @return Boolean indicating whether the object is finalized
* Checks whether the obect is finalized
**/
const bool isFinalized () const;
/**
* @return The finalized packet string
* Returns the finalized packet string if the object is finalized
**/
const std::string &finalizedPacket () const;
/**
* @return The identifier of the packet
* Returns the packets identifier
**/
Identifier identifier () const;
/**
* @return The packets timestamp
* Returns the packets timestamp
**/
Timestamp timestamp () const;
/**
* @param index: Index of the parameter
* @return The Parameter at the given index
* Returns the parameter at a given index
**/
Parameter parameterAtIndex (const size_t index) const;
/**
* @return The number of parameters the packet has
* Returns the amount of parameters the packet has
**/
size_t parameterCount () const;
/**
* @param value: An integer value
* Appends the packet by an Parameter with ParameterTypeInteger
**/
void append (const int value);
/**
* @param value: A floating point value
* Appends the packet by an Parameter with ParameterTypeFloat
**/
void append (const float value);
/**
* @param value: A zero terminated string
* Appends the packet by an Parameter with ParameterTypeText
**/
void append (const char *value);
/**
* @param value: The integer value to search for
* @return The index of the first Parameter found or Packet::INDEX_ERROR
* Searches for a Parameter and returns the index
**/
const size_t find (const int value) const;
/**
* @param value: The floating point value to search for
* @return The index of the first Parameter found or Packet::INDEX_ERROR
* Searches for a Parameter and returns the index
**/
const size_t find (const float value) const;
/**
* @param value: The zero terminated string to search for
* @return The index of the first Parameter found or Packet::INDEX_ERROR
* Searches for a Parameter and returns the index
**/
const size_t find (const char *value) const;
/**
* @param index: The index of the parameter to change
* @param value: The integer value to set
* Sets a parameter at a given index to a given value
**/
void setParameterAtIndex (const size_t index,
const int value);
/**
* @param index: The index of the parameter to change
* @param value: The floating point value to set
* Sets a parameter at a given index to a given value
**/
void setParameterAtIndex (const size_t index,
const float value);
/**
* @param index: The index of the parameter to change
* @param value: The zero terminated string to set
* Sets a parameter at a given index to a given value
**/
void setParameterAtIndex (const size_t index,
const char *value);
/**
* @param index: The index to insert the parameter at
* @param value: The integer value to insert
* Inserts a parameter at a given index with a given value
**/
void insertParameterAtIndex (const size_t index,
const int value);
/**
* @param index: The index to insert the parameter at
* @param value: The floating point value to insert
* Inserts a parameter at a given index with a given value
**/
void insertParameterAtIndex (const size_t index,
const float value);
/**
* @param index: The index to insert the parameter at
* @param value: The zro terminated string to insert
* Inserts a parameter at a given index with a given value
**/
void insertParameterAtIndex (const size_t index,
const char *value);
/**
* @param index: The index of the first parameter to delete
* @param count: The count of parameters to delete
* Deletes a specified count of parameters starting at a given index
**/
void deleteParameterAtIndex (const size_t index,
const size_t count);
/**
* @param timestamp: The timestamp to set
* Sets a given timestamp
**/
void setTimestamp (const Timestamp timestamp);
/**
Sets the result of ::timeGetTime() as the timestamp
**/
void setCurrentTimestamp ();
/**
* @param socket: The socket to send the data to
* @param flags: Flags to pass to ::send
* @return The result of ::send
* Calls ::send with the finalized packet, a given socket and the given flags
**/
int send (const SOCKET socket,
const int flags);
};
#endif /* __PACKET_HPP__ */
|
|
|
12/10/2012, 12:59
|
#560
|
elite*gold: 0
Join Date: Dec 2012
Posts: 2
Received Thanks: 0
|
Quote:
Originally Posted by __underScore
Hey guys,
here is the newly-built class for packet processing Yazzn and me wrote.
You can download the files here:
Packet.hpp - 
Packet.cpp -
The header file contains a description of every function.
-- underScore
Code:
//
// Packet.hpp
//
// Created by underScore and Yazzn on 09. December 2012.
// Copyright (c) 2012 WR-Cheats.net. All Rights reserved.
//
// THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
#ifndef __PACKET_HPP__
#define __PACKET_HPP__
#include <stdexcept>
#include <sstream>
#include <vector>
#include <windows.h>
#ifdef USE_ATOMIC_LOCK
#include <mutex>
#endif
#pragma comment (lib, "ws2_32.lib")
#pragma comment (lib, "Winmm.lib")
//
// Packet
//
// A tool for managing packets as from the free2play game War Rock.
// Finalized packets are formatted like this:
// <timestamp> <identifier> <parameter-0> .. <parameter-n> \n
// Note that n is greater or equal to zero.
// Define USE_ATOMIC_LOCK to avoid multithreading failure on Packet::send
//
class Packet
{
public:
typedef unsigned short Identifier;
typedef unsigned long Timestamp;
typedef enum
{
ParameterTypeInteger,
ParameterTypeFloat,
ParameterTypeText
} ParameterType;
typedef struct
{
ParameterType type;
union
{
int asInteger;
float asFloat;
char *asText;
} value;
/**
* @symbol public: const std::string Packet::Parameter::toString const
* @return Parameter.value converted to an object of type std::string
**/
const std::string toString () const;
} Parameter;
private:
static const char CHAR_GROUP_SEPERATOR = '\x1D';
#ifdef USE_ATOMIC_LOCK
static std::mutex _atomicLock;
#endif
Identifier _identifier;
Timestamp _timestamp;
std::vector<Parameter> _parameterList;
bool _finalized;
std::string _finalizedPacket;
/**
* @param text: Parameter as zero terminated string
* @return Type of the given parameter as ParameterType
* Finds out which type fits the given string best by matching expressions
**/
ParameterType findType (const char *text) const;
public:
static const size_t INDEX_ERROR = 0xFFFFFFFF;
/**
* Initializes a new object of type Packet
**/
Packet ();
/**
* Frees an object of type Packet
**/
~Packet ();
/**
* @param finalizedPacket: A finalized packet string to be analysed
* @param xorKey: The key to decrypt the finalized packet string with
* @return this-pointer
* Initializes the object based on a finalized packet string
**/
Packet *initWithFinalizedPacket (const std::string &finalizedPacket,
const BYTE xorKey);
/**
* @param socket: The socket to receive data from
* @param length: The number of bytes to receive
* @param flags: Flags to pass to ::recv
* @param xorKey: The key to decrypt the received packet with
* @return this-pointer
* Initializes the object based on received data
**/
Packet *initWithRecv(const SOCKET socket,
const size_t length,
const int flags,
const BYTE xorKey);
/**
* @param packet: The packet to copy data from
* @return this-pointer
* Initializes the object as a copy of another Packet
**/
Packet *initWithPacket (const Packet &packet);
/**
* @param identifier: The packets identifier
* @return this-pointer
* Initializes the object with just an identifier
**/
Packet *initWithIdentifier (const Identifier identifier);
/**
* Resets the packets data to zero and unfinalizes it
*/
void reset ();
/**
* @param xorKey: The key to encrypt the packet with
* Finalizes the packet to a string
**/
void finalize (const BYTE xorKey);
/**
* @return Boolean indicating whether the object is finalized
* Checks whether the obect is finalized
**/
const bool isFinalized () const;
/**
* @return The finalized packet string
* Returns the finalized packet string if the object is finalized
**/
const std::string &finalizedPacket () const;
/**
* @return The identifier of the packet
* Returns the packets identifier
**/
Identifier identifier () const;
/**
* @return The packets timestamp
* Returns the packets timestamp
**/
Timestamp timestamp () const;
/**
* @param index: Index of the parameter
* @return The Parameter at the given index
* Returns the parameter at a given index
**/
Parameter parameterAtIndex (const size_t index) const;
/**
* @return The number of parameters the packet has
* Returns the amount of parameters the packet has
**/
size_t parameterCount () const;
/**
* @param value: An integer value
* Appends the packet by an Parameter with ParameterTypeInteger
**/
void append (const int value);
/**
* @param value: A floating point value
* Appends the packet by an Parameter with ParameterTypeFloat
**/
void append (const float value);
/**
* @param value: A zero terminated string
* Appends the packet by an Parameter with ParameterTypeText
**/
void append (const char *value);
/**
* @param value: The integer value to search for
* @return The index of the first Parameter found or Packet::INDEX_ERROR
* Searches for a Parameter and returns the index
**/
const size_t find (const int value) const;
/**
* @param value: The floating point value to search for
* @return The index of the first Parameter found or Packet::INDEX_ERROR
* Searches for a Parameter and returns the index
**/
const size_t find (const float value) const;
/**
* @param value: The zero terminated string to search for
* @return The index of the first Parameter found or Packet::INDEX_ERROR
* Searches for a Parameter and returns the index
**/
const size_t find (const char *value) const;
/**
* @param index: The index of the parameter to change
* @param value: The integer value to set
* Sets a parameter at a given index to a given value
**/
void setParameterAtIndex (const size_t index,
const int value);
/**
* @param index: The index of the parameter to change
* @param value: The floating point value to set
* Sets a parameter at a given index to a given value
**/
void setParameterAtIndex (const size_t index,
const float value);
/**
* @param index: The index of the parameter to change
* @param value: The zero terminated string to set
* Sets a parameter at a given index to a given value
**/
void setParameterAtIndex (const size_t index,
const char *value);
/**
* @param index: The index to insert the parameter at
* @param value: The integer value to insert
* Inserts a parameter at a given index with a given value
**/
void insertParameterAtIndex (const size_t index,
const int value);
/**
* @param index: The index to insert the parameter at
* @param value: The floating point value to insert
* Inserts a parameter at a given index with a given value
**/
void insertParameterAtIndex (const size_t index,
const float value);
/**
* @param index: The index to insert the parameter at
* @param value: The zro terminated string to insert
* Inserts a parameter at a given index with a given value
**/
void insertParameterAtIndex (const size_t index,
const char *value);
/**
* @param index: The index of the first parameter to delete
* @param count: The count of parameters to delete
* Deletes a specified count of parameters starting at a given index
**/
void deleteParameterAtIndex (const size_t index,
const size_t count);
/**
* @param timestamp: The timestamp to set
* Sets a given timestamp
**/
void setTimestamp (const Timestamp timestamp);
/**
Sets the result of ::timeGetTime() as the timestamp
**/
void setCurrentTimestamp ();
/**
* @param socket: The socket to send the data to
* @param flags: Flags to pass to ::send
* @return The result of ::send
* Calls ::send with the finalized packet, a given socket and the given flags
**/
int send (const SOCKET socket,
const int flags);
};
#endif /* __PACKET_HPP__ */
|
Was ist das?
|
|
|
12/10/2012, 13:47
|
#561
|
elite*gold: 297
Join Date: Dec 2010
Posts: 1,129
Received Thanks: 1,687
|
Quote:
Originally Posted by °Cyan°
Was ist das?
|
Das steht in dem Post... Englisch sollte man natürlich ausreichend beherrschen dafür.
Quote:
(...)
the newly-built class for packet processing Yazzn and me wrote.
(...)
The header file contains a description of every function.
(...)
Code:
(...)
//
// Packet
//
// A tool for managing packets as from the free2play game War Rock.
// Finalized packets are formatted like this:
// <timestamp> <identifier> <parameter-0> .. <parameter-n> \n
// Note that n is greater or equal to zero.
// Define USE_ATOMIC_LOCK to avoid multithreading failure on Packet::send
//
(...)
|
By the way, an updated version with faster tokenizing on initWithFinalizedPacket and some new methods for like copying to a buffer (useful when having hooked ::send) or merging packets will be released within the next days.
|
|
|
12/10/2012, 14:22
|
#562
|
elite*gold: 0
Join Date: Dec 2012
Posts: 2
Received Thanks: 0
|
Quote:
Originally Posted by __underScore
Das steht in dem Post... Englisch sollte man natürlich ausreichend beherrschen dafür.
By the way, an updated version with faster tokenizing on initWithFinalizedPacket and some new methods for like copying to a buffer (useful when having hooked ::send) or merging packets will be released within the next days.
|
What is it?
|
|
|
12/10/2012, 16:20
|
#563
|
elite*gold: 351
Join Date: Jul 2012
Posts: 427
Received Thanks: 430
|
Quote:
Originally Posted by °Cyan°
What is it?
|
Wenn Du nicht verstehst, was Du damit anfolgen sollst, wieso fragst du dann noch?
Es steht doch ausreichend beschrieben, was Du damit machen kannst:
Quote:
|
[...] A tool for managing packets as from the free2play game War Rock. [...]
|
Solltest Du nun immer noch nicht verstehen, was das bedeutet, weil Du vielleicht kein English kannst, kannst du Google Translate benutzen. Ja, ich weiß, die Sätze die da raus kommen sind vielleicht nicht die Besten, jedoch reicht es, um zu verstehen, was es auf Deutsch heißt ..
Google Translate Übersetzung:
Ein Tool zum Verwalten von Paketen ab dem free2play Spiel War Rock.
"Bessere" Übersetzung:
Ein Tool zum Verwalten von Paketen für das Free2Play Spiel War Rock.
Solltest Du nicht wissen, was Packets sind oder Du die komplette Source nicht verstehen (wovon ich ausgehe), ignorier' es doch einfach ..
|
|
|
12/11/2012, 07:32
|
#564
|
elite*gold: 0
Join Date: Nov 2007
Posts: 119
Received Thanks: 45
|
help source code of this OPK please
|
|
|
12/11/2012, 11:07
|
#565
|
elite*gold: 0
Join Date: Nov 2012
Posts: 51
Received Thanks: 21
|
Quote:
Originally Posted by boknoy24
help source code of this OPK please

|
Set Player Positions to 0
|
|
|
12/11/2012, 11:45
|
#566
|
elite*gold: 0
Join Date: Nov 2007
Posts: 119
Received Thanks: 45
|
Quote:
Originally Posted by Lazl07
Set Player Positions to 0
|
i know that -,-.
i need the source that you can move.. only the enemies are in the position.
|
|
|
12/11/2012, 14:37
|
#567
|
elite*gold: 20
Join Date: Sep 2012
Posts: 289
Received Thanks: 120
|
Quote:
Originally Posted by boknoy24
i know that -,-.
i need the source that you can move.. only the enemies are in the position.
|
Code:
if ( SuperOPK )
{
for(int i = 0; i < 32; i++)
{
if(i != cStructs->getLocalIndex())
{
p_Player->pGlobal[i]->Position[0] = 0;
p_Player->pGlobal[i]->Position[1] = 0;
p_Player->pGlobal[i]->Position[2] = 0;
}
}
}
|
|
|
12/12/2012, 09:28
|
#568
|
elite*gold: 0
Join Date: Nov 2012
Posts: 51
Received Thanks: 21
|
I Love Copy & Pasters
|
|
|
12/12/2012, 10:14
|
#569
|
elite*gold: 0
Join Date: Nov 2007
Posts: 119
Received Thanks: 45
|
Quote:
Originally Posted by iSkyLikeX
Code:
if ( SuperOPK )
{
for(int i = 0; i < 32; i++)
{
if(i != cStructs->getLocalIndex())
{
p_Player->pGlobal[i]->Position[0] = 0;
p_Player->pGlobal[i]->Position[1] = 0;
p_Player->pGlobal[i]->Position[2] = 0;
}
}
}
|
already try that wont work -_- still on one position even me.
|
|
|
12/12/2012, 14:08
|
#570
|
elite*gold: 0
Join Date: Jul 2012
Posts: 1,426
Received Thanks: 1,370
|
Quote:
Originally Posted by boknoy24
already try that wont work -_- still on one position even me.
|
this source work 
check your structs
|
|
|
Similar Threads
|
WarRock EU - Code Snippets
07/12/2012 - WarRock - 7490 Replies
Hi Leute,
in diesem Thread könnt ihr:
-> Nach Sourcecodes fragen(Beispiel unten)
-> Eure Sourcecodes posten(Wenn sie nicht von euch sind mit Credits!)
-> Fragen ob eure Source evtl. einen Fehler hat
-> Fragen was welcher Fehler bedeuted
-> Sourcecodes entnehmen(Bitte beim Release dann Credits angeben!)
|
All times are GMT +1. The time now is 15:55.
|
|