Register for your free account! | Forgot your password?

You last visited: Today at 17:21

  • Please register to post and access all features, it's quick, easy and FREE!


Walk Packet using Google Protocol Buffer

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Aug 2013
Posts: 3
Received Thanks: 0
Thumbs up Walk Packet using Google Protocol Buffer

PHP Code:
using System
using System.Collections.Generic
using System.IO
using System.Linq

namespace 
Conquer_Online_Server.Network.GamePackets 

    public class 
GroundMovement WriterInterfaces.IPacket 
    

        public const 
uint Walk 0
                          
Run 1
                          
Slide 9


        public 
GroundMovement(bool CreateInstance
        { 

        } 
        public 
byte[] CreateProtocolBuffer(params uint[] values
        { 
            List<
byteptr = new List<byte>(); 
            
ptr.Add(8); 
            for (
int x 0values.Lengthx++) 
            { 
                
uint value values[x]; 
                while (
value 0x7F
                { 
                    
ptr.Add((byte)((value 0x7F) | 0x80)); 
                    
value >>= 7
                } 
                
ptr.Add((byte)(value 0x7F)); 
                
ptr.Add((byte)(* (2))); 
                if (
== values.Length
                    break; 
            } 
            return 
ptr.ToArray(); 
        } 
        public 
uint ReadFromProtocolUint32(uint positionBinaryReader reader
        { 
            
byte key reader.ReadByte(); 
            if (
key == position
            { 
                
uint value 0
                
int shift 0
                
uint val reader.ReadByte(); 
                while (
val 0x7F
                { 
                    
value |= (val 0x7F) << shift
                    
shift += 7
                    
val reader.ReadByte(); 
                } 
                
value |= (val 0x7F) << shift
                return 
value
            } 
            return 
0
        } 
        public 
byte[] ToArray() 
        { 
            
byte[] ptr CreateProtocolBuffer((uint)DirectionUIDGroundMovementTypeTimeStampMapID); 


            List<
bytepack = new List<byte>(); 
            for (
int i 0< (ptr.Length 1); i++) 
            { 
                
pack.Add(ptr[i]); 
            } 
            
ptr pack.ToArray(); 

            
byte[] buffer = new byte[12 ptr.Length]; 
            
Writer.WriteUInt16((ushort)(buffer.Length 8), 0buffer); 
            
Writer.WriteUInt16(100052buffer); 
            
System.Array.Copy(ptr0buffer4ptr.Length); 

            return 
buffer
        } 

        public 
void Deserialize(byte[] buffer
        { 

            var 
packet = new byte[buffer.Length 4]; 
            
System.Array.Copy(buffer4packet0packet.Length); 
            
using (var Reader = new BinaryReader(new MemoryStream(packet))) 
            { 
                
uint direction 0
                
uint uid 0
                
uint type 0
                
uint tstamp 0
                
uint mapid 0
                for (
int i 0Reader.BaseStream.Lengthi++) 
                { 
                    
Reader.BaseStream.Position i
                    if (
packet[i] == 8
                    { 
                        
direction ReadFromProtocolUint32(8Reader); 
                    } 
                    if (
packet[i] == 16
                    { 
                        
uid ReadFromProtocolUint32(16Reader); 
                    } 
                    if (
packet[i] == 24
                    { 
                        
type ReadFromProtocolUint32(24Reader); 
                    } 
                    if (
packet[i] == 32
                    { 
                        
tstamp ReadFromProtocolUint32(32Reader); 
                    } 
                    if (
packet[i] == 40
                    { 
                        
mapid ReadFromProtocolUint32(40Reader); 
                    } 
                } 
                
Direction = (Conquer_Online_Server.Game.Enums.ConquerAngle)direction
                
UID uid
                
GroundMovementType type
                
TimeStamp tstamp
                
MapID mapid
            } 

        } 

        public 
Game.Enums.ConquerAngle Direction
        public 
uint UID
        public 
uint TimeStamp
        public 
uint MapID
        public 
uint GroundMovementType
        public 
void Send(Client.GameClient client
        { 
            
client.Send(ToArray()); 
        } 
    } 

If you got any Errors
change
Conquer_Online_Server
by name of your Project.



mllove is offline  
Old 10/24/2015, 19:21   #2
 
elite*gold: 12
Join Date: Jul 2011
Posts: 7,044
Received Thanks: 3,383
Quote:
Originally Posted by mllove View Post
PHP Code:
using System
using System.Collections.Generic
using System.IO
using System.Linq

namespace 
Conquer_Online_Server.Network.GamePackets 

    public class 
GroundMovement WriterInterfaces.IPacket 
    

        public const 
uint Walk 0
                          
Run 1
                          
Slide 9


        public 
GroundMovement(bool CreateInstance
        { 

        } 
        public 
byte[] CreateProtocolBuffer(params uint[] values
        { 
            List<
byteptr = new List<byte>(); 
            
ptr.Add(8); 
            for (
int x 0values.Lengthx++) 
            { 
                
uint value values[x]; 
                while (
value 0x7F
                { 
                    
ptr.Add((byte)((value 0x7F) | 0x80)); 
                    
value >>= 7
                } 
                
ptr.Add((byte)(value 0x7F)); 
                
ptr.Add((byte)(* (2))); 
                if (
== values.Length
                    break; 
            } 
            return 
ptr.ToArray(); 
        } 
        public 
uint ReadFromProtocolUint32(uint positionBinaryReader reader
        { 
            
byte key reader.ReadByte(); 
            if (
key == position
            { 
                
uint value 0
                
int shift 0
                
uint val reader.ReadByte(); 
                while (
val 0x7F
                { 
                    
value |= (val 0x7F) << shift
                    
shift += 7
                    
val reader.ReadByte(); 
                } 
                
value |= (val 0x7F) << shift
                return 
value
            } 
            return 
0
        } 
        public 
byte[] ToArray() 
        { 
            
byte[] ptr CreateProtocolBuffer((uint)DirectionUIDGroundMovementTypeTimeStampMapID); 


            List<
bytepack = new List<byte>(); 
            for (
int i 0< (ptr.Length 1); i++) 
            { 
                
pack.Add(ptr[i]); 
            } 
            
ptr pack.ToArray(); 

            
byte[] buffer = new byte[12 ptr.Length]; 
            
Writer.WriteUInt16((ushort)(buffer.Length 8), 0buffer); 
            
Writer.WriteUInt16(100052buffer); 
            
System.Array.Copy(ptr0buffer4ptr.Length); 

            return 
buffer
        } 

        public 
void Deserialize(byte[] buffer
        { 

            var 
packet = new byte[buffer.Length 4]; 
            
System.Array.Copy(buffer4packet0packet.Length); 
            
using (var Reader = new BinaryReader(new MemoryStream(packet))) 
            { 
                
uint direction 0
                
uint uid 0
                
uint type 0
                
uint tstamp 0
                
uint mapid 0
                for (
int i 0Reader.BaseStream.Lengthi++) 
                { 
                    
Reader.BaseStream.Position i
                    if (
packet[i] == 8
                    { 
                        
direction ReadFromProtocolUint32(8Reader); 
                    } 
                    if (
packet[i] == 16
                    { 
                        
uid ReadFromProtocolUint32(16Reader); 
                    } 
                    if (
packet[i] == 24
                    { 
                        
type ReadFromProtocolUint32(24Reader); 
                    } 
                    if (
packet[i] == 32
                    { 
                        
tstamp ReadFromProtocolUint32(32Reader); 
                    } 
                    if (
packet[i] == 40
                    { 
                        
mapid ReadFromProtocolUint32(40Reader); 
                    } 
                } 
                
Direction = (Conquer_Online_Server.Game.Enums.ConquerAngle)direction
                
UID uid
                
GroundMovementType type
                
TimeStamp tstamp
                
MapID mapid
            } 

        } 

        public 
Game.Enums.ConquerAngle Direction
        public 
uint UID
        public 
uint TimeStamp
        public 
uint MapID
        public 
uint GroundMovementType
        public 
void Send(Client.GameClient client
        { 
            
client.Send(ToArray()); 
        } 
    } 

If you got any Errors
change
Conquer_Online_Server
by name of your Project.
Oh god this thread title is so fucking shit. Request thread rename to something that isn't completely and utterly retarded. Examples: "Walk Packet using Google Protocol Buffer" or "Walk Packet, Patch What-ever-the-fuck".


Spirited is offline  
Old 10/24/2015, 19:26   #3
 
elite*gold: 0
Join Date: Jul 2009
Posts: 487
Received Thanks: 178
Quote:
Originally Posted by Spirited View Post
Oh *** this thread title is so ******* ****. Request thread rename to something that isn't completely and utterly retarded. Examples: "Walk Packet using Google Protocol Buffer" or "Walk Packet, Patch What-ever-the-****".
Second one, please sir
pintinho12 is offline  
Old 10/24/2015, 19:34   #4
 
elite*gold: 12
Join Date: Jul 2011
Posts: 7,044
Received Thanks: 3,383
Quote:
Originally Posted by pintinho12 View Post
Second one, please sir
I've noticed that not a single one of these idiots have actually posted a patch number for their questions. It's patch 6132.


Spirited is offline  
Old 10/25/2015, 04:38   #5
 
elite*gold: 0
Join Date: Aug 2013
Posts: 3
Received Thanks: 0
i was try to help all want the walk thanks for edit and soory good luck all
mllove is offline  
Old 10/25/2015, 09:06   #6
 
elite*gold: 67
Join Date: Aug 2014
Posts: 1,314
Received Thanks: 920
Thats the kind of **** I dont get. Someone posts something that hasnt been released and all he gets is **** for the title.
Xio. is offline  
Old 10/25/2015, 09:26   #7
 
elite*gold: 12
Join Date: Jul 2011
Posts: 7,044
Received Thanks: 3,383
Quote:
Originally Posted by Xio. View Post
Thats the kind of **** I dont get. Someone posts something that hasnt been released and all he gets is **** for the title.
You didn't see the title and this is just copied from the egy forums. Know what and who you're backing before you back something like a blind idiot. A more maintainable implementation can be found here, by the way: . Also my article on my wiki: .

Edit: I'm dying.
Spirited is offline  
Thanks
1 User
Old 10/25/2015, 23:43   #8
 
elite*gold: 0
Join Date: Aug 2013
Posts: 3
Received Thanks: 0
Spririted its none of your business its my title if you not like it leave it if copied i do to help other.......
i will not help any one again good luck just help my self
mllove is offline  
Old 10/26/2015, 00:27   #9
 
elite*gold: 12
Join Date: Jul 2011
Posts: 7,044
Received Thanks: 3,383
Quote:
Originally Posted by mllove View Post
Spririted its none of your business its my title if you not like it leave it if copied i do to help other.......
i will not help any one again good luck just help my self
Good.
One egy bites the dust.
Spirited is offline  
Thanks
1 User
Old 11/03/2015, 18:00   #10
 
elite*gold: 0
Join Date: Sep 2008
Posts: 331
Received Thanks: 136
Quote:
Originally Posted by Spirited View Post
Good.
One egy bites the dust.

@Spirited < --- You Should Reported always be out OFF Topic , That not your problem IF you Find the Code is bad , there is sticky Topic
You make Conquer PS Deve looking bad

Spirited IS Awesome

EGY FTW
!DeX! is offline  
Old 11/03/2015, 18:35   #11
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,311
Quote:
Originally Posted by !DeX! View Post
EGY FTW
pro4never is offline  
Thanks
6 Users
Old 11/04/2015, 02:34   #12
 
elite*gold: 12
Join Date: Jul 2011
Posts: 7,044
Received Thanks: 3,383
Quote:
Originally Posted by !DeX! View Post

@Spirited < --- You Should Reported always be out OFF Topic , That not your problem IF you Find the Code is bad , there is sticky Topic
You make Conquer PS Deve looking bad

Spirited IS Awesome
Spirited is offline  
Old 11/04/2015, 10:04   #13
 
elite*gold: 0
Join Date: Sep 2008
Posts: 331
Received Thanks: 136
Quote:
Originally Posted by Spirited View Post
@Spirited < ---
@pro4never < -- What do u Think About THAT EGY.FTW
!DeX! is offline  
Old 11/06/2015, 08:08   #14
 
elite*gold: 0
Join Date: Dec 2012
Posts: 1,620
Received Thanks: 834
I have been logged in for 2 minutes and now I'm logging out again.


Super Aids is offline  
Thanks
4 Users
Reply


Similar Threads
[Question] Walk/Run Packet
10/19/2015 - CO2 PServer - Discussions / Questions - 1 Replies
After adding fully functional Tempest Wings to the source and client, there seems to be an issue with the Walk/Run packet that lags or glitches you out of the game resulting you to disconnect. Has anyone found any hint where to change the packet? or is it still not discovered yet. :handsdown: to those who have. or is this the result of adding mesh? or can it be the Move/Run speed within the Monsters?
walk packet - visual effect
06/28/2014 - Nostale - 9 Replies
Hi! I'm making packet-using bot and I have big problem - I stopped on walking event, beacuse sending "walk" only sends packet to server and our character (in client) is standing in the same place. Do you have any ideas to move our character visually with packet? :)
Packet: desc buffer mem_size overflow...
08/09/2012 - Metin2 PServer - Discussions / Questions - 13 Replies
Packet: desc buffer mem_size overflow. memsize(131072) write_pos(131056) iSize(35) 8GB RAM, 6Cores pro Channel für 200 Gamer, login & alles andere scheißt nach ner Weile ab, weiss nicht mehr weiter. 300e*g Belohnung bei erfolgreicher Hilfe! vielen dank im vorraus
Walk packet
09/28/2011 - CO2 PServer - Discussions / Questions - 3 Replies
today i came across to a problem that when 1 client sends walk packet to other clients. That packet is delayed up to 1-4 secs. But this is when you send it at stand -> to walk. if you send walk packet when client is walking then there is no delay(not counting delay that was made stand ->walk). could that be client? or my source? i don't have problems with any other packet.... client is 4*** late something. Fun -= walk <-- video to better understand what I'm talking about!
Walk Packet
04/01/2010 - SRO Main - Discussions / Questions - 3 Replies
I've been following Pushedx (Drew) guides, and so far I've done some interesting things. Now I want to understand how the Walk packets works, but I can't find any pattern or place to start of, if anyone could help me please. That's what I have so far: 01 ?? ?? //Dunno what they are XX ?? //Left one indicates the X position, but dunno how ?? ?? YY ?? //Left one indicates the Y position, but dunno how



All times are GMT +1. The time now is 17:21.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Abuse
Copyright ©2018 elitepvpers All Rights Reserved.